Jump to content

DaNatin

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by DaNatin

  1. Is it possible to make an update method in my mod's main class? I want to check for stuff such as if a player is wearing iron armor, or if they're outside. Most update methods I know of are in custom item/block classes themselves, I don't want that. So, is it possible to have an update method in the main class?
  2. I found the problem: renderItem's message was never mentioned in the console Meaning this whole chunk of code is being ignored for some reason @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png")); //ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); boolean isFirstPerson = true; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 0.0F))) isFirstPerson = true; GL11.glTranslatef(0.5F, 0.8F, 0.1F); //position GL11.glRotatef(-10F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(160F, 1.0F, 0.0F, 1.0F); //z //Size rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F); } } GL11.glPopMatrix(); default: break; case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png")); //ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); boolean isFirstPerson = false; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 1 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F || RenderManager.instance.playerViewY == 0.0F))) { isFirstPerson = false; GL11.glTranslatef(0.4F, 0.5F, 0.08F); //position GL11.glRotatef(-26F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(140F, 1.0F, 0.0F, 1.0F); //z //Size rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F); } } GL11.glPopMatrix(); } System.out.println("Item renderer loaded!"); }
  3. RenderRocketLauncher package com.natin.tf2mod.render; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainerCreative; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import com.natin.tf2mod.models.RocketLauncherModel; public class RenderRocketLauncher implements IItemRenderer { //public static final ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); protected RocketLauncherModel rocketlaunchermodel; public RenderRocketLauncher() { rocketlaunchermodel = new RocketLauncherModel(); } // protected ResourceLocation func_110832_a(RocketLauncherModel par1EntitySpiderQueen) //{ // return Texture; //} @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch(type) { case EQUIPPED_FIRST_PERSON: return true; case EQUIPPED: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } public EnumAction EQUIPPED(ItemStack par1ItemStack) { return EnumAction.bow; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png")); //ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); boolean isFirstPerson = false; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 1 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F))) { isFirstPerson = false; GL11.glTranslatef(0.4F, 0.5F, 0.08F); //position GL11.glRotatef(-26F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(140F, 1.0F, 0.0F, 1.0F); //z //Size rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F); } } GL11.glPopMatrix(); } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png")); //ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); boolean isFirstPerson = true; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 0.0F))) isFirstPerson = true; GL11.glTranslatef(0.5F, 0.8F, 0.1F); //position GL11.glRotatef(-10F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(160F, 1.0F, 0.0F, 1.0F); //z //Size rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F); } } GL11.glPopMatrix(); default: break; } } }
  4. I've made this in the Client Proxy @Override public void registerItemRenderer() { MinecraftForgeClient.registerItemRenderer(TF2Mod.RocketLauncher, new RenderRocketLauncher()); System.out.println("[TF2 Mod]TF2 Items Rendered!"); } The message I applied showed up in the console, some how the render code isn't working
  5. Client Proxy package com.natin.tf2mod.client; import net.minecraftforge.client.MinecraftForgeClient; import com.natin.tf2mod.common.TF2ModCommonProxy; import com.natin.tf2mod.render.RenderRocketLauncher; public class TF2ClientProxy extends TF2ModCommonProxy { @Override public void registerRenderThings() { // This is for rendering entities and so forth later on } @Override public void registerItemRenderer() { MinecraftForgeClient.registerItemRenderer(TF2Mod.RocketLauncher, new RenderRocketLauncher()); } } Common Proxy package com.natin.tf2mod.common; public class TF2ModCommonProxy { public void registerRenderThings() { // Nothing here as the server doesn't render graphics or entities! } public void registerItemRenderer() { } }
  6. The item still isn't rendered in 3D here's what I've done: -made a method in both proxies -put ItemRenderer into Client Proxy -called proxy.something() into the main file
  7. I forgot how to call certain methods -.- How do I call the code from the Client proxy?
  8. The game never really crashed from the start. I should've said that the SERVER crashed, not the game.
  9. That method actually renders that item into a custom 3D model, puting that into the Client Proxy actually disabled it... Is there another way?
  10. Mkay, Here is the main file: package com.natin.tf2mod.client; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; import com.natin.tf2mod.common.TF2ModCommonProxy; import com.natin.tf2mod.items.guns.Rocket; import com.natin.tf2mod.items.guns.RocketLauncher; import com.natin.tf2mod.render.RenderRocketLauncher; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = TF2Mod.MODID, version = TF2Mod.VERSION) public class TF2Mod { @SidedProxy(clientSide="com.natin.tf2mod.client.TF2ClientProxy", serverSide="com.natin.tf2mod.common.TF2ModCommonProxy") public static TF2ModCommonProxy proxy; public static final String MODID = "tf2mod"; public static final String VERSION = "v0.4"; /**Items**/ public static Item RocketLauncher; public static Item Rocket; @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRenderThings(); RocketLauncher = new RocketLauncher().setUnlocalizedName("RocketLauncher"); MinecraftForgeClient.registerItemRenderer(TF2Mod.RocketLauncher, new RenderRocketLauncher()); GameRegistry.registerItem(RocketLauncher, "RocketLauncher"); GameRegistry.addRecipe(new ItemStack(RocketLauncher), new Object[] { "GRT", " S", 'T', Items.iron_ingot , 'G', Items.gunpowder, 'R', Items.redstone, 'S', Items.stick }); Rocket = new Rocket().setUnlocalizedName("Rocket"); GameRegistry.registerItem(Rocket, "Rocket"); GameRegistry.addRecipe(new ItemStack(Rocket), new Object[] { "SGS", 'S', Items.iron_ingot, 'G', Items.gunpowder }); } /** public static DamageSource causeMagnumDamage(EntityNormalBullet bullet, Entity par1Entity) { return par1Entity == null ? (new EntityDamageSourceIndirect("onFire", bullet, bullet)).setProjectile() : (new EntityDamageSourceIndirect("fireball", bullet, par1Entity)).setProjectile(); } **/ } The crash report really only mentions the main file, but if you need more just ask.
  11. After I've setup forge server and loaded my mod into it, it contained a crash report like this: Exception in server tick loop cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException at cpw.mods.fml.common.LoadController.transition(LoadController.java:162) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:692) at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:97) at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:318) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:210) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) Caused by: java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException at net.minecraftforge.client.MinecraftForgeClient.getStencilBits(MinecraftForgeClient.java:51) at net.minecraftforge.client.MinecraftForgeClient.<clinit>(MinecraftForgeClient.java:55) at com.natin.tf2mod.client.TF2Mod.init(TF2Mod.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) ... 5 more Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:104) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 35 more It mentions my mod in a line, and also states that there was an exception in the server tick. So how do I make my mod server compatible?
  12. That actually fixed third person from the back, I still see two models when I'm in the front view third person. I can't seem what's causing the problem...
  13. I added an extra PushMatrix, but that still doesn't change the fact that it still renders two of the same model?
  14. I've made an item render as a custom 3D model, the problem is that I can see two of the same model (or a part of it) in third person. Here's what I see: This only happens when I'm in third person: [/img] Here is the rendering code: package com.natin.borderlands2mod.entities.render; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainerCreative; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import com.natin.borderlands2mod.guns.models.RocketLauncherModel; public class RenderRocketLauncher implements IItemRenderer { //public static final ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); protected RocketLauncherModel rocketlaunchermodel; public RenderRocketLauncher() { rocketlaunchermodel = new RocketLauncherModel(); } // protected ResourceLocation func_110832_a(RocketLauncherModel par1EntitySpiderQueen) //{ // return Texture; //} @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch(type) { case EQUIPPED: return true; case EQUIPPED_FIRST_PERSON: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } public EnumAction EQUIPPED(ItemStack par1ItemStack) { return EnumAction.bow; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("borderlands2mod", "textures/models/RocketLauncher.png")); //ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); boolean isFirstPerson = false; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F))) { isFirstPerson = false; GL11.glTranslatef(0.4F, 0.5F, 0.08F); //position GL11.glRotatef(-26F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(140F, 1.0F, 0.0F, 1.0F); //z //Size rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F); } } } case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("borderlands2mod", "textures/models/RocketLauncher.png")); //ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); boolean isFirstPerson = true; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 0.0F))) isFirstPerson = true; GL11.glTranslatef(0.5F, 0.8F, 0.1F); //position GL11.glRotatef(-10F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(160F, 1.0F, 0.0F, 1.0F); //z //Size rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F); } } GL11.glPopMatrix(); default: break; } } } Also in the console, this message is spammed repeatedly when I go into third person: [13:51:44] [Client thread/ERROR]: ########## GL ERROR ########## [13:51:44] [Client thread/ERROR]: @ Post render [13:51:44] [Client thread/ERROR]: 1283: Stack overflow
  15. I should have phrased it a little differently, I already have the model done and ready to use. I'm adding its diff child parts and it can be pretty difficult not knowing how the model might end up. The debug client doesn't seem to update with the code, which is why I always have to reopen Minecraft every time I change something in the code (mainly child position/rotation).
  16. I'm trying to hard-code my mob's model, but it takes a lot longer because I'd always have to reopen my client whenever I change something in its code to update. I used the Debug client feature, but it only works with certain things, (not limited to) such as removing/adding new AI. The thing I need help with here, is how to modify my mob's model with a debug-like feature, without having to reopen Minecraft every time I'd want to refresh/update.
  17. I need those who have mastered or at least have an idea on how to work Model animations. I made this mob which has "chicken" styled robot legs, and I implemented animation methods from ModelBiped. I have very small knowledge as to how to work on methods such as these: this.LLegTop.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; this.LLegMiddle.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; this.LLegBottom.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 2F; Here is the entire Model of the mob: // Date: 7/20/2014 4:45:51 PM // Template version 1.1 // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX package com.natin.borderlands2mod.entities.models; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; public class ModelGUN_Loader extends ModelBase { //fields ModelRenderer FrontHeadBump; ModelRenderer Head; ModelRenderer HeadSpike; ModelRenderer LArmMesh; ModelRenderer RArmMesh; ModelRenderer BodyInner; ModelRenderer BodyShield; ModelRenderer DaButt; ModelRenderer RLegTop; ModelRenderer LLegTop; ModelRenderer RLegMiddle; ModelRenderer LLegMiddle; ModelRenderer LLegBottom; ModelRenderer RLegBottom; ModelRenderer RFoot; ModelRenderer LFoot; ModelRenderer LeftArm1; ModelRenderer LeftArm2; ModelRenderer LeftArmThing; ModelRenderer RightArm1; ModelRenderer RightArm2; public ModelGUN_Loader() { textureWidth = 128; textureHeight = 128; FrontHeadBump = new ModelRenderer(this, 1, 21); FrontHeadBump.addBox(-2F, -6F, -3F, 4, 6, 2); FrontHeadBump.setRotationPoint(0F, 0F, 0F); FrontHeadBump.setTextureSize(128, 128); FrontHeadBump.mirror = true; setRotation(FrontHeadBump, 0F, 0.0174533F, 0F); Head = new ModelRenderer(this, 0, 31); Head.addBox(-8F, -6F, -2F, 16, 6, 4); Head.setRotationPoint(0F, 0F, 0F); Head.setTextureSize(128, 128); Head.mirror = true; setRotation(Head, 0F, 0F, 0F); HeadSpike = new ModelRenderer(this, 1, 11); HeadSpike.addBox(-2F, -7F, -5F, 4, 4, 2); HeadSpike.setRotationPoint(0F, 0F, 0F); HeadSpike.setTextureSize(128, 128); HeadSpike.mirror = true; setRotation(HeadSpike, -0.6981317F, 0F, 0F); LArmMesh = new ModelRenderer(this, 64, 1); LArmMesh.addBox(-10F, -5F, -1F, 2, 4, 2); LArmMesh.setRotationPoint(0F, 0F, 0F); LArmMesh.setTextureSize(128, 128); LArmMesh.mirror = true; setRotation(LArmMesh, 0F, 0F, 0F); RArmMesh = new ModelRenderer(this, 73, 1); RArmMesh.addBox(8F, -5F, -1F, 2, 4, 2); RArmMesh.setRotationPoint(0F, 0F, 0F); RArmMesh.setTextureSize(128, 128); RArmMesh.mirror = true; setRotation(RArmMesh, 0F, 0F, 0F); BodyInner = new ModelRenderer(this, 10, 43); BodyInner.addBox(-1.5F, -8F, -2F, 3, 9, 3); BodyInner.setRotationPoint(0F, 7F, 0F); BodyInner.setTextureSize(128, 128); BodyInner.mirror = true; setRotation(BodyInner, -0.1745329F, 0F, 0F); BodyShield = new ModelRenderer(this, 1, 43); BodyShield.addBox(-1.5F, -6F, -3F, 3, 7, 1); BodyShield.setRotationPoint(0F, 7F, 0F); BodyShield.setTextureSize(128, 128); BodyShield.mirror = true; setRotation(BodyShield, -0.0698132F, 0F, 0F); DaButt = new ModelRenderer(this, 1, 56); DaButt.addBox(-2F, 0F, -4F, 4, 3, ; DaButt.setRotationPoint(0F, 7F, 0F); DaButt.setTextureSize(128, 128); DaButt.mirror = true; setRotation(DaButt, 0F, 0F, 0F); RLegTop = new ModelRenderer(this, 12, 81); RLegTop.addBox(0F, -1F, -1F, 2, 7, 2); RLegTop.setRotationPoint(2F, 9F, -2F); RLegTop.setTextureSize(128, 128); RLegTop.mirror = true; setRotation(RLegTop, -0.1745329F, 0F, 0F); LLegTop = new ModelRenderer(this, 0, 81); LLegTop.addBox(-2F, -1F, -1F, 2, 7, 2); LLegTop.setRotationPoint(-2F, 9F, -2F); LLegTop.setTextureSize(128, 128); LLegTop.mirror = true; setRotation(LLegTop, -0.1745329F, 0F, 0F); RLegMiddle = new ModelRenderer(this, 12, 92); RLegMiddle.addBox(0F, -1F, -7F, 2, 7, 2); RLegMiddle.setRotationPoint(2F, 9F, -2F); RLegMiddle.setTextureSize(128, 128); RLegMiddle.mirror = true; setRotation(RLegMiddle, 1.396263F, 0F, 0F); LLegMiddle = new ModelRenderer(this, 0, 92); LLegMiddle.addBox(-2F, -1F, -7F, 2, 7, 2); LLegMiddle.setRotationPoint(-2F, 9F, -2F); LLegMiddle.setTextureSize(128, 128); LLegMiddle.mirror = true; setRotation(LLegMiddle, 2.396263F, 0F, 0F); LLegBottom = new ModelRenderer(this, 0, 103); LLegBottom.addBox(-2F, 5F, 4F, 2, 9, 4); LLegBottom.setRotationPoint(-2F, 9F, -2F); LLegBottom.setTextureSize(128, 128); LLegBottom.mirror = true; setRotation(LLegBottom, 0F, 0F, 0F); RLegBottom = new ModelRenderer(this, 12, 103); RLegBottom.addBox(0F, 5F, 4F, 2, 9, 4); RLegBottom.setRotationPoint(2F, 9F, -2F); RLegBottom.setTextureSize(128, 128); RLegBottom.mirror = true; setRotation(RLegBottom, -0.2443461F, 0F, 0F); RFoot = new ModelRenderer(this, 0, 0); RFoot.addBox(-0.5F, 12F, -3F, 3, 2, ; RFoot.setRotationPoint(2F, 10F, -2F); RFoot.setTextureSize(128, 128); RFoot.mirror = true; setRotation(RFoot, 0F, 0F, 0F); LFoot = new ModelRenderer(this, 0, 0); LFoot.addBox(-6.5F, 12F, -3F, 3, 2, ; LFoot.setRotationPoint(2F, 10F, -2F); LFoot.setTextureSize(128, 128); LFoot.mirror = true; setRotation(LFoot, 0F, 0F, 0F); LeftArm1 = new ModelRenderer(this, 62, 19); LeftArm1.addBox(-1F, -1F, -1F, 1, 10, 2); LeftArm1.setRotationPoint(-10F, -3F, 0F); LeftArm1.setTextureSize(128, 128); LeftArm1.mirror = true; setRotation(LeftArm1, 0F, 0F, 0F); LeftArm2 = new ModelRenderer(this, 62, 19); LeftArm2.addBox(-0.5333334F, -1F, -1F, 1, 10, 2); LeftArm2.setRotationPoint(-10.5F, 5F, 0F); LeftArm2.setTextureSize(128, 128); LeftArm2.mirror = true; setRotation(LeftArm2, 0F, 0F, 0F); LeftArmThing = new ModelRenderer(this, 22, 2); LeftArmThing.addBox(-2F, -5F, -1F, 2, 6, 2); LeftArmThing.setRotationPoint(-10F, -3F, 0F); LeftArmThing.setTextureSize(128, 128); LeftArmThing.mirror = true; setRotation(LeftArmThing, 0F, 0F, 0.1396263F); RightArm1 = new ModelRenderer(this, 62, 19); RightArm1.addBox(0F, -1F, -1F, 1, 10, 2); RightArm1.setRotationPoint(10F, -3F, 0F); RightArm1.setTextureSize(128, 128); RightArm1.mirror = true; setRotation(RightArm1, 0F, 0F, 0F); RightArm2 = new ModelRenderer(this, 62, 19); RightArm2.addBox(-0.5F, 0F, -1F, 1, 10, 2); RightArm2.setRotationPoint(10.5F, 4F, 0F); RightArm2.setTextureSize(128, 128); RightArm2.mirror = true; setRotation(RightArm2, 0F, 0F, 0F); } public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); FrontHeadBump.render(par7); Head.render(par7); HeadSpike.render(par7); LArmMesh.render(par7); RArmMesh.render(par7); BodyInner.render(par7); BodyShield.render(par7); DaButt.render(par7); RLegTop.render(par7); LLegTop.render(par7); RLegMiddle.render(par7); LLegMiddle.render(par7); LLegBottom.render(par7); RLegBottom.render(par7); RFoot.render(par7); LFoot.render(par7); LeftArm1.render(par7); LeftArm2.render(par7); LeftArmThing.render(par7); RightArm1.render(par7); RightArm2.render(par7); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); this.LeftArm1.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; this.LeftArm2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; this.RightArm1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; this.RightArm2.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; this.RLegTop.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; this.RLegMiddle.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; this.RLegBottom.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; this.LLegTop.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; this.LLegMiddle.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; this.LLegBottom.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 2F; } } The legs are the problem right now. Here's how it's supposed to look in-game: And here's how it turned out:
  18. Are you kidding me... Solved, I had to put the CommonProxy proxy; right under the SidedProxy method -.-
  19. Actually I tried that: "client.Borderlands2ModClientProxy"
  20. I can't seem to figure out the directory for this: @SidedProxy(clientSide ="Borderlands2ModClientProxy", serverSide = "Borderlands2ModCommonProxy") No matter what I put, it always ends up with "ClassNotFoundException". What's the directory supposed to be at the clientSide?
  21. Here's the code for registerEntityEgg: public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) { int id = getUniqueEntityId(); EntityList.IDtoClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); } I'll try making a proxy and tell you how it works out
  22. Whenever I try to spawn my mob, it crashes the game. As I look into what caused it, most of the errors point to the spawn egg. I'm still unsure and need some help with the problem. Here is the crash log: ---- Minecraft Crash Report ---- // Ooh. Shiny. Time: 7/19/14 10:22 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.client.network.NetHandlerPlayClient.handleSpawnMob(NetHandlerPlayClient.java:864) at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:129) at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:222) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1693) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at GradleStart.bounce(GradleStart.java:108) at GradleStart.startClient(GradleStart.java:101) at GradleStart.main(GradleStart.java:66) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.client.network.NetHandlerPlayClient.handleSpawnMob(NetHandlerPlayClient.java:864) at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:129) at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:222) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['ForgeDevName'/245, l='MpServer', x=1057.32, y=5.62, z=597.92]] Chunk stats: MultiplayerChunkCache: 25, 25 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: World: (1059,4,600), Chunk: (at 3,0,8 in 66,37; contains blocks 1056,0,592 to 1071,255,607), Region: (2,1; contains chunks 64,32 to 95,63, blocks 1024,0,512 to 1535,255,1023) Level time: 3369 game time, 3369 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 55 total; [EntityVillager['Villager'/137, l='MpServer', x=1062.44, y=4.00, z=622.31], EntityVillager['Villager'/136, l='MpServer', x=1069.10, y=5.00, z=615.50], EntityVillager['Villager'/139, l='MpServer', x=1063.94, y=5.00, z=616.13], EntityVillager['Villager'/138, l='MpServer', x=1065.50, y=5.00, z=620.25], EntityVillager['Villager'/141, l='MpServer', x=1072.00, y=4.00, z=634.97], EntityVillager['Villager'/140, l='MpServer', x=1068.50, y=5.00, z=631.50], EntitySlime['Slime'/142, l='MpServer', x=1048.03, y=4.61, z=622.67], EntitySlime['Slime'/133, l='MpServer', x=1059.26, y=4.41, z=579.00], EntitySlime['Slime'/135, l='MpServer', x=1077.59, y=4.65, z=583.23], EntitySlime['Slime'/134, l='MpServer', x=1073.17, y=4.00, z=587.84], EntityItem['item.item.rottenFlesh'/48781, l='MpServer', x=1093.34, y=4.13, z=629.28], EntityChicken['Chicken'/158, l='MpServer', x=1084.53, y=4.00, z=578.44], EntityHorse['Donkey'/159, l='MpServer', x=1086.00, y=4.00, z=567.06], EntitySlime['Slime'/171, l='MpServer', x=1077.78, y=4.00, z=635.22], EntitySlime['Slime'/170, l='MpServer', x=1079.69, y=5.00, z=633.50], EntityVillager['Villager'/169, l='MpServer', x=1085.88, y=5.50, z=628.50], EntityVillager['Villager'/168, l='MpServer', x=1087.88, y=5.00, z=627.25], EntitySlime['Slime'/172, l='MpServer', x=1083.22, y=4.00, z=631.22], EntityVillager['Villager'/163, l='MpServer', x=1087.38, y=6.00, z=617.69], EntityChicken['Chicken'/162, l='MpServer', x=1087.41, y=4.00, z=578.56], EntityCow['Cow'/161, l='MpServer', x=1087.50, y=4.00, z=564.91], EntityChicken['Chicken'/160, l='MpServer', x=1079.56, y=4.00, z=572.44], EntityVillager['Villager'/167, l='MpServer', x=1080.13, y=5.00, z=632.44], EntitySlime['Slime'/19948, l='MpServer', x=1048.03, y=4.00, z=635.10], EntityVillager['Villager'/166, l='MpServer', x=1079.50, y=5.00, z=631.50], EntityZombie['Zombie'/52349, l='MpServer', x=1089.53, y=4.00, z=624.50], EntityVillager['Villager'/165, l='MpServer', x=1075.25, y=4.00, z=614.44], EntityVillager['Villager'/164, l='MpServer', x=1086.50, y=5.00, z=617.06], EntityVillager['Villager'/186, l='MpServer', x=1101.50, y=5.00, z=616.50], EntityVillager['Villager'/187, l='MpServer', x=1098.50, y=5.00, z=608.50], EntityVillager['Villager'/184, l='MpServer', x=1091.63, y=4.00, z=599.31], EntityVillager['Villager'/185, l='MpServer', x=1089.44, y=5.00, z=599.13], EntityVillager['Villager'/190, l='MpServer', x=1090.44, y=5.00, z=610.97], EntityVillager['Villager'/191, l='MpServer', x=1100.66, y=4.00, z=611.56], EntityVillager['Villager'/188, l='MpServer', x=1098.31, y=4.00, z=615.16], EntityVillager['Villager'/189, l='MpServer', x=1100.13, y=5.00, z=609.44], EntityChicken['Chicken'/178, l='MpServer', x=1093.44, y=4.00, z=570.38], EntityHorse['Donkey'/179, l='MpServer', x=1093.00, y=4.00, z=564.59], EntityCow['Cow'/182, l='MpServer', x=1096.88, y=4.00, z=562.97], EntityHorse['Donkey'/183, l='MpServer', x=1091.00, y=4.00, z=564.16], EntityHorse['Donkey'/180, l='MpServer', x=1091.41, y=4.00, z=561.47], EntityCow['Cow'/181, l='MpServer', x=1094.75, y=4.00, z=561.56], EntityClientPlayerMP['ForgeDevName'/245, l='MpServer', x=1057.32, y=5.62, z=597.92], EntityVillager['Villager'/192, l='MpServer', x=1089.41, y=4.00, z=611.13], EntitySlime['Slime'/195, l='MpServer', x=1100.34, y=4.00, z=638.34], EntityBat['Bat'/194, l='MpServer', x=1088.59, y=7.02, z=637.53], EntitySheep['Sheep'/93, l='MpServer', x=1029.91, y=4.00, z=595.97], EntityHorse['Horse'/119, l='MpServer', x=1028.19, y=4.00, z=582.59], EntityChicken['Chicken'/118, l='MpServer', x=1033.47, y=4.00, z=574.56], EntityChicken['Chicken'/117, l='MpServer', x=1034.53, y=4.00, z=566.59], EntitySheep['Sheep'/116, l='MpServer', x=1029.16, y=4.00, z=573.50], EntityHorse['Horse'/115, l='MpServer', x=1031.19, y=4.00, z=571.59], EntityItem['item.item.slimeball'/125, l='MpServer', x=1046.16, y=4.13, z=607.88], EntityChicken['Chicken'/121, l='MpServer', x=1024.59, y=4.00, z=574.63], EntityHorse['Horse'/120, l='MpServer', x=1026.50, y=4.00, z=579.84]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:417) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2568) at net.minecraft.client.Minecraft.run(Minecraft.java:990) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at GradleStart.bounce(GradleStart.java:108) at GradleStart.startClient(GradleStart.java:101) at GradleStart.main(GradleStart.java:66) Like I said I can't quite figure out the problem and where/how to fix it. If needed, here is the mob I made: Register in the main mod file: EntityRegistry.registerGlobalEntityID(EXP_Loader.class, "EXP_Loader", 614); EntityRegistry.addSpawn(EXP_Loader.class, 6, 1, 6, EnumCreatureType.monster, BiomeGenBase.plains); RenderingRegistry.registerEntityRenderingHandler(EXP_Loader.class, new RenderEXP_Loader(new ModelEXP_Loader(), 0.6F)); registerEntityEgg(EXP_Loader.class, 0xA60000 , 0x000000); Here is the Entity file package com.natin.borderlands2mod.entities.robots; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIAvoidEntity; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import com.natin.borderlands2mod.entities.AI.EXP_Loader_AI; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class EXP_Loader extends EntityMob { /** * Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go * weird) */ private int lastActiveTime; /** * The amount of time since the creeper was close enough to the player to ignite */ private int timeSinceIgnited; private int fuseTime = 30; /** Explosion radius for this creeper. */ private int explosionRadius = 5; public EXP_Loader(World par1World) { super(par1World); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EXP_Loader_AI(this)); this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false)); this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); //Max Health this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); //following range this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D); //knockback resistance this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.0D); } /** * Returns true if the newer Entity AI code should be run */ public boolean isAIEnabled() { return true; } /** * The number of iterations PathFinder.getSafePoint will execute before giving up. */ public int getMaxSafePointTries() { return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F); } /** * Called when the mob is falling. Calculates and applies fall damage. */ protected void fall(float par1) { super.fall(par1); this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + par1 * 1.5F); if (this.timeSinceIgnited > this.fuseTime - 5) { this.timeSinceIgnited = this.fuseTime - 5; } } protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1)); this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); } /** * (abstract) Protected helper method to write subclass entity data to NBT. */ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); if (this.dataWatcher.getWatchableObjectByte(17) == 1) { par1NBTTagCompound.setBoolean("powered", true); } par1NBTTagCompound.setShort("Fuse", (short)this.fuseTime); par1NBTTagCompound.setByte("ExplosionRadius", (byte)this.explosionRadius); } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); this.dataWatcher.updateObject(17, Byte.valueOf((byte)(par1NBTTagCompound.getBoolean("powered") ? 1 : 0))); if (par1NBTTagCompound.hasKey("Fuse")) { this.fuseTime = par1NBTTagCompound.getShort("Fuse"); } if (par1NBTTagCompound.hasKey("ExplosionRadius")) { this.explosionRadius = par1NBTTagCompound.getByte("ExplosionRadius"); } } /** * Called to update the entity's position/logic. */ public void onUpdate() { if (this.isEntityAlive()) { this.lastActiveTime = this.timeSinceIgnited; int i = this.getCreeperState(); if (i > 0 && this.timeSinceIgnited == 0) { this.playSound("random.fuse", 1.0F, 0.5F); } this.timeSinceIgnited += i; if (this.timeSinceIgnited < 0) { this.timeSinceIgnited = 0; } if (this.timeSinceIgnited >= this.fuseTime) { this.timeSinceIgnited = this.fuseTime; if (!this.worldObj.isRemote) { boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); if (this.getPowered()) { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(this.explosionRadius * 2), flag); } else { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, flag); } this.setDead(); } } } super.onUpdate(); } /** * Returns the sound this mob makes when it is hurt. */ protected String getHurtSound() { return "mob.creeper.say"; } /** * Returns the sound this mob makes on death. */ protected String getDeathSound() { return "mob.creeper.death"; } /** * Called when the mob's health reaches 0. */ public boolean attackEntityAsMob(Entity par1Entity) { return true; } /** * Returns true if the creeper is powered by a lightning bolt. */ public boolean getPowered() { return this.dataWatcher.getWatchableObjectByte(17) == 1; } @SideOnly(Side.CLIENT) /** * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited. */ public float getCreeperFlashIntensity(float par1) { return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * par1) / (float)(this.fuseTime - 2); } /** * Returns the item ID for the item the mob drops on death. */ protected Item getDropItemId() { return Items.gunpowder; } /** * Returns the current state of creeper, -1 is idle, 1 is 'in fuse' */ public int getCreeperState() { return this.dataWatcher.getWatchableObjectByte(16); } /** * Sets the state of creeper, -1 to idle and 1 to be 'in fuse' */ public void setCreeperState(int par1) { this.dataWatcher.updateObject(16, Byte.valueOf((byte)par1)); } /** * Called when a lightning bolt hits the entity. */ public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { super.onStruckByLightning(par1EntityLightningBolt); this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); } } And yes, I wanted this thing to explode so I copied the creeper's whole file into it and just made some changes. I need help figuring out what's causing the problem, and how to fix it. Thanks in advance
  23. There's no sound in-game at all, and the console is spammed with all errors of the sounds not being found Example: Unable to play unknown soundEvent: minecraft:step.grass I've actually never touched the sound file yet, unless something went wrong with the installation. Could anyone help me out?
  24. How do I apply this? Do I need to make a new method, if so, how? I'm asking this, because apparently this method doesn't exist
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.