Animania Base

Animania Base

11M Downloads

NPE with hamster in wheel

eliskvitka opened this issue ยท 4 comments

commented

Expected Behavior

Normal ejecting after some time.

Actual Behavior

NullPointerException crash

Steps to Reproduce

Put hamster in wheel and wait some time.

Version of Minecraft, version of Animania, Single Player or Server

Minecraft 1.10.2
Animania 1.4.6
Single player and Server

Screenshots encouraged

Traceback

Description: Ticking block entity

java.lang.NullPointerException: Ticking block entity
	at com.animania.tileentities.TileEntityHamsterWheel.ejectHamster(TileEntityHamsterWheel.java:190)
	at com.animania.tileentities.TileEntityHamsterWheel.func_73660_a(TileEntityHamsterWheel.java:106)
	at net.minecraft.world.World.func_72939_s(World.java:1804)
	at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:620)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:709)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:240)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471)
	at java.lang.Thread.run(Thread.java:748)
commented
this.hamster = null;
this.hamsterNBT = null;
this.hamster.setCustomNameTag(this.hamsterName);

@capnkirok, seriously?

commented

What is this? @braunly

commented

I think this is DeObf of my 1.10 code, which is currently broken on server.

commented

The problem was this line (and not the ones you show above, those just clear the 'stored entity' info: this.hamster.setCustomNameTag(hamsterName);

For Hamsters that did not have a custom name, it resulted in applying a null. Added a NPE check. Fixed in Next Release.