Fix wand of symmetry not applying fortune or silk touch

This commit is contained in:
grimmauld 2020-09-06 09:35:49 +02:00
parent 3c128946f3
commit d89807fad9

View file

@ -273,9 +273,7 @@ public class SymmetryWandItem extends Item {
continue; continue;
BlockState blockstate = world.getBlockState(position); BlockState blockstate = world.getBlockState(position);
if (blockstate.isAir(world, position)) { if (!blockstate.isAir(world, position)) {
continue;
} else {
targets.add(position); targets.add(position);
world.playEvent(2001, position, Block.getStateId(blockstate)); world.playEvent(2001, position, Block.getStateId(blockstate));
world.setBlockState(position, air, 3); world.setBlockState(position, air, 3);
@ -286,7 +284,7 @@ public class SymmetryWandItem extends Item {
player.getHeldItemMainhand() player.getHeldItemMainhand()
.onBlockDestroyed(world, blockstate, position, player); .onBlockDestroyed(world, blockstate, position, player);
TileEntity tileentity = blockstate.hasTileEntity() ? world.getTileEntity(position) : null; TileEntity tileentity = blockstate.hasTileEntity() ? world.getTileEntity(position) : null;
Block.spawnDrops(blockstate, world, pos, tileentity); Block.spawnDrops(blockstate, world, pos, tileentity, player, player.getHeldItemMainhand()); // Add fortune, silk touch and other loot modifiers
} }
} }
} }