添加药弹的贴图

This commit is contained in:
17146 2025-02-22 23:53:16 +08:00
parent a74a47e3bd
commit 0ba7607b5b
4 changed files with 15 additions and 2 deletions

View file

@ -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());
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "item/generated",
"textures": {
"layer0": "superbwarfare:item/potion_mortar_shell_overlay",
"layer1": "superbwarfare:item/potion_mortar_shell_base"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B