From 02ce111d9e484431742f38e5bff80bf7adad21dc Mon Sep 17 00:00:00 2001 From: SquidDev Date: Mon, 1 May 2017 21:43:24 +0100 Subject: [PATCH] Invert side when checking connectivity The side marks the direction relative to the wire, rather than the side of the block it is attempting to connect to. Therefore needs to be flipped. Closes #149 --- .../shared/computer/blocks/TileComputerBase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java index 2da5f2a43..d75959d3d 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java @@ -22,10 +22,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.ITickable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.EnumFacing; public abstract class TileComputerBase extends TileGeneric implements IComputerTile, IDirectionalTile, ITickable @@ -143,7 +143,8 @@ public abstract class TileComputerBase extends TileGeneric @Override public boolean getRedstoneConnectivity( EnumFacing side ) { - int localDir = remapLocalSide( DirectionUtil.toLocal( this, side ) ); + if( side == null ) return false; + int localDir = remapLocalSide( DirectionUtil.toLocal( this, side.getOpposite() ) ); return !isRedstoneBlockedOnSide( localDir ); }