Redstone connection rules for Drawbridge

This commit is contained in:
mDiyo committed 2013-08-31 00:22:50 -07:00
1 parent ef40140d2f
commit 1ec866f98d
2 files changed
+21 -7

No files matched your search

+8 -6
View File
@@ -12,6 +12,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -238,12 +239,6 @@ public class RedstoneMachine extends InventoryBlock
return false;
}
@Override
public boolean canConnectRedstone (IBlockAccess world, int x, int y, int z, int side)
{
return true;
}
/* Keep inventory */
@Override
@@ -338,4 +333,11 @@ public class RedstoneMachine extends InventoryBlock
}
}
}
/* Redstone connections */
public boolean canConnectRedstone (IBlockAccess world, int x, int y, int z, int side)
{
return true;
}
}
+13 -1
View File
@@ -150,7 +150,7 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc
}
else
{
if (keycode % 2 == 0)
if (keycode == 0) //Forward
{
fakePlayer.rotationYaw = mapDirection() * 90;
@@ -159,6 +159,18 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc
else
fakePlayer.rotationPitch = -90;
}
else if (keycode == 2) //Backward
{
int face = mapDirection() + 2;
if (face > 3)
face -= 4;
fakePlayer.rotationYaw = face * 90;
if (keycode == 0)
fakePlayer.rotationPitch = 90;
else
fakePlayer.rotationPitch = -90;
}
else
{
fakePlayer.rotationPitch = 0;