Baubles

Baubles

116M Downloads

BaublesContainer.isItemValidForSlot passes player = null to IBauble.canEquip

BrainStone opened this issue ยท 3 comments

commented

When calling BaublesContainer.isItemValidForSlot it calls IBauble.canEquip of the Baubles item. However the argument player is null. This naturally causes an NPE when the IBauble.canEquip implementation tries to access the player.

  • Baubles: 1.10.2-1.3.3
  • Minecraft: 1.10.2
  • Forge: 12.18.2.2124

StackTrace: http://pastebin.com/i1BgkEZY

Also see SleepyTrousers/EnderIO-1.5-1.12#3830

commented

I can solve the player being null on my end, but just a few things I could mention:

  1. Probably not the best idea to assume the passed player would not be null (In ItemBrainStoneLifeCapacitor.canEquip). The parameter is not marked as such.
  2. It uses the deprecated version of api method. It is probably best to switch to using the capabilities version asap. The deprecated version is there just to prevent breakage of mods using my old api.
commented

I tried switching to the new API, but it just won't work in our Java 1.6 workspace...

commented

It uses Java 1.8 stuff so that is not surprising. Time to update :)