Updated onUse for better client handling

This commit is contained in:
Justin Parsell 2021-11-21 23:33:59 -05:00
parent 9bf8b8f5d9
commit 563d579aab
1 changed files with 4 additions and 1 deletions

View File

@ -215,7 +215,10 @@ public class WDWireBlock extends Block{
@Override // For each link, set to break and update the blocks around me (above and below) @Override // For each link, set to break and update the blocks around me (above and below)
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit){ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit){
if(world.isClient) if(world.isClient)
if(hasConnection(state) && !player.hasStackEquipped(EquipmentSlot.MAINHAND))
return ActionResult.SUCCESS; return ActionResult.SUCCESS;
else
return ActionResult.PASS;
if(player.abilities.allowModifyWorld) if(player.abilities.allowModifyWorld)
if(hasConnection(state) && !player.hasStackEquipped(EquipmentSlot.MAINHAND)) { if(hasConnection(state) && !player.hasStackEquipped(EquipmentSlot.MAINHAND)) {
Iterator<Direction> dirItr = Direction.Type.HORIZONTAL.iterator(); Iterator<Direction> dirItr = Direction.Type.HORIZONTAL.iterator();