Fixed some shaft directions

This commit is contained in:
Calclavia 2014-01-31 00:21:06 +08:00
parent bffc3e4fd5
commit 9acebbba76
3 changed files with 9 additions and 3 deletions

View file

@ -479,6 +479,6 @@ public class PartGear extends PartMechanical implements IMechanical, IMultiBlock
@Override
public boolean inverseRotation(ForgeDirection dir, IMechanical with)
{
return !(with instanceof PartGearShaft);
return true;
}
}

View file

@ -43,6 +43,7 @@ public class PartGearShaft extends PartMechanical
public void preparePlacement(int side, int itemDamage)
{
ForgeDirection dir = ForgeDirection.getOrientation((byte) (side ^ 1));
// Unwind rotation. We can only have "3" axis.
this.placementSide = ForgeDirection.getOrientation(!(dir.ordinal() % 2 == 0) ? dir.ordinal() - 1 : dir.ordinal());
}
@ -189,7 +190,12 @@ public class PartGearShaft extends PartMechanical
@Override
public boolean inverseRotation(ForgeDirection dir, IMechanical with)
{
return dir == placementSide && !(with instanceof PartGearShaft);
if (placementSide.offsetY != 0 || placementSide.offsetZ != 0)
{
return dir == placementSide.getOpposite();
}
return dir == placementSide;
}
}

View file

@ -6,8 +6,8 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import resonantinduction.mechanical.process.TileGrinderWheel;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.mechanical.gear.PartGearShaft;
import universalelectricity.api.net.IUpdate;
import universalelectricity.core.net.Network;
import universalelectricity.core.net.NetworkTickHandler;