The Erebus

The Erebus

16M Downloads

ItemBlockEnum.getUnlocalisedName assumes that the stack is valid.

AlexIIL opened this issue ยท 5 comments

commented

Specifically here -- the stack given may have a metadata outside of the array's size, however the method currently takes this and uses it directly for the array index. The original report is BuildCraft/BuildCraft#4047.

commented

There are only probably half a dozen blocks or so that have metas up in that range so it shouldn't be difficult to find the culprit if it is something in Erebus.

commented

That method is purely used as internal method to return an itemstack's name for enumerated block states. It "shouldn't" really ever produce anything outside the range of the blocks own internal states. I don't know the specific implementation used in BC that would be needing the itemstack's name from the blockstate but I'm guessing it is something to do with automagically creating facades.

commented

I can put an check in to stop the error and have also spoken to The Betweenlands mod as we use a similar implementation there - but BC should probably have something on their end to prevent any other issues with other mods and just "blindly assume" every mod will work fine :P
Thanks for the heads up - will sort out a compat fixy.

commented

We call stack.getDisplayName() rather than getUnlocalizedName() directly, however vanilla eventually calls your method anyway. (We use this for getting the localised name for a facade, so I'm not sure what else we could do)

Something else has obviously gone wrong though, as in theory we shouldn't have created an itemstacks outside of the valid range - it would probably be very useful to return an obviously wrong name (like "ERROR: Unknown metadata) so that we can look into what might be causing this.

commented

Fixed in the next update.