From 471dc18d238715826bba0603f11cccc3302ac08d Mon Sep 17 00:00:00 2001 From: Garkatron <145294535+Garkatron@users.noreply.github.com> Date: Fri, 10 Jan 2025 20:38:24 +0100 Subject: [PATCH] Now you can make you cold with an IceCreamBucket --- README.md | 124 +++++++++++++----- build.gradle | 87 +++++++----- gradle.properties | 20 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- jitpack.yml | 2 - settings.gradle | 9 +- .../StanleyTemperature.java | 10 +- .../config/ConfigHandler.java | 8 +- .../config/TemperatureConfig.java | 30 ++++- .../enums/CustomDamageTypes.java | 13 +- .../interfaces/IMinecraft.java | 11 ++ .../interfaces/IPlayerEntity.java | 4 +- .../management/TemperatureManager.java | 67 ++++++---- .../mixin/MixinEntityPlayer.java | 35 ++--- .../mixin/MixinIceCreamBucket.java | 54 ++++++++ .../mixin/MixinMinecraft.java | 37 ++++++ .../overlay/HudManager.java | 6 +- .../overlay/ThermometerComponent.java | 31 ++--- .../textures/gui/coldIcon.png | Bin 0 -> 249 bytes .../textures/gui/heatIcon.png | Bin 0 -> 192 bytes src/main/resources/fabric.mod.json | 10 +- .../resources/stanleytemperature.mixins.json | 4 +- 22 files changed, 396 insertions(+), 168 deletions(-) delete mode 100644 jitpack.yml create mode 100644 src/main/java/deus/stanleytemperature/interfaces/IMinecraft.java create mode 100644 src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java create mode 100644 src/main/java/deus/stanleytemperature/mixin/MixinMinecraft.java create mode 100644 src/main/resources/assets/stanleytemperature/textures/gui/coldIcon.png create mode 100644 src/main/resources/assets/stanleytemperature/textures/gui/heatIcon.png diff --git a/README.md b/README.md index 19b5af7..fe439f0 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,94 @@ -#### Better than adventure -This mod uses a modified version of Fabric (Babric) and is designed only for Better than Adventure, a heavily modified version of Minecraft b1.7.3! For more information, join the discord server provided on this projects - -## StanleyLib updated to 1.2.0-7.2pre2 -*A temperature mod and lib* - -### What's this mod? -This mod introduces a library of functions aimed at managing player body temperature, enhancing gameplay through realistic environmental challenges and efficient resource management of thermal clothing and heat sources. - -### Main features: -* Accessible functions for managing player temperature -* New damage types -* Fully configurable -* Classes and methods to monitor player temperature changes -* And more! - -**Gameplay features can be deactivated.** -To deactivate: -##### stanleylib.cfg -```cfg -stanley.activate.temperature_management=false -``` -**You can use only library features.** +# RPG System Documentation -## Import -##### build.gradle -```gradle -repositories { - maven { url = "https://jitpack.io" } -} -dependencies { - modImplementation "com.github.Garkatron:StanleyLib:${project.stanleylib_version}" +## Skills System + +The **Skills System** is managed by an instance of `SkillTree.java`. Below is a guide to understanding and using the system effectively. + +--- + +### **Creating and Managing Skills** + +Skills can be implemented by extending `FunctionalSkill.java` or implementing the `IFunctionalSkill` interface. These classes provide templates for creating custom skills. + +For example, if you want to create a skill like **Super Strength**, you can extend `FunctionalSkill` and write the logic to enhance the player's strength. + +#### **Timed Skills** +You can use templates like `TimedFunctionalSkill` if your skill requires pre-written cooldown logic. + +--- + +### **Skill Implementation Example** + +Here is a simple implementation of a custom skill: + +```java +public class MySkill extends FunctionalSkill { + public MySkill() { + // Initialization logic (if needed) + } + + @Override + public boolean activate() { + // Logic to activate the skill + return false; + } + + @Override + public boolean deactivate() { + // Logic to deactivate the skill + return false; + } + + @Override + public boolean canActivate() { + // Conditions for activation + return false; + } + + @Override + public boolean canDeactivate() { + // Conditions for deactivation + return false; + } + + /* + * Optional methods: + * - boolean canComplete(); + * - boolean complete(); + * - boolean cancel(); + */ } ``` -##### gradle.properties -```gradle -mod_version = release_tag_name +### Creating Skills and Adding Them to a Skill Tree +Here is an example of how to create instances of Skill and manage them using a SkillTree: + +```java +// Define skills with dependencies +Skill skill1 = new Skill("Super Strength", 0, "Increases player strength", false, 0, 0, 0, new int[]{}, new MySkill()); +Skill skill2 = new Skill("Advanced Strength", 1, "Further increases player strength", false, 0, 0, 0, new int[]{0}, new MySkill()); + +// Create a SkillTree instance +SkillTree skillTree = new SkillTree( + skill1, + skill2 + // Add more skills as needed +); + +// Unlocking skills +skillTree.unlockSkill(1); // Fails because Skill 1 depends on Skill 0 +skillTree.unlockSkill(0); // Unlocks Skill 0 +skillTree.unlockSkill(1); // Succeeds because Skill 0 is now unlocked + +// Using skills +skillTree.getSkillById(0).getFunctionalSkill().activate(); +skillTree.getSkillById(0).getFunctionalSkill().deactivate(); + ``` +#### Key Concepts +Skill Dependencies: Skills can have dependencies. In the example above, Skill 1 depends on Skill 0 being unlocked first. +Functional Skills: These encapsulate the logic for what happens when a skill is activated, deactivated, completed, etc. +Skill Tree: A container for managing and unlocking skills, enforcing dependency rules. + +#### Use FunctionalSkill for general-purpose skills and extend it for custom behavior. +Leverage TimedFunctionalSkill if your skill needs cooldown or duration logic. +Ensure skill dependencies are correctly defined using the integer array parameter in the Skill constructor. diff --git a/build.gradle b/build.gradle index 9e51e9f..f53630f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,30 @@ plugins { - id 'babric-loom' version '1.4.+' + id 'fabric-loom' version '1.7.bta' id 'java' } +import org.gradle.internal.os.OperatingSystem + +project.ext.lwjglVersion = "3.3.4" + +switch (OperatingSystem.current()) { + case OperatingSystem.LINUX: + project.ext.lwjglNatives = "natives-linux" + break + case OperatingSystem.WINDOWS: + project.ext.lwjglNatives = "natives-windows" + break + case OperatingSystem.MAC_OS: + project.ext.lwjglNatives = "natives-macos" +} + group = project.mod_group archivesBaseName = project.mod_name version = project.mod_version loom { - gluedMinecraftJar() noIntermediateMappings() - customMinecraftManifest.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json") + customMinecraftMetadata.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json") } repositories { @@ -25,12 +39,12 @@ repositories { url = 'https://maven.fabricmc.net/' } maven { - name = 'signalumMavenReleases' - url = 'https://maven.thesignalumproject.net/releases' + name = 'SignalumMavenInfrastructure' + url = 'https://maven.thesignalumproject.net/infrastructure' } maven { - name = 'signalumMavenInfrastructure' - url = 'https://maven.thesignalumproject.net/infrastructure' + name = 'SignalumMavenReleases' + url = 'https://maven.thesignalumproject.net/releases' } ivy { url = "https://github.com/Better-than-Adventure" @@ -41,25 +55,17 @@ repositories { metadataSources { artifact() } } ivy { - url = "https://github.com/Turnip-Labs" - patternLayout { - artifact "[organisation]/releases/download/v[revision]/[module]-[revision].jar" - m2compatible = true - } - metadataSources { artifact() } - } - ivy { - url = "https://github.com/Turnip-Labs" + url = "https://downloads.betterthanadventure.net/bta-client/${project.bta_channel}/" patternLayout { - artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar" + artifact "/v[revision]/client.jar" m2compatible = true } metadataSources { artifact() } } ivy { - url = "https://github.com/Turnip-Labs" + url = "https://downloads.betterthanadventure.net/bta-server/${project.bta_channel}/" patternLayout { - artifact "[organisation]/releases/download/[revision]/[module]-bta-[revision].jar" + artifact "/v[revision]/server.jar" m2compatible = true } metadataSources { artifact() } @@ -72,28 +78,21 @@ repositories { } metadataSources { artifact() } } - ivy { - url = "https://github.com/MartinSVK12" - patternLayout { - artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar" - m2compatible = true - } - metadataSources { artifact() } - } + } dependencies { - minecraft "bta-download-repo:bta:${project.bta_version}" + minecraft "::${project.bta_version}" mappings loom.layered() {} modRuntimeOnly "objects:client:43db9b498cb67058d2e12d394e6507722e71bb45" // https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar - modImplementation "fabric-loader:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" // Helper library // If you do not need Halplibe you can comment this line out or delete this line - modImplementation "turniplabs:halplibe:${project.halplibe_version}" + implementation("turniplabs:halplibe:${project.halplibe_version}") - modImplementation "ModMenu:ModMenu:${project.mod_menu_version}" + modImplementation("turniplabs:modmenu-bta:${project.mod_menu_version}") implementation "org.slf4j:slf4j-api:1.8.0-beta4" implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0" @@ -104,15 +103,34 @@ dependencies { implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}") implementation("org.apache.logging.log4j:log4j-api:${log4jVersion}") implementation("org.apache.logging.log4j:log4j-1.2-api:${log4jVersion}") + include(implementation("org.apache.commons:commons-lang3:3.12.0")) + + modImplementation("com.github.zarzelcow:legacy-lwjgl3:1.0.4") + implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion") + + runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives" + runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives" + runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives" + runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives" + runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives" + runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives" + implementation "org.lwjgl:lwjgl:$lwjglVersion" + implementation "org.lwjgl:lwjgl-assimp:$lwjglVersion" + implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion" + implementation "org.lwjgl:lwjgl-openal:$lwjglVersion" + implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion" + implementation "org.lwjgl:lwjgl-stb:$lwjglVersion" } java { + sourceCompatibility = JavaVersion.VERSION_16 + targetCompatibility = JavaVersion.VERSION_16 withSourcesJar() } tasks.withType(JavaCompile).configureEach { - options.release.set 8 + options.release.set 16 } jar { @@ -121,6 +139,11 @@ jar { } } +configurations.configureEach { + // Removes LWJGL2 dependencies + exclude group: "org.lwjgl.lwjgl" +} + processResources { inputs.property "version", version diff --git a/gradle.properties b/gradle.properties index cd7add0..2b38d32 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,19 +1,17 @@ org.gradle.jvmargs=-Xmx2G # BTA -bta_version=7.2_01 +bta_version=7.3-pre3 +bta_channel=prerelease -# Loader & Mod Menu -# Check the newest version at https://github.com/Turnip-Labs/fabric-loader/releases -loader_version=0.15.6-babric.6-bta -# Check the newest version at https://github.com/Turnip-Labs/ModMenu/releases/ -mod_menu_version=2.0.6 +# Loader +loader_version=0.15.6-bta.7 -# HalpLibe -# Check the newest version at https://github.com/Turnip-Labs/bta-halplibe/releases/ -halplibe_version=4.1.3 +# Other Mods +mod_menu_version=3.0.0 +halplibe_version=5.0.0 # Mod -mod_version=1.3.3-7.2_01 +mod_version=1.0.0 mod_group=deus -mod_name=stanleytemperature +mod_name=rpgstuff diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index db9a6b8..0d18421 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/jitpack.yml b/jitpack.yml deleted file mode 100644 index efde7bf..0000000 --- a/jitpack.yml +++ /dev/null @@ -1,2 +0,0 @@ -jdk: - - openjdk17 diff --git a/settings.gradle b/settings.gradle index 8e9a02d..dfdc0a5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,10 @@ pluginManagement { repositories { + gradlePluginPortal() maven { name = 'Fabric' url = 'https://maven.fabricmc.net/' } - gradlePluginPortal() maven { name = 'Jitpack' url = 'https://jitpack.io' @@ -13,8 +13,9 @@ pluginManagement { name = 'Babric' url = 'https://maven.glass-launcher.net/babric' } + maven { + name = 'SignalumMavenInfrastructure' + url = 'https://maven.thesignalumproject.net/infrastructure' + } } } -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' -} diff --git a/src/main/java/deus/stanleytemperature/StanleyTemperature.java b/src/main/java/deus/stanleytemperature/StanleyTemperature.java index 0924383..7932ffc 100644 --- a/src/main/java/deus/stanleytemperature/StanleyTemperature.java +++ b/src/main/java/deus/stanleytemperature/StanleyTemperature.java @@ -6,11 +6,12 @@ import net.fabricmc.api.ModInitializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import turniplabs.halplibe.util.ClientStartEntrypoint; import turniplabs.halplibe.util.GameStartEntrypoint; import turniplabs.halplibe.util.RecipeEntrypoint; -public class StanleyTemperature implements ModInitializer, GameStartEntrypoint, RecipeEntrypoint { +public class StanleyTemperature implements ModInitializer, RecipeEntrypoint, ClientStartEntrypoint { public static final String MOD_ID = "stanleytemperature"; public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); @@ -40,16 +41,15 @@ public void onInitialize() { } + @Override - public void beforeGameStart() { + public void beforeClientStart() { } @Override - public void afterGameStart() { + public void afterClientStart() { HudManager.init(); - - } @Override diff --git a/src/main/java/deus/stanleytemperature/config/ConfigHandler.java b/src/main/java/deus/stanleytemperature/config/ConfigHandler.java index 7c3ba66..c4cdb43 100644 --- a/src/main/java/deus/stanleytemperature/config/ConfigHandler.java +++ b/src/main/java/deus/stanleytemperature/config/ConfigHandler.java @@ -1,5 +1,6 @@ package deus.stanleytemperature.config; +import deus.stanleytemperature.StanleyTemperature; import turniplabs.halplibe.util.TomlConfigHandler; import turniplabs.halplibe.util.toml.Toml; @@ -32,7 +33,7 @@ public class ConfigHandler { .addEntry("overworldRain", -0.5) .addEntry("overworldSnow", -1.0) .addEntry("overworldStorm", -0.1) - .addEntry("overworldWinterSnow", -1.3); + .addEntry("overworldClear", 0.0); toml.addCategory("itemEffects") .addEntry("itemAffectsTemperature", true) @@ -46,8 +47,7 @@ public class ConfigHandler { toml.addCategory("foodEffects") .addEntry("foodAffectsTemperature", true) - .addEntry("soup", 1.8) - .addEntry("milk", -0.5); + .addEntry("bucketIcecream", -10.0); toml.addCategory("lifeEffects") .addEntry("lifeAffectsTemperature", true) @@ -89,7 +89,7 @@ public class ConfigHandler { .addEntry("winterTemperature", -0.05) .addEntry("springTemperature", 0.0); - config = new TomlConfigHandler(null, MOD_ID, toml); + config = new TomlConfigHandler(StanleyTemperature.MOD_ID, toml); } private final TemperatureConfig temperatureConfig; diff --git a/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java b/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java index dec7798..ad29a20 100644 --- a/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java +++ b/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java @@ -1,9 +1,14 @@ package deus.stanleytemperature.config; +import net.minecraft.client.Minecraft; import net.minecraft.core.block.material.Material; +import net.minecraft.core.item.Item; +import net.minecraft.core.item.ItemBucketIceCream; +import net.minecraft.core.item.ItemFood; +import net.minecraft.core.item.ItemSoup; import net.minecraft.core.world.biome.*; import net.minecraft.core.world.season.*; -import net.minecraft.core.world.weather.Weather; +import net.minecraft.core.world.weather.*; import turniplabs.halplibe.util.TomlConfigHandler; import java.util.HashMap; @@ -11,23 +16,30 @@ public class TemperatureConfig { - private final Map weatherTemperatureAdjustments; + private final Map, Double> weatherTemperatureAdjustments; private final Map blockTemperatureAdjustments; private final Map, Double> seasonAdjustments; private final Map, Double> biomeAdjustments; + private final Map, Double> foodAdjustments; public TemperatureConfig(TomlConfigHandler configHandler) { weatherTemperatureAdjustments = new HashMap<>(); blockTemperatureAdjustments = new HashMap<>(); seasonAdjustments = new HashMap<>(); biomeAdjustments = new HashMap<>(); + foodAdjustments = new HashMap<>(); // Weather adjustments if (configHandler.getBoolean("weatherEffects.weatherAffectsTemperature")) { - weatherTemperatureAdjustments.put(Weather.overworldRain, configHandler.getDouble("weatherEffects.overworldRain")); - weatherTemperatureAdjustments.put(Weather.overworldSnow, configHandler.getDouble("weatherEffects.overworldSnow")); - weatherTemperatureAdjustments.put(Weather.overworldStorm, configHandler.getDouble("weatherEffects.overworldStorm")); - weatherTemperatureAdjustments.put(Weather.overworldWinterSnow, configHandler.getDouble("weatherEffects.overworldWinterSnow")); + weatherTemperatureAdjustments.put(WeatherRain.class, configHandler.getDouble("weatherEffects.overworldRain")); + weatherTemperatureAdjustments.put(WeatherSnow.class, configHandler.getDouble("weatherEffects.overworldSnow")); + weatherTemperatureAdjustments.put(WeatherStorm.class, configHandler.getDouble("weatherEffects.overworldStorm")); + weatherTemperatureAdjustments.put(WeatherClear.class, configHandler.getDouble("weatherEffects.overworldClear")); + // Add more weather types if needed + } + + if (configHandler.getBoolean("foodEffects.foodAffectsTemperature")) { + foodAdjustments.put(ItemBucketIceCream.class, configHandler.getDouble("foodEffects.bucketIcecream")); // Add more weather types if needed } @@ -63,7 +75,7 @@ public TemperatureConfig(TomlConfigHandler configHandler) { } } - public Double getWeatherTemperatureAdjustment(Weather weather) { + public Double getWeatherTemperatureAdjustment(Class weather) { return weatherTemperatureAdjustments.getOrDefault(weather, 0.0); } @@ -71,6 +83,10 @@ public Double getBlockTemperatureAdjustment(Material material) { return blockTemperatureAdjustments.getOrDefault(material, 0.0); } + public Double getFoodAdjustment(Class item) { + return foodAdjustments.getOrDefault(item, 0.0); + } + public Double getSeasonAdjustment(Season season) { return seasonAdjustments.getOrDefault(season.getClass(), 0.0); } diff --git a/src/main/java/deus/stanleytemperature/enums/CustomDamageTypes.java b/src/main/java/deus/stanleytemperature/enums/CustomDamageTypes.java index 32a575b..6447a89 100644 --- a/src/main/java/deus/stanleytemperature/enums/CustomDamageTypes.java +++ b/src/main/java/deus/stanleytemperature/enums/CustomDamageTypes.java @@ -1,15 +1,16 @@ package deus.stanleytemperature.enums; +import deus.stanleytemperature.StanleyTemperature; import net.minecraft.core.util.helper.DamageType; public class CustomDamageTypes extends DamageType { - public static final DamageType OVERHEATING = new DamageType("damagetype.overheating", false, true, 0); - public static final DamageType FREEZING = new DamageType("damagetype.freezing", false, true, 0); - public static final DamageType HEAT = new DamageType("damagetype.heat", false, true, 0); - public static final DamageType COLD = new DamageType("damagetype.cold", false, true, 0); + public static final DamageType OVERHEATING = new DamageType("damagetype.overheating", false, true, StanleyTemperature.MOD_ID+":gui/heatIcon"); + public static final DamageType FREEZING = new DamageType("damagetype.freezing", false, true, StanleyTemperature.MOD_ID+":gui/coldIcon"); + public static final DamageType HEAT = new DamageType("damagetype.heat", false, true, StanleyTemperature.MOD_ID+":gui/heatIcon"); + public static final DamageType COLD = new DamageType("damagetype.cold", false, true, StanleyTemperature.MOD_ID+":gui/coldIcon"); - public CustomDamageTypes(String languageKey, boolean shouldDamageArmor, boolean shouldDisplay, int iconIndex) { - super(languageKey, shouldDamageArmor, shouldDisplay, iconIndex); + public CustomDamageTypes(String languageKey, boolean shouldDamageArmor, boolean shouldDisplay, String icon) { + super(languageKey, shouldDamageArmor, shouldDisplay, icon); } } diff --git a/src/main/java/deus/stanleytemperature/interfaces/IMinecraft.java b/src/main/java/deus/stanleytemperature/interfaces/IMinecraft.java new file mode 100644 index 0000000..9bdd7f8 --- /dev/null +++ b/src/main/java/deus/stanleytemperature/interfaces/IMinecraft.java @@ -0,0 +1,11 @@ +package deus.stanleytemperature.interfaces; + +import gssl.Signal; +import net.minecraft.core.item.Item; +import net.minecraft.core.item.ItemFood; + +public interface IMinecraft { + + Signal stanley$getOnCunsumeItemSignal(); + +} diff --git a/src/main/java/deus/stanleytemperature/interfaces/IPlayerEntity.java b/src/main/java/deus/stanleytemperature/interfaces/IPlayerEntity.java index d4fd855..d00d41e 100644 --- a/src/main/java/deus/stanleytemperature/interfaces/IPlayerEntity.java +++ b/src/main/java/deus/stanleytemperature/interfaces/IPlayerEntity.java @@ -1,12 +1,12 @@ package deus.stanleytemperature.interfaces; import net.minecraft.core.block.Block; -import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.entity.player.Player; import net.minecraft.core.item.Item; public interface IPlayerEntity { Block stanley$getBlockUnderPlayer(); Item stanley$getItemInHand(); - boolean[] stanley$hasLeatherArmor(EntityPlayer player); + boolean[] stanley$hasLeatherArmor(Player player); } diff --git a/src/main/java/deus/stanleytemperature/management/TemperatureManager.java b/src/main/java/deus/stanleytemperature/management/TemperatureManager.java index 1a87440..494667e 100644 --- a/src/main/java/deus/stanleytemperature/management/TemperatureManager.java +++ b/src/main/java/deus/stanleytemperature/management/TemperatureManager.java @@ -1,11 +1,16 @@ package deus.stanleytemperature.management; +import deus.stanleytemperature.StanleyTemperature; import deus.stanleytemperature.enums.PlayerTemperatureState; +import deus.stanleytemperature.interfaces.IMinecraft; import deus.stanleytemperature.interfaces.IPlayerEntity; import deus.stanleytemperature.interfaces.IStanleyPlayerEntity; +import net.minecraft.client.Minecraft; import net.minecraft.core.block.Block; -import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.block.Blocks; +import net.minecraft.core.entity.player.Player; import net.minecraft.core.item.Item; +import net.minecraft.core.item.Items; import net.minecraft.core.world.biome.Biome; import net.minecraft.core.world.season.Season; import net.minecraft.core.world.weather.Weather; @@ -14,16 +19,17 @@ public class TemperatureManager { + private final IStanleyPlayerEntity custom_player; + private final boolean[] sent_messages = new boolean[4]; Double overheatingTemperature = MOD_CONFIG.getConfig().getDouble("player.overHeatingTemperature"); Double hotTemperature = MOD_CONFIG.getConfig().getDouble("player.hotTemperature"); Double defaultTemperature = MOD_CONFIG.getConfig().getDouble("player.defaultTemperature"); Double coldTemperature = MOD_CONFIG.getConfig().getDouble("player.coldTemperature"); Double freezingTemperature = MOD_CONFIG.getConfig().getDouble("player.freezingTemperature"); - private final IStanleyPlayerEntity custom_player; - private final boolean[] sent_messages = new boolean[4]; - private int ticks_remaining = 0; double previousPenalization = -1; // Store previous penalization value double penalization = 0; + private int ticks_remaining = 0; + private Minecraft mc = Minecraft.getMinecraft(); public TemperatureManager(IStanleyPlayerEntity custom_player) { this.custom_player = custom_player; @@ -31,14 +37,32 @@ public TemperatureManager(IStanleyPlayerEntity custom_player) { sent_messages[1] = false; sent_messages[2] = false; sent_messages[3] = false; + + if (MOD_CONFIG.getConfig().getBoolean("foodEffects.foodAffectsTemperature")) { + ((IMinecraft)mc).stanley$getOnCunsumeItemSignal().connect((r, item)-> { + double v = MOD_CONFIG.getTemperatureConfig().getFoodAdjustment(item.getClass()); + + System.out.println(item.getClass().getSimpleName()); + if (v > 0) { + custom_player.stanley$increasePlayerTemperature(v); + } else { + custom_player.stanley$decreasePlayerTemperature(-v); + } + }); + } + + + + } public void update() { - IPlayerEntity iplayer = (IPlayerEntity) custom_player; + IPlayerEntity iplayer = custom_player; - Block under_player_block = iplayer.stanley$getBlockUnderPlayer(); - EntityPlayer player = (EntityPlayer) (Object) this.custom_player; + Block under_player_block = iplayer.stanley$getBlockUnderPlayer(); + Player player = (Player) this.custom_player; + assert player.world != null; Biome current_biome_at_block = player.world.getBlockBiome((int) player.x, (int) player.y, (int) player.z); Season current_season = player.world.seasonManager.getCurrentSeason(); boolean[] leather_armors = iplayer.stanley$hasLeatherArmor(player); @@ -78,19 +102,18 @@ public void update() { } - if (ticks_remaining >= secondsToTicks(NEEDED_TIME_TO_UPDATE)) { ticks_remaining = 0; // Adjust temperature based on current weather if (MOD_CONFIG.getConfig().getBoolean("weatherEffects.weatherAffectsTemperature")) { - totalAdjustment += MOD_CONFIG.getTemperatureConfig().getWeatherTemperatureAdjustment(current_weather); + totalAdjustment += MOD_CONFIG.getTemperatureConfig().getWeatherTemperatureAdjustment(current_weather.getClass()); } // Adjust temperature based on the block player is standing on if (MOD_CONFIG.getConfig().getBoolean("blockEffects.playerOverBlockAffectsTemperature")) { if (under_player_block != null) { - totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBlockTemperatureAdjustment(under_player_block.blockMaterial); + totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBlockTemperatureAdjustment(under_player_block.getMaterial()); } } @@ -103,9 +126,7 @@ public void update() { // Adjust temperature based on the current biome if (MOD_CONFIG.getConfig().getBoolean("biomeEffects.biomeAffectsTemperature")) { - if (current_biome_at_block != null) { - totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBiomeAdjustment(current_biome_at_block); - } + totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBiomeAdjustment(current_biome_at_block); } // Adjust temperature based on leather armor protection @@ -124,33 +145,33 @@ public void update() { Item item = custom_player.stanley$getItemInHand(); if ( MOD_CONFIG.getConfig().getBoolean("itemEffects.itemAffectsTemperature") && - item!=null + item != null ) { - if (item == Item.bucketLava) { + if (item == Items.BUCKET_LAVA) { totalAdjustment += MOD_CONFIG.getConfig().getDouble("itemEffects.lavaBucket"); - } else if (item == Item.nethercoal) { + } else if (item == Items.NETHERCOAL) { totalAdjustment += MOD_CONFIG.getConfig().getDouble("itemEffects.netherCoal"); - } else if (item == Block.torchCoal.asItem()) { + } else if (item == Blocks.TORCH_COAL.asItem()) { totalAdjustment += MOD_CONFIG.getConfig().getDouble("itemEffects.torch"); - } else if (item == Block.torchRedstoneIdle.asItem()) { + } else if (item == Blocks.TORCH_REDSTONE_ACTIVE.asItem()) { totalAdjustment += MOD_CONFIG.getConfig().getDouble("itemEffects.redstoneTorch"); - } else if (item == Block.permafrost.asItem()) { + } else if (item == Blocks.PERMAFROST.asItem()) { totalAdjustment += MOD_CONFIG.getConfig().getDouble("itemEffects.permafrostBlock"); - } else if (item == Item.bucketIcecream) { + } else if (item == Items.BUCKET_ICECREAM) { totalAdjustment += MOD_CONFIG.getConfig().getDouble("itemEffects.bucketIcecream"); - } else if (item == Block.ice.asItem()) { + } else if (item == Blocks.ICE.asItem()) { totalAdjustment += MOD_CONFIG.getConfig().getDouble("itemEffects.iceBlock"); @@ -164,12 +185,12 @@ public void update() { ticks_remaining++; } - public void updatePlayerTemperatureState(EntityPlayer player, Double current_temperature) { + public void updatePlayerTemperatureState(Player player, Double current_temperature) { boolean isOverheating = current_temperature >= overheatingTemperature; boolean isHot = current_temperature >= hotTemperature && current_temperature < overheatingTemperature; - boolean isNormal = current_temperature == defaultTemperature; + boolean isNormal = current_temperature.equals(defaultTemperature); boolean isCold = current_temperature <= coldTemperature && current_temperature > freezingTemperature; diff --git a/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java b/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java index 650030f..c5a1371 100644 --- a/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java +++ b/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java @@ -5,11 +5,13 @@ import deus.stanleytemperature.management.SignalAccessor; import deus.stanleytemperature.management.TemperatureManager; import deus.stanleytemperature.interfaces.IStanleyPlayerEntity; +import net.minecraft.client.entity.player.PlayerLocal; import net.minecraft.core.block.Block; import net.minecraft.core.entity.Entity; -import net.minecraft.core.entity.monster.EntitySnowman; -import net.minecraft.core.entity.player.EntityPlayer; -import net.minecraft.core.entity.projectile.EntitySnowball; + +import net.minecraft.core.entity.monster.MobSnowman; +import net.minecraft.core.entity.player.Player; +import net.minecraft.core.entity.projectile.ProjectileSnowball; import net.minecraft.core.item.Item; import net.minecraft.core.item.ItemArmor; import net.minecraft.core.item.ItemStack; @@ -22,12 +24,13 @@ import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Surrogate; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import static deus.stanleytemperature.StanleyTemperature.MOD_CONFIG; -@Mixin(EntityPlayer.class) +@Mixin(Player.class) public abstract class MixinEntityPlayer implements IStanleyPlayerEntity { @Unique @@ -62,15 +65,17 @@ public void afterConstructor(World world, CallbackInfo ci) { public void afterUpdate(CallbackInfo ci) { if (MOD_CONFIG.getConfig().getBoolean("temperatureManagement.activateTemperatureManagement")) stanley$updateTemperature(); + + System.out.println(temperature_state); } @Inject(method = "hurt(Lnet/minecraft/core/entity/Entity;ILnet/minecraft/core/util/helper/DamageType;)Z", at = @At("RETURN"), remap = false) public void afterPlayerHurt(Entity attacker, int damage, DamageType type, CallbackInfoReturnable cir) { if (MOD_CONFIG.getConfig().getBoolean("snowballEffects.snowballAffectsTemperature")) { Object obj = attacker; - if (obj instanceof EntitySnowball && ((EntitySnowball) obj).owner != null) { + if (obj instanceof ProjectileSnowball && ((ProjectileSnowball) obj).owner != null) { stanley$decreasePlayerTemperature(MOD_CONFIG.getConfig().getFloat("snowballEffect.snowballEffect")); - } else if (attacker instanceof EntitySnowman) { + } else if (attacker instanceof MobSnowman) { stanley$decreasePlayerTemperature(MOD_CONFIG.getConfig().getFloat("snowballEffect.snowballEffect")); } } @@ -125,7 +130,7 @@ public void afterPlayerHurt(Entity attacker, int damage, DamageType type, Callba @Override public void stanley$killByFreezing() { - EntityPlayer player = (EntityPlayer) (Object) this; + Player player = (Player) (Object) this; player.sendTranslatedChatMessage("killed_by.freezing"); accessor.killedByFreezing.emit(null); this.killPlayer(); @@ -133,7 +138,7 @@ public void afterPlayerHurt(Entity attacker, int damage, DamageType type, Callba @Override public void stanley$killByOverheating() { - EntityPlayer player = (EntityPlayer) (Object) this; + Player player = (Player) (Object) this; player.sendTranslatedChatMessage("killed_by.overheating"); accessor.killedByOverheating.emit(null); this.killPlayer(); @@ -141,7 +146,7 @@ public void afterPlayerHurt(Entity attacker, int damage, DamageType type, Callba @Override public Block stanley$getBlockUnderPlayer() { - EntityPlayer player = (EntityPlayer) (Object) this; + Player player = (Player) (Object) this; return player.world.getBlock((int) player.x, (int) player.y - 2, (int) player.z); } @@ -176,22 +181,22 @@ public void afterPlayerHurt(Entity attacker, int damage, DamageType type, Callba } @Override - public boolean[] stanley$hasLeatherArmor(EntityPlayer player) { + public boolean[] stanley$hasLeatherArmor(Player player) { ItemArmor helmet = getArmorFromSlot(player, 0); ItemArmor chestplate = getArmorFromSlot(player, 1); ItemArmor leggings = getArmorFromSlot(player, 2); ItemArmor boots = getArmorFromSlot(player, 3); - boolean a = helmet != null && helmet.material == ArmorMaterial.LEATHER; - boolean b = chestplate != null && chestplate.material == ArmorMaterial.LEATHER; - boolean c = leggings != null && leggings.material == ArmorMaterial.LEATHER; - boolean d = boots != null && boots.material == ArmorMaterial.LEATHER; + boolean a = helmet != null && helmet.getArmorMaterial() == ArmorMaterial.LEATHER; + boolean b = chestplate != null && chestplate.getArmorMaterial() == ArmorMaterial.LEATHER; + boolean c = leggings != null && leggings.getArmorMaterial() == ArmorMaterial.LEATHER; + boolean d = boots != null && boots.getArmorMaterial() == ArmorMaterial.LEATHER; return new boolean[]{a, b, c, d}; } @Unique - private ItemArmor getArmorFromSlot(EntityPlayer player, int slot_index) { + private ItemArmor getArmorFromSlot(Player player, int slot_index) { if (slot_index < 0 || slot_index >= player.inventory.armorInventory.length) { return null; } diff --git a/src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java b/src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java new file mode 100644 index 0000000..3634290 --- /dev/null +++ b/src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java @@ -0,0 +1,54 @@ +package deus.stanleytemperature.mixin; + +import deus.stanleytemperature.enums.PlayerTemperatureState; +import deus.stanleytemperature.interfaces.IStanleyPlayerEntity; +import net.minecraft.core.entity.player.Player; +import net.minecraft.core.item.*; +import net.minecraft.core.world.World; +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 java.util.Random; + +@Mixin(ItemBucketIceCream.class) +public class MixinIceCreamBucket { + + private static final Random ITEM_RAND = new Random(); + + @Inject(method = "onUseItem", at = @At(value = "HEAD"), remap = false, cancellable = true) + private void customOnUseItem(ItemStack itemstack, World world, Player entityplayer, CallbackInfoReturnable cir) { + // Check if the player can consume the ice cream + boolean canConsumeIceCream = entityplayer.getHealth() < entityplayer.getMaxHealth() + && entityplayer.getHealth() + entityplayer.getTotalHealingRemaining() < entityplayer.getMaxHealth() + && itemstack.consumeItem(entityplayer); + + // Get the temperature state of the player + PlayerTemperatureState state = ((IStanleyPlayerEntity) entityplayer).stanley$getState(); + + // Determine sound effect + String soundEffect = ((ItemBucketIceCream) (Object) this).getTicksPerHeal() >= 10 ? "random.bite_extended" : "random.bite"; + + // Check the player's temperature state and apply effects + if (canConsumeIceCream) { + // Heal the player and apply the sound effect + entityplayer.eatFood((ItemBucketIceCream) (Object) this); + playSound(world, entityplayer, soundEffect); + cir.setReturnValue(new ItemStack(Items.BUCKET)); + } else if (state.equals(PlayerTemperatureState.HOT) || state.equals(PlayerTemperatureState.OVERHEATING)) { + playSound(world, entityplayer, soundEffect); + cir.setReturnValue(new ItemStack(Items.BUCKET)); + } else { + playSound(world, entityplayer, soundEffect); + cir.setReturnValue(new ItemStack(Items.BUCKET)); + } + } + + // Helper method to play sound at the entity + private void playSound(World world, Player entityplayer, String soundEffect) { + world.playSoundAtEntity(entityplayer, entityplayer, soundEffect, + 0.5F + (ITEM_RAND.nextFloat() - ITEM_RAND.nextFloat()) * 0.1F, + 1.1F + (ITEM_RAND.nextFloat() - ITEM_RAND.nextFloat()) * 0.1F); + } +} diff --git a/src/main/java/deus/stanleytemperature/mixin/MixinMinecraft.java b/src/main/java/deus/stanleytemperature/mixin/MixinMinecraft.java new file mode 100644 index 0000000..b883850 --- /dev/null +++ b/src/main/java/deus/stanleytemperature/mixin/MixinMinecraft.java @@ -0,0 +1,37 @@ +package deus.stanleytemperature.mixin; + +import deus.stanleytemperature.interfaces.IMinecraft; +import gssl.Signal; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.player.PlayerLocal; +import net.minecraft.core.item.Item; +import net.minecraft.core.item.ItemFood; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(Minecraft.class) +public class MixinMinecraft implements IMinecraft { + + @Shadow + public PlayerLocal thePlayer; + @Unique + @Final + private final Signal onConsumeItem = new Signal<>(); + + @Inject(method = "clickMouse(IZZ)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/controller/PlayerController;useItem(Lnet/minecraft/core/entity/player/Player;Lnet/minecraft/core/world/World;Lnet/minecraft/core/item/ItemStack;)Z"), remap = false) + private void customClickMouse(int clickType, boolean attack, boolean repeat, CallbackInfo ci) { + if (thePlayer.getHeldItem().getItem()instanceof ItemFood itemFood) { + onConsumeItem.emit(itemFood); + } + } + + @Override + public Signal stanley$getOnCunsumeItemSignal() { + return onConsumeItem; + } +} diff --git a/src/main/java/deus/stanleytemperature/overlay/HudManager.java b/src/main/java/deus/stanleytemperature/overlay/HudManager.java index 15a700f..ebce3d0 100644 --- a/src/main/java/deus/stanleytemperature/overlay/HudManager.java +++ b/src/main/java/deus/stanleytemperature/overlay/HudManager.java @@ -2,6 +2,10 @@ import deus.stanleytemperature.StanleyTemperature; import net.minecraft.client.gui.hud.*; // Asegúrate de que las importaciones sean correctas +import net.minecraft.client.gui.hud.component.ComponentAnchor; +import net.minecraft.client.gui.hud.component.HudComponent; +import net.minecraft.client.gui.hud.component.HudComponents; +import net.minecraft.client.gui.hud.component.layout.LayoutSnap; public class HudManager { @@ -10,7 +14,7 @@ public class HudManager { ThermometerComponent.getTemperatureBarW(), ThermometerComponent.getTemperatureBarH() , - new SnapLayout(HudComponents.HOTBAR, ComponentAnchor.TOP_LEFT, ComponentAnchor.BOTTOM_LEFT))); + new LayoutSnap(HudComponents.HOTBAR, ComponentAnchor.TOP_LEFT, ComponentAnchor.BOTTOM_LEFT))); public static void init() { diff --git a/src/main/java/deus/stanleytemperature/overlay/ThermometerComponent.java b/src/main/java/deus/stanleytemperature/overlay/ThermometerComponent.java index 7b52186..65960ae 100644 --- a/src/main/java/deus/stanleytemperature/overlay/ThermometerComponent.java +++ b/src/main/java/deus/stanleytemperature/overlay/ThermometerComponent.java @@ -4,10 +4,11 @@ import deus.stanleytemperature.interfaces.IStanleyPlayerEntity; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiIngame; -import net.minecraft.client.gui.hud.Layout; -import net.minecraft.client.gui.hud.MovableHudComponent; -import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.client.gui.hud.HudIngame; +import net.minecraft.client.gui.hud.component.HudComponentMovable; +import net.minecraft.client.gui.hud.component.layout.Layout; +import net.minecraft.client.gui.hud.component.layout.LayoutSnap; +import net.minecraft.core.entity.player.Player; import net.minecraft.core.player.gamemode.Gamemode; import org.lwjgl.opengl.GL11; @@ -15,7 +16,7 @@ import static deus.stanleytemperature.StanleyTemperature.MOD_CONFIG; -public class ThermometerComponent extends MovableHudComponent { +public class ThermometerComponent extends HudComponentMovable { private int width = getTemperatureBarW(); private int height = getTemperatureBarH(); @@ -41,14 +42,14 @@ public class ThermometerComponent extends MovableHudComponent { // assets/stanleylib/textures/gui/thermometer.png // /assets/minecraft/textures/gui/icons.png - public ThermometerComponent(String key, int xSize, int ySize, Layout layout) { + public ThermometerComponent(String key, int xSize, int ySize, LayoutSnap layout) { super(key, xSize, ySize, layout); } @Override public boolean isVisible(Minecraft mc) { - EntityPlayer player = mc.thePlayer; + Player player = mc.thePlayer; if (player == null) return true; @@ -94,7 +95,7 @@ private void renderSprite(Minecraft mc, Gui gui, int x, int y, double targetTemp break; } - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(texture)); + mc.textureManager.loadTexture(texture).bind(); int textureWidth = width; int textureHeight = height; @@ -119,7 +120,7 @@ private void renderSprite(Minecraft mc, Gui gui, int x, int y, double targetTemp } @Override - public void render(Minecraft mc, GuiIngame gui, int xSizeScreen, int ySizeScreen, float partialTick) { + public void render(Minecraft mc, HudIngame gui, int xSizeScreen, int ySizeScreen, float partialTick) { int x = this.getLayout().getComponentX(mc, this, xSizeScreen); int y = this.getLayout().getComponentY(mc, this, ySizeScreen); @@ -138,12 +139,12 @@ public void render(Minecraft mc, GuiIngame gui, int xSizeScreen, int ySizeScreen @Override - public void renderPreview(Minecraft mc, Gui gui, Layout layout, int xSizeScreen, int ySizeScreen) { + public void renderPreview(Minecraft minecraft, Gui gui, Layout layout, int i, int j) { { - int x = layout.getComponentX(mc, this, xSizeScreen); - int y = layout.getComponentY(mc, this, ySizeScreen); + int x = layout.getComponentX(minecraft, this, i); + int y = layout.getComponentY(minecraft, this, j); - renderSprite(mc, gui, x, y, 0.5f, PlayerTemperatureState.NORMAL); + renderSprite(minecraft, gui, x, y, 0.5f, PlayerTemperatureState.NORMAL); } } private void setColor(Color color) @@ -190,11 +191,11 @@ public static String getTexture() { String orientation = MOD_CONFIG.getConfig().getString("Gui.temperatureBar"); boolean isCompact = MOD_CONFIG.getConfig().getBoolean("Gui.temperatureBarCompact"); if ("horizontal".equals(orientation)) { - return isCompact ? "assets/stanleytemperature/textures/gui/c_thermometer.png" : "assets/stanleytemperature/textures/gui/thermometer.png"; + return isCompact ? "/assets/stanleytemperature/textures/gui/c_thermometer.png" : "/assets/stanleytemperature/textures/gui/thermometer.png"; } else { if ("vertical".equals(orientation)) { - return isCompact ? "assets/stanleytemperature/textures/gui/vc_thermometer.png" : "assets/stanleytemperature/textures/gui/v_thermometer.png"; + return isCompact ? "/assets/stanleytemperature/textures/gui/vc_thermometer.png" : "/assets/stanleytemperature/textures/gui/v_thermometer.png"; } else { return ""; } diff --git a/src/main/resources/assets/stanleytemperature/textures/gui/coldIcon.png b/src/main/resources/assets/stanleytemperature/textures/gui/coldIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..3be48c7147a5f9b6f30892b83e6091d0dbbf1adc GIT binary patch literal 249 zcmVA;%8VDtPSx0EhWgBI`=|yW@*FV)3Q1gZ~fF0c zP}qCyaiQE}(>XCaTDA3h8FN-%JgUayP+6c3M3uL%{ao-^ q=CT5pSm2qK$^Gvy=V|{}_j?wiz58aE!$zQ!7(8A5T-G@yGywoWEJ(co literal 0 HcmV?d00001 diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 02b3df3..810f7bb 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -17,14 +17,14 @@ "license": "CC0-1.0", "environment": "*", - "entrypoints": { - "main": [ + "entrypoints": { + "main": [ "deus.stanleytemperature.StanleyTemperature" - ], - "beforeGameStart": [ + ], + "beforeClientStart": [ "deus.stanleytemperature.StanleyTemperature" ], - "afterGameStart": [ + "afterClientStart": [ "deus.stanleytemperature.StanleyTemperature" ], "recipesReady": [ diff --git a/src/main/resources/stanleytemperature.mixins.json b/src/main/resources/stanleytemperature.mixins.json index dc61338..f9cd3b1 100644 --- a/src/main/resources/stanleytemperature.mixins.json +++ b/src/main/resources/stanleytemperature.mixins.json @@ -4,9 +4,11 @@ "package": "deus.stanleytemperature.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ - "MixinEntityPlayer" + "MixinEntityPlayer", + "MixinIceCreamBucket" ], "client": [ + "MixinMinecraft" ], "injectors": { "defaultRequire": 1