|
@@ -14,7 +14,8 @@ import org.spongepowered.asm.mixin.Final;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
|
|
|
|
-import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
|
|
|
|
|
+import me.shedaniel.autoconfig.AutoConfig;
|
|
|
|
+import me.shedaniel.math.Color;
|
|
import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
|
|
import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
|
|
import monkey.lumpy.horse.stats.vanilla.util.Converter;
|
|
import monkey.lumpy.horse.stats.vanilla.util.Converter;
|
|
|
|
|
|
@@ -26,10 +27,6 @@ public abstract class HorseScreenMixin extends HandledScreen<HorseScreenHandler>
|
|
@Shadow
|
|
@Shadow
|
|
@Final
|
|
@Final
|
|
private HorseBaseEntity entity;
|
|
private HorseBaseEntity entity;
|
|
-
|
|
|
|
- private final int normalColor = 4210752;
|
|
|
|
- private final int badColor = 16733525;
|
|
|
|
- private final int goodColor = 43520;
|
|
|
|
private ModConfig config;
|
|
private ModConfig config;
|
|
|
|
|
|
public HorseScreenMixin(HorseScreenHandler handler, PlayerInventory inventory, Text title) {
|
|
public HorseScreenMixin(HorseScreenHandler handler, PlayerInventory inventory, Text title) {
|
|
@@ -51,60 +48,60 @@ public abstract class HorseScreenMixin extends HandledScreen<HorseScreenHandler>
|
|
String speed = df.format(Converter.genericSpeedToBlocPerSec(this.entity.getAttributes().getValue(EntityAttributes.GENERIC_MOVEMENT_SPEED)));
|
|
String speed = df.format(Converter.genericSpeedToBlocPerSec(this.entity.getAttributes().getValue(EntityAttributes.GENERIC_MOVEMENT_SPEED)));
|
|
|
|
|
|
// Coloring
|
|
// Coloring
|
|
- int jumpColor = normalColor;
|
|
|
|
- int speedColor = normalColor;
|
|
|
|
- int hearthColor = normalColor;
|
|
|
|
|
|
+ Color jumpColor = config.getNeutralColor();
|
|
|
|
+ Color speedColor = config.getNeutralColor();
|
|
|
|
+ Color hearthColor = config.getNeutralColor();
|
|
if(config.useColors()) {
|
|
if(config.useColors()) {
|
|
double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
|
|
double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
|
|
double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
|
|
double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
|
|
int healthValue = new BigDecimal(maxHealth.replace(',', '.')).intValue();
|
|
int healthValue = new BigDecimal(maxHealth.replace(',', '.')).intValue();
|
|
|
|
|
|
- if(jumpValue > 4) {jumpColor = goodColor;}
|
|
|
|
- else if (jumpValue < 2.5) {jumpColor = badColor;};
|
|
|
|
|
|
+ if(jumpValue > config.getGoodHorseJumpValue()) {jumpColor = config.getGoodColor();}
|
|
|
|
+ else if (jumpValue < config.getBadHorseJumpValue()) {jumpColor = config.getBadColor();};
|
|
|
|
|
|
- if(speedValue > 11) {speedColor = goodColor;}
|
|
|
|
- else if (speedValue < 7) {speedColor = badColor;};
|
|
|
|
|
|
+ if(speedValue > config.getGoodHorseSpeedValue()) {speedColor = config.getGoodColor();}
|
|
|
|
+ else if (speedValue < config.getBadHorseSpeedValue()) {speedColor = config.getBadColor();};
|
|
|
|
|
|
- if(healthValue > 25) {hearthColor = goodColor;}
|
|
|
|
- else if (healthValue < 20) {hearthColor = badColor;};
|
|
|
|
|
|
+ if(healthValue > config.getGoodHorseHeartsValue()) {hearthColor = config.getGoodColor();}
|
|
|
|
+ else if (healthValue < config.getBadHorseHeartsValue()) {hearthColor = config.getBadColor();};
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!hasChest) {
|
|
if (!hasChest) {
|
|
float spacer = 1.0F;
|
|
float spacer = 1.0F;
|
|
if(config.showMaxMin()) {
|
|
if(config.showMaxMin()) {
|
|
- this.textRenderer.draw(matrices, "(4.8-14.5)", 119.0F, 26.0F, normalColor);
|
|
|
|
- this.textRenderer.draw(matrices, "(1-5.1)", 119.0F, 36.0F, normalColor);
|
|
|
|
- this.textRenderer.draw(matrices, "(15-30)", 119.0F, 46.0F, normalColor);
|
|
|
|
|
|
+ this.textRenderer.draw(matrices, "(4.8-14.5)", 119.0F, 26.0F, config.getNeutralColor().hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "(1-5.1)", 119.0F, 36.0F, config.getNeutralColor().hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "(15-30)", 119.0F, 46.0F, config.getNeutralColor().hashCode());
|
|
} else {
|
|
} else {
|
|
spacer = 10.0F;
|
|
spacer = 10.0F;
|
|
}
|
|
}
|
|
- this.textRenderer.draw(matrices, "➟", 82.0F + spacer, 26.0F, speedColor);
|
|
|
|
- this.textRenderer.draw(matrices, "" + speed, 93.0F + spacer, 26.0F, speedColor);
|
|
|
|
|
|
+ this.textRenderer.draw(matrices, "➟", 82.0F + spacer, 26.0F, speedColor.hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "" + speed, 93.0F + spacer, 26.0F, speedColor.hashCode());
|
|
|
|
|
|
- this.textRenderer.draw(matrices, "⇮", 84.0F + spacer, 36.0F, jumpColor);
|
|
|
|
- this.textRenderer.draw(matrices, "" + jumpstrength, 93.0F + spacer, 36.0F, jumpColor);
|
|
|
|
- this.textRenderer.draw(matrices, "♥", 83.0F + spacer, 46.0F, hearthColor);
|
|
|
|
- this.textRenderer.draw(matrices, "" + maxHealth, 93.0F + spacer, 46.0F, hearthColor);
|
|
|
|
|
|
+ this.textRenderer.draw(matrices, "⇮", 84.0F + spacer, 36.0F, jumpColor.hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "" + jumpstrength, 93.0F + spacer, 36.0F, jumpColor.hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "♥", 83.0F + spacer, 46.0F, hearthColor.hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "" + maxHealth, 93.0F + spacer, 46.0F, hearthColor.hashCode());
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- this.textRenderer.draw(matrices, "➟ " + speed, 80.0F, 6.0F, speedColor);
|
|
|
|
- this.textRenderer.draw(matrices, "⇮ " + jumpstrength, 115.0F, 6.0F, jumpColor);
|
|
|
|
- this.textRenderer.draw(matrices, "♥ " + maxHealth, 140.0F, 6.0F, hearthColor);
|
|
|
|
|
|
+ this.textRenderer.draw(matrices, "➟ " + speed, 80.0F, 6.0F, speedColor.hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "⇮ " + jumpstrength, 115.0F, 6.0F, jumpColor.hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "♥ " + maxHealth, 140.0F, 6.0F, hearthColor.hashCode());
|
|
}
|
|
}
|
|
|
|
|
|
- int strengthColor = normalColor;
|
|
|
|
|
|
+ Color strengthColor = config.getNeutralColor();
|
|
|
|
|
|
if (LlamaEntity.class.isAssignableFrom(this.entity.getClass())) {
|
|
if (LlamaEntity.class.isAssignableFrom(this.entity.getClass())) {
|
|
int strength = 3 * ((LlamaEntity) this.entity).getStrength();
|
|
int strength = 3 * ((LlamaEntity) this.entity).getStrength();
|
|
|
|
|
|
if(config.useColors()) {
|
|
if(config.useColors()) {
|
|
- if(strength > 9) {strengthColor = goodColor;}
|
|
|
|
- else if (strength < 6) {strengthColor = badColor;};
|
|
|
|
|
|
+ if(strength > config.getGoodHorseJumpValue()) {strengthColor = config.getGoodColor();}
|
|
|
|
+ else if (strength < config.getBadHorseJumpValue()) {strengthColor = config.getBadColor();};
|
|
}
|
|
}
|
|
if (!hasChest) {
|
|
if (!hasChest) {
|
|
- this.textRenderer.draw(matrices, "▦", 91.0F, 56.0F, strengthColor);
|
|
|
|
- this.textRenderer.draw(matrices, "" + strength, 100.0F, 56.0F, strengthColor);
|
|
|
|
|
|
+ this.textRenderer.draw(matrices, "▦", 91.0F, 56.0F, strengthColor.hashCode());
|
|
|
|
+ this.textRenderer.draw(matrices, "" + strength, 100.0F, 56.0F, strengthColor.hashCode());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|