Manipulator mode fix - conflict with inversion

This commit is contained in:
Brian Ricketts 2012-12-29 22:13:43 -06:00
parent f374e916b9
commit 54aa4f2ee2

View file

@ -51,8 +51,27 @@ public class BlockManipulator extends BlockImprintable
if (tileEntity instanceof TileEntityManipulator)
{
((TileEntityManipulator) tileEntity).toggleOutput();
return true;
TileEntityManipulator manip = (TileEntityManipulator) tileEntity;
boolean manipMode = manip.isOutput();
boolean inverted = manip.isInverted();
if (manipMode && !inverted)
{
manip.toggleInversion();
}
else if (manipMode && inverted)
{
manip.toggleOutput();
manip.toggleInversion();
}
else if (!manipMode && !inverted)
{
manip.toggleInversion();
}
else
{
manip.toggleOutput();
manip.toggleInversion();
}
}
return false;