Rats

Rats

14M Downloads

[1.16.1] [Forgecraft]: Crash with Null Rat on Rat GUI Screen

Lanse505 opened this issue ยท 1 comments

commented

Crashlog:

Observations from FC chat:
So something is obviously really F'd here.
It seems the entity that's passed into "drawEntityOnScreen" is passing in a null entity, and it's crashing on float f2 = p_228187_5_.renderYawOffset;
So it seems to be called through func_230450_a_ which gets the rat entity through this.rat which gets set by this.rat = RatsMod.PROXY.getRefrencedRat(); which is a call in the constructor.

Which is an empty constructor on the server and on the client it's

    @OnlyIn(Dist.CLIENT)
    @Override
    public EntityRat getRefrencedRat() {
        return refrencedRat;
    }

Which in turn gets it from "refrencedRat" which gets set by the "setRefrencedRat" method.
Which is set by "handlePacketCheeseStaffRat" in the ClientProxy.
Gonna check where else it's called.

So it also gets called in for whatever reason in "CommonEvents" by "onPlayerInteract" which is an event handler for "PlayerInteractEvent.RightClickBlock".
It's also handled by the entity itself in "openGUI" in "EntityRat".

Not quite sure why the entity itself is null.
Though a few things:

  1. Referenced not Refrenced >:(
  2. Could do with some null checks in the code to not just crash.
commented

Should no longer be an issue, I changed how rat selection happens and added a lot of extra checks just in case in 5e55839