Archive incari-client (client, 26.3, clean)

This commit is contained in:
2026-11-28 00:54:38 -06:00
parent 7a6174687f
commit 12838e838c
2383 changed files with 280266 additions and 0 deletions
@@ -0,0 +1,37 @@
package incari.features.saturation;
import incari.framework.Category;
import incari.framework.Module;
import incari.framework.event.Events;
import incari.framework.setting.ColorSetting;
/**
* Saturation: the hidden food value that keeps hunger from dropping, shown on the hunger bar. Each
* shank's worth of saturation outlines that shank in a bright color, from the right as hunger
* fills, as AppleSkin does; when no outline is left, hunger is about to start going down.
*/
public final class Saturation extends Module {
final ColorSetting color =
settings().color("color", "Color", 0xFFCC00).describedAs("The color saturated shanks are outlined in.");
/** Saturation, off until the player turns it on. */
public Saturation() {
super("saturation", "Saturation", "Shows your saturation on the hunger bar.", Category.HUD);
on(Events.TICK, this::apply);
}
private void apply() {
system().game().overrideSaturation(color.get() & 0xFFFFFF);
}
@Override
protected void onEnable() {
apply();
}
@Override
protected void onDisable() {
system().game().overrideSaturation(-1);
}
}
@@ -0,0 +1,5 @@
/** Saturation: the player's saturation shown on the hunger bar. */
@NullMarked
package incari.features.saturation;
import org.jspecify.annotations.NullMarked;
@@ -0,0 +1,24 @@
package incari.features.saturation;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
import com.tngtech.archunit.core.importer.ImportOption;
import com.tngtech.archunit.junit.AnalyzeClasses;
import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.lang.ArchRule;
/** A feature sees the module framework and the JDK's basics: no game, platform or other feature. */
@AnalyzeClasses(packages = "incari.features.saturation", importOptions = ImportOption.DoNotIncludeTests.class)
class BoundaryTest {
@ArchTest
static final ArchRule onlyTheFramework = classes()
.should()
.onlyDependOnClassesThat()
.resideInAnyPackage(
"java.lang..",
"java.util..",
"org.jspecify..",
"incari.framework..",
"incari.features.saturation..");
}
@@ -0,0 +1,28 @@
package incari.features.saturation;
import static org.assertj.core.api.Assertions.assertThat;
import incari.framework.testing.TestGame;
import org.junit.jupiter.api.Test;
class SaturationTest {
private final Saturation module = new Saturation();
private final TestGame game = new TestGame(module);
@Test
void tintsTheHungerBarWhileOn() {
assertThat(game.saturationColor).isEqualTo(-1);
module.setEnabled(true);
assertThat(game.saturationColor).isEqualTo(0xFFCC00);
module.color.set(0x00FF00);
game.tick();
assertThat(game.saturationColor).isEqualTo(0x00FF00);
// Black is a color like any other, not "off".
module.color.set(0);
game.tick();
assertThat(game.saturationColor).isZero();
module.setEnabled(false);
assertThat(game.saturationColor).isEqualTo(-1);
}
}