Reader / writer GUI can't be opened when not clicking cable part.

This commit is contained in:
Raoul Van den Berge
2016-11-12 22:17:32 +01:00
parent 1dd498d51d
commit ac5ab31ace
2 changed files with 8 additions and 1 deletions

View File

@@ -30,6 +30,10 @@ public class BlockReader extends BlockCable {
@Override
public boolean onBlockActivatedDefault(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
if (hitCablePart(state, world, pos, hitX, hitY, hitZ)) {
return false;
}
if (!world.isRemote) {
player.openGui(RS.INSTANCE, RSGui.READER_WRITER, world, pos.getX(), pos.getY(), pos.getZ());

View File

@@ -3,7 +3,6 @@ package com.raoulvdberge.refinedstorage.block;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.RSBlocks;
import com.raoulvdberge.refinedstorage.RSGui;
import com.raoulvdberge.refinedstorage.tile.TileReader;
import com.raoulvdberge.refinedstorage.tile.TileWriter;
import mcmultipart.microblock.MicroblockContainer;
import net.minecraft.block.state.IBlockState;
@@ -31,6 +30,10 @@ public class BlockWriter extends BlockCable {
@Override
public boolean onBlockActivatedDefault(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
if (hitCablePart(state, world, pos, hitX, hitY, hitZ)) {
return false;
}
if (!world.isRemote) {
player.openGui(RS.INSTANCE, RSGui.READER_WRITER, world, pos.getX(), pos.getY(), pos.getZ());