SHARE
TWEET

Untitled

a guest Jun 18th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.krokoyt.throwabletorchmod;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import net.minecraft.client.renderer.ItemModelMesher;
  5. import net.minecraft.client.renderer.RenderItem;
  6. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  7. import net.minecraft.init.Blocks;
  8. import net.minecraft.init.Items;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.util.ResourceLocation;
  12. import net.minecraftforge.fml.common.Mod;
  13. import net.minecraftforge.fml.common.Mod.EventHandler;
  14. import net.minecraftforge.fml.common.Mod.Instance;
  15. import net.minecraftforge.fml.common.SidedProxy;
  16. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  17. import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
  18. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  19. import net.minecraftforge.fml.common.registry.EntityRegistry;
  20. import net.minecraftforge.fml.common.registry.ForgeRegistries;
  21. import net.minecraftforge.fml.common.registry.GameRegistry;
  22. import net.minecraftforge.fml.relauncher.Side;
  23.  
  24. @Mod(modid=ThrowableTorchMod.MODID, name=ThrowableTorchMod.NAME, version=ThrowableTorchMod.VERSION, acceptedMinecraftVersions="[1.12.2]")
  25. public class ThrowableTorchMod
  26. {
  27.   public static final String MODID = "throwabletorchmod";
  28.   public static final String NAME = "ThrowableTorchMod";
  29.   public static final String VERSION = "1.4";
  30.   public static Item ITEM_THROWABLE_SLIME_TORCH;
  31.   public static Item ITEM_THROWABLE_CLAY_TORCH;
  32.   public static Item ITEM_THROWABLE_MAGMA_TORCH;
  33.   @Instance("throwabletorchmod")
  34.   public static ThrowableTorchMod instance;
  35.   @SidedProxy(clientSide="de.krokoyt.throwabletorchmod.ThrowableTorchModClientProxy", serverSide="de.krokoyt.throwabletorchmod.ThrowableTorchModCommonProxy")
  36.   public static ThrowableTorchModCommonProxy proxy;
  37.  
  38.  
  39.  
  40.   @EventHandler
  41.   public void preInit(FMLPreInitializationEvent event)
  42.   {
  43.    
  44.  
  45.      ITEM_THROWABLE_SLIME_TORCH = new ItemThrowableSlimeTorch("throwableslimetorch");
  46.      ITEM_THROWABLE_CLAY_TORCH = new ItemThrowableClayTorch("throwableclaytorch");
  47.      ITEM_THROWABLE_MAGMA_TORCH = new ItemThrowableMagmaTorch("throwablemagmatorch");
  48.      
  49.     ForgeRegistries.ITEMS.register(ITEM_THROWABLE_SLIME_TORCH);
  50.    
  51.  
  52.  
  53.     ForgeRegistries.ITEMS.register(ITEM_THROWABLE_CLAY_TORCH);
  54.    
  55.  
  56.  
  57.     ForgeRegistries.ITEMS.register(ITEM_THROWABLE_MAGMA_TORCH);
  58.    
  59.     proxy.preInit(event);
  60.   }
  61.  
  62.   @EventHandler
  63.   public void init(FMLInitializationEvent event)
  64.   {
  65.     int entityID = 0;
  66.    
  67.     ResourceLocation reLoc = new ResourceLocation("throwabletorchmod", ItemThrowableSlimeTorch.ID);
  68.     EntityRegistry.registerModEntity(reLoc, EntityThrowableSlimeTorch.class, "Throwable Slime Torch", ++entityID, instance, 80, 10, true);
  69.  
  70.     reLoc = new ResourceLocation("throwabletorchmod", ItemThrowableClayTorch.ID);
  71.     EntityRegistry.registerModEntity(reLoc, EntityThrowableClayTorch.class, "Throwable Clay Torch", ++entityID, instance, 80, 10, true);
  72.    
  73.     reLoc = new ResourceLocation("throwabletorchmod", ItemThrowableMagmaTorch.ID);
  74.     EntityRegistry.registerModEntity(reLoc, EntityThrowableMagmaTorch.class, "Throwable Magma Torch", ++entityID, instance, 80, 10, true);
  75.    
  76.     if (event.getSide() == Side.CLIENT)
  77.     {
  78.       RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
  79.      
  80.       renderItem.getItemModelMesher().register(ITEM_THROWABLE_SLIME_TORCH, 0, new ModelResourceLocation("throwabletorchmod:" + ItemThrowableSlimeTorch.ID, "inventory"));
  81.      
  82.       renderItem.getItemModelMesher().register(ITEM_THROWABLE_CLAY_TORCH, 0, new ModelResourceLocation("throwabletorchmod:" + ItemThrowableClayTorch.ID, "inventory"));
  83.      
  84.       renderItem.getItemModelMesher().register(ITEM_THROWABLE_MAGMA_TORCH, 0, new ModelResourceLocation("throwabletorchmod:" + ItemThrowableMagmaTorch.ID, "inventory"));
  85.     }
  86.     proxy.init(event);
  87.   }
  88.  
  89.   @EventHandler
  90.   public void postInit(FMLPostInitializationEvent event)
  91.   {
  92.     proxy.postInit(event);
  93.   }
  94. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top