Kaynağa Gözat

Update to 1.17

d4rkm0nkey 4 yıl önce
ebeveyn
işleme
23ede2b9cc

+ 32 - 31
build.gradle

@@ -1,10 +1,10 @@
 plugins {
-	id 'fabric-loom' version '0.5-SNAPSHOT'
+	id 'fabric-loom' version '0.8-SNAPSHOT'
 	id 'maven-publish'
 }
 
-sourceCompatibility = JavaVersion.VERSION_1_8
-targetCompatibility = JavaVersion.VERSION_1_8
+sourceCompatibility = JavaVersion.VERSION_16
+targetCompatibility = JavaVersion.VERSION_16
 
 archivesBaseName = project.archives_base_name
 version = project.mod_version
@@ -23,20 +23,20 @@ repositories {
 }
 
 dependencies {
-	// to change the versions see the gradle.properties file
+	// To change the versions see the gradle.properties file
 	minecraft "com.mojang:minecraft:${project.minecraft_version}"
 	mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
 	modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
 
 	// Fabric API. This is technically optional, but you probably want it anyway.
 	modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
-	modImplementation "com.terraformersmc:modmenu:1.16.5"
-	modImplementation "io.github.cottonmc:LibGui:3.3.5+1.16.5"
-	modApi("me.shedaniel.cloth:cloth-config-fabric:4.11.14") {
+	modImplementation "com.terraformersmc:modmenu:2.0.0-beta.7"
+	modImplementation "io.github.cottonmc:LibGui:4.0.0-beta.4+1.17-rc1"
+	modApi("me.shedaniel.cloth:cloth-config-fabric:5.0.34") {
         exclude(group: "net.fabricmc.fabric-api")
     }
-	include "me.shedaniel.cloth:cloth-config-fabric:4.11.14"
-	include "io.github.cottonmc:LibGui:3.3.5+1.16.5"
+	include "me.shedaniel.cloth:cloth-config-fabric:5.0.34"
+	include "io.github.cottonmc:LibGui:4.0.0-beta.4+1.17-rc1"
 	// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
 	// You may need to force-disable transitiveness on them.
 }
@@ -44,33 +44,33 @@ dependencies {
 processResources {
 	inputs.property "version", project.version
 
-	from(sourceSets.main.resources.srcDirs) {
-		include "fabric.mod.json"
+	filesMatching("fabric.mod.json") {
 		expand "version": project.version
 	}
-
-	from(sourceSets.main.resources.srcDirs) {
-		exclude "fabric.mod.json"
-	}
 }
 
-// ensure that the encoding is set to UTF-8, no matter what the system default is
-// this fixes some edge cases with special characters not displaying correctly
-// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
-tasks.withType(JavaCompile) {
-	options.encoding = "UTF-8"
+tasks.withType(JavaCompile).configureEach {
+	// ensure that the encoding is set to UTF-8, no matter what the system default is
+	// this fixes some edge cases with special characters not displaying correctly
+	// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
+	// If Javadoc is generated, this must be specified in that task too.
+	it.options.encoding = "UTF-8"
+
+	// Minecraft 1.17 (21w19a) upwards uses Java 16.
+	it.options.release = 16
 }
 
-// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
-// if it is present.
-// If you remove this task, sources will not be generated.
-task sourcesJar(type: Jar, dependsOn: classes) {
-	classifier = "sources"
-	from sourceSets.main.allSource
+java {
+	// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
+	// if it is present.
+	// If you remove this line, sources will not be generated.
+	withSourcesJar()
 }
 
 jar {
-	from "LICENSE"
+	from("LICENSE") {
+		rename { "${it}_${project.archivesBaseName}"}
+	}
 }
 
 // configure the maven publication
@@ -87,10 +87,11 @@ publishing {
 		}
 	}
 
-	// select the repositories you want to publish to
+	// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
 	repositories {
-		// uncomment to publish to the local maven
-		// mavenLocal()
-		jcenter()
+		// Add repositories to publish to here.
+		// Notice: This block does NOT have the same function as the block in the top level.
+		// The repositories here will be used for publishing your artifact, not for
+		// retrieving dependencies.
 	}
 }

+ 5 - 5
gradle.properties

@@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
 
 # Fabric Properties
 	# check these on https://fabricmc.net/use
-	minecraft_version=1.16.5
-	yarn_mappings=1.16.5+build.5
-	loader_version=0.11.2
+	minecraft_version=1.17
+	yarn_mappings=1.17+build.6
+	loader_version=0.11.3
 
 # Mod Properties
-	mod_version = 4.1.7
+	mod_version = 4.1.8
 	maven_group = monkey.lumpy
 	archives_base_name = horse-stats-vanilla
 
 # Dependencies
 	# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
-	fabric_version=0.31.0+1.16
+	fabric_version=0.34.9+1.17

BIN
gradle/wrapper/gradle-wrapper.jar


+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 2 - 0
gradlew

@@ -82,6 +82,7 @@ esac
 
 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
 
+
 # Determine the Java command to use to start the JVM.
 if [ -n "$JAVA_HOME" ] ; then
     if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
 if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
     JAVACMD=`cygpath --unix "$JAVACMD"`
 
     # We build the pattern for arguments to be converted via cygpath

+ 4 - 18
gradlew.bat

@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
 
 set JAVA_EXE=java.exe
 %JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
+if "%ERRORLEVEL%" == "0" goto execute
 
 echo.
 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
 set JAVA_HOME=%JAVA_HOME:"=%
 set JAVA_EXE=%JAVA_HOME%/bin/java.exe
 
-if exist "%JAVA_EXE%" goto init
+if exist "%JAVA_EXE%" goto execute
 
 echo.
 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
 
 goto fail
 
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
 :execute
 @rem Setup the command line
 
 set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
 
+
 @rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
 
 :end
 @rem End local scope for the variables with windows NT shell

+ 13 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/HorseStatsVanilla.java

@@ -0,0 +1,13 @@
+package monkey.lumpy.horse.stats.vanilla;
+
+import net.fabricmc.api.ModInitializer;
+import me.shedaniel.autoconfig.AutoConfig;
+import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer;
+import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
+
+public class HorseStatsVanilla implements ModInitializer {
+    @Override
+    public void onInitialize() {
+        AutoConfig.register(ModConfig.class, JanksonConfigSerializer::new);
+    }
+}

+ 18 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/ModMenuApiImpl.java

@@ -0,0 +1,18 @@
+package monkey.lumpy.horse.stats.vanilla;
+
+import com.terraformersmc.modmenu.api.ConfigScreenFactory;
+import com.terraformersmc.modmenu.api.ModMenuApi;
+
+import me.shedaniel.autoconfig.AutoConfig;
+import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
+import net.fabricmc.api.Environment;
+import net.fabricmc.api.EnvType;
+
+@Environment(EnvType.CLIENT)
+public class ModMenuApiImpl implements ModMenuApi {
+
+    @Override
+    public ConfigScreenFactory<?> getModConfigScreenFactory() {
+        return parent -> AutoConfig.getConfigScreen(ModConfig.class, parent).get();
+    }
+}

+ 124 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/config/ModConfig.java

@@ -0,0 +1,124 @@
+package monkey.lumpy.horse.stats.vanilla.config;
+
+import me.shedaniel.autoconfig.ConfigData;
+import me.shedaniel.autoconfig.annotation.Config;
+import me.shedaniel.autoconfig.annotation.ConfigEntry;
+import me.shedaniel.autoconfig.annotation.ConfigEntry.Category;
+import me.shedaniel.math.Color;
+import monkey.lumpy.horse.stats.vanilla.config.ModConfig.ColorObj;
+
+@Config(name = "horsestatsvanilla")
+public class ModConfig implements ConfigData {
+    static class ColorObj {
+        public ColorObj(int red, int green, int blue) {
+            this.red = red;
+            this.green = green;
+            this.blue = blue;
+        }
+        @ConfigEntry.BoundedDiscrete(max=255)
+        int red;
+        @ConfigEntry.BoundedDiscrete(max=255)
+        int green;
+        @ConfigEntry.BoundedDiscrete(max=255)
+        int blue;
+
+        Color getColor() {
+            return Color.ofRGB(red,green,blue);
+        }
+    }
+    @ConfigEntry.Gui.Tooltip
+    private boolean useColors = true;
+    @ConfigEntry.Gui.Tooltip
+    private boolean showMaxMin = true;
+    @ConfigEntry.Gui.Tooltip
+    private boolean enableTooltip = true;
+
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float goodHorseJumpValue = 4;
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float badHorseJumpValue = 2.5f;
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float goodHorseSpeedValue = 11;
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float badHorseSpeedValue = 7;
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float goodHorseHeartsValue = 25;
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float badHorseHeartsValue = 20;
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float goodStrengthValue = 9;
+    @Category("coloring")
+    @ConfigEntry.Gui.Tooltip
+    private float badStrengthValue = 6;
+
+    
+    @ConfigEntry.Gui.CollapsibleObject
+    private ColorObj goodColor = new ColorObj(0,180,0);
+    @ConfigEntry.Gui.CollapsibleObject
+    private ColorObj neutralColor = new ColorObj(70,70,70);
+    @ConfigEntry.Gui.CollapsibleObject
+    private ColorObj badColor = new ColorObj(255,0,0);
+
+    public boolean useColors() {
+        return useColors;
+    }
+
+    public boolean showMaxMin() {
+        return showMaxMin;
+    }
+
+    public boolean isTooltipEnabled() {
+        return enableTooltip;
+    }
+    
+    public float getGoodHorseJumpValue() {
+        return goodHorseJumpValue;
+    }
+
+    public float getBadHorseJumpValue() {
+        return badHorseJumpValue;
+    }
+
+    public float getGoodHorseSpeedValue() {
+        return goodHorseSpeedValue;
+    }
+
+    public float getBadHorseSpeedValue() {
+        return badHorseSpeedValue;
+    }
+
+    public float getGoodHorseHeartsValue() {
+        return goodHorseHeartsValue;
+    }
+
+    public float getBadHorseHeartsValue() {
+        return badHorseHeartsValue;
+    }
+
+    public float getGoodStrengthValue() {
+        return goodStrengthValue;
+    }
+
+    public float getBadStrengthValue() {
+        return badStrengthValue;
+    }
+
+    public Color getGoodColor() {
+        return goodColor.getColor();
+    }
+
+    public Color getNeutralColor() {
+        return neutralColor.getColor();
+    }
+
+    public Color getBadColor() {
+        return badColor.getColor();
+    }
+}

+ 28 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/gui/ToolTipGui.java

@@ -0,0 +1,28 @@
+package monkey.lumpy.horse.stats.vanilla.gui;
+
+import io.github.cottonmc.cotton.gui.GuiDescription;
+import io.github.cottonmc.cotton.gui.client.CottonClientScreen;
+
+public class ToolTipGui extends CottonClientScreen {
+
+    public ToolTipGui(GuiDescription description) {
+        super(description);
+    }
+
+    @Override
+    public boolean keyPressed(int ch, int keyCode, int modifiers) {
+        if(keyCode == 26) {
+            onClose();
+        }
+        return super.keyPressed(ch, keyCode, modifiers);
+    }
+
+    @Override
+    public boolean keyReleased(int ch, int keyCode, int modifiers) {
+        if(keyCode == 50) {
+            onClose();
+        }
+        return super.keyReleased(ch, keyCode, modifiers);
+    }
+    
+}

+ 78 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/gui/Tooltip.java

@@ -0,0 +1,78 @@
+package monkey.lumpy.horse.stats.vanilla.gui;
+
+import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription;
+import io.github.cottonmc.cotton.gui.widget.WBox;
+import io.github.cottonmc.cotton.gui.widget.WLabel;
+import io.github.cottonmc.cotton.gui.widget.data.Axis;
+import me.shedaniel.autoconfig.AutoConfig;
+import me.shedaniel.math.Color;
+import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
+import net.minecraft.text.LiteralText;
+
+public class Tooltip extends LightweightGuiDescription {
+    private ModConfig config;
+
+    public Tooltip(double speed, double jump, double health) {
+        config = AutoConfig.getConfigHolder(ModConfig.class).getConfig();
+        WBox root = new WBox(Axis.VERTICAL);
+        setRootPanel(root);
+        root.setSpacing(-8);
+        
+        // Coloring
+        Color jumpColor = config.getNeutralColor();
+        Color speedColor = config.getNeutralColor();
+        Color hearthColor = config.getNeutralColor();
+        if(config == null || config.useColors()) {
+            if(jump > config.getGoodHorseJumpValue()) {jumpColor = config.getGoodColor();;}
+            else if (jump < config.getBadHorseJumpValue()) {jumpColor = config.getBadColor();};
+    
+            if(speed > config.getGoodHorseSpeedValue()) {speedColor = config.getGoodColor();} 
+            else if (speed < config.getBadHorseSpeedValue()) {speedColor = config.getBadColor();};
+    
+            if(health> config.getGoodHorseHeartsValue()) {hearthColor = config.getGoodColor();} 
+            else if (health < config.getBadHorseHeartsValue()) {hearthColor = config.getBadColor();};
+        }
+
+        WBox speedBox = new WBox(Axis.HORIZONTAL);
+        
+        WLabel speedSymbol = new WLabel(new LiteralText("➟"), speedColor.hashCode());
+        WLabel speedLabel = new WLabel(new LiteralText("" + speed), speedColor.hashCode());
+        // WLabel speedRange = new WLabel(new LiteralText("(4.8-14.5)"), normalColor);
+        
+        // speedSymbol.setVerticalAlignment(VerticalAlignment.CENTER);
+
+        speedBox.add(speedSymbol);
+        speedBox.add(speedLabel);
+        // speedBox.add(speedRange);
+
+        WBox jumpBox = new WBox(Axis.HORIZONTAL);
+        
+        WLabel jumpSymbol = new WLabel(new LiteralText("⇮"), jumpColor.hashCode());
+        WLabel jumpLabel = new WLabel(new LiteralText("" + jump), jumpColor.hashCode());
+        // WLabel jumpRange = new WLabel(new LiteralText("(1-5.1)"), normalColor);
+        
+        // jumpSymbol.setVerticalAlignment(VerticalAlignment.CENTER);
+
+        jumpBox.add(jumpSymbol);
+        jumpBox.add(jumpLabel);
+        // jumpBox.add(jumpRange);
+
+        WBox healthBox = new WBox(Axis.HORIZONTAL);
+        
+        WLabel healthSymbol = new WLabel(new LiteralText("♥"), hearthColor.hashCode());
+        WLabel healthLabel = new WLabel(new LiteralText("" + health), hearthColor.hashCode());
+        // WLabel healthRange = new WLabel(new LiteralText("(15-30)"), normalColor);
+        
+        // healthSymbol.setVerticalAlignment(VerticalAlignment.CENTER);
+
+        healthBox.add(healthSymbol);
+        healthBox.add(healthLabel);
+        // healthBox.add(healthRange);
+
+        root.add(speedBox);
+        root.add(jumpBox);
+        root.add(healthBox);
+        root.validate(this);
+
+    }
+}

+ 61 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/mixin/AbstractDonkeyEntityMixin.java

@@ -0,0 +1,61 @@
+package monkey.lumpy.horse.stats.vanilla.mixin;
+
+import com.ibm.icu.math.BigDecimal;
+import com.ibm.icu.text.DecimalFormat;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import me.shedaniel.autoconfig.AutoConfig;
+import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
+import monkey.lumpy.horse.stats.vanilla.gui.ToolTipGui;
+import monkey.lumpy.horse.stats.vanilla.gui.Tooltip;
+import monkey.lumpy.horse.stats.vanilla.util.Converter;
+
+import org.spongepowered.asm.mixin.injection.At;
+
+import net.minecraft.client.MinecraftClient;
+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.player.PlayerEntity;
+import net.minecraft.util.ActionResult;
+import net.minecraft.util.Hand;
+import net.minecraft.world.World;
+
+@Mixin(AbstractDonkeyEntity.class)
+public class AbstractDonkeyEntityMixin extends HorseBaseEntity {
+
+    private ModConfig config;
+
+    protected AbstractDonkeyEntityMixin(EntityType<? extends HorseBaseEntity> entityType, World world) {
+        super(entityType, world);
+    }
+
+    @Inject(at = @At("HEAD"), method = "interactMob")
+    public ActionResult interactMob(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> ret) {
+        if(config == null) {
+            config = AutoConfig.getConfigHolder(ModConfig.class).getConfig();
+        }
+        
+        if (this.world.isClient && !this.isTame() && player.shouldCancelInteraction() && (config == null || config.isTooltipEnabled())) {
+            // Show tooltip
+            DecimalFormat df = new DecimalFormat("#.#");
+            String jumpstrength = df.format( Converter.jumpStrengthToJumpHeight(this.getJumpStrength()) );
+            String maxHealth = df.format(this.getMaxHealth());
+            String speed = df.format(Converter.genericSpeedToBlocPerSec(this.getAttributes().getValue(EntityAttributes.GENERIC_MOVEMENT_SPEED)));            
+            
+            double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
+            double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
+            double healthValue = new BigDecimal(maxHealth.replace(',', '.')).doubleValue();
+            
+            MinecraftClient.getInstance().openScreen(
+                new ToolTipGui(new Tooltip(speedValue, jumpValue, healthValue))
+            );
+        }
+        return ret.getReturnValue();
+    }
+}

+ 61 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/mixin/HorseEntityMixin.java

@@ -0,0 +1,61 @@
+package monkey.lumpy.horse.stats.vanilla.mixin;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import me.shedaniel.autoconfig.AutoConfig;
+import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
+import monkey.lumpy.horse.stats.vanilla.gui.ToolTipGui;
+import monkey.lumpy.horse.stats.vanilla.gui.Tooltip;
+import monkey.lumpy.horse.stats.vanilla.util.Converter;
+import net.minecraft.client.MinecraftClient;
+import net.minecraft.entity.EntityType;
+import net.minecraft.entity.attribute.EntityAttributes;
+import net.minecraft.entity.passive.HorseBaseEntity;
+import net.minecraft.entity.passive.HorseEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.util.ActionResult;
+import net.minecraft.util.Hand;
+import net.minecraft.world.World;
+
+@Mixin(HorseEntity.class)
+public abstract class HorseEntityMixin extends HorseBaseEntity {
+
+    private ModConfig config;
+
+    protected HorseEntityMixin(EntityType<? extends HorseBaseEntity> entityType, World world) {
+        super(entityType, world);
+    }
+
+
+    @Inject(at = @At("HEAD"), method = "interactMob")
+    public ActionResult interactMob(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> ret) {
+        if(config == null) {
+            config = AutoConfig.getConfigHolder(ModConfig.class).getConfig();
+        }
+        
+        if (this.world.isClient && !this.isTame() && player.shouldCancelInteraction() && (config == null || config.isTooltipEnabled())) {
+            // Show tooltip
+            DecimalFormat df = new DecimalFormat("#.#");
+            String jumpstrength = df.format( Converter.jumpStrengthToJumpHeight(this.getJumpStrength()) );
+            String maxHealth = df.format(this.getMaxHealth());
+            String speed = df.format(Converter.genericSpeedToBlocPerSec(this.getAttributes().getValue(EntityAttributes.GENERIC_MOVEMENT_SPEED)));         
+            
+            double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
+            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))
+            );
+        }
+        return ret.getReturnValue();
+    }
+}

