소스 검색

Remove strength from tooltip

d4rkm0nkey 4 년 전
부모
커밋
fd503d8dcf

+ 1 - 1
gradle.properties

@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
 	loader_version=0.11.2
 
 # Mod Properties
-	mod_version = 4.1.6
+	mod_version = 4.1.7
 	maven_group = monkey.lumpy
 	archives_base_name = horse-stats-vanilla
 

+ 1 - 18
src/main/java/monkey/lumpy/horse/stats/vanilla/gui/Tooltip.java

@@ -12,7 +12,7 @@ import net.minecraft.text.LiteralText;
 public class Tooltip extends LightweightGuiDescription {
     private ModConfig config;
 
-    public Tooltip(double speed, double jump, double health, Integer strength) {
+    public Tooltip(double speed, double jump, double health) {
         config = AutoConfig.getConfigHolder(ModConfig.class).getConfig();
         WBox root = new WBox(Axis.VERTICAL);
         setRootPanel(root);
@@ -72,23 +72,6 @@ public class Tooltip extends LightweightGuiDescription {
         root.add(speedBox);
         root.add(jumpBox);
         root.add(healthBox);
-
-        if(strength != null) {
-            Color strengthColor = config.getNeutralColor();;
-            if(config == null || config.useColors()) {
-                if(strength > config.getGoodStrengthValue()) {strengthColor = config.getGoodColor();} 
-                else if (strength < config.getGoodStrengthValue()) {strengthColor = config.getBadColor();};
-            }
-
-            WBox strengthBox = new WBox(Axis.HORIZONTAL);
-            WLabel strengthSymbol = new WLabel(new LiteralText("▦"), strengthColor.hashCode());
-            WLabel strengthLabel = new WLabel(new LiteralText("" + strength), strengthColor.hashCode());
-            strengthBox.add(strengthSymbol);
-            strengthBox.add(strengthLabel);
-
-            root.add(strengthBox);
-        }
-
         root.validate(this);
 
     }

+ 1 - 10
src/main/java/monkey/lumpy/horse/stats/vanilla/mixin/AbstractDonkeyEntityMixin.java

@@ -20,7 +20,6 @@ import net.minecraft.entity.EntityType;
 import net.minecraft.entity.attribute.EntityAttributes;
 import net.minecraft.entity.passive.AbstractDonkeyEntity;
 import net.minecraft.entity.passive.HorseBaseEntity;
-import net.minecraft.entity.passive.LlamaEntity;
 import net.minecraft.entity.player.PlayerEntity;
 import net.minecraft.util.ActionResult;
 import net.minecraft.util.Hand;
@@ -52,18 +51,10 @@ public class AbstractDonkeyEntityMixin extends HorseBaseEntity {
             double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
             double healthValue = new BigDecimal(maxHealth.replace(',', '.')).doubleValue();
             
-            Integer strength = null;
-            if (LlamaEntity.class.isAssignableFrom(this.getClass())) {
-                strength = 3 * this.getStrength();
-            }
             MinecraftClient.getInstance().openScreen(
-                new ToolTipGui(new Tooltip(speedValue, jumpValue, healthValue, strength))
+                new ToolTipGui(new Tooltip(speedValue, jumpValue, healthValue))
             );
         }
         return ret.getReturnValue();
     }
-
-    public int getStrength() {
-        return 0;
-    }
 }

+ 3 - 1
src/main/java/monkey/lumpy/horse/stats/vanilla/mixin/HorseEntityMixin.java

@@ -50,8 +50,10 @@ public abstract class HorseEntityMixin extends HorseBaseEntity {
             double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
             double healthValue = new BigDecimal(maxHealth.replace(',', '.')).doubleValue();
 
+            System.out.println("Hello!");
+
             MinecraftClient.getInstance().openScreen(
-                new ToolTipGui(new Tooltip(speedValue, jumpValue, healthValue, null))
+                new ToolTipGui(new Tooltip(speedValue, jumpValue, healthValue))
             );
         }
         return ret.getReturnValue();