Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemRenderer Null Pointer Exception #201

Open
drguthals opened this issue Sep 28, 2015 · 0 comments
Open

ItemRenderer Null Pointer Exception #201

drguthals opened this issue Sep 28, 2015 · 0 comments

Comments

@drguthals
Copy link

I create a new block using a new Java interface that I built called SimpleBlockUtil.java. In this code, I have the following line:

block.components.add(new ItemRenderer(block));

I know that this is deprecated, but was told by Henry to use it anyway.

It works fine (in creating the item in the inventory, and when you throw the block), however I came across a weird bug when I try to teleport down into two of my custom blocks stacked on top of each other.

For example:
ME
CUSTOMBLOCK
CUSTOMBLOCK

Then I run: /tp PLAYERNAME ~ ~-2 ~

and I get the following error:

java.lang.NullPointerException: Unexpected error
    at net.minecraft.client.renderer.ItemRenderer.func_178108_a(ItemRenderer.java:414)
    at net.minecraft.client.renderer.ItemRenderer.renderOverlays(ItemRenderer.java:381)
    at net.minecraft.client.renderer.EntityRenderer.renderHand(EntityRenderer.java:769)
    at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1408)
    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1210)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1035)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1055)
    at net.minecraft.client.Minecraft.run(Minecraft.java:345)
    at net.minecraft.client.main.Main.main(Main.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)

When I try: /tp PLAYERNAME ~ ~-1 ~
I get no error and it works.

When I try: /tp PLAYERNAME ~ ~-2 ~
and I'm on top of two grass blocks, it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant