Jump to content

darty11

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by darty11

  1. Make sure the resource locations I put in are actually the right ones.
  2. In your entity constructor try adding this.entityCollisionReduction=1.0f
  3. Place a beacon next to it, that way you can compare the two to tell if your beacon disappearing is a bug in your code or a bug/issue with beacon beams in general.
  4. public class RenderBall extends Render { private static final ResourceLocation BallTextures = new ResourceLocation(yourmod.modid+"textures/items/Ball3D.png"); protected ModelBase modelBall; public RenderBall() { this.shadowSize = 0.5F; this.modelBall = new ModelBall(); } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(Entity par1EntityBoat, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix(); GL11.glTranslatef((float)par2, (float)par4+1.5f, (float)par6); GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); this.bindEntityTexture(par1EntityBoat); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.modelBall.render(par1EntityBoat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(Entity par1Entity) { return this.BallTextures; } public class ItemRenderBall implements IItemRenderer { protected ItemModelBall modelBall; private static final ResourceLocation itemTexture = new ResourceLocation("yourmod.modid+"textures/items/Ball3D.png"); public ItemRenderBall() { modelBall = new ItemModelBall(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { case EQUIPPED: case EQUIPPED_FIRST_PERSON: case ENTITY: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } //Renders the Ball in your hand @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED: case EQUIPPED_FIRST_PERSON: GL11.glPushMatrix(); // rotates the item GL11.glRotatef(90, 0, 0, 1); GL11.glRotatef(90, 0, 1, 0); GL11.glRotatef(230, 1, 0, 0); GL11.glTranslatef(0, 0.2f, -0.6f); Minecraft.getMinecraft().renderEngine.bindTexture(this.itemTexture ); // renders the item modelBall.render((Entity) data[1], 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0225f); GL11.glPopMatrix(); default: break; //Renders the Ball on ground } switch (type) { case ENTITY: GL11.glPushMatrix(); // rotates the item and translates the item GL11.glRotatef(0, 0, 0, 1); GL11.glRotatef(0, 0, 1, 0); GL11.glRotatef(180, 1, 0, 0); GL11.glTranslatef(0, 0f, 0f); // renders the item modelBall.render((Entity) data[1], 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0225f); GL11.glPopMatrix(); default: break; } } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(Entity Ball) { return this.itemTexture; } }
  5. The white box is the default rendering, basically rendering a white box the size of the hitbox. We don't see it at all because most of the time we either mess up our rendering defining, or we are extending a class that does have rendering and it uses that classes rendering. As jabelar said, make sure registerRenderThings() is being called
  6. What you could do is use the damage bar or item metadata as a reload counter, for example if you want to have a 40 second reload you could set the meta data to 40 and then subtract 1 every tick. Example: public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { par1ItemStack.getItemDamageForDisplay(); int i=par1ItemStack.getItemDamage(); if(i>0) { par1ItemStack.setItemDamage(i-1); } } And then in your firing code check if par1ItemStack.getItemDamageForDisplay()=0 and then do par1ItemStack.setItemDamage('relaodtime");
  7. Can I see your spawning code, and your Snowballclone class? From everything I have seen you are doing everything right, so there has to be a problem somewhere else. Also, make sure all your imports are importing the right version of whatever, it might seem unlikely but its happened before. Also, the counsel logs would be nice too, even if it doesn't look like anything is being done.
  8. Yes, your first mob will be 0, your second 1, your third 2 etc. So you know that your snowball is being spawned? Also, can I see your entire com.eastonium.bionicle.ClientProxyBionicle?
  9. This is your code: if (super.attackEntityAsMob(par1)) { if (par1 instanceof EntityLiving) { EntityPlayer player = (EntityPlayer) par1; if (player != null) { player.addPotionEffect(new PotionEffect(Potion.blindness.id, 12 * 20, 0)); return true; } } } else { return false; } If par1 instanceof EntityLiving, par1; par1 CANNOT be cast to EntityPlayer as EntityPlayer does NOT extend EntityLiving.
  10. EntityRegistry.registerModEntity(EntitySnowballClone.class, "Snowball_Clone", EntityRegistry.findGlobalUniqueEntityId(), this, 64, 10, true); EntityRegistry.findGlobalUniqueEntityId() You can't use this unless you are also registering your entity globally. (which you should NOT do ever) It won't cause any problems now, but if you add a second entity it will, so change it to 0(your next entity will be 1), or make a int that you add 1 too every time you register an entity. Also, is the RenderSnowball class your own class or the default one? If it is your own can we see the code? One last thing: flyingItem = new ItemNormal().setUnlocalizedName("ItemFlying"); GameRegistry.registerItem(itemFllying, "itemFlying");
  11. If that entity attacks a non-player we will have issues. @Override public boolean attackEntityAsMob(Entity par1) { if (super.attackEntityAsMob(par1)) { if (par1 instanceof EntityPlayer ) { EntityPlayer player = (EntityPlayer) par1; if (player != null) { player.addPotionEffect(new PotionEffect(Potion.blindness.id, 12 * 20, 0)); return true; } } } else { return false; } ALSO EntityPlayer does NOT extend EntityLiving.
  12. if (itemstack==new ItemStack(Blocks.dragon_egg)) fuelValue=5500; What you are saying here is "if an itemstack that was created earlier IS the item stack I just created now..." ==does not tell you if 2 objects are similar, or even have the exact same properties. It tells you if they ARE the same object.
  13. Umm, try using the gradlew.bat instead of gradle, and make sure you have the right JDK installed.
  14. Try making a new folder and reinstalling forge there. It looks like you have some build errors like: /Users/Ben/Desktop/MCSK Mod Folder/forge-1.7.2-10.12.0.1057-src/eclipse/mods for mods [13:25:30] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!
  15. public ItemStack getContainerItem(ItemStack itemStack) { return new ItemStack(this,itemStack.stackSize,itemStack.getItemDamage()+1); }
  16. if (event.craftMatrix.getStackInSlot(0) == new ItemStack(usefulStuff.itemTransOrb)) if (event.craftMatrix.getStackInSlot(0).getItem()==usefulStuff.itemTransOrb Reason: I java the == means that the two things are the same thing, aka lets say I have 2 identical books. Even though book 1 is identical to book 2, book 1 does not == book 2, book 1 only == other references of book 1.
  17. I actually did think about having two preInits, one for each side, but when I tried using @SideOnly to distinguish them Eclipse complained about having two methods with the same name. Although maybe I can ignore that warning since I guess only the one for the proper side will be loaded? I'll play around with this more. You should still use proxies, but for a hypothetical situation, you could use LoadServer and LoadClient as the names of the methods as what matters is the @eventhandler.
  18. You cannot reference anything client side only in code that does not have @SideOnly. Use proxies. Seriously. The only other way is to have a server side only and client side only preInit
  19. In your entity file: public YourEntity(World w) { //yourcode this.getDataWatcher().addObject(25, defaultintvalue); } public void setYourVariable1(int I) { this.getDataWatcher().udateObject(25, I); } public int getYourVariable1() { this.getDataWatcher().getWatchableObjectInt(25); } //whenever you want to change your variable: { this.setYourVariable1(newval); } In your model file: public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { if((entity insanceof YourEntity)&&((YourEntity)entity).getYourVariable1==valueneededtoanimate) { //OpenGL transformation code. Remember that all transformations are applied in the //opposite order that they are called in GL11.glTranslatef(0.0f, -0.5f, 0.0f); //move model up a little bit GL11.glRotatef(10.0f, 1.0f, 0.0f, 0.0f); //pitch 10 degrees downwards GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); //rotate so the model is no longer backwards GL11.glScalef(5.5f, 5.5f, 5.5f); //scale the model 5.5x } setRotationAngles(f, f1, f2, f3, f4, f5); Face.render(f5); Bottom_Chin.render(f5); head_L.render(f5); head_R.render(f5); head.render(f5); }
  20. You have to make whatever registers your rendering client side. The best way to do this is to use proxies.
  21. EntityAITasks.EntityAITaskEntry is basically an object that stores the AI and its priority. This code is called to see if the AI is able to be called, and if it can continue. this.theProfiler.startSection("canUse"); Iterator iterator = this.taskEntries.iterator(); while (iterator.hasNext()) { EntityAITasks.EntityAITaskEntry entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); if (entityaitaskentry != par1EntityAITaskEntry) { if (par1EntityAITaskEntry.priority >= entityaitaskentry.priority) { if (this.executingTaskEntries.contains(entityaitaskentry) && !this.areTasksCompatible(par1EntityAITaskEntry, entityaitaskentry)) { this.theProfiler.endSection(); return false; } } else if (this.executingTaskEntries.contains(entityaitaskentry) && !entityaitaskentry.action.isInterruptible()) { this.theProfiler.endSection(); return false; } } } this.theProfiler.endSection(); return true;
  22. He could iterate through the tasks.taskEntries to find the task. Also, the priority value is not for an array, it is actually compared with a >= sign, which allows you to use negative values in your AIs.
  23. public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9){ super.doRender(par1EntityLiving,par2,par4+1.5,par6,par8,par9); renderHunch((EntityHunch)par1EntityLiving, par2, par4, par6, par8, par9); } You are rendering it twice. If the bottom model is at ground level, then remove super.doRender(par1EntityLiving,par2,par4+1.5,par6,par8,par9); , otherwise, remove renderHunch((EntityHunch)par1EntityLiving, par2, par4, par6, par8, par9); Also, did you make any changes to the egg since you last used it successfully? because changing an import should not effect code from another part of the mod.
  24. From your Hunch file: import com.sun.xml.internal.stream.Entity; Thats not the right entity!
×
×
  • Create New...

Important Information

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