diff --git a/src/main/java/deus/stanleytemperature/StanleyRecipeRegistries.java b/src/main/java/deus/stanleytemperature/StanleyRecipeRegistries.java new file mode 100644 index 0000000..448068a --- /dev/null +++ b/src/main/java/deus/stanleytemperature/StanleyRecipeRegistries.java @@ -0,0 +1,13 @@ +package deus.stanleytemperature; + +import net.minecraft.core.data.registry.recipe.RecipeNamespace; +import net.minecraft.core.data.registry.recipe.RecipeRegistry; + +public class StanleyRecipeRegistries extends RecipeRegistry { + public static final RecipeNamespace STANLEY = new RecipeNamespace(); + + public StanleyRecipeRegistries() { + + } + +} diff --git a/src/main/java/deus/stanleytemperature/StanleyRecipes.java b/src/main/java/deus/stanleytemperature/StanleyRecipes.java index a824003..027f123 100644 --- a/src/main/java/deus/stanleytemperature/StanleyRecipes.java +++ b/src/main/java/deus/stanleytemperature/StanleyRecipes.java @@ -1,4 +1,20 @@ package deus.stanleytemperature; +import deus.stanleytemperature.items.StanleyItems; +import net.minecraft.core.block.Blocks; +import net.minecraft.core.item.Item; +import turniplabs.halplibe.helper.RecipeBuilder; + public class StanleyRecipes { + public static void initialize() { + + RecipeBuilder.Shaped(StanleyTemperature.MOD_ID) + .setShape( + " ", + "ppp", + " ") + .addInput('p', Blocks.PERMAFROST.asItem()) + .create("StanleyRecipeIceCubes", StanleyItems.iceCubes.getDefaultStack()); + + } } diff --git a/src/main/java/deus/stanleytemperature/StanleyTemperature.java b/src/main/java/deus/stanleytemperature/StanleyTemperature.java index 05bbfd2..00064c8 100644 --- a/src/main/java/deus/stanleytemperature/StanleyTemperature.java +++ b/src/main/java/deus/stanleytemperature/StanleyTemperature.java @@ -5,6 +5,7 @@ import deus.stanleytemperature.items.StanleyItems; import deus.stanleytemperature.overlay.HudManager; import net.fabricmc.api.ModInitializer; +import net.minecraft.core.data.registry.Registries; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import turniplabs.halplibe.util.ClientStartEntrypoint; @@ -55,11 +56,13 @@ public void afterClientStart() { @Override public void onRecipesReady() { + StanleyRecipes.initialize(); } @Override public void initNamespaces() { - + new StanleyRecipeRegistries(); + Registries.RECIPES.register("stanley", StanleyRecipeRegistries.STANLEY); } } diff --git a/src/main/java/deus/stanleytemperature/config/ConfigHandler.java b/src/main/java/deus/stanleytemperature/config/ConfigHandler.java index 8cbc441..1e5d17e 100644 --- a/src/main/java/deus/stanleytemperature/config/ConfigHandler.java +++ b/src/main/java/deus/stanleytemperature/config/ConfigHandler.java @@ -33,14 +33,14 @@ public class ConfigHandler { ; toml.addCategory("weatherEffects") - .addEntry("weatherAffectsTemperature", true) + .addEntry("enabled", true) .addEntry("overworldRain", -0.5) .addEntry("overworldSnow", -1.0) .addEntry("overworldStorm", -0.1) .addEntry("overworldClear", 0.0); toml.addCategory("itemEffects") - .addEntry("itemAffectsTemperature", true) + .addEntry("enabled", true) .addEntry("torch", 0.5) .addEntry("redstoneTorch", 0.05) .addEntry("lavaBucket", 2.0) @@ -49,17 +49,22 @@ public class ConfigHandler { .addEntry("bucketIcecream", -2.0) .addEntry("iceBlock", -2.0); - toml.addCategory("foodEffects") - .addEntry("foodAffectsTemperature", true) + toml.addCategory("vanillaFoodEffects") + .addEntry("enabled", true) .addEntry("bucketIcecream", -10.0); + toml.addCategory("foodEffects") + .addEntry("enabled", true) + .addEntry("iceCubes", -5.0) + .addEntry("netherrackMeatBalls", 5.0); + toml.addCategory("lifeEffects") - .addEntry("lifeAffectsTemperature", true) + .addEntry("enabled", true) .addEntry("applyEffectEveryXHearts", 2) .addEntry("temperatureResistancePenalizationPerHeart", -1.0); toml.addCategory("blockEffects") - .addEntry("playerOverBlockAffectsTemperature", true) + .addEntry("enabled", true) .addEntry("snowBlock", -0.05) .addEntry("waterBlock", -0.05) .addEntry("fire", -2.00) @@ -67,11 +72,11 @@ public class ConfigHandler { .addEntry("iceBlock", -0.03); toml.addCategory("snowballEffects") - .addEntry("snowballAffectsTemperature", true) + .addEntry("enabled", true) .addEntry("snowballEffect", 0.01); toml.addCategory("biomeEffects") - .addEntry("biomeAffectsTemperature", true) + .addEntry("enabled", true) .addEntry("plains", 0.0) .addEntry("taiga", -0.1) .addEntry("nether", 3.0) @@ -83,11 +88,11 @@ public class ConfigHandler { .addEntry("forest", -0.015); toml.addCategory("leatherProtection") - .addEntry("leatherProtectionPercentage", 0.01) - .addEntry("leatherProtectsTemperature", true); + .addEntry("enabled", true) + .addEntry("leatherProtectionPercentage", 0.01); toml.addCategory("seasonEffects") - .addEntry("seasonAffectsTemperature", true) + .addEntry("enabled", true) .addEntry("summerTemperature", 0.04) .addEntry("fallTemperature", 0.0) .addEntry("winterTemperature", -0.05) diff --git a/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java b/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java index ad29a20..75b238c 100644 --- a/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java +++ b/src/main/java/deus/stanleytemperature/config/TemperatureConfig.java @@ -1,11 +1,8 @@ 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.*; @@ -16,82 +13,98 @@ public class TemperatureConfig { - private final Map, Double> weatherTemperatureAdjustments; - private final Map blockTemperatureAdjustments; - private final Map, Double> seasonAdjustments; - private final Map, Double> biomeAdjustments; - private final Map, Double> foodAdjustments; + private final Map, Double> weatherValues; + private final Map blockValues; + private final Map, Double> seasonValues; + private final Map, Double> biomeValues; + private final Map, Double> vanillaFoodValues; + private final Map foodValues; public TemperatureConfig(TomlConfigHandler configHandler) { - weatherTemperatureAdjustments = new HashMap<>(); - blockTemperatureAdjustments = new HashMap<>(); - seasonAdjustments = new HashMap<>(); - biomeAdjustments = new HashMap<>(); - foodAdjustments = new HashMap<>(); + weatherValues = new HashMap<>(); + blockValues = new HashMap<>(); + seasonValues = new HashMap<>(); + biomeValues = new HashMap<>(); + vanillaFoodValues = new HashMap<>(); + foodValues = new HashMap<>(); // Weather adjustments - if (configHandler.getBoolean("weatherEffects.weatherAffectsTemperature")) { - 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")); + if (configHandler.getBoolean("weatherEffects.enabled")) { + weatherValues.put(WeatherRain.class, configHandler.getDouble("weatherEffects.overworldRain")); + weatherValues.put(WeatherSnow.class, configHandler.getDouble("weatherEffects.overworldSnow")); + weatherValues.put(WeatherStorm.class, configHandler.getDouble("weatherEffects.overworldStorm")); + weatherValues.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")); + if (configHandler.getBoolean("vanillaFoodEffects.enabled")) { + vanillaFoodValues.put(ItemBucketIceCream.class, configHandler.getDouble("vanillaFoodEffects.bucketIcecream")); // Add more weather types if needed } + + if (configHandler.getBoolean("foodEffects.enabled")) { + foodValues.put("netherrackMeatBalls", configHandler.getDouble("foodEffects.netherrackMeatBalls")); + foodValues.put("iceCubes", configHandler.getDouble("foodEffects.iceCubes")); + // Add more weather types if needed + } + + // Block adjustments - if (configHandler.getBoolean("blockEffects.playerOverBlockAffectsTemperature")) { - blockTemperatureAdjustments.put(Material.snow, configHandler.getDouble("blockEffects.snowBlock")); - blockTemperatureAdjustments.put(Material.water, configHandler.getDouble("blockEffects.waterBlock")); - blockTemperatureAdjustments.put(Material.ice, configHandler.getDouble("blockEffects.iceBlock")); - blockTemperatureAdjustments.put(Material.lava, configHandler.getDouble("blockEffects.lava")); - blockTemperatureAdjustments.put(Material.fire, configHandler.getDouble("blockEffects.fire")); + if (configHandler.getBoolean("blockEffects.enabled")) { + blockValues.put(Material.snow, configHandler.getDouble("blockEffects.snowBlock")); + blockValues.put(Material.water, configHandler.getDouble("blockEffects.waterBlock")); + blockValues.put(Material.ice, configHandler.getDouble("blockEffects.iceBlock")); + blockValues.put(Material.lava, configHandler.getDouble("blockEffects.lava")); + blockValues.put(Material.fire, configHandler.getDouble("blockEffects.fire")); // Add more block materials if needed } // Season adjustments - if (configHandler.getBoolean("seasonEffects.seasonAffectsTemperature")) { - seasonAdjustments.put(SeasonSummer.class, configHandler.getDouble("seasonEffects.summerTemperature")); - seasonAdjustments.put(SeasonFall.class, configHandler.getDouble("seasonEffects.fallTemperature")); - seasonAdjustments.put(SeasonSpring.class, configHandler.getDouble("seasonEffects.springTemperature")); - seasonAdjustments.put(SeasonWinter.class, configHandler.getDouble("seasonEffects.winterTemperature")); + if (configHandler.getBoolean("seasonEffects.enabled")) { + seasonValues.put(SeasonSummer.class, configHandler.getDouble("seasonEffects.summerTemperature")); + seasonValues.put(SeasonFall.class, configHandler.getDouble("seasonEffects.fallTemperature")); + seasonValues.put(SeasonSpring.class, configHandler.getDouble("seasonEffects.springTemperature")); + seasonValues.put(SeasonWinter.class, configHandler.getDouble("seasonEffects.winterTemperature")); } // Biome adjustments - if (configHandler.getBoolean("biomeEffects.biomeAffectsTemperature")) { - biomeAdjustments.put(BiomeDesert.class, configHandler.getDouble("biomeEffects.desert")); - biomeAdjustments.put(BiomeBorealForest.class, configHandler.getDouble("biomeEffects.borealForest")); - biomeAdjustments.put(BiomeBirchForest.class, configHandler.getDouble("biomeEffects.birchForest")); - biomeAdjustments.put(BiomeCaatinga.class, configHandler.getDouble("biomeEffects.caatinga")); - biomeAdjustments.put(BiomePlains.class, configHandler.getDouble("biomeEffects.plains")); - biomeAdjustments.put(BiomeSwamp.class, configHandler.getDouble("biomeEffects.swampLand")); - biomeAdjustments.put(BiomeTaiga.class, configHandler.getDouble("biomeEffects.taiga")); - biomeAdjustments.put(BiomeForest.class, configHandler.getDouble("biomeEffects.forest")); - biomeAdjustments.put(BiomeNether.class, configHandler.getDouble("biomeEffects.nether")); + if (configHandler.getBoolean("biomeEffects.enabled")) { + biomeValues.put(BiomeDesert.class, configHandler.getDouble("biomeEffects.desert")); + biomeValues.put(BiomeBorealForest.class, configHandler.getDouble("biomeEffects.borealForest")); + biomeValues.put(BiomeBirchForest.class, configHandler.getDouble("biomeEffects.birchForest")); + biomeValues.put(BiomeCaatinga.class, configHandler.getDouble("biomeEffects.caatinga")); + biomeValues.put(BiomePlains.class, configHandler.getDouble("biomeEffects.plains")); + biomeValues.put(BiomeSwamp.class, configHandler.getDouble("biomeEffects.swampLand")); + biomeValues.put(BiomeTaiga.class, configHandler.getDouble("biomeEffects.taiga")); + biomeValues.put(BiomeForest.class, configHandler.getDouble("biomeEffects.forest")); + biomeValues.put(BiomeNether.class, configHandler.getDouble("biomeEffects.nether")); } } - public Double getWeatherTemperatureAdjustment(Class weather) { - return weatherTemperatureAdjustments.getOrDefault(weather, 0.0); + public Double getFoodValues(String item) { + return foodValues.getOrDefault(item, 0.0); } - public Double getBlockTemperatureAdjustment(Material material) { - return blockTemperatureAdjustments.getOrDefault(material, 0.0); + public Double getWeatherValues(Class weather) { + return weatherValues.getOrDefault(weather, 0.0); } - public Double getFoodAdjustment(Class item) { - return foodAdjustments.getOrDefault(item, 0.0); + public Double getBlockValues(Material material) { + return blockValues.getOrDefault(material, 0.0); + } + + + + public Double getVanillaFoodValues(Class item) { + return vanillaFoodValues.getOrDefault(item, 0.0); } - public Double getSeasonAdjustment(Season season) { - return seasonAdjustments.getOrDefault(season.getClass(), 0.0); + public Double getSeasonValues(Season season) { + return seasonValues.getOrDefault(season.getClass(), 0.0); } - public Double getBiomeAdjustment(Biome biome) { - return biomeAdjustments.getOrDefault(biome.getClass(), 0.0); + public Double getBiomeValues(Biome biome) { + return biomeValues.getOrDefault(biome.getClass(), 0.0); } } diff --git a/src/main/java/deus/stanleytemperature/items/StanleyFoodType.java b/src/main/java/deus/stanleytemperature/items/StanleyFoodType.java new file mode 100644 index 0000000..2d97338 --- /dev/null +++ b/src/main/java/deus/stanleytemperature/items/StanleyFoodType.java @@ -0,0 +1,6 @@ +package deus.stanleytemperature.items; + +public enum StanleyFoodType { + HOT, + COLD +} diff --git a/src/main/java/deus/stanleytemperature/items/StanleyItemFood.java b/src/main/java/deus/stanleytemperature/items/StanleyItemFood.java new file mode 100644 index 0000000..9a7df1f --- /dev/null +++ b/src/main/java/deus/stanleytemperature/items/StanleyItemFood.java @@ -0,0 +1,55 @@ +package deus.stanleytemperature.items; + +import deus.stanleytemperature.StanleyTemperature; +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; + +public class StanleyItemFood extends ItemFood { + + protected double sAmount; + protected StanleyFoodType type; + + public StanleyItemFood(String name, String namespaceId, int id, int healAmount, int ticksPerHeal, boolean favouriteWolfMeat, int maxStackSize, double sAmount, StanleyFoodType type) { + super(name, namespaceId, id, healAmount, ticksPerHeal, favouriteWolfMeat, maxStackSize); + this.sAmount = sAmount; + } + + @Override + public ItemStack onUseItem(ItemStack itemstack, World world, Player entityplayer) { + + PlayerTemperatureState state = ((IStanleyPlayerEntity) entityplayer).stanley$getState(); + String soundEffect = this.getTicksPerHeal() >= 10 ? "random.bite_extended" : "random.bite"; + + boolean canConsumeIceCream = entityplayer.getHealth() < entityplayer.getMaxHealth() + && entityplayer.getHealth() + entityplayer.getTotalHealingRemaining() < entityplayer.getMaxHealth() + && itemstack.consumeItem(entityplayer); + + + if (canConsumeIceCream) { + entityplayer.eatFood(this); + } + + + if (StanleyFoodType.COLD.equals(type)) { + ((IStanleyPlayerEntity)entityplayer).stanley$decreasePlayerTemperature(sAmount); + + } else { + ((IStanleyPlayerEntity)entityplayer).stanley$increasePlayerTemperature(sAmount); + + } + + playSound(world, entityplayer, soundEffect); + + return new ItemStack(this, itemstack.stackSize-1); + } + + // Helper method to play sound at the entity + private void playSound(World world, Player entityplayer, String soundEffect) { + world.playSoundAtEntity(entityplayer, entityplayer, soundEffect, + 0.5F + (itemRand.nextFloat() - itemRand.nextFloat()) * 0.1F, + 1.1F + (itemRand.nextFloat() - itemRand.nextFloat()) * 0.1F); + } +} diff --git a/src/main/java/deus/stanleytemperature/items/StanleyItems.java b/src/main/java/deus/stanleytemperature/items/StanleyItems.java index b6ee7aa..1c10b0b 100644 --- a/src/main/java/deus/stanleytemperature/items/StanleyItems.java +++ b/src/main/java/deus/stanleytemperature/items/StanleyItems.java @@ -6,7 +6,7 @@ public class StanleyItems { - public static ItemFood iceCubes; + public static StanleyItemFood iceCubes; public static ItemFood netherrackMeatBalls; private static int currentBlockId = StanleyTemperature.MOD_CONFIG.getConfig().getInt("StartingIDs.blocks"); @@ -27,26 +27,30 @@ public static void initialize() { iceCubes = genericItemBuilder .setIcon(StanleyTemperature.MOD_ID + ":item/iceCubes") - .build(new ItemFood( + .build(new StanleyItemFood( "iceCubes", StanleyTemperature.MOD_ID + ":item/ice_cubes", newItemId(), 1, 1, false, - DEFAULT_STACK_SIZE + DEFAULT_STACK_SIZE, + StanleyTemperature.MOD_CONFIG.getTemperatureConfig().getFoodValues("iceCubes"), + StanleyFoodType.COLD )); netherrackMeatBalls = genericItemBuilder .setIcon(StanleyTemperature.MOD_ID + ":item/netherrackMeatBalls") - .build(new ItemFood( + .build(new StanleyItemFood( "netherrackMeatBalls", StanleyTemperature.MOD_ID + ":item/netherrack_meat_balls", newItemId(), 1, 1, false, - DEFAULT_STACK_SIZE + DEFAULT_STACK_SIZE, + StanleyTemperature.MOD_CONFIG.getTemperatureConfig().getFoodValues("netherrackMeatBalls"), + StanleyFoodType.HOT )); } } diff --git a/src/main/java/deus/stanleytemperature/management/TemperatureManager.java b/src/main/java/deus/stanleytemperature/management/TemperatureManager.java index 494667e..1bb826d 100644 --- a/src/main/java/deus/stanleytemperature/management/TemperatureManager.java +++ b/src/main/java/deus/stanleytemperature/management/TemperatureManager.java @@ -1,6 +1,5 @@ package deus.stanleytemperature.management; -import deus.stanleytemperature.StanleyTemperature; import deus.stanleytemperature.enums.PlayerTemperatureState; import deus.stanleytemperature.interfaces.IMinecraft; import deus.stanleytemperature.interfaces.IPlayerEntity; @@ -38,11 +37,10 @@ public TemperatureManager(IStanleyPlayerEntity custom_player) { sent_messages[2] = false; sent_messages[3] = false; - if (MOD_CONFIG.getConfig().getBoolean("foodEffects.foodAffectsTemperature")) { + if (MOD_CONFIG.getConfig().getBoolean("vanillaFoodEffects.enabled")) { ((IMinecraft)mc).stanley$getOnCunsumeItemSignal().connect((r, item)-> { - double v = MOD_CONFIG.getTemperatureConfig().getFoodAdjustment(item.getClass()); + double v = MOD_CONFIG.getTemperatureConfig().getVanillaFoodValues(item.getClass()); - System.out.println(item.getClass().getSimpleName()); if (v > 0) { custom_player.stanley$increasePlayerTemperature(v); } else { @@ -76,7 +74,7 @@ public void update() { Double totalAdjustment = 0.0; // Adjust temperature based on the health - if (MOD_CONFIG.getConfig().getBoolean("lifeEffects.lifeAffectsTemperature")) { + if (MOD_CONFIG.getConfig().getBoolean("lifeEffects.enabled")) { // Get the absolute difference between the current health and maximum health int healthDifference = player.getMaxHealth() - player.getHealth(); @@ -106,31 +104,33 @@ public void update() { ticks_remaining = 0; // Adjust temperature based on current weather - if (MOD_CONFIG.getConfig().getBoolean("weatherEffects.weatherAffectsTemperature")) { - totalAdjustment += MOD_CONFIG.getTemperatureConfig().getWeatherTemperatureAdjustment(current_weather.getClass()); + if (MOD_CONFIG.getConfig().getBoolean("weatherEffects.enabled")) { + if (current_weather!=null) { + totalAdjustment += MOD_CONFIG.getTemperatureConfig().getWeatherValues(current_weather.getClass()); + } } // Adjust temperature based on the block player is standing on - if (MOD_CONFIG.getConfig().getBoolean("blockEffects.playerOverBlockAffectsTemperature")) { + if (MOD_CONFIG.getConfig().getBoolean("blockEffects.enabled")) { if (under_player_block != null) { - totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBlockTemperatureAdjustment(under_player_block.getMaterial()); + totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBlockValues(under_player_block.getMaterial()); } } // Adjust temperature based on the current season - if (MOD_CONFIG.getConfig().getBoolean("seasonEffects.seasonAffectsTemperature")) { + if (MOD_CONFIG.getConfig().getBoolean("seasonEffects.enabled")) { if (current_season != null) { - totalAdjustment += MOD_CONFIG.getTemperatureConfig().getSeasonAdjustment(current_season); + totalAdjustment += MOD_CONFIG.getTemperatureConfig().getSeasonValues(current_season); } } // Adjust temperature based on the current biome - if (MOD_CONFIG.getConfig().getBoolean("biomeEffects.biomeAffectsTemperature")) { - totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBiomeAdjustment(current_biome_at_block); + if (MOD_CONFIG.getConfig().getBoolean("biomeEffects.enabled")) { + totalAdjustment += MOD_CONFIG.getTemperatureConfig().getBiomeValues(current_biome_at_block); } // Adjust temperature based on leather armor protection - if (MOD_CONFIG.getConfig().getBoolean("leatherProtection.leatherProtectsTemperature")) { + if (MOD_CONFIG.getConfig().getBoolean("leatherProtection.enabled")) { int leatherArmorCount = 0; for (boolean leatherArmor : leather_armors) { if (leatherArmor) { @@ -144,7 +144,7 @@ public void update() { // Adjust temperature based on equipped item Item item = custom_player.stanley$getItemInHand(); if ( - MOD_CONFIG.getConfig().getBoolean("itemEffects.itemAffectsTemperature") && + MOD_CONFIG.getConfig().getBoolean("itemEffects.enabled") && item != null ) { if (item == Items.BUCKET_LAVA) { diff --git a/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java b/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java index 18b1d52..7439901 100644 --- a/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java +++ b/src/main/java/deus/stanleytemperature/mixin/MixinEntityPlayer.java @@ -211,12 +211,12 @@ private ItemArmor getArmorFromSlot(Player player, int slot_index) { @Override public void stanley$hurtByCold(int amount) { - this.hurt(null, amount, CustomDamageTypes.COLD); + this.damageEntity(amount, CustomDamageTypes.COLD); } @Override public void stanley$hurtByHeat(int amount) { - this.hurt(null, amount, CustomDamageTypes.HEAT); + this.damageEntity(amount, CustomDamageTypes.HEAT); } @Override diff --git a/src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java b/src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java index 3634290..baa8118 100644 --- a/src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java +++ b/src/main/java/deus/stanleytemperature/mixin/MixinIceCreamBucket.java @@ -36,9 +36,7 @@ private void customOnUseItem(ItemStack itemstack, World world, Player entityplay 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)); diff --git a/src/main/resources/assets/stanleytemperature/textures/gui/c_thermometer.png b/src/main/resources/assets/stanleytemperature/textures/gui/c_thermometer.png index 80d11bd..38ee119 100644 Binary files a/src/main/resources/assets/stanleytemperature/textures/gui/c_thermometer.png and b/src/main/resources/assets/stanleytemperature/textures/gui/c_thermometer.png differ