SHARE
TWEET

Untitled

a guest Aug 10th, 2018 148 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.common.registry.ForgeRegistries;
  5. import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
  6. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  7. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  8. import net.minecraftforge.common.util.EnumHelper;
  9.  
  10. import net.minecraft.world.World;
  11. import net.minecraft.item.ItemStack;
  12. import net.minecraft.item.ItemArmor;
  13. import net.minecraft.item.Item;
  14. import net.minecraft.inventory.EntityEquipmentSlot;
  15. import net.minecraft.entity.player.EntityPlayer;
  16. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  17. import net.minecraft.client.Minecraft;
  18. import net.minecraft.enchantment.EnchantmentHelper;
  19. import net.minecraft.init.Enchantments;
  20. import net.minecraft.enchantment.Enchantment;
  21.  
  22.  
  23. import java.util.Random;
  24.  
  25. public class mcreator_redstoneArmor {
  26.  
  27.     public mcreator_redstoneArmor() {
  28.     }
  29.  
  30.     public static Item helmet;
  31.     public static Item body;
  32.     public static Item legs;
  33.     public static Item boots;
  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(helmet, 0, new ModelResourceLocation("testenvironmentmod:redstonearmorhelmet", "inventory"));
  40.             Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
  41.                     .register(body, 0, new ModelResourceLocation("testenvironmentmod:redstonearmorbody", "inventory"));
  42.             Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
  43.                     .register(legs, 0, new ModelResourceLocation("testenvironmentmod:redstonearmorlegs", "inventory"));
  44.             Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
  45.                     .register(boots, 0, new ModelResourceLocation("testenvironmentmod:redstonearmorboots", "inventory"));
  46.         }
  47.         helmet.setCreativeTab(mcreator_redstoneMod.tab);
  48.         body.setCreativeTab(mcreator_redstoneMod.tab);
  49.         legs.setCreativeTab(mcreator_redstoneMod.tab);
  50.         boots.setCreativeTab(mcreator_redstoneMod.tab);
  51.     }
  52.  
  53.     public void generateNether(World world, Random random, int chunkX, int chunkZ) {
  54.     }
  55.  
  56.     public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
  57.     }
  58.  
  59.     public int addFuel(ItemStack fuel) {
  60.         return 0;
  61.     }
  62.  
  63.     public void serverLoad(FMLServerStartingEvent event) {
  64.     }
  65.  
  66.     public void preInit(FMLPreInitializationEvent event) {
  67.     }
  68.  
  69.     public void registerRenderers() {
  70.     }
  71.  
  72.     static {
  73.         ItemArmor.ArmorMaterial enuma = EnumHelper.addArmorMaterial("REDSTONEARMOR", "red", 5, new int[]{2, 5, 6, 2}, 10, null, 1.0f);
  74.         int armorPreffix = 0;
  75.         helmet = (new ItemArmor(enuma, armorPreffix, EntityEquipmentSlot.HEAD) {
  76.  
  77.             public void onArmorTick(World world, EntityPlayer entity, ItemStack itemstack) {
  78.                 int i = (int) entity.posX;
  79.                 int j = (int) entity.posY;
  80.                 int k = (int) entity.posZ;
  81.                 java.util.HashMap<String, Object> dependencies = new java.util.HashMap<>();
  82.                 dependencies.put("x", i);
  83.                 dependencies.put("y", j);
  84.                 dependencies.put("z", k);
  85.                 dependencies.put("world", world);
  86.                 dependencies.put("entity", entity);
  87.                 dependencies.put("itemstack", itemstack);
  88.                 mcreator_helmetEffect.executeProcedure(dependencies);
  89.  
  90.             }
  91.         }).setUnlocalizedName("redstonearmorhelmet");
  92.         helmet.setMaxStackSize(1);
  93.         body = (new ItemArmor(enuma, armorPreffix, EntityEquipmentSlot.CHEST) {
  94.  
  95.             public void onArmorTick(World world, EntityPlayer entity, ItemStack itemstack) {
  96.                 int i = (int) entity.posX;
  97.                 int j = (int) entity.posY;
  98.                 int k = (int) entity.posZ;
  99.             }
  100.         }).setUnlocalizedName("redstonearmorbody");
  101.         body.setMaxStackSize(1);
  102.         legs = (new ItemArmor(enuma, armorPreffix, EntityEquipmentSlot.LEGS) {
  103.  
  104.             public void onArmorTick(World world, EntityPlayer entity, ItemStack itemstack) {
  105.                 int i = (int) entity.posX;
  106.                 int j = (int) entity.posY;
  107.                 int k = (int) entity.posZ;
  108.                 java.util.HashMap<String, Object> dependencies = new java.util.HashMap<>();
  109.                 dependencies.put("x", i);
  110.                 dependencies.put("y", j);
  111.                 dependencies.put("z", k);
  112.                 dependencies.put("world", world);
  113.                 dependencies.put("entity", entity);
  114.                 dependencies.put("itemstack", itemstack);
  115.                 mcreator_legsEffect.executeProcedure(dependencies);
  116.             }
  117.         }).setUnlocalizedName("redstonearmorlegs");
  118.         legs.setMaxStackSize(1);
  119.         boots = (new ItemArmor(enuma, armorPreffix, EntityEquipmentSlot.FEET) {
  120.  
  121.             public void onArmorTick(World world, EntityPlayer entity, ItemStack itemstack) {
  122.                 int i = (int) entity.posX;
  123.                 int j = (int) entity.posY;
  124.                 int k = (int) entity.posZ;
  125.                 java.util.HashMap<String, Object> dependencies = new java.util.HashMap<>();
  126.                 dependencies.put("x", i);
  127.                 dependencies.put("y", j);
  128.                 dependencies.put("z", k);
  129.                 dependencies.put("world", world);
  130.                 dependencies.put("entity", entity);
  131.                 dependencies.put("itemstack", itemstack);
  132.                 mcreator_bootsEffects.executeProcedure(dependencies);
  133.             }
  134.         }).setUnlocalizedName("redstonearmorboots");
  135.         boots.setMaxStackSize(1);
  136.         helmet.setRegistryName("redstonearmorhelmet");
  137.         ForgeRegistries.ITEMS.register(helmet);
  138.         body.setRegistryName("redstonearmorbody");
  139.         ForgeRegistries.ITEMS.register(body);
  140.         legs.setRegistryName("redstonearmorlegs");
  141.         ForgeRegistries.ITEMS.register(legs);
  142.         boots.setRegistryName("redstonearmorboots");
  143.         ForgeRegistries.ITEMS.register(boots);
  144.     }
  145. }
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