The Erebus

The Erebus

16M Downloads

Ender Pickaxe with Direct crashes mining red gem from erebus.

KitKat31337 opened this issue ยท 3 comments

commented

Issue Description:
Ender Pickaxe with Direct crashes mining red gem from erebus.

What happens:
server crash

What you expected to happen:
mine the gem

Steps to reproduce:
get Ender Pickaxe with Direct Upgrade
2.Mine Red Gem in Erebus dimension
Affected Versions (Do not use "latest"):
EnderIO: 5.0.40
EnderCore:1.12.2-0.5.45
Minecraft:1.12.2
Forge: 14.23.5.2808
SpongeForge? no
Optifine? no
Server
Your most recent log file where the issue was present:

commented

@Override
public NonNullList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
if (state.getValue(TYPE) == EnumType.RED_LAMP_ON || state.getValue(TYPE) == EnumType.RED_LAMP_OFF)
return NonNullList.withSize(1, new ItemStack(this, 1, EnumType.RED_LAMP_ON.ordinal()));
else if (state.getValue(TYPE) == EnumType.RED_GEM)
return NonNullList.withSize(1 + RANDOM.nextInt(2 + fortune), EnumErebusMaterialsType.RED_GEM.createStack());
else
return NonNullList.create();
}

EIO tries to change to drop to 0 then adds it to the players inventory but its in a NonNullable List

SleepyTrousers/EnderIO-1.5-1.12#5073

commented

To be more precise, it is a fixed-size, array-backed NonNullList. Those don't support remove().

The list returned from getDrops() is used in the HarvestDropsEvent, which explicitly states that changing the drops list by removing or adding stacks is not only supported but the main purpose of the event. So handing out a list from getDrops() that can not be modified is wrong.

commented

Should be fixed in dev now,
Closing - but will open agian if it still is wonky.