use piston orientation way for determining dir
This commit is contained in:
@@ -42,7 +42,7 @@ public class BlockDrive extends BlockSC implements ITileEntityProvider {
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileDrive tile = (TileDrive) world.getTileEntity(x, y, z);
|
||||
|
||||
if (side == tile.getDirection().getOpposite().ordinal()) {
|
||||
if (side == tile.getDirection().ordinal()) {
|
||||
return frontIcon;
|
||||
}
|
||||
|
||||
|
@@ -44,7 +44,7 @@ public class BlockGrid extends BlockSC implements ITileEntityProvider {
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileGrid tile = (TileGrid) world.getTileEntity(x, y, z);
|
||||
|
||||
if (side == tile.getDirection().getOpposite().ordinal()) {
|
||||
if (side == tile.getDirection().ordinal()) {
|
||||
return tile.isConnected() ? connectedIcon : disconnectedIcon;
|
||||
}
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
package storagecraft.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import storagecraft.SC;
|
||||
@@ -37,26 +37,7 @@ public class BlockSC extends Block {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile instanceof TileSC) {
|
||||
ForgeDirection direction = null;
|
||||
|
||||
int facing = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
switch (facing) {
|
||||
case 0:
|
||||
direction = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 1:
|
||||
direction = ForgeDirection.WEST;
|
||||
break;
|
||||
case 2:
|
||||
direction = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 3:
|
||||
direction = ForgeDirection.EAST;
|
||||
break;
|
||||
}
|
||||
|
||||
((TileSC) tile).setDirection(direction);
|
||||
((TileSC) tile).setDirection(ForgeDirection.getOrientation(BlockPistonBase.determineOrientation(world, x, y, z, entityLiving)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ public class BlockStorageProxy extends BlockSC implements ITileEntityProvider {
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileStorageProxy tile = (TileStorageProxy) world.getTileEntity(x, y, z);
|
||||
|
||||
if (side == tile.getDirection().getOpposite().ordinal()) {
|
||||
if (side == tile.getDirection().ordinal()) {
|
||||
return frontIcon;
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ public class TileStorageProxy extends TileMachine implements IStorageProvider, I
|
||||
super.updateEntity();
|
||||
|
||||
if (!worldObj.isRemote && isConnected()) {
|
||||
TileEntity tile = worldObj.getTileEntity(xCoord + getDirection().getOpposite().offsetX, yCoord + getDirection().getOpposite().offsetY, zCoord + getDirection().getOpposite().offsetZ);
|
||||
TileEntity tile = worldObj.getTileEntity(xCoord + getDirection().offsetX, yCoord + getDirection().offsetY, zCoord + getDirection().offsetZ);
|
||||
|
||||
if (tile instanceof IInventory) {
|
||||
inventory = (IInventory) tile;
|
||||
|
Reference in New Issue
Block a user