+ 108 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/mixin/HorseScreenMixin.java

@@ -0,0 +1,108 @@
+package monkey.lumpy.horse.stats.vanilla.mixin;
+
+import net.minecraft.client.gui.screen.ingame.HandledScreen;
+import net.minecraft.client.gui.screen.ingame.HorseScreen;
+import net.minecraft.client.util.math.MatrixStack;
+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.PlayerInventory;
+import net.minecraft.screen.HorseScreenHandler;
+import net.minecraft.text.Text;
+import org.spongepowered.asm.mixin.Final;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+
+import me.shedaniel.autoconfig.AutoConfig;
+import me.shedaniel.math.Color;
+import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
+import monkey.lumpy.horse.stats.vanilla.util.Converter;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+
+@Mixin(HorseScreen.class)
+public abstract class HorseScreenMixin extends HandledScreen<HorseScreenHandler> {
+    @Shadow
+    @Final
+    private HorseBaseEntity entity;
+    private ModConfig config;
+
+    public HorseScreenMixin(HorseScreenHandler handler, PlayerInventory inventory, Text title) {
+        super(handler, inventory, title);
+    }
+
+    protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) {
+        super.drawForeground(matrices, mouseX, mouseY);
+        if(config == null) {
+            config = AutoConfig.getConfigHolder(ModConfig.class).getConfig();
+        }
+        boolean hasChest = false;
+        if (AbstractDonkeyEntity.class.isAssignableFrom(this.entity.getClass()) && ((AbstractDonkeyEntity) this.entity).hasChest()) {
+            hasChest = true;
+        }
+        DecimalFormat df = new DecimalFormat("#.#");
+        String jumpstrength = df.format(Converter.jumpStrengthToJumpHeight(this.entity.getJumpStrength()));
+        String maxHealth = df.format(this.entity.getMaxHealth());
+        String speed = df.format(Converter.genericSpeedToBlocPerSec(this.entity.getAttributes().getValue(EntityAttributes.GENERIC_MOVEMENT_SPEED)));
+
+        // Coloring
+        Color jumpColor = config.getNeutralColor();
+        Color speedColor = config.getNeutralColor();
+        Color hearthColor = config.getNeutralColor();
+        if(config.useColors()) {
+            double jumpValue = new BigDecimal(jumpstrength.replace(',', '.')).doubleValue();
+            double speedValue = new BigDecimal(speed.replace(',', '.')).doubleValue();
+            double healthValue = new BigDecimal(maxHealth.replace(',', '.')).doubleValue();
+    
+            if(jumpValue > config.getGoodHorseJumpValue()) {jumpColor = config.getGoodColor();}
+            else if (jumpValue < config.getBadHorseJumpValue()) {jumpColor = config.getBadColor();};
+    
+            if(speedValue > config.getGoodHorseSpeedValue()) {speedColor = config.getGoodColor();} 
+            else if (speedValue < config.getBadHorseSpeedValue()) {speedColor = config.getBadColor();};
+    
+            if(healthValue > config.getGoodHorseHeartsValue()) {hearthColor = config.getGoodColor();} 
+            else if (healthValue < config.getBadHorseHeartsValue()) {hearthColor = config.getBadColor();};
+        }
+
+
+        if (!hasChest) {
+            float spacer = 1.0F;
+            if(config.showMaxMin()) {
+                this.textRenderer.draw(matrices, "(4.7-14.2)", 119.0F, 26.0F, config.getNeutralColor().hashCode());
+                this.textRenderer.draw(matrices, "(1-5.3)", 119.0F, 36.0F, config.getNeutralColor().hashCode());
+                this.textRenderer.draw(matrices, "(15-30)", 119.0F, 46.0F, config.getNeutralColor().hashCode());
+            } else {
+                spacer = 10.0F;
+            }
+            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.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 {
+            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());
+        }
+
+        Color strengthColor = config.getNeutralColor();
+
+        if (LlamaEntity.class.isAssignableFrom(this.entity.getClass())) {
+            int strength = 3 * ((LlamaEntity) this.entity).getStrength();
+
+            if(config.useColors()) {
+                if(strength > config.getGoodHorseJumpValue()) {strengthColor = config.getGoodColor();} 
+                else if (strength < config.getBadHorseJumpValue()) {strengthColor = config.getBadColor();};
+            }
+            if (!hasChest) {
+                this.textRenderer.draw(matrices, "▦", 91.0F, 56.0F, strengthColor.hashCode());
+                this.textRenderer.draw(matrices, "" + strength, 100.0F, 56.0F, strengthColor.hashCode());
+            }
+        }
+    }
+}

