SHARE
TWEET

Full Armor Code

a guest Jan 31st, 2015 335 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  package mod.mcreator;//based on master condiguration
  2.  
  3. import cpw.mods.fml.client.*;
  4. import cpw.mods.fml.client.registry.*;
  5. import cpw.mods.fml.common.*;
  6. import cpw.mods.fml.common.asm.*;
  7. import cpw.mods.fml.common.asm.transformers.*;
  8. import cpw.mods.fml.common.discovery.*;
  9. import cpw.mods.fml.common.discovery.asm.*;
  10. import cpw.mods.fml.common.event.*;
  11. import cpw.mods.fml.common.functions.*;
  12. import cpw.mods.fml.common.network.*;
  13. import cpw.mods.fml.common.registry.*;
  14. import cpw.mods.fml.common.toposort.*;
  15. import cpw.mods.fml.common.versioning.*;
  16. import cpw.mods.fml.relauncher.*;
  17. import cpw.mods.fml.server.*;
  18. import net.minecraft.block.*;
  19. import net.minecraft.block.material.*;
  20. import net.minecraft.client.*;
  21. import net.minecraft.client.audio.*;
  22. import net.minecraft.client.entity.*;
  23. import net.minecraft.client.gui.*;
  24. import net.minecraft.client.gui.achievement.*;
  25. import net.minecraft.client.gui.inventory.*;
  26. import net.minecraft.client.model.*;
  27. import net.minecraft.client.multiplayer.*;
  28. import net.minecraft.client.particle.*;
  29. import net.minecraft.client.renderer.*;
  30. import net.minecraft.client.renderer.culling.*;
  31. import net.minecraft.client.renderer.entity.*;
  32. import net.minecraft.client.renderer.tileentity.*;
  33. import net.minecraft.client.settings.*;
  34. import net.minecraft.command.*;
  35. import net.minecraft.crash.*;
  36. import net.minecraft.creativetab.*;
  37. import net.minecraft.dispenser.*;
  38. import net.minecraft.enchantment.*;
  39. import net.minecraft.entity.*;
  40. import net.minecraft.entity.ai.*;
  41. import net.minecraft.entity.boss.*;
  42. import net.minecraft.entity.effect.*;
  43. import net.minecraft.entity.item.*;
  44. import net.minecraft.entity.monster.*;
  45. import net.minecraft.entity.passive.*;
  46. import net.minecraft.entity.player.*;
  47. import net.minecraft.entity.projectile.*;
  48. import net.minecraft.inventory.*;
  49. import net.minecraft.item.*;
  50. import net.minecraft.item.crafting.*;
  51. import net.minecraft.nbt.*;
  52. import net.minecraft.network.*;
  53. import net.minecraft.network.rcon.*;
  54. import net.minecraft.pathfinding.*;
  55. import net.minecraft.potion.*;
  56. import net.minecraft.profiler.*;
  57. import net.minecraft.server.*;
  58. import net.minecraft.server.dedicated.*;
  59. import net.minecraft.server.gui.*;
  60. import net.minecraft.server.integrated.*;
  61. import net.minecraft.server.management.*;
  62. import net.minecraft.src.*;
  63. import net.minecraft.stats.*;
  64. import net.minecraft.tileentity.*;
  65. import net.minecraft.util.*;
  66. import net.minecraft.village.*;
  67. import net.minecraft.world.*;
  68. import net.minecraft.world.biome.*;
  69. import net.minecraft.world.chunk.*;
  70. import net.minecraft.world.chunk.storage.*;
  71. import net.minecraft.world.demo.*;
  72. import net.minecraft.world.gen.*;
  73. import net.minecraft.world.gen.feature.*;
  74. import net.minecraft.world.gen.layer.*;
  75. import net.minecraft.world.gen.structure.*;
  76. import net.minecraft.world.storage.*;
  77. import net.minecraftforge.classloading.*;
  78. import net.minecraftforge.client.*;
  79. import net.minecraftforge.client.event.*;
  80. import net.minecraftforge.client.event.sound.*;
  81. import net.minecraftforge.common.*;
  82. import net.minecraftforge.event.*;
  83. import net.minecraftforge.event.entity.*;
  84. import net.minecraftforge.event.entity.item.*;
  85. import net.minecraftforge.event.entity.living.*;
  86. import net.minecraftforge.event.entity.minecart.*;
  87. import net.minecraftforge.event.entity.player.*;
  88. import net.minecraftforge.event.terraingen.*;
  89. import net.minecraftforge.event.world.*;
  90. import net.minecraftforge.oredict.*;
  91. import net.minecraftforge.transformers.*;
  92. import net.minecraft.init.*;
  93. import net.minecraft.creativetab.CreativeTabs;
  94. import net.minecraft.entity.Entity;
  95. import net.minecraft.entity.EntityLivingBase;
  96. import net.minecraft.entity.player.EntityPlayer;
  97. import net.minecraft.item.ItemArmor;
  98. import net.minecraft.item.ItemStack;
  99. import net.minecraft.util.DamageSource;
  100. import net.minecraft.world.World;
  101. import net.minecraftforge.common.ISpecialArmor;
  102. import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
  103. import net.minecraft.item.Item;
  104. import cpw.mods.fml.common.eventhandler.Event;
  105. import net.minecraftforge.event.entity.EntityEvent;
  106. import net.minecraftforge.event.entity.living.LivingEvent;
  107. import net.minecraft.item.ItemMapBase;
  108. import net.minecraft.item.ItemMap;
  109. import java.util.Random;
  110.  
  111. import net.minecraftforge.common.util.*;public class mcreator_ghastArmor{
  112.  
  113. public mcreator_ghastArmor(){}
  114.  
  115. public static Item helmet;
  116. public static Item body;
  117. public static Item legs;
  118. public static Item boots;
  119. public Object instance;public void load(){
  120. GameRegistry.addRecipe(new ItemStack(helmet, 1), new Object[]{
  121.         "012", "3X5", "XXX", Character.valueOf('0'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('1'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('2'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('3'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('5'), new ItemStack(mcreator_ghastIgotn.block, 1),
  122. });
  123. GameRegistry.addRecipe(new ItemStack(body, 1), new Object[]{
  124.         "0X2", "345", "678", Character.valueOf('0'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('2'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('3'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('4'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('5'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('6'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('7'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('8'), new ItemStack(mcreator_ghastIgotn.block, 1),
  125. });
  126. GameRegistry.addRecipe(new ItemStack(legs, 1), new Object[]{
  127.         "012", "3X5", "6X8", Character.valueOf('0'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('1'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('2'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('3'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('5'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('6'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('8'), new ItemStack(mcreator_ghastIgotn.block, 1),
  128. });
  129. GameRegistry.addRecipe(new ItemStack(boots, 1), new Object[]{
  130.         "0X2", "3X5", "XXX", Character.valueOf('0'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('2'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('3'), new ItemStack(mcreator_ghastIgotn.block, 1), Character.valueOf('5'), new ItemStack(mcreator_ghastIgotn.block, 1),
  131. });
  132. helmet.setCreativeTab(CreativeTabs.tabCombat);
  133. body.setCreativeTab(CreativeTabs.tabCombat);
  134. legs.setCreativeTab(CreativeTabs.tabCombat);
  135. boots.setCreativeTab(CreativeTabs.tabCombat);
  136. }
  137. public void generateNether(World world, Random random, int chunkX, int chunkZ){}
  138. public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
  139. public int addFuel(ItemStack fuel){return 0;}
  140. public void serverLoad(FMLServerStartingEvent event){}
  141. public void preInit(FMLPreInitializationEvent event){}
  142. public void registerRenderers(){}
  143.  
  144.  
  145. static{
  146. ItemArmor.ArmorMaterial enuma = EnumHelper.addArmorMaterial("GHASTARMOR", 60, new int[] {20, 20, 20, 20}, 9);
  147.  
  148. int armorPreffix = 0;if(FMLCommonHandler.instance().getEffectiveSide()==Side.CLIENT) armorPreffix = RenderingRegistry.addNewArmourRendererPrefix("ghast");
  149. helmet = (new ItemArmor(enuma, armorPreffix, 0){public void onArmorTick(World world, EntityPlayer entity, ItemStack itemStack){
  150.  
  151.  
  152. if(true){
  153. entity.addPotionEffect(new PotionEffect(12, 480, 4));
  154. }
  155.  
  156. if(true){
  157. entity.addPotionEffect(new PotionEffect(16, 480, 4));
  158. }
  159. }
  160. }).setUnlocalizedName("ghast_helmet").setTextureName("ghast_helmet");helmet.setMaxStackSize(1);
  161. body = (new ItemArmor(enuma, armorPreffix, 1){
  162. @Override
  163.     public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack){
  164.     {
  165.         if(player.capabilities.allowFlying == false){
  166.             player.capabilities.allowFlying=true;
  167.         }
  168.     }
  169.  }
  170.  /**
  171.  * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
  172.  * update it's contents.
  173.  * In Shortcut Disable Flying When Armor Part Is Removed
  174.  */
  175.  
  176. public void onUpdate(ItemStack itemstack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_){
  177. {
  178. if (entity != null)
  179. {
  180. if(entity instanceof EntityPlayer)
  181. {
  182. EntityPlayer player = ((EntityPlayer)entity);
  183. if(player.inventory.armorItemInSlot(2) == null){
  184. if(player.capabilities.allowFlying == true){
  185. player.capabilities.allowFlying = false;
  186. }
  187. }else if(player.inventory.armorItemInSlot(2).getItem() != mcreator_ghastArmor.body){
  188. if(player.capabilities.allowFlying == true){
  189. player.capabilities.allowFlying = false;
  190. }
  191. }
  192. }
  193. }
  194. }
  195.  
  196. if(true){
  197. entity.addPotionEffect(new PotionEffect(12, 480, 4));
  198. }
  199.  
  200. if(true){
  201. entity.addPotionEffect(new PotionEffect(16, 480, 4));
  202. }
  203. }
  204. }).setUnlocalizedName("ghast_chestplate").setTextureName("ghast_chestplate");body.setMaxStackSize(1);
  205. legs = (new ItemArmor(enuma, armorPreffix, 2){public void onArmorTick(World world, EntityPlayer entity, ItemStack itemStack){
  206.  
  207.  
  208. if(true){
  209. entity.addPotionEffect(new PotionEffect(12, 480, 4));
  210. }
  211.  
  212. if(true){
  213. entity.addPotionEffect(new PotionEffect(16, 480, 4));
  214. }
  215. }
  216. }).setUnlocalizedName("ghast_leggings").setTextureName("ghast_leggings");legs.setMaxStackSize(1);
  217. boots = (new ItemArmor(enuma, armorPreffix, 3){public void onArmorTick(World world, EntityPlayer entity, ItemStack itemStack){
  218.  
  219.  
  220. if(true){
  221. entity.addPotionEffect(new PotionEffect(12, 480, 4));
  222. }
  223.  
  224. if(true){
  225. entity.addPotionEffect(new PotionEffect(16, 480, 4));
  226. }
  227. }
  228. }).setUnlocalizedName("ghast_boots").setTextureName("ghast_boots");boots.setMaxStackSize(1);
  229.  
  230. Item.itemRegistry.addObject(433, "ghast_helmet", helmet);
  231. Item.itemRegistry.addObject(434, "ghast_chestplate", body);
  232. Item.itemRegistry.addObject(435, "ghast_leggings", legs);
  233. Item.itemRegistry.addObject(436, "ghast_boots", boots);
  234.  
  235.  
  236. }
  237.  
  238. }
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