Przeglądaj źródła

Fix crash baby donkeys

d4rkm0nkey 4 lat temu
rodzic
commit
e8cc6bef9e

+ 1 - 1
gradle.properties

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

+ 1 - 1
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, int health, Integer strength) {
+    public Tooltip(double speed, double jump, double health, Integer strength) {
         config = AutoConfig.getConfigHolder(ModConfig.class).getConfig();
         WBox root = new WBox(Axis.VERTICAL);
         setRootPanel(root);

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

@@ -50,7 +50,7 @@ public class AbstractDonkeyEntityMixin extends HorseBaseEntity {
             
             double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
             double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
-            int healthValue = new BigDecimal(maxHealth).intValue();
+            double healthValue = new BigDecimal(maxHealth.replace(',', '.')).doubleValue();
             
             Integer strength = null;
             if (LlamaEntity.class.isAssignableFrom(this.getClass())) {

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

@@ -48,7 +48,7 @@ public abstract class HorseEntityMixin extends HorseBaseEntity {
             
             double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
             double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
-            int healthValue = new BigDecimal(maxHealth.replace(',', '.')).intValue();
+            double healthValue = new BigDecimal(maxHealth.replace(',', '.')).doubleValue();
 
             MinecraftClient.getInstance().openScreen(
                 new ToolTipGui(new Tooltip(speedValue, jumpValue, healthValue, null))

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

@@ -54,7 +54,7 @@ public abstract class HorseScreenMixin extends HandledScreen<HorseScreenHandler>
         if(config.useColors()) {
             double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
             double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
-            int healthValue = new BigDecimal(maxHealth.replace(',', '.')).intValue();
+            double healthValue = new BigDecimal(maxHealth.replace(',', '.')).doubleValue();
     
             if(jumpValue > config.getGoodHorseJumpValue()) {jumpColor = config.getGoodColor();}
             else if (jumpValue < config.getBadHorseJumpValue()) {jumpColor = config.getBadColor();};

+ 1 - 1
src/main/resources/fabric.mod.json

@@ -1,7 +1,7 @@
 {
   "schemaVersion": 1,
   "id": "horsestatsvanilla",
-  "version": "${version}",
+  "version": "4.1.6",
   "name": "Horse Stats Vanilla",
   "description": "Shows horse stats in the horse inventory.",
   "authors": [