+ 11 - 0
remappedSrc/monkey/lumpy/horse/stats/vanilla/util/Converter.java

@@ -0,0 +1,11 @@
+package monkey.lumpy.horse.stats.vanilla.util;
+
+public class Converter {
+    public static double jumpStrengthToJumpHeight(double strength) {
+        return -0.1817584952 * strength * strength * strength + 3.689713992 * strength * strength + 2.128599134 * strength - 0.343930367;
+    }
+
+    public static double genericSpeedToBlocPerSec(double speed) {
+        return 0.132 * speed * speed + 42.119 * speed;
+    }
+}

+ 3 - 0
src/main/java/monkey/lumpy/horse/stats/vanilla/gui/Tooltip.java

@@ -4,6 +4,7 @@ import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription;
 import io.github.cottonmc.cotton.gui.widget.WBox;
 import io.github.cottonmc.cotton.gui.widget.WLabel;
 import io.github.cottonmc.cotton.gui.widget.data.Axis;
+import io.github.cottonmc.cotton.gui.widget.data.Insets;
 import me.shedaniel.autoconfig.AutoConfig;
 import me.shedaniel.math.Color;
 import monkey.lumpy.horse.stats.vanilla.config.ModConfig;
@@ -13,10 +14,12 @@ public class Tooltip extends LightweightGuiDescription {
     private ModConfig config;
 
     public Tooltip(double speed, double jump, double health) {
+        super();
         config = AutoConfig.getConfigHolder(ModConfig.class).getConfig();
         WBox root = new WBox(Axis.VERTICAL);
         setRootPanel(root);
         root.setSpacing(-8);
+        root.setInsets(new Insets(5,5,0,5));
         
         // Coloring
         Color jumpColor = config.getNeutralColor();

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

@@ -1,7 +1,7 @@
 {
   "schemaVersion": 1,
   "id": "horsestatsvanilla",
-  "version": "4.1.7",
+  "version": "4.1.8",
   "name": "Horse Stats Vanilla",
   "description": "Shows horse stats in the horse inventory.",
   "authors": [
@@ -26,7 +26,7 @@
   "depends": {
     "fabricloader": ">=0.7.4",
     "fabric": "*",
-    "minecraft": "1.16.x"
+    "minecraft": "1.17.x"
   },
   "suggests": {
     "flamingo": "*"

+ 1 - 1
src/main/resources/horsestatsvanilla.mixins.json

@@ -1,7 +1,7 @@
 {
   "required": true,
   "package": "monkey.lumpy.horse.stats.vanilla.mixin",
-  "compatibilityLevel": "JAVA_8",
+  "compatibilityLevel": "JAVA_16",
   "mixins": [],
   "client": [
     "HorseScreenMixin",