mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-29 00:08:56 +00:00
Redstone connection rules for Drawbridge
This commit is contained in:
1 parent
ef40140d2f
commit
1ec866f98d
2 files changed
+21
-7
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user