Skip to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. 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).
  2. 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.
  3. 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.
  4. 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.
  5. this.setCreativeTab(null); ?
  6. 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 } }
  7. 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; } }
  8. It shouldn't. That code was where I stopped last night, before I did placement angles (my TE now has 4 facings).
  9. 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).
  10. 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.
  11. 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?
  12. 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.
  13. 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); }
  14. 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(); }
  15. 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
  16. No no, the Forge log. ForgeModLoader-server-0.log Also, most recent file in /crash-reports, if any
  17. Error messages make it easier to help you.
  18. I've got what I want working 100% except for one niggling little detail: The server doesn't send the chest contents to the client until they open the chest. How do I go about resolving this?
  19. JDGui on your release zip will also get back a fair chunk of your code. All your class and properties will be whatever you named them, you'd only have to deal with the reobfuscated method/field names of vanilla classes. As an example: MinecraftForge.setBlockHarvestLevel(BlockMyBlock.instance, "pickaxe", 0); TileEntity.func_70306_a(TileEntityMyTE.class, "MyTE"); Most of them you'd be able to figure out from context, but the troublesome ones you can lookup through MCP
  20. I'm not surprised. I had mine in postInit for a good reason (cough, probably because I backtracked the vanilla code to figure out when it registered its behaviors).
  21. I think the problem is that every time you create a new EntityItem it starts with a random rotation (check the EntityItem constructor).
  22. Are you making sure that this code is getting called? Also, when I mucked about with this, I called it in my mod's PostInit function, and it worked (but I was also adding custom behaviors to a custom dispenser).

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.