SHARE
TWEET

Untitled

a guest Aug 10th, 2018 153 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.registry.GameRegistry;
  7. import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
  8. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  9. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  10. import net.minecraftforge.common.util.EnumHelper;
  11.  
  12. import net.minecraft.world.World;
  13. import net.minecraft.util.ResourceLocation;
  14. import net.minecraft.item.ItemSword;
  15. import net.minecraft.item.ItemStack;
  16. import net.minecraft.init.Items;
  17. import net.minecraft.item.Item;
  18. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  19. import net.minecraft.client.Minecraft;
  20. import net.minecraft.enchantment.EnchantmentHelper;
  21. import net.minecraft.init.Enchantments;
  22. import net.minecraft.enchantment.Enchantment;
  23.  
  24. import java.util.Set;
  25. import java.util.Random;
  26. import java.util.HashMap;
  27.  
  28. public class mcreator_redIngSword {
  29.  
  30.     public mcreator_redIngSword() {
  31.     }
  32.  
  33.     public static Item block;
  34.     public static Object instance;
  35.      
  36.     public void load(FMLInitializationEvent event) {
  37.         if (event.getSide() == Side.CLIENT)
  38.             Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
  39.                     .register(block, 0, new ModelResourceLocation("testenvironmentmod:redingsword", "inventory"));
  40.                          recStack.addEnchantment(Enchantments.FIRE_ASPECT, 2);
  41.  
  42.     }
  43.    
  44.     public void generateNether(World world, Random random, int chunkX, int chunkZ) {
  45.     }
  46.  
  47.     public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
  48.     }
  49.  
  50.     public int addFuel(ItemStack fuel) {
  51.         return 0;
  52.     }
  53.  
  54.     public void serverLoad(FMLServerStartingEvent event) {
  55.     }
  56.  
  57.     public void preInit(FMLPreInitializationEvent event) {
  58.     }
  59.  
  60.     public void registerRenderers() {
  61.     }
  62.  
  63.     static {
  64.         Item.ToolMaterial enumt = EnumHelper.addToolMaterial("REDINGSWORD", 1, 1500, 4F, 3, 10);
  65.         block = (Item) (new ItemSword(enumt) {
  66.  
  67.             public Set<String> getToolClasses(ItemStack stack) {
  68.                 HashMap<String, Integer> ret = new HashMap<String, Integer>();
  69.                 ret.put("sword", 1);
  70.                 return ret.keySet();
  71.             }
  72.  
  73.                @SideOnly(Side.CLIENT)
  74. public boolean hasEffect(ItemStack par1ItemStack)
  75. {
  76. return true;
  77. }
  78.  
  79.         }).setUnlocalizedName("redingsword");
  80.         block.setRegistryName("redingsword");
  81.         ForgeRegistries.ITEMS.register(block);
  82.         block.setCreativeTab(mcreator_redstoneMod.tab);
  83.     }
  84.    
  85. }
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