From 18d1f5af76edb9205c57e96f0df2e3bfe8f9e3df Mon Sep 17 00:00:00 2001 From: Martin Prokoph Date: Sun, 26 Jan 2025 18:18:10 +0100 Subject: [PATCH] feat: get colored water buckets working again --- .../mixin/MixinPotionTintSource.java | 4 +++- .../assets/minecraft/items/axolotl_bucket.json | 16 ++++++++++++++++ .../assets/minecraft/items/cod_bucket.json | 16 ++++++++++++++++ .../minecraft/items/pufferfish_bucket.json | 16 ++++++++++++++++ .../assets/minecraft/items/salmon_bucket.json | 16 ++++++++++++++++ .../minecraft/items/tropical_fish_bucket.json | 16 ++++++++++++++++ .../assets/minecraft/items/water_bucket.json | 16 ++++++++++++++++ 7 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/axolotl_bucket.json create mode 100644 common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/cod_bucket.json create mode 100644 common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/pufferfish_bucket.json create mode 100644 common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/salmon_bucket.json create mode 100644 common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/tropical_fish_bucket.json create mode 100644 common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/water_bucket.json diff --git a/common/src/main/java/eu/midnightdust/visualoverhaul/mixin/MixinPotionTintSource.java b/common/src/main/java/eu/midnightdust/visualoverhaul/mixin/MixinPotionTintSource.java index 980e665..1cc0a04 100644 --- a/common/src/main/java/eu/midnightdust/visualoverhaul/mixin/MixinPotionTintSource.java +++ b/common/src/main/java/eu/midnightdust/visualoverhaul/mixin/MixinPotionTintSource.java @@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.Potions; import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.util.math.ColorHelper; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; @@ -31,7 +32,8 @@ public class MixinPotionTintSource { if (!WATER_POTIONS.contains(contents.potion().get())) return; // Skip all potions with effects } - cir.setReturnValue(VisualOverhaulClient.potionColor); + if (cir.getReturnValue() == -1) cir.setReturnValue(ColorHelper.fullAlpha(VisualOverhaulClient.potionColor)); + else cir.setReturnValue(VisualOverhaulClient.potionColor); } } } diff --git a/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/axolotl_bucket.json b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/axolotl_bucket.json new file mode 100644 index 0000000..da0fb46 --- /dev/null +++ b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/axolotl_bucket.json @@ -0,0 +1,16 @@ +{ + "model": { + "type": "minecraft:model", + "model": "minecraft:item/axolotl_bucket", + "tints": [ + { + "type": "minecraft:constant", + "value": -1 + }, + { + "type": "minecraft:potion", + "default": -1 + } + ] + } +} \ No newline at end of file diff --git a/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/cod_bucket.json b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/cod_bucket.json new file mode 100644 index 0000000..4ed7a6f --- /dev/null +++ b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/cod_bucket.json @@ -0,0 +1,16 @@ +{ + "model": { + "type": "minecraft:model", + "model": "minecraft:item/cod_bucket", + "tints": [ + { + "type": "minecraft:constant", + "value": -1 + }, + { + "type": "minecraft:potion", + "default": -1 + } + ] + } +} \ No newline at end of file diff --git a/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/pufferfish_bucket.json b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/pufferfish_bucket.json new file mode 100644 index 0000000..44134e2 --- /dev/null +++ b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/pufferfish_bucket.json @@ -0,0 +1,16 @@ +{ + "model": { + "type": "minecraft:model", + "model": "minecraft:item/pufferfish_bucket", + "tints": [ + { + "type": "minecraft:constant", + "value": -1 + }, + { + "type": "minecraft:potion", + "default": -1 + } + ] + } +} \ No newline at end of file diff --git a/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/salmon_bucket.json b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/salmon_bucket.json new file mode 100644 index 0000000..304fb53 --- /dev/null +++ b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/salmon_bucket.json @@ -0,0 +1,16 @@ +{ + "model": { + "type": "minecraft:model", + "model": "minecraft:item/salmon_bucket", + "tints": [ + { + "type": "minecraft:constant", + "value": -1 + }, + { + "type": "minecraft:potion", + "default": -1 + } + ] + } +} \ No newline at end of file diff --git a/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/tropical_fish_bucket.json b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/tropical_fish_bucket.json new file mode 100644 index 0000000..424dda4 --- /dev/null +++ b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/tropical_fish_bucket.json @@ -0,0 +1,16 @@ +{ + "model": { + "type": "minecraft:model", + "model": "minecraft:item/tropical_fish_bucket", + "tints": [ + { + "type": "minecraft:constant", + "value": -1 + }, + { + "type": "minecraft:potion", + "default": -1 + } + ] + } +} \ No newline at end of file diff --git a/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/water_bucket.json b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/water_bucket.json new file mode 100644 index 0000000..dc0e26b --- /dev/null +++ b/common/src/main/resources/resourcepacks/coloredwaterbucket/assets/minecraft/items/water_bucket.json @@ -0,0 +1,16 @@ +{ + "model": { + "type": "minecraft:model", + "model": "minecraft:item/water_bucket", + "tints": [ + { + "type": "minecraft:constant", + "value": -1 + }, + { + "type": "minecraft:potion", + "default": -1 + } + ] + } +} \ No newline at end of file