Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.58 KB | None | 0 0
  1. import net.minecraftforge.fml.relauncher.SideOnly;
  2. import net.minecraftforge.fml.relauncher.Side;
  3. import net.minecraftforge.fml.common.registry.EntityRegistry;
  4. import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
  5. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  6. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  7. import net.minecraftforge.fml.client.registry.RenderingRegistry;
  8.  
  9. import net.minecraft.world.biome.Biome;
  10. import net.minecraft.world.World;
  11. import net.minecraft.util.ResourceLocation;
  12. import net.minecraft.util.EnumHand;
  13. import net.minecraft.util.DamageSource;
  14. import net.minecraft.item.ItemStack;
  15. import net.minecraft.item.Item;
  16. import net.minecraft.entity.player.EntityPlayer;
  17. import net.minecraft.entity.monster.EntityMob;
  18. import net.minecraft.entity.effect.EntityLightningBolt;
  19. import net.minecraft.entity.ai.EntityAIWander;
  20. import net.minecraft.entity.ai.EntityAISwimming;
  21. import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
  22. import net.minecraft.entity.ai.EntityAILookIdle;
  23. import net.minecraft.entity.ai.EntityAIHurtByTarget;
  24. import net.minecraft.entity.ai.EntityAIAttackMelee;
  25. import net.minecraft.entity.SharedMonsterAttributes;
  26. import net.minecraft.entity.EntityLivingBase;
  27. import net.minecraft.entity.Entity;
  28. import net.minecraft.client.renderer.entity.RenderLiving;
  29. import net.minecraft.client.model.ModelRenderer;
  30. import net.minecraft.client.model.ModelBase;
  31. import net.minecraft.client.Minecraft;
  32.  
  33. import java.util.Random;
  34. import java.util.Iterator;
  35. import java.util.ArrayList;
  36.  
  37. @SuppressWarnings("unchecked")
  38. public class mcreator_iceBoss {
  39.  
  40. public int mobid = 72;
  41. public static Object instance;
  42.  
  43. public void load(FMLInitializationEvent event) {
  44. }
  45.  
  46. public void generateNether(World world, Random random, int chunkX, int chunkZ) {
  47. }
  48.  
  49. public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
  50. }
  51.  
  52. public int addFuel(ItemStack fuel) {
  53. return 0;
  54. }
  55.  
  56. @SideOnly(Side.CLIENT)
  57. public void registerRenderers() {
  58. RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new mcreator_iceBoss.ModelIceBoss(), 0) {
  59.  
  60. protected ResourceLocation getEntityTexture(Entity par1Entity) {
  61. return new ResourceLocation("IceBoss.png");
  62. }
  63. };
  64. RenderingRegistry.registerEntityRenderingHandler(mcreator_iceBoss.EntityiceBoss.class, customRender);
  65. }
  66.  
  67. public void serverLoad(FMLServerStartingEvent event) {
  68. }
  69.  
  70. public void preInit(FMLPreInitializationEvent event) {
  71. EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:iceboss"), mcreator_iceBoss.EntityiceBoss.class, "iceboss", mobid,
  72. instance, 64, 1, true, (255 << 16) + (255 << 8) + 255, (255 << 16) + (255 << 8) + 255);
  73. }
  74.  
  75. public static Biome[] allbiomes(net.minecraft.util.registry.RegistryNamespaced<ResourceLocation, Biome> in) {
  76. Iterator<Biome> itr = in.iterator();
  77. ArrayList<Biome> ls = new ArrayList<Biome>();
  78. while (itr.hasNext()) {
  79. ls.add(itr.next());
  80. }
  81. return ls.toArray(new Biome[ls.size()]);
  82. }
  83.  
  84. public static class EntityiceBoss extends EntityMob {
  85.  
  86. World world = null;
  87.  
  88. public EntityiceBoss(World var1) {
  89. super(var1);
  90. world = var1;
  91. experienceValue = 5;
  92. this.isImmuneToFire = false;
  93. addRandomArmor();
  94. setNoAI(!true);
  95. this.tasks.addTask(1, new EntityAIWander(this, 1));
  96. this.tasks.addTask(2, new EntityAILookIdle(this));
  97. this.tasks.addTask(3, new EntityAISwimming(this));
  98. this.targetTasks.addTask(4, new EntityAIHurtByTarget(this, false));
  99. this.tasks.addTask(5, new EntityAIAttackMelee(this, 1.2, true));
  100. this.targetTasks.addTask(6, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true, true));
  101. }
  102.  
  103. protected void applyEntityAttributes() {
  104. super.applyEntityAttributes();
  105. this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
  106. this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10D);
  107. if (this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE) != null)
  108. this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3D);
  109. }
  110.  
  111. protected void addRandomArmor() {
  112. }
  113.  
  114. @Override
  115. protected Item getDropItem() {
  116. return null;
  117. }
  118.  
  119. @Override
  120. protected net.minecraft.util.SoundEvent getAmbientSound() {
  121. return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation(""));
  122. }
  123.  
  124. @Override
  125. protected net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) {
  126. return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.hurt"));
  127. }
  128.  
  129. @Override
  130. protected net.minecraft.util.SoundEvent getDeathSound() {
  131. return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.die"));
  132. }
  133.  
  134. @Override
  135. public void onStruckByLightning(EntityLightningBolt entityLightningBolt) {
  136. super.onStruckByLightning(entityLightningBolt);
  137. int i = (int) this.posX;
  138. int j = (int) this.posY;
  139. int k = (int) this.posZ;
  140. Entity entity = this;
  141. }
  142.  
  143. @Override
  144. public void fall(float l, float d) {
  145. super.fall(l, d);
  146. int i = (int) this.posX;
  147. int j = (int) this.posY;
  148. int k = (int) this.posZ;
  149. Entity entity = this;
  150. }
  151.  
  152. /**
  153. * Called when the entity is attacked.
  154. */
  155. @Override
  156. public boolean attackEntityFrom(DamageSource source, float amount) {
  157. boolean retval = super.attackEntityFrom(source, amount);
  158. int i = (int) this.posX;
  159. int j = (int) this.posY;
  160. int k = (int) this.posZ;
  161. Entity entity = this;
  162. return retval;
  163. }
  164.  
  165. @Override
  166. public void onDeath(DamageSource source) {
  167. super.onDeath(source);
  168. int i = (int) this.posX;
  169. int j = (int) this.posY;
  170. int k = (int) this.posZ;
  171. Entity entity = this;
  172. }
  173.  
  174. @Override
  175. public boolean processInteract(EntityPlayer entity, EnumHand hand) {
  176. boolean retval = super.processInteract(entity, hand);
  177. int i = (int) this.posX;
  178. int j = (int) this.posY;
  179. int k = (int) this.posZ;
  180. ItemStack itemstack = entity.getHeldItem(hand);
  181. return retval;
  182. }
  183.  
  184. @Override
  185. public void onKillEntity(EntityLivingBase entity) {
  186. super.onKillEntity(entity);
  187. int i = (int) this.posX;
  188. int j = (int) this.posY;
  189. int k = (int) this.posZ;
  190. }
  191.  
  192. @Override
  193. public void onEntityUpdate() {
  194. super.onEntityUpdate();
  195. int i = (int) this.posX;
  196. int j = (int) this.posY;
  197. int k = (int) this.posZ;
  198. Entity entity = this;
  199. }
  200.  
  201. @Override
  202. public void onCollideWithPlayer(EntityPlayer entity) {
  203. super.onCollideWithPlayer(entity);
  204. int i = (int) this.posX;
  205. int j = (int) this.posY;
  206. int k = (int) this.posZ;
  207. }
  208.  
  209. @Override
  210. protected float getSoundVolume() {
  211. return 1.0F;
  212. }
  213. }
  214.  
  215. // Date: 14/08/2018 20:14:55
  216. // Template version 1.1
  217. // Java generated by Techne
  218. // Keep in mind that you still need to fill in some blanks
  219. // - ZeuX
  220. public static class ModelIceBoss extends ModelBase {
  221.  
  222. // fields
  223. ModelRenderer Face;
  224. ModelRenderer Body1;
  225. ModelRenderer Body2;
  226. ModelRenderer ArmLeft;
  227. ModelRenderer ArmRight;
  228. ModelRenderer LegLeft;
  229. ModelRenderer LegRight;
  230.  
  231. public ModelIceBoss() {
  232. textureWidth = 128;
  233. textureHeight = 64;
  234. Face = new ModelRenderer(this, 0, 17);
  235. Face.addBox(0F, 0F, 0F, 6, 7, 6);
  236. Face.setRotationPoint(-3F, -11F, -5F);
  237. Face.setTextureSize(128, 64);
  238. Face.mirror = true;
  239. setRotation(Face, 0F, 0F, 0F);
  240. Body1 = new ModelRenderer(this, 0, 33);
  241. Body1.addBox(0F, 0F, 0F, 10, 8, 4);
  242. Body1.setRotationPoint(-5F, 1F, -3F);
  243. Body1.setTextureSize(128, 64);
  244. Body1.mirror = true;
  245. setRotation(Body1, 0F, 0F, 0F);
  246. Body2 = new ModelRenderer(this, 0, 47);
  247. Body2.addBox(0F, 0F, 0F, 10, 5, 5);
  248. Body2.setRotationPoint(-5F, -4F, -4F);
  249. Body2.setTextureSize(128, 64);
  250. Body2.mirror = true;
  251. setRotation(Body2, 0F, 0F, 0F);
  252. ArmLeft = new ModelRenderer(this, 30, 15);
  253. ArmLeft.addBox(0F, 0F, 0F, 2, 15, 2);
  254. ArmLeft.setRotationPoint(5F, -4F, -2F);
  255. ArmLeft.setTextureSize(128, 64);
  256. ArmLeft.mirror = true;
  257. setRotation(ArmLeft, 0F, 0F, 0F);
  258. ArmRight = new ModelRenderer(this, 30, 15);
  259. ArmRight.addBox(0F, 0F, 0F, 2, 15, 2);
  260. ArmRight.setRotationPoint(-7F, -4F, -2F);
  261. ArmRight.setTextureSize(128, 64);
  262. ArmRight.mirror = true;
  263. setRotation(ArmRight, 0F, 0F, 0F);
  264. LegLeft = new ModelRenderer(this, 0, 0);
  265. LegLeft.addBox(0F, 0F, 0F, 2, 15, 2);
  266. LegLeft.setRotationPoint(3F, 9F, -2F);
  267. LegLeft.setTextureSize(128, 64);
  268. LegLeft.mirror = true;
  269. setRotation(LegLeft, 0F, 0F, 0F);
  270. LegRight = new ModelRenderer(this, 0, 0);
  271. LegRight.addBox(0F, 0F, 0F, 2, 15, 2);
  272. LegRight.setRotationPoint(-5F, 9F, -2F);
  273. LegRight.setTextureSize(128, 64);
  274. LegRight.mirror = true;
  275. setRotation(LegRight, 0F, 0F, 0F);
  276. }
  277.  
  278. public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
  279. super.render(entity, f, f1, f2, f3, f4, f5);
  280. setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  281. Face.render(f5);
  282. Body1.render(f5);
  283. Body2.render(f5);
  284. ArmLeft.render(f5);
  285. ArmRight.render(f5);
  286. LegLeft.render(f5);
  287. LegRight.render(f5);
  288. }
  289.  
  290. private void setRotation(ModelRenderer model, float x, float y, float z) {
  291. model.rotateAngleX = x;
  292. model.rotateAngleY = y;
  293. model.rotateAngleZ = z;
  294. }
  295.  
  296. public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
  297. super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  298. }
  299. }
  300. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement