Fix wrench requiring shift click to rotate blocks.

This commit is contained in:
raoulvdberge
2020-07-14 15:45:40 +02:00
parent 4e42de4548
commit d2cf8667eb
2 changed files with 5 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
### 1.9
- Port to Minecraft 1.16 (raoulvdberge)
- Introduced new save system that should make saving network data more robust. RS previously used standard Minecraft-provided mechanisms for this, but those were unreliable (Darkere)
- Fixed wrench requiring shift click to rotate blocks (raoulvdberge)
### 1.8.8
- Fixed duplication bug and weird behavior in the Crafting Grid matrix (Darkere)

View File

@@ -7,6 +7,7 @@ import com.refinedmods.refinedstorage.util.NetworkUtils;
import com.refinedmods.refinedstorage.util.WorldUtils;
import net.minecraft.block.BlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Rotation;
@@ -19,13 +20,9 @@ public class WrenchItem extends Item {
}
@Override
public ActionResultType onItemUse(ItemUseContext ctx) {
if (!ctx.getPlayer().isCrouching()) {
return ActionResultType.FAIL;
}
public ActionResultType onItemUseFirst(ItemStack stack, ItemUseContext ctx) {
if (ctx.getWorld().isRemote) {
return ActionResultType.SUCCESS;
return ActionResultType.CONSUME;
}
INetwork network = NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromTile(ctx.getWorld().getTileEntity(ctx.getPos())));
@@ -39,6 +36,6 @@ public class WrenchItem extends Item {
ctx.getWorld().setBlockState(ctx.getPos(), state.rotate(Rotation.CLOCKWISE_90));
return ActionResultType.SUCCESS;
return ActionResultType.CONSUME;
}
}