mirror of
https://github.com/GTNewHorizons/BetterBuildersWands.git
synced 2026-11-24 22:14:48 +00:00
Fix block placement for smart blocks
https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/2416
This commit is contained in:
1 parent
5fa6a5cd08
commit
447583e71c
1 file changed
+6
-10
@@ -203,16 +203,9 @@ public class WandWorker {
|
||||
blockPlaceSuccess = world.copyBlock(originalBlock, blockPos);
|
||||
}
|
||||
|
||||
if(blockPlaceSuccess) {
|
||||
Item itemFromBlock = Item.getItemFromBlock(world.getBlock(originalBlock));
|
||||
world.playPlaceAtBlock(blockPos, world.getBlock(originalBlock));
|
||||
/*if(sourceItems.getItem() instanceof ItemBlock) {
|
||||
ItemBlock itemBlock = (ItemBlock) sourceItems.getItem();
|
||||
itemBlock.placeBlockAt(sourceItems, player.getPlayer(), world.getWorld(), blockPos.x, blockPos.y, blockPos.z, side, hitX, hitY, hitZ, sourceItems.getItemDamage());
|
||||
}
|
||||
else {
|
||||
world.playPlaceAtBlock(blockPos, world.getBlock(originalBlock));
|
||||
}*/
|
||||
if (blockPlaceSuccess) {
|
||||
Block block = world.getBlock(originalBlock);
|
||||
world.playPlaceAtBlock(blockPos, block);
|
||||
placedBlocks.add(blockPos);
|
||||
if (!player.isCreative()) {
|
||||
wand.placeBlock(wandItem, player.getPlayer());
|
||||
@@ -223,6 +216,9 @@ public class WandWorker {
|
||||
world.setBlockToAir(blockPos);
|
||||
placedBlocks.remove(placedBlocks.size() - 1);
|
||||
}
|
||||
else {
|
||||
block.onBlockPlacedBy(world.getWorld(), blockPos.x, blockPos.y, blockPos.z, player.getPlayer(), sourceItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user