deferred creation of a dummy entity for block breaking to when its needed.
This commit is contained in:
1 parent
e37e4050b1
commit
063b4b84ec
1 file changed
+2
-2
@@ -121,8 +121,7 @@ public class WorldAccess {
|
|||||||
put("unknown", ChunkTicketType.UNKNOWN); // unknown
|
put("unknown", ChunkTicketType.UNKNOWN); // unknown
|
||||||
}};
|
}};
|
||||||
// dummy entity for dummy requirements in the loot tables (see snowball)
|
// 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(
|
private static LazyValue booleanStateTest(
|
||||||
Context c,
|
Context c,
|
||||||
String name,
|
String name,
|
||||||
@@ -930,6 +929,7 @@ public class WorldAccess {
|
|||||||
{
|
{
|
||||||
if (how > 0)
|
if (how > 0)
|
||||||
tool.addEnchantment(Enchantments.FORTUNE, (int) how);
|
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);
|
Block.dropStacks(state, world, where, be, DUMMY_ENTITY, tool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user