Jump 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.

Featured Replies

Posted

I updated my Mod from 1.6.4, works fine in eclipse so I wanted to test it in a real Minecraft copy.

 

When I try to open the creativeTab with the blocks (I only have blocks) Minecraft chrashes:

 

java.lang.NullPointerException: Rendering item
at net.minecraft.item.ItemStack.func_77960_j(ItemStack.java:231)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:406)
at net.minecraft.client.renderer.entity.RenderItem.func_82406_b(RenderItem.java:548)
at net.minecraft.client.gui.inventory.GuiContainerCreative.func_147051_a(GuiContainerCreative.java:940)
at net.minecraft.client.gui.inventory.GuiContainerCreative.func_146976_a(GuiContainerCreative.java:771)
at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:89)
at net.minecraft.client.renderer.InventoryEffectRenderer.func_73863_a(SourceFile:30)
at net.minecraft.client.gui.inventory.GuiContainerCreative.func_73863_a(GuiContainerCreative.java:649)
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1109)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:984)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:873)
at net.minecraft.client.main.Main.main(SourceFile:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

When I spawn the item with

/give xTeNNoXx tennox_assemblymod:normal

it is rendered like an item:

 

ce6027eab3db89e668b517beaa3ea3ed.png

 

And when I try to place it, this error comes up:

 

java.lang.ArrayIndexOutOfBoundsException: -1
at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:138)
at net.minecraft.client.multiplayer.PlayerControllerMP.func_78760_a(PlayerControllerMP.java:376)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1445)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1952)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:956)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:873)
at net.minecraft.client.main.Main.main(SourceFile:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

Hi

 

My Forge 1.7.2 version is a lot less obfuscated than yours so I can't see the functions causing the problem.

 

My guess is that your Item (ItemBlock) hasn't been registered properly.  I haven't done that in 1.7.2 yet so I'm stuck there.

 

-TGG

  • Author

Hi

 

My Forge 1.7.2 version is a lot less obfuscated than yours so I can't see the functions causing the problem.

 

My guess is that your Item (ItemBlock) hasn't been registered properly.  I haven't done that in 1.7.2 yet so I'm stuck there.

 

-TGG

 

I think you got something wrong. The crashed occur in the real Minecraft, completely obfuscated and shit. The decompiled one in Eclipse is running perfectly fine. O.o

 

I could recreate the second error like this:

 

TestMod:

@Mod(modid = "tennox_test", version = "0.1")
public class Test {

Block test;

@EventHandler
public void init(FMLInitializationEvent event) {
	test = new BlockTest(Material.rock).setBlockName("tennox_test");
	GameRegistry.registerBlock(test, "tennox_test");
}
}

BlockTest:

class BlockChameleon extends Block {
protected BlockChameleon(Material material) {
	super(material);
}
}

 

 

ERROR:

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:154) ~[itemStack.class:?]
at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:424) ~[itemInWorldManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:596) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) ~[NetworkSystem.class:?]

 

 

What am I missing? some block/item registering in 1.7?

According to your crashlog, Item.getIdFromItem(this.field_151002_e) is returning with a -1 for the block ID for that ITEM. So, yeah your item in not registered with a block properly.

  • Author

Do all your registering stuff in preInit (FMLPreInitializationEvent)

 

That's the solution. Thanks you very much!

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

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.