Fix wrench requiring shift click to rotate blocks.
This commit is contained in:
@@ -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)
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user