diff --git a/src/main/java/com/atsuishio/superbwarfare/ModUtils.java b/src/main/java/com/atsuishio/superbwarfare/ModUtils.java index dd3edec50..e5d94c5ae 100644 --- a/src/main/java/com/atsuishio/superbwarfare/ModUtils.java +++ b/src/main/java/com/atsuishio/superbwarfare/ModUtils.java @@ -14,6 +14,7 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.alchemy.PotionUtils; import net.minecraft.world.item.alchemy.Potions; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.client.event.RegisterColorHandlersEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.brewing.BrewingRecipeRegistry; import net.minecraftforge.event.TickEvent; @@ -69,10 +70,15 @@ public class ModUtils { bus.addListener(this::onCommonSetup); bus.addListener(this::onClientSetup); + bus.addListener(this::onRegisterColorHandlers); MinecraftForge.EVENT_BUS.register(this); } + public static ResourceLocation loc(String path) { + return new ResourceLocation(MODID, path); + } + private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel PACKET_HANDLER = NetworkRegistry.newSimpleChannel(new ResourceLocation(MODID, MODID), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); private static int messageID = 0; @@ -184,7 +190,7 @@ public class ModUtils { MouseMovementHandler.init(); } - public static ResourceLocation loc(String path) { - return new ResourceLocation(MODID, path); + public void onRegisterColorHandlers(final RegisterColorHandlersEvent.Item event) { + event.register((stack, count) -> count == 0 ? PotionUtils.getColor(stack) : -1, ModItems.POTION_MORTAR_SHELL.get()); } } diff --git a/src/main/resources/assets/superbwarfare/models/item/potion_mortar_shell.json b/src/main/resources/assets/superbwarfare/models/item/potion_mortar_shell.json new file mode 100644 index 000000000..b47bbe6b2 --- /dev/null +++ b/src/main/resources/assets/superbwarfare/models/item/potion_mortar_shell.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "superbwarfare:item/potion_mortar_shell_overlay", + "layer1": "superbwarfare:item/potion_mortar_shell_base" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/superbwarfare/textures/item/potion_mortar_shell_base.png b/src/main/resources/assets/superbwarfare/textures/item/potion_mortar_shell_base.png new file mode 100644 index 000000000..f356d89aa Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/item/potion_mortar_shell_base.png differ diff --git a/src/main/resources/assets/superbwarfare/textures/item/potion_mortar_shell_overlay.png b/src/main/resources/assets/superbwarfare/textures/item/potion_mortar_shell_overlay.png new file mode 100644 index 000000000..67a7671b7 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/item/potion_mortar_shell_overlay.png differ