SHARE
TWEET

Untitled

a guest Aug 10th, 2018 21 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package mod.mcreator;
  2.  
  3. import net.minecraftforge.fml.relauncher.Side;
  4. import net.minecraftforge.fml.relauncher.SideOnly;
  5. import net.minecraftforge.fml.common.registry.ForgeRegistries;
  6. import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
  7. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  8. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  9. import net.minecraftforge.common.util.EnumHelper;
  10.  
  11. import net.minecraft.world.World;
  12. import net.minecraft.item.ItemStack;
  13. import net.minecraft.item.ItemHoe;
  14. import net.minecraft.item.Item;
  15. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  16. import net.minecraft.client.Minecraft;
  17.  
  18. import java.util.Set;
  19. import java.util.Random;
  20. import java.util.HashMap;
  21.  
  22. public class mcreator_redHoe {
  23.  
  24.     public mcreator_redHoe() {
  25.     }
  26.  
  27.     public static Item block;
  28.     public static Object instance;
  29.  
  30.     public void load(FMLInitializationEvent event) {
  31.         if (event.getSide() == Side.CLIENT)
  32.             Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
  33.                     .register(block, 0, new ModelResourceLocation("testenvironmentmod:redhoe", "inventory"));
  34.     }
  35.  
  36.     public void generateNether(World world, Random random, int chunkX, int chunkZ) {
  37.     }
  38.  
  39.     public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
  40.     }
  41.  
  42.     public int addFuel(ItemStack fuel) {
  43.         return 0;
  44.     }
  45.  
  46.     public void serverLoad(FMLServerStartingEvent event) {
  47.     }
  48.  
  49.     public void preInit(FMLPreInitializationEvent event) {
  50.     }
  51.  
  52.     public void registerRenderers() {
  53.     }
  54.  
  55.     static {
  56.         Item.ToolMaterial enumt = EnumHelper.addToolMaterial("REDHOE", 1, 1500, 4F, 5, 2);
  57.         block = (Item) (new ItemHoe(enumt) {
  58.  
  59.             public Set<String> getToolClasses(ItemStack stack) {
  60.                 HashMap<String, Integer> ret = new HashMap<String, Integer>();
  61.                 ret.put("hoe", 1);
  62.                 return ret.keySet();
  63.             }
  64.         }).setUnlocalizedName("redhoe");
  65.         block.setRegistryName("redhoe");
  66.         ForgeRegistries.ITEMS.register(block);
  67.         block.setCreativeTab(mcreator_redstoneMod.tab);
  68.     }
  69. }
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