Support rotation of structures containing mana spreaders (#2599)

This commit is contained in:
QuarterAnimal authored and Vincent Lee committed 2018-04-11 22:09:37 -05:00
1 parent 34afbd45ab
commit 4383e8cbbc
1 file changed
+39
@@ -26,6 +26,8 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@@ -741,6 +743,43 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
rotationY = rot;
}
@Override
public void rotate(Rotation rotationIn) {
switch (rotationIn)
{
case CLOCKWISE_90:
rotationX += 270F;
break;
case CLOCKWISE_180:
rotationX += 180F;
break;
case COUNTERCLOCKWISE_90:
rotationX += 90F;
break;
default: break;
}
if(rotationX >= 360F)
rotationX -= 360F;
}
@Override
public void mirror(Mirror mirrorIn) {
switch (mirrorIn)
{
case LEFT_RIGHT:
rotationX = 360F - rotationX;
break;
case FRONT_BACK:
rotationX = 180F - rotationX;
break;
default: break;
}
if(rotationX < 0F)
rotationX += 360F;
}
@Override
public void commitRedirection() {
checkForReceiver();