Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Honestly, I wouldn't both with UE. An opinion I can agree with, due to having looked at UE and gone "why would I want this?" So there's the grain of salt that will come with your mod.
  2. Based on some trouble I had the other day, item entity's rotation is based on age.
  3. Yes. But you'll need reflections to add them to the potion array.
  4. I'd suggest just updating the entity's rotation/age/etc. through your TE's update, rather than calling the EntityItem's update function. That would give you better control over the animation (e.g. rotating but not bobbing). I'm actually using that for some animation one of of my blocks right now: tweaking the Entity's age, then using that value in the render process.
  5. There is a difference between the entity having a null world and the entity not being spawned into the world. You can totally construct an entity with a valid world, but never spawn it. Touche. Just checked my code and I am setting a world object, but I suspect he isn't. As that's the only reason that line would crash.
  6. He totally is, because he's never spawning it in the world (he's doing the same thing I'm doing right now, except he wants it to rotate, and I don't).
  7. Because you're using a "fake" EntityItem that isn't added to the world, the EntityItem is causing a NPE when it attempts to access its world object (which is null): public void onEntityUpdate() { this.worldObj.theProfiler.startSection("entityBaseTick"); It's cashing at "this.worldObj.theProfiler" because "worldObj" is null.
  8. That probably isn't worth the effort. It's not that important, it just would have been "nice" that this one block would be in both the redstone tab and in my custom tab. But for one or two blocks I'm not going to go to that much effort.
  9. BLOCK, NOT ITEM The item class has this function: public CreativeTabs[] getCreativeTabs() { return new CreativeTabs[]{ getCreativeTab() }; } The block class does NOT have this function. How do I get a block into more than one creative tab? And no, calling setCreativeTab(...) twice is not going to work, that function looks like this: public Block setCreativeTab(CreativeTabs par1CreativeTabs) { this.displayOnCreativeTab = par1CreativeTabs; return this; } So the second call will just overwrite the first.
  10. this.setCreativeTab(null); ?
  11. Huh? Wha? Where am I? D:
  12. this.setCreativeTab(null); ?
  13. It's called a null check. if(someObject != null) { //if the object isn't null if(someObject.property) { //then do things with it //do stuff } }
  14. Ah! I see your problem. This is from my tile entity: @Override public void onInventoryChanged() { super.onInventoryChanged(); if(contents[0] != null) { itemEnt = new EntityItem(this.worldObj, this.xCoord, this.yCoord, this.zCoord, contents[0]); itemEnt.hoverStart = 0; //this is making it be off-center itemEnt.rotationYaw = 0; //this is what's making it rotate for you itemEnt.motionX = 0; //zero out these just in case itemEnt.motionY = 0; itemEnt.motionZ = 0; } else { itemEnt = null; } }
  15. It shouldn't. That code was where I stopped last night, before I did placement angles (my TE now has 4 facings).
  16. I have that as part of the Model (public class MyModel extends ModelBase). es.itemEnt is just an EntityItem that is stored in the custom tile entity so that I'm not creating a new one all the time (I also force its position, rotation, and age to zero).
  17. Potions will be a huge pain in the ass, just FYI. isPotionIngredient isn't enough, as there's a whole bitflag system in place to handle what brews into what and what constitutes a valid result.
  18. By "despawn when the chunk unloads" do you mean that it ceases to exist because the chunk is not there, or do you mean that even after you reload the chunk the entity is still gone?
  19. Screw that, edit core classes as you get started. Go crazy, see what happens, try to do stuff intentionally. Play around, have fun. What would happen if you forged every sign to start with a chat enum formatting character (just the § symbol, which tells the renderer that the next character defines color)? Once you have an understanding of what CAN be done and what DOES what, then pull back, reinstall the original source, and get started on a mod you can release.
  20. Thanks, though I figured it out on my own late last night. I'd been going in all the wrong directions based on the scant info I had available. Then threw a google search at the problem and found what I needed: public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { readFromNBT(packet.data); }
  21. Here's the render function for my TE model: public void render(TileEntity te, double x, double y, double z) { TEDisplayPedestal es = (TEDisplayPedestal)te; if(es.itemEnt != null) { //store the item entity in the tile entity GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F, (float)z + 0.25F);//position where I want it GL11.glRotatef(90, 1, 0, 0); //lay the item flat RenderHelper.enableStandardItemLighting(); RenderManager.instance.renderEntityWithPosYaw(es.itemEnt, 0, 0, 0, 0, 0); GL11.glPopMatrix(); } GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5f, (float)y - 0.5f, (float)z + 0.5f); ResourceLocation rl = new ResourceLocation(es.getModelTexture()); Minecraft.getMinecraft().renderEngine.bindTexture(rl); this.render(); GL11.glPopMatrix(); }
  22. You're not running the right jar. minecraft_server.1.6.4.jar <-- vanilla minecraftforge-universal-1.6.4-9.11.0.884.jar <-- with forge
  23. When should I pass this packet?
  24. No no, the Forge log. ForgeModLoader-server-0.log Also, most recent file in /crash-reports, if any
  25. Error messages make it easier to help you.
×
×
  • Create New...

Important Information

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