SleepyTrousers / EnderCore

Library mod used by EnderIO, EnderZoo, and others
Creative Commons Zero v1.0 Universal
50 stars 71 forks source link

Make getInv() @Nonnull instead of @Nullable #21

Closed HenryLoenwind closed 8 years ago

HenryLoenwind commented 8 years ago

Oops, it actually should be on neither (or only on the second one). The first one is filled with "player.inventory", which we would have to null-check every single time when creating a container object. No thanks, we can centralize this check here. More ore less the same with the second one, although not that strong. We could propagate a @Nonnull, but again, many changes in many places for something that'd crash on the very first try. (It isn't as if the te is sometimes null and sometimes not.)