deferred creation of a dummy entity for block breaking to when its needed.

This commit is contained in:
gnembon committed 2021-04-05 13:42:22 -03:00
1 parent e37e4050b1
commit 063b4b84ec
1 file changed
+2 -2
@@ -121,8 +121,7 @@ public class WorldAccess {
put("unknown", ChunkTicketType.UNKNOWN); // unknown
}};
// dummy entity for dummy requirements in the loot tables (see snowball)
private static FallingBlockEntity DUMMY_ENTITY = new FallingBlockEntity(EntityType.FALLING_BLOCK, null);
private static FallingBlockEntity DUMMY_ENTITY = null;
private static LazyValue booleanStateTest(
Context c,
String name,
@@ -930,6 +929,7 @@ public class WorldAccess {
{
if (how > 0)
tool.addEnchantment(Enchantments.FORTUNE, (int) how);
if (DUMMY_ENTITY == null) DUMMY_ENTITY = new FallingBlockEntity(EntityType.FALLING_BLOCK, null);
Block.dropStacks(state, world, where, be, DUMMY_ENTITY, tool);
}
}