Fix ComposterBlock entity NPE (#1042)

This commit is contained in:
IzzelAliz 2023-10-22 13:00:09 +08:00
parent f347f85986
commit 71acd73ac3

View File

@ -55,7 +55,7 @@ public abstract class ComposterBlockMixin {
double rand = world.random.nextDouble(); double rand = world.random.nextDouble();
BlockState state1 = addItem(entity, state, DummyGeneratorAccess.INSTANCE, pos, stack, rand); BlockState state1 = addItem(entity, state, DummyGeneratorAccess.INSTANCE, pos, stack, rand);
if (state == state1 || !CraftEventFactory.callEntityChangeBlockEvent(entity, pos, state1)) { if (state == state1 || (entity != null && !CraftEventFactory.callEntityChangeBlockEvent(entity, pos, state1))) {
return state; return state;
} }