Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.krokoyt.throwabletorchmod;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.ItemModelMesher;
- import net.minecraft.client.renderer.RenderItem;
- import net.minecraft.client.renderer.block.model.ModelResourceLocation;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.common.Mod;
- import net.minecraftforge.fml.common.Mod.EventHandler;
- import net.minecraftforge.fml.common.Mod.Instance;
- import net.minecraftforge.fml.common.SidedProxy;
- import net.minecraftforge.fml.common.event.FMLInitializationEvent;
- import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
- import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
- import net.minecraftforge.fml.common.registry.EntityRegistry;
- import net.minecraftforge.fml.common.registry.ForgeRegistries;
- import net.minecraftforge.fml.common.registry.GameRegistry;
- import net.minecraftforge.fml.relauncher.Side;
- @Mod(modid=ThrowableTorchMod.MODID, name=ThrowableTorchMod.NAME, version=ThrowableTorchMod.VERSION, acceptedMinecraftVersions="[1.12.2]")
- public class ThrowableTorchMod
- {
- public static final String MODID = "throwabletorchmod";
- public static final String NAME = "ThrowableTorchMod";
- public static final String VERSION = "1.4";
- public static Item ITEM_THROWABLE_SLIME_TORCH;
- public static Item ITEM_THROWABLE_CLAY_TORCH;
- public static Item ITEM_THROWABLE_MAGMA_TORCH;
- @Instance("throwabletorchmod")
- public static ThrowableTorchMod instance;
- @SidedProxy(clientSide="de.krokoyt.throwabletorchmod.ThrowableTorchModClientProxy", serverSide="de.krokoyt.throwabletorchmod.ThrowableTorchModCommonProxy")
- public static ThrowableTorchModCommonProxy proxy;
- @EventHandler
- public void preInit(FMLPreInitializationEvent event)
- {
- ITEM_THROWABLE_SLIME_TORCH = new ItemThrowableSlimeTorch("throwableslimetorch");
- ITEM_THROWABLE_CLAY_TORCH = new ItemThrowableClayTorch("throwableclaytorch");
- ITEM_THROWABLE_MAGMA_TORCH = new ItemThrowableMagmaTorch("throwablemagmatorch");
- ForgeRegistries.ITEMS.register(ITEM_THROWABLE_SLIME_TORCH);
- ForgeRegistries.ITEMS.register(ITEM_THROWABLE_CLAY_TORCH);
- ForgeRegistries.ITEMS.register(ITEM_THROWABLE_MAGMA_TORCH);
- proxy.preInit(event);
- }
- @EventHandler
- public void init(FMLInitializationEvent event)
- {
- int entityID = 0;
- ResourceLocation reLoc = new ResourceLocation("throwabletorchmod", ItemThrowableSlimeTorch.ID);
- EntityRegistry.registerModEntity(reLoc, EntityThrowableSlimeTorch.class, "Throwable Slime Torch", ++entityID, instance, 80, 10, true);
- reLoc = new ResourceLocation("throwabletorchmod", ItemThrowableClayTorch.ID);
- EntityRegistry.registerModEntity(reLoc, EntityThrowableClayTorch.class, "Throwable Clay Torch", ++entityID, instance, 80, 10, true);
- reLoc = new ResourceLocation("throwabletorchmod", ItemThrowableMagmaTorch.ID);
- EntityRegistry.registerModEntity(reLoc, EntityThrowableMagmaTorch.class, "Throwable Magma Torch", ++entityID, instance, 80, 10, true);
- if (event.getSide() == Side.CLIENT)
- {
- RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
- renderItem.getItemModelMesher().register(ITEM_THROWABLE_SLIME_TORCH, 0, new ModelResourceLocation("throwabletorchmod:" + ItemThrowableSlimeTorch.ID, "inventory"));
- renderItem.getItemModelMesher().register(ITEM_THROWABLE_CLAY_TORCH, 0, new ModelResourceLocation("throwabletorchmod:" + ItemThrowableClayTorch.ID, "inventory"));
- renderItem.getItemModelMesher().register(ITEM_THROWABLE_MAGMA_TORCH, 0, new ModelResourceLocation("throwabletorchmod:" + ItemThrowableMagmaTorch.ID, "inventory"));
- }
- proxy.init(event);
- }
- @EventHandler
- public void postInit(FMLPostInitializationEvent event)
- {
- proxy.postInit(event);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement