mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 22:34:21 +00:00
Fix compile errors in API package
This commit is contained in:
1 parent
1dfba5e6c9
commit
4247ba136a
71 files changed
+387
-452
No files matched your search
@@ -3,18 +3,21 @@ package mekanism.api;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3i;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -24,11 +27,8 @@ import java.util.ArrayList;
|
||||
* @author aidancbrady
|
||||
*
|
||||
*/
|
||||
public class Coord4D
|
||||
public class Coord4D extends BlockPos
|
||||
{
|
||||
public int xCoord;
|
||||
public int yCoord;
|
||||
public int zCoord;
|
||||
|
||||
public int dimensionId;
|
||||
|
||||
@@ -40,24 +40,27 @@ public class Coord4D
|
||||
*/
|
||||
public Coord4D(int x, int y, int z)
|
||||
{
|
||||
xCoord = x;
|
||||
yCoord = y;
|
||||
zCoord = z;
|
||||
super(x, y, z);
|
||||
|
||||
dimensionId = 0;
|
||||
}
|
||||
|
||||
|
||||
public Coord4D(double x, double y, double z)
|
||||
{
|
||||
super(x, y, z);
|
||||
|
||||
dimensionId = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Coord4D from an entity's position, rounded down.
|
||||
* @param entity - entity to create the Coord4D from
|
||||
*/
|
||||
public Coord4D(Entity entity)
|
||||
{
|
||||
xCoord = (int)entity.posX;
|
||||
yCoord = (int)entity.posY;
|
||||
zCoord = (int)entity.posZ;
|
||||
super(entity);
|
||||
|
||||
dimensionId = entity.worldObj.provider.dimensionId;
|
||||
dimensionId = entity.worldObj.provider.getDimensionId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,18 +72,24 @@ public class Coord4D
|
||||
*/
|
||||
public Coord4D(int x, int y, int z, int dimension)
|
||||
{
|
||||
xCoord = x;
|
||||
yCoord = y;
|
||||
zCoord = z;
|
||||
super(x, y, z);
|
||||
|
||||
dimensionId = dimension;
|
||||
}
|
||||
|
||||
public Coord4D(double x, double y, double z, int dimension)
|
||||
{
|
||||
super(x, y, z);
|
||||
|
||||
dimensionId = dimension;
|
||||
}
|
||||
|
||||
|
||||
public Coord4D(MovingObjectPosition mop)
|
||||
{
|
||||
xCoord = mop.blockX;
|
||||
yCoord = mop.blockY;
|
||||
zCoord = mop.blockZ;
|
||||
super(mop.getBlockPos());
|
||||
|
||||
dimensionId = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,9 +97,9 @@ public class Coord4D
|
||||
* @param world - world this Coord4D is in
|
||||
* @return the metadata of this Coord4D's block
|
||||
*/
|
||||
public int getMetadata(IBlockAccess world)
|
||||
public IBlockState getBlockState(IBlockAccess world)
|
||||
{
|
||||
return world.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
return world.getBlockState(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +114,7 @@ public class Coord4D
|
||||
return null;
|
||||
}
|
||||
|
||||
return world.getTileEntity(xCoord, yCoord, zCoord);
|
||||
return world.getTileEntity(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +129,7 @@ public class Coord4D
|
||||
return null;
|
||||
}
|
||||
|
||||
return world.getBlock(xCoord, yCoord, zCoord);
|
||||
return world.getBlockState(this).getBlock();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,9 +139,9 @@ public class Coord4D
|
||||
*/
|
||||
public NBTTagCompound write(NBTTagCompound nbtTags)
|
||||
{
|
||||
nbtTags.setInteger("x", xCoord);
|
||||
nbtTags.setInteger("y", yCoord);
|
||||
nbtTags.setInteger("z", zCoord);
|
||||
nbtTags.setInteger("x", getX());
|
||||
nbtTags.setInteger("y", getY());
|
||||
nbtTags.setInteger("z", getZ());
|
||||
nbtTags.setInteger("dimensionId", dimensionId);
|
||||
|
||||
return nbtTags;
|
||||
@@ -144,9 +153,9 @@ public class Coord4D
|
||||
*/
|
||||
public void write(ArrayList data)
|
||||
{
|
||||
data.add(xCoord);
|
||||
data.add(yCoord);
|
||||
data.add(zCoord);
|
||||
data.add(getX());
|
||||
data.add(getY());
|
||||
data.add(getZ());
|
||||
data.add(dimensionId);
|
||||
}
|
||||
|
||||
@@ -156,9 +165,9 @@ public class Coord4D
|
||||
*/
|
||||
public void write(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(xCoord);
|
||||
dataStream.writeInt(yCoord);
|
||||
dataStream.writeInt(zCoord);
|
||||
dataStream.writeInt(getX());
|
||||
dataStream.writeInt(getY());
|
||||
dataStream.writeInt(getZ());
|
||||
dataStream.writeInt(dimensionId);
|
||||
}
|
||||
|
||||
@@ -169,58 +178,52 @@ public class Coord4D
|
||||
* @param z - z value to translate
|
||||
* @return translated Coord4D
|
||||
*/
|
||||
public Coord4D translate(int x, int y, int z)
|
||||
public Coord4D add(int x, int y, int z)
|
||||
{
|
||||
xCoord += x;
|
||||
yCoord += y;
|
||||
zCoord += z;
|
||||
|
||||
return this;
|
||||
return x == 0 && y == 0 && z == 0 ? this : new Coord4D(this.getX() + x, this.getY() + y, this.getZ() + z, dimensionId);
|
||||
}
|
||||
|
||||
|
||||
public Coord4D add(double x, double y, double z)
|
||||
{
|
||||
return x == 0.0D && y == 0.0D && z == 0.0D ? this : new Coord4D((double)this.getX() + x, (double)this.getY() + y, (double)this.getZ() + z, dimensionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates this Coord4D by the defined Coord4D's coordinates, regardless of dimension.
|
||||
* @param coord - coordinates to translate by
|
||||
* @return translated Coord4D
|
||||
*/
|
||||
public Coord4D translate(Coord4D coord)
|
||||
public Coord4D add(Vec3i coord)
|
||||
{
|
||||
translate(coord.xCoord, coord.yCoord, coord.zCoord);
|
||||
|
||||
return this;
|
||||
return add(coord.getX(), coord.getY(), coord.getZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a new Coord4D translated to the defined offsets of the side.
|
||||
* @param side - side to translate this Coord4D to
|
||||
* @return translated Coord4D
|
||||
* Offset this BlockPos 1 block in the given direction
|
||||
*/
|
||||
public Coord4D getFromSide(ForgeDirection side)
|
||||
public Coord4D offset(EnumFacing facing)
|
||||
{
|
||||
return getFromSide(side, 1);
|
||||
return this.offset(facing, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a new Coord4D translated to the defined offsets of the side by the defined amount.
|
||||
* @param side - side to translate this Coord4D to
|
||||
* @param amount - how far to translate this Coord4D
|
||||
* @return translated Coord4D
|
||||
* Offsets this BlockPos n blocks in the given direction
|
||||
*/
|
||||
public Coord4D getFromSide(ForgeDirection side, int amount)
|
||||
public Coord4D offset(EnumFacing facing, int n)
|
||||
{
|
||||
return new Coord4D(xCoord+(side.offsetX*amount), yCoord+(side.offsetY*amount), zCoord+(side.offsetZ*amount), dimensionId);
|
||||
return n == 0 ? this : new Coord4D(this.getX() + facing.getFrontOffsetX() * n, this.getY() + facing.getFrontOffsetY() * n, this.getZ() + facing.getFrontOffsetZ() * n);
|
||||
}
|
||||
|
||||
|
||||
public ItemStack getStack(IBlockAccess world)
|
||||
{
|
||||
Block block = getBlock(world);
|
||||
IBlockState state = getBlockState(world);
|
||||
|
||||
if(block == null || block == Blocks.air)
|
||||
if(state == null || state == Blocks.air)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ItemStack(block, 1, getMetadata(world));
|
||||
|
||||
return new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,7 +233,8 @@ public class Coord4D
|
||||
*/
|
||||
public static Coord4D get(TileEntity tileEntity)
|
||||
{
|
||||
return new Coord4D(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, tileEntity.getWorldObj().provider.dimensionId);
|
||||
BlockPos pos = tileEntity.getPos();
|
||||
return new Coord4D(pos.getX(), pos.getY(), pos.getZ(), tileEntity.getWorld().provider.getDimensionId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,13 +259,12 @@ public class Coord4D
|
||||
|
||||
/**
|
||||
* Creates and returns a new Coord4D with values representing the difference between the defined Coord4D
|
||||
* @param other - the Coord4D to subtract from this
|
||||
* @param vec - the Coord4D to subtract from this
|
||||
* @return a Coord4D representing the distance between the defined Coord4D
|
||||
*/
|
||||
public Coord4D difference(Coord4D other)
|
||||
public Coord4D difference(Vec3i vec)
|
||||
{
|
||||
return new Coord4D(xCoord-other.xCoord, yCoord-other.yCoord, zCoord-other.zCoord, dimensionId);
|
||||
}
|
||||
return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this : new Coord4D(this.getX() - vec.getX(), this.getY() - vec.getY(), this.getZ() - vec.getZ()); }
|
||||
|
||||
/**
|
||||
* A method used to find the ForgeDirection represented by the distance of the defined Coord4D. Most likely won't have many
|
||||
@@ -269,19 +272,19 @@ public class Coord4D
|
||||
* @param other - Coord4D to find the side difference of
|
||||
* @return ForgeDirection representing the side the defined relative Coord4D is on to this
|
||||
*/
|
||||
public ForgeDirection sideDifference(Coord4D other)
|
||||
public EnumFacing sideDifference(Coord4D other)
|
||||
{
|
||||
Coord4D diff = difference(other);
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
if(side.offsetX == diff.xCoord && side.offsetY == diff.yCoord && side.offsetZ == diff.zCoord)
|
||||
if(side.getDirectionVec().equals(diff))
|
||||
{
|
||||
return side;
|
||||
}
|
||||
}
|
||||
|
||||
return ForgeDirection.UNKNOWN;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,11 +292,11 @@ public class Coord4D
|
||||
* @param obj - the Coord4D to find the distance to
|
||||
* @return the distance to the defined Coord4D
|
||||
*/
|
||||
public int distanceTo(Coord4D obj)
|
||||
public int distanceTo(Vec3i obj)
|
||||
{
|
||||
int subX = xCoord - obj.xCoord;
|
||||
int subY = yCoord - obj.yCoord;
|
||||
int subZ = zCoord - obj.zCoord;
|
||||
int subX = getX() - obj.getX();
|
||||
int subY = getY() - obj.getY();
|
||||
int subZ = getZ() - obj.getZ();
|
||||
return (int)MathHelper.sqrt_double(subX * subX + subY * subY + subZ * subZ);
|
||||
}
|
||||
|
||||
@@ -303,9 +306,9 @@ public class Coord4D
|
||||
* @param world - world this Coord4D is in
|
||||
* @return
|
||||
*/
|
||||
public boolean sideVisible(ForgeDirection side, IBlockAccess world)
|
||||
public boolean sideVisible(EnumFacing side, IBlockAccess world)
|
||||
{
|
||||
return world.isAirBlock(xCoord+side.offsetX, yCoord+side.offsetY, zCoord+side.offsetZ);
|
||||
return world.isAirBlock(offset(side));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,17 +318,7 @@ public class Coord4D
|
||||
*/
|
||||
public TargetPoint getTargetPoint(double range)
|
||||
{
|
||||
return new TargetPoint(dimensionId, xCoord, yCoord, zCoord, range);
|
||||
}
|
||||
|
||||
/**
|
||||
* Steps this Coord4D in the defined side's offset without creating a new value.
|
||||
* @param side - side to step towards
|
||||
* @return this Coord4D
|
||||
*/
|
||||
public Coord4D step(ForgeDirection side)
|
||||
{
|
||||
return translate(side.offsetX, side.offsetY, side.offsetZ);
|
||||
return new TargetPoint(dimensionId, getX(), getY(), getZ(), range);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,7 +328,7 @@ public class Coord4D
|
||||
*/
|
||||
public boolean exists(World world)
|
||||
{
|
||||
return world.getChunkProvider() == null || world.getChunkProvider().chunkExists(xCoord >> 4, zCoord >> 4);
|
||||
return world.getChunkProvider() == null || world.getChunkProvider().chunkExists(getX() >> 4, getZ() >> 4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,7 +338,7 @@ public class Coord4D
|
||||
*/
|
||||
public Chunk getChunk(World world)
|
||||
{
|
||||
return world.getChunkFromBlockCoords(xCoord, zCoord);
|
||||
return world.getChunkFromBlockCoords(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,7 +357,7 @@ public class Coord4D
|
||||
*/
|
||||
public boolean isAirBlock(IBlockAccess world)
|
||||
{
|
||||
return world.isAirBlock(xCoord, yCoord, zCoord);
|
||||
return world.isAirBlock(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -372,9 +365,9 @@ public class Coord4D
|
||||
* @param world - world this Coord4D is in
|
||||
* @return if this Coord4D is replaceable
|
||||
*/
|
||||
public boolean isReplaceable(IBlockAccess world)
|
||||
public boolean isReplaceable(World world)
|
||||
{
|
||||
return getBlock(world).isReplaceable(world, xCoord, yCoord, zCoord);
|
||||
return getBlock(world).isReplaceable(world, this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,38 +376,39 @@ public class Coord4D
|
||||
*/
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
{
|
||||
return AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord+1, yCoord+1, zCoord+1);
|
||||
return new AxisAlignedBB(this, add(1,1,1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Coord4D clone()
|
||||
{
|
||||
return new Coord4D(xCoord, yCoord, zCoord, dimensionId);
|
||||
return new Coord4D(getX(), getY(), getZ(), dimensionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[Coord4D: " + xCoord + ", " + yCoord + ", " + zCoord + ", dim=" + dimensionId + "]";
|
||||
return "[Coord4D: " + getX() + ", " + getY() + ", " + getZ() + ", dim=" + dimensionId + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
return obj instanceof Coord4D &&
|
||||
((Coord4D)obj).xCoord == xCoord &&
|
||||
((Coord4D)obj).yCoord == yCoord &&
|
||||
((Coord4D)obj).zCoord == zCoord &&
|
||||
((Coord4D)obj).dimensionId == dimensionId;
|
||||
return obj instanceof Vec3i &&
|
||||
(
|
||||
((Vec3i)obj).getX() == getX() &&
|
||||
((Vec3i)obj).getY() == getY() &&
|
||||
((Vec3i)obj).getZ() == getZ()
|
||||
) && !(obj instanceof Coord4D && ((Coord4D)obj).dimensionId != dimensionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int code = 1;
|
||||
code = 31 * code + xCoord;
|
||||
code = 31 * code + yCoord;
|
||||
code = 31 * code + zCoord;
|
||||
code = 31 * code + getX();
|
||||
code = 31 * code + getY();
|
||||
code = 31 * code + getZ();
|
||||
code = 31 * code + dimensionId;
|
||||
return code;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.api;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public interface IHeatTransfer
|
||||
{
|
||||
@@ -14,7 +14,7 @@ public interface IHeatTransfer
|
||||
|
||||
public double getInverseConductionCoefficient();
|
||||
|
||||
public double getInsulationCoefficient(ForgeDirection side);
|
||||
public double getInsulationCoefficient(EnumFacing side);
|
||||
|
||||
public void transferHeatTo(double heat);
|
||||
|
||||
@@ -22,7 +22,7 @@ public interface IHeatTransfer
|
||||
|
||||
public double applyTemperatureChange();
|
||||
|
||||
public boolean canConnectHeat(ForgeDirection side);
|
||||
public boolean canConnectHeat(EnumFacing side);
|
||||
|
||||
public IHeatTransfer getAdjacent(ForgeDirection side);
|
||||
public IHeatTransfer getAdjacent(EnumFacing side);
|
||||
}
|
||||
@@ -4,53 +4,48 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.Vec3i;
|
||||
|
||||
/**
|
||||
* Pos3D - a way of performing operations on objects in a three dimensional environment.
|
||||
* @author aidancbrady
|
||||
*
|
||||
*/
|
||||
public class Pos3D
|
||||
public class Pos3D extends Vec3
|
||||
{
|
||||
public double xPos;
|
||||
public double yPos;
|
||||
public double zPos;
|
||||
|
||||
public Pos3D()
|
||||
{
|
||||
this(0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
public Pos3D(Vec3 vec)
|
||||
{
|
||||
xPos = vec.xCoord;
|
||||
yPos = vec.yCoord;
|
||||
zPos = vec.zCoord;
|
||||
super(vec.xCoord, vec.yCoord, vec.zCoord);
|
||||
}
|
||||
|
||||
|
||||
public Pos3D(Vec3i vec)
|
||||
{
|
||||
super(vec);
|
||||
}
|
||||
|
||||
public Pos3D(MovingObjectPosition mop)
|
||||
{
|
||||
xPos = mop.blockX;
|
||||
yPos = mop.blockY;
|
||||
zPos = mop.blockZ;
|
||||
this(mop.getBlockPos());
|
||||
}
|
||||
|
||||
public Pos3D(double x, double y, double z)
|
||||
{
|
||||
xPos = x;
|
||||
yPos = y;
|
||||
zPos = z;
|
||||
super(x, y, z);
|
||||
}
|
||||
|
||||
public Pos3D(Coord4D coord)
|
||||
{
|
||||
xPos = coord.xCoord;
|
||||
yPos = coord.yCoord;
|
||||
zPos = coord.zCoord;
|
||||
super(coord.xCoord, coord.yCoord, coord.zCoord);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +63,7 @@ public class Pos3D
|
||||
*/
|
||||
public Pos3D(TileEntity tileEntity)
|
||||
{
|
||||
this(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
this(tileEntity.getPos());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,21 +83,21 @@ public class Pos3D
|
||||
*/
|
||||
public NBTTagCompound write(NBTTagCompound nbtTags)
|
||||
{
|
||||
nbtTags.setDouble("x", xPos);
|
||||
nbtTags.setDouble("y", yPos);
|
||||
nbtTags.setDouble("z", zPos);
|
||||
nbtTags.setDouble("x", xCoord);
|
||||
nbtTags.setDouble("y", yCoord);
|
||||
nbtTags.setDouble("z", zCoord);
|
||||
|
||||
return nbtTags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a Pos3D with values representing the difference between this and the Pos3D in the parameters.
|
||||
* @param pos - Pos3D to subtract
|
||||
* @param vec - Vec3 to subtract
|
||||
* @return difference of the two Pos3Ds
|
||||
*/
|
||||
public Pos3D diff(Pos3D pos)
|
||||
public Pos3D diff(Vec3 vec)
|
||||
{
|
||||
return new Pos3D(xPos-pos.xPos, yPos-pos.yPos, zPos-pos.zPos);
|
||||
return new Pos3D(xCoord-vec.xCoord, yCoord-vec.yCoord, zCoord-vec.zCoord);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +117,7 @@ public class Pos3D
|
||||
*/
|
||||
public Coord4D getCoord(int dimensionId)
|
||||
{
|
||||
return new Coord4D((int)xPos, (int)yPos, (int)zPos, dimensionId);
|
||||
return new Coord4D((int)xCoord, (int)yCoord, (int)zCoord, dimensionId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,11 +137,7 @@ public class Pos3D
|
||||
*/
|
||||
public Pos3D translate(double x, double y, double z)
|
||||
{
|
||||
xPos += x;
|
||||
yPos += y;
|
||||
zPos += z;
|
||||
|
||||
return this;
|
||||
return new Pos3D(xCoord + x, yCoord + y, zCoord + z);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,29 +145,30 @@ public class Pos3D
|
||||
* @param pos - Pos3D value to translate by
|
||||
* @return translated Pos3D
|
||||
*/
|
||||
public Pos3D translate(Pos3D pos)
|
||||
public Pos3D translate(Vec3 pos)
|
||||
{
|
||||
return translate(pos.xPos, pos.yPos, pos.zPos);
|
||||
return translate(pos.xCoord, pos.yCoord, pos.zCoord);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the same operation as translate(x, y, z), but by a set amount in a ForgeDirection
|
||||
*/
|
||||
public Pos3D translate(ForgeDirection direction, double amount)
|
||||
public Pos3D translate(EnumFacing direction, double amount)
|
||||
{
|
||||
return translate(direction.offsetX * amount, direction.offsetY * amount, direction.offsetZ * amount);
|
||||
return translate(direction.getDirectionVec().getX() * amount, direction.getDirectionVec().getY() * amount, direction.getDirectionVec().getZ() * amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the same operation as translate(x, y, z), but by a set amount in a ForgeDirection
|
||||
*/
|
||||
public Pos3D translateExcludingSide(ForgeDirection direction, double amount)
|
||||
public Pos3D translateExcludingSide(EnumFacing direction, double amount)
|
||||
{
|
||||
if(direction.offsetX == 0) xPos += amount;
|
||||
if(direction.offsetY == 0) yPos += amount;
|
||||
if(direction.offsetZ == 0) zPos += amount;
|
||||
double xPos = xCoord, yPos = yCoord, zPos = zCoord;
|
||||
if(direction.getAxis() != Axis.X) xPos += amount;
|
||||
if(direction.getAxis() != Axis.Y) yPos += amount;
|
||||
if(direction.getAxis() != Axis.Z) zPos += amount;
|
||||
|
||||
return this;
|
||||
return new Pos3D(xPos, yPos, zPos);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,11 +176,11 @@ public class Pos3D
|
||||
* @param pos - the Pos3D to find the distance to
|
||||
* @return the distance between this and the defined Pos3D
|
||||
*/
|
||||
public double distance(Pos3D pos)
|
||||
public double distance(Vec3 pos)
|
||||
{
|
||||
double subX = xPos - pos.xPos;
|
||||
double subY = yPos - pos.yPos;
|
||||
double subZ = zPos - pos.zPos;
|
||||
double subX = xCoord - pos.xCoord;
|
||||
double subY = yCoord - pos.yCoord;
|
||||
double subZ = zCoord - pos.zCoord;
|
||||
return MathHelper.sqrt_double(subX * subX + subY * subY + subZ * subZ);
|
||||
}
|
||||
|
||||
@@ -201,32 +193,32 @@ public class Pos3D
|
||||
{
|
||||
double yawRadians = Math.toRadians(yaw);
|
||||
|
||||
double x = xPos;
|
||||
double z = zPos;
|
||||
double xPos = xCoord;
|
||||
double zPos = zCoord;
|
||||
|
||||
if(yaw != 0)
|
||||
{
|
||||
xPos = x * Math.cos(yawRadians) - z * Math.sin(yawRadians);
|
||||
zPos = z * Math.cos(yawRadians) + x * Math.sin(yawRadians);
|
||||
xPos = xCoord * Math.cos(yawRadians) - zCoord * Math.sin(yawRadians);
|
||||
zPos = zCoord * Math.cos(yawRadians) + xCoord * Math.sin(yawRadians);
|
||||
}
|
||||
|
||||
return this;
|
||||
return new Pos3D(xPos, yCoord, zPos);
|
||||
}
|
||||
|
||||
public Pos3D rotatePitch(double pitch)
|
||||
{
|
||||
double pitchRadians = Math.toRadians(pitch);
|
||||
|
||||
double y = yPos;
|
||||
double z = zPos;
|
||||
double yPos = yCoord;
|
||||
double zPos = zCoord;
|
||||
|
||||
if(pitch != 0)
|
||||
{
|
||||
yPos = y * Math.cos(pitchRadians) - z * Math.sin(pitchRadians);
|
||||
zPos = z * Math.cos(pitchRadians) + y * Math.sin(pitchRadians);
|
||||
yPos = yCoord * Math.cos(pitchRadians) - zCoord * Math.sin(pitchRadians);
|
||||
zPos = zCoord * Math.cos(pitchRadians) + yCoord * Math.sin(pitchRadians);
|
||||
}
|
||||
|
||||
return this;
|
||||
return new Pos3D(xCoord, yPos, zPos);
|
||||
}
|
||||
|
||||
public Pos3D rotate(double yaw, double pitch)
|
||||
@@ -240,24 +232,20 @@ public class Pos3D
|
||||
double pitchRadians = Math.toRadians(pitch);
|
||||
double rollRadians = Math.toRadians(roll);
|
||||
|
||||
double x = xPos;
|
||||
double y = yPos;
|
||||
double z = zPos;
|
||||
double xPos = xCoord;
|
||||
double yPos = yCoord;
|
||||
double zPos = zCoord;
|
||||
|
||||
xPos = x * Math.cos(yawRadians) * Math.cos(pitchRadians) + z * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) - Math.sin(yawRadians) * Math.cos(rollRadians)) + y * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) + Math.sin(yawRadians) * Math.sin(rollRadians));
|
||||
zPos = x * Math.sin(yawRadians) * Math.cos(pitchRadians) + z * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) + Math.cos(yawRadians) * Math.cos(rollRadians)) + y * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) - Math.cos(yawRadians) * Math.sin(rollRadians));
|
||||
yPos = -x * Math.sin(pitchRadians) + z * Math.cos(pitchRadians) * Math.sin(rollRadians) + y * Math.cos(pitchRadians) * Math.cos(rollRadians);
|
||||
xPos = xCoord * Math.cos(yawRadians) * Math.cos(pitchRadians) + zCoord * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) - Math.sin(yawRadians) * Math.cos(rollRadians)) + yCoord * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) + Math.sin(yawRadians) * Math.sin(rollRadians));
|
||||
zPos = xCoord * Math.sin(yawRadians) * Math.cos(pitchRadians) + zCoord * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) + Math.cos(yawRadians) * Math.cos(rollRadians)) + yCoord * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) - Math.cos(yawRadians) * Math.sin(rollRadians));
|
||||
yPos = -xCoord * Math.sin(pitchRadians) + zCoord * Math.cos(pitchRadians) * Math.sin(rollRadians) + yCoord * Math.cos(pitchRadians) * Math.cos(rollRadians);
|
||||
|
||||
return this;
|
||||
return new Pos3D(xPos, yPos, zPos);
|
||||
}
|
||||
|
||||
public Pos3D multiply(Pos3D pos)
|
||||
public Pos3D multiply(Vec3 pos)
|
||||
{
|
||||
xPos *= pos.xPos;
|
||||
yPos *= pos.yPos;
|
||||
zPos *= pos.zPos;
|
||||
|
||||
return this;
|
||||
return scale(pos.xCoord, pos.yCoord, pos.zCoord);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,11 +257,7 @@ public class Pos3D
|
||||
*/
|
||||
public Pos3D scale(double x, double y, double z)
|
||||
{
|
||||
xPos *= x;
|
||||
yPos *= y;
|
||||
zPos *= z;
|
||||
|
||||
return this;
|
||||
return new Pos3D(xCoord * x, yCoord * y, zCoord * z);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,9 +280,9 @@ public class Pos3D
|
||||
double[] matrix = new double[16];
|
||||
Pos3D axis = clone().normalize();
|
||||
|
||||
double x = axis.xPos;
|
||||
double y = axis.yPos;
|
||||
double z = axis.zPos;
|
||||
double x = axis.xCoord;
|
||||
double y = axis.yCoord;
|
||||
double z = axis.zCoord;
|
||||
|
||||
angle *= 0.0174532925D;
|
||||
|
||||
@@ -322,15 +306,11 @@ public class Pos3D
|
||||
|
||||
public static Pos3D translateMatrix(double[] matrix, Pos3D translation)
|
||||
{
|
||||
double x = translation.xPos * matrix[0] + translation.yPos * matrix[1] + translation.zPos * matrix[2] + matrix[3];
|
||||
double y = translation.xPos * matrix[4] + translation.yPos * matrix[5] + translation.zPos * matrix[6] + matrix[7];
|
||||
double z = translation.xPos * matrix[8] + translation.yPos * matrix[9] + translation.zPos * matrix[10] + matrix[11];
|
||||
double x = translation.xCoord * matrix[0] + translation.yCoord * matrix[1] + translation.zCoord * matrix[2] + matrix[3];
|
||||
double y = translation.xCoord * matrix[4] + translation.yCoord * matrix[5] + translation.zCoord * matrix[6] + matrix[7];
|
||||
double z = translation.xCoord * matrix[8] + translation.yCoord * matrix[9] + translation.zCoord * matrix[10] + matrix[11];
|
||||
|
||||
translation.xPos = x;
|
||||
translation.yPos = y;
|
||||
translation.zPos = z;
|
||||
|
||||
return translation;
|
||||
return new Pos3D(x, y, z);
|
||||
}
|
||||
|
||||
public static double[] getRotationMatrix(float angle, Pos3D axis)
|
||||
@@ -347,43 +327,24 @@ public class Pos3D
|
||||
{
|
||||
return Math.acos(pos1.clone().dotProduct(pos2));
|
||||
}
|
||||
|
||||
public double dotProduct(Pos3D pos)
|
||||
{
|
||||
return xPos * pos.xPos + yPos * pos.yPos + zPos * pos.zPos;
|
||||
}
|
||||
|
||||
public Pos3D crossProduct(Pos3D compare)
|
||||
{
|
||||
return clone().toCrossProduct(compare);
|
||||
}
|
||||
|
||||
public Pos3D toCrossProduct(Pos3D compare)
|
||||
{
|
||||
double newX = yPos * compare.zPos - zPos * compare.yPos;
|
||||
double newY = zPos * compare.xPos - xPos * compare.zPos;
|
||||
double newZ = xPos * compare.yPos - yPos * compare.xPos;
|
||||
|
||||
xPos = newX;
|
||||
yPos = newY;
|
||||
zPos = newZ;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pos3D normalize() {
|
||||
return new Pos3D(super.normalize());
|
||||
}
|
||||
|
||||
public Pos3D xCrossProduct()
|
||||
{
|
||||
return new Pos3D(0.0D, zPos, -yPos);
|
||||
return new Pos3D(0.0D, zCoord, -yCoord);
|
||||
}
|
||||
|
||||
public Pos3D zCrossProduct()
|
||||
{
|
||||
return new Pos3D(-yPos, xPos, 0.0D);
|
||||
return new Pos3D(-yCoord, xCoord, 0.0D);
|
||||
}
|
||||
|
||||
public Pos3D getPerpendicular()
|
||||
{
|
||||
if(zPos == 0)
|
||||
if(zCoord == 0)
|
||||
{
|
||||
return zCrossProduct();
|
||||
}
|
||||
@@ -393,66 +354,49 @@ public class Pos3D
|
||||
|
||||
public Pos3D floor()
|
||||
{
|
||||
return new Pos3D(Math.floor(xPos), Math.floor(yPos), Math.floor(zPos));
|
||||
return new Pos3D(Math.floor(xCoord), Math.floor(yCoord), Math.floor(zCoord));
|
||||
}
|
||||
|
||||
public double getMagnitude()
|
||||
{
|
||||
return Math.sqrt(xPos * xPos + yPos * yPos + zPos * zPos);
|
||||
}
|
||||
|
||||
public Pos3D normalize()
|
||||
{
|
||||
double d = getMagnitude();
|
||||
|
||||
if (d != 0)
|
||||
{
|
||||
this.scale(1 / d);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public static AxisAlignedBB getAABB(Pos3D pos1, Pos3D pos2)
|
||||
{
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
Math.min(pos1.xPos, pos2.xPos),
|
||||
Math.min(pos1.yPos, pos2.yPos),
|
||||
Math.min(pos1.zPos, pos2.zPos),
|
||||
Math.max(pos1.xPos, pos2.xPos),
|
||||
Math.max(pos1.yPos, pos2.yPos),
|
||||
Math.max(pos1.zPos, pos2.zPos)
|
||||
return new AxisAlignedBB(
|
||||
pos1.xCoord,
|
||||
pos1.yCoord,
|
||||
pos1.zCoord,
|
||||
pos2.xCoord,
|
||||
pos2.yCoord,
|
||||
pos2.zCoord
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pos3D clone()
|
||||
{
|
||||
return new Pos3D(xPos, yPos, zPos);
|
||||
return new Pos3D(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[Pos3D: " + xPos + ", " + yPos + ", " + zPos + "]";
|
||||
return "[Pos3D: " + xCoord + ", " + yCoord + ", " + zCoord + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
return obj instanceof Pos3D &&
|
||||
((Pos3D)obj).xPos == xPos &&
|
||||
((Pos3D)obj).yPos == yPos &&
|
||||
((Pos3D)obj).zPos == zPos;
|
||||
return obj instanceof Vec3 &&
|
||||
((Vec3)obj).xCoord == xCoord &&
|
||||
((Vec3)obj).xCoord == yCoord &&
|
||||
((Vec3)obj).xCoord == zCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int code = 1;
|
||||
code = 31 * code + new Double(xPos).hashCode();
|
||||
code = 31 * code + new Double(yPos).hashCode();
|
||||
code = 31 * code + new Double(zPos).hashCode();
|
||||
code = 31 * code + new Double(xCoord).hashCode();
|
||||
code = 31 * code + new Double(yCoord).hashCode();
|
||||
code = 31 * code + new Double(zCoord).hashCode();
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.api.energy;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
/**
|
||||
* Implement this if your TileEntity is capable of outputting energy to cables, overriding Mekanism's default implementation.
|
||||
@@ -14,5 +14,5 @@ public interface ICableOutputter
|
||||
* @param side - side to check
|
||||
* @return if the block can output
|
||||
*/
|
||||
public boolean canOutputTo(ForgeDirection side);
|
||||
public boolean canOutputTo(EnumFacing side);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.api.energy;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
/**
|
||||
* Implement this if your TileEntity can accept energy at a floating-point double value from Universal Cables.
|
||||
@@ -14,12 +14,12 @@ public interface IStrictEnergyAcceptor extends IStrictEnergyStorage
|
||||
* @param amount - amount to transfer
|
||||
* @return energy used
|
||||
*/
|
||||
public double transferEnergyToAcceptor(ForgeDirection side, double amount);
|
||||
public double transferEnergyToAcceptor(EnumFacing side, double amount);
|
||||
|
||||
/**
|
||||
* Whether or not this tile entity accepts energy from a certain side.
|
||||
* @param side - side to check
|
||||
* @return if tile entity accepts energy
|
||||
*/
|
||||
public boolean canReceiveEnergy(ForgeDirection side);
|
||||
public boolean canReceiveEnergy(EnumFacing side);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.api.gas;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
@@ -19,7 +19,7 @@ public class Gas
|
||||
|
||||
private Fluid fluid;
|
||||
|
||||
private IIcon icon;
|
||||
private ResourceLocation icon;
|
||||
|
||||
private boolean visible = true;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Gas
|
||||
public Gas(Fluid f)
|
||||
{
|
||||
unlocalizedName = name = f.getName();
|
||||
icon = f.getStillIcon();
|
||||
icon = f.getStill();
|
||||
fluid = f;
|
||||
from_fluid = true;
|
||||
}
|
||||
@@ -109,11 +109,11 @@ public class Gas
|
||||
* Gets the IIcon associated with this Gas.
|
||||
* @return associated IIcon
|
||||
*/
|
||||
public IIcon getIcon()
|
||||
public ResourceLocation getIcon()
|
||||
{
|
||||
if(from_fluid)
|
||||
{
|
||||
return this.getFluid().getIcon();
|
||||
return this.getFluid().getStill();
|
||||
}
|
||||
|
||||
return icon;
|
||||
@@ -124,7 +124,8 @@ public class Gas
|
||||
* @param i - IIcon to associate with this Gas
|
||||
* @return this Gas object
|
||||
*/
|
||||
public Gas setIcon(IIcon i)
|
||||
/*
|
||||
public Gas setIcon(ResourceLocation i)
|
||||
{
|
||||
icon = i;
|
||||
|
||||
@@ -137,6 +138,7 @@ public class Gas
|
||||
|
||||
return this;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets the ID associated with this gas.
|
||||
@@ -202,7 +204,7 @@ public class Gas
|
||||
{
|
||||
if(FluidRegistry.getFluid(getName()) == null)
|
||||
{
|
||||
fluid = new Fluid(getName()).setGaseous(true);
|
||||
fluid = new Fluid(getName(), getIcon(), getIcon()).setGaseous(true);
|
||||
FluidRegistry.registerFluid(fluid);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -7,8 +7,8 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.api.transmitters.DynamicNetwork;
|
||||
import mekanism.api.transmitters.IGridTransmitter;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -150,7 +150,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
||||
for(IGasHandler acceptor : availableAcceptors)
|
||||
{
|
||||
int currentSending = sending;
|
||||
EnumSet<ForgeDirection> sides = acceptorDirections.get(Coord4D.get((TileEntity)acceptor));
|
||||
EnumSet<EnumFacing> sides = acceptorDirections.get(Coord4D.get((TileEntity)acceptor));
|
||||
|
||||
if(remaining > 0)
|
||||
{
|
||||
@@ -158,7 +158,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
||||
remaining--;
|
||||
}
|
||||
|
||||
for(ForgeDirection side : sides)
|
||||
for(EnumFacing side : sides)
|
||||
{
|
||||
int prev = toSend;
|
||||
|
||||
@@ -289,7 +289,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
||||
|
||||
for(Coord4D coord : possibleAcceptors.keySet())
|
||||
{
|
||||
EnumSet<ForgeDirection> sides = acceptorDirections.get(coord);
|
||||
EnumSet<EnumFacing> sides = acceptorDirections.get(coord);
|
||||
TileEntity tile = coord.getTileEntity(getWorld());
|
||||
|
||||
if(!(tile instanceof IGasHandler) || sides == null || sides.isEmpty())
|
||||
@@ -299,7 +299,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
||||
|
||||
IGasHandler acceptor = (IGasHandler)tile;
|
||||
|
||||
for(ForgeDirection side : sides)
|
||||
for(EnumFacing side : sides)
|
||||
{
|
||||
if(acceptor != null && acceptor.canReceiveGas(side, type))
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ import mekanism.api.transmitters.TransmissionType;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
/**
|
||||
* A handy class containing several utilities for efficient gas transfer.
|
||||
@@ -29,9 +29,9 @@ public final class GasTransmission
|
||||
{
|
||||
IGasHandler[] acceptors = new IGasHandler[] {null, null, null, null, null, null};
|
||||
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(EnumFacing orientation : EnumFacing.VALUES)
|
||||
{
|
||||
TileEntity acceptor = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj());
|
||||
TileEntity acceptor = Coord4D.get(tileEntity).offset(orientation).getTileEntity(tileEntity.getWorld());
|
||||
|
||||
if(acceptor instanceof IGasHandler)
|
||||
{
|
||||
@@ -51,9 +51,9 @@ public final class GasTransmission
|
||||
{
|
||||
ITubeConnection[] connections = new ITubeConnection[] {null, null, null, null, null, null};
|
||||
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(EnumFacing orientation : EnumFacing.VALUES)
|
||||
{
|
||||
TileEntity connection = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj());
|
||||
TileEntity connection = Coord4D.get(tileEntity).offset(orientation).getTileEntity(tileEntity.getWorld());
|
||||
|
||||
if(canConnect(connection, orientation))
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public final class GasTransmission
|
||||
* @param side - side to attempt connection on
|
||||
* @return if this tile and side are connectable
|
||||
*/
|
||||
public static boolean canConnect(TileEntity tileEntity, ForgeDirection side)
|
||||
public static boolean canConnect(TileEntity tileEntity, EnumFacing side)
|
||||
{
|
||||
if(tileEntity instanceof ITubeConnection && (!(tileEntity instanceof ITransmitterTile) || TransmissionType.checkTransmissionType(((ITransmitterTile)tileEntity).getTransmitter(), TransmissionType.GAS)))
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public final class GasTransmission
|
||||
* @param from - the TileEntity to output from
|
||||
* @return the amount of gas emitted
|
||||
*/
|
||||
public static int emit(List<ForgeDirection> sides, GasStack stack, TileEntity from)
|
||||
public static int emit(List<EnumFacing> sides, GasStack stack, TileEntity from)
|
||||
{
|
||||
if(stack == null)
|
||||
{
|
||||
@@ -144,7 +144,7 @@ public final class GasTransmission
|
||||
{
|
||||
IGasHandler handler = possibleAcceptors[i];
|
||||
|
||||
if(handler != null && handler.canReceiveGas(ForgeDirection.getOrientation(i).getOpposite(), stack.getGas()))
|
||||
if(handler != null && handler.canReceiveGas(EnumFacing.getFront(i).getOpposite(), stack.getGas()))
|
||||
{
|
||||
availableAcceptors.add(handler);
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public final class GasTransmission
|
||||
remaining--;
|
||||
}
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(Arrays.asList(possibleAcceptors).indexOf(acceptor)).getOpposite();
|
||||
EnumFacing dir = EnumFacing.getFront(Arrays.asList(possibleAcceptors).indexOf(acceptor)).getOpposite();
|
||||
toSend -= acceptor.receiveGas(dir, new GasStack(stack.getGas(), currentSending), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.api.gas;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
/**
|
||||
* Implement this if your tile entity accepts gas from an external source.
|
||||
@@ -14,20 +14,20 @@ public interface IGasHandler
|
||||
* @param stack - gas to add
|
||||
* @return gas added
|
||||
*/
|
||||
public int receiveGas(ForgeDirection side, GasStack stack, boolean doTransfer);
|
||||
public int receiveGas(EnumFacing side, GasStack stack, boolean doTransfer);
|
||||
|
||||
@Deprecated
|
||||
public int receiveGas(ForgeDirection side, GasStack stack);
|
||||
public int receiveGas(EnumFacing side, GasStack stack);
|
||||
|
||||
/**
|
||||
* Draws a certain amount of gas from this block.
|
||||
* @param amount - amount to draw
|
||||
* @return gas drawn
|
||||
*/
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer);
|
||||
public GasStack drawGas(EnumFacing side, int amount, boolean doTransfer);
|
||||
|
||||
@Deprecated
|
||||
public GasStack drawGas(ForgeDirection side, int amount);
|
||||
public GasStack drawGas(EnumFacing side, int amount);
|
||||
|
||||
/**
|
||||
* Whether or not this block can accept gas from a certain side.
|
||||
@@ -35,7 +35,7 @@ public interface IGasHandler
|
||||
* @param type - type of gas to check
|
||||
* @return if block accepts gas
|
||||
*/
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type);
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type);
|
||||
|
||||
/**
|
||||
* Whether or not this block can be drawn of gas from a certain side.
|
||||
@@ -43,5 +43,5 @@ public interface IGasHandler
|
||||
* @param type - type of gas to check
|
||||
* @return if block can be drawn of gas
|
||||
*/
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type);
|
||||
public boolean canDrawGas(EnumFacing side, Gas type);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.api.gas;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
/**
|
||||
* Implement this if your block can connect to Pressurized Tubes.
|
||||
@@ -14,5 +14,5 @@ public interface ITubeConnection
|
||||
* @param side - orientation to check
|
||||
* @return if a tube can connect
|
||||
*/
|
||||
public boolean canTubeConnect(ForgeDirection side);
|
||||
public boolean canTubeConnect(EnumFacing side);
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package mekanism.api.lasers;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public interface ILaserReceptor
|
||||
{
|
||||
public void receiveLaserEnergy(double energy, ForgeDirection side);
|
||||
public void receiveLaserEnergy(double energy, EnumFacing side);
|
||||
|
||||
public boolean canLasersDig();
|
||||
}
|
||||
@@ -10,9 +10,9 @@ import mekanism.api.IClientTicker;
|
||||
import mekanism.api.Range4D;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
@@ -24,8 +24,8 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
public LinkedHashSet<IGridTransmitter<A, N>> transmittersAdded = Sets.newLinkedHashSet();
|
||||
|
||||
public HashMap<Coord4D, A> possibleAcceptors = new HashMap<Coord4D, A>();
|
||||
public HashMap<Coord4D, EnumSet<ForgeDirection>> acceptorDirections = new HashMap<Coord4D, EnumSet<ForgeDirection>>();
|
||||
public HashMap<IGridTransmitter<A, N>, EnumSet<ForgeDirection>> changedAcceptors = Maps.newHashMap();
|
||||
public HashMap<Coord4D, EnumSet<EnumFacing>> acceptorDirections = new HashMap<Coord4D, EnumSet<EnumFacing>>();
|
||||
public HashMap<IGridTransmitter<A, N>, EnumSet<EnumFacing>> changedAcceptors = Maps.newHashMap();
|
||||
|
||||
private Set<DelayQueue> updateQueue = new LinkedHashSet<DelayQueue>();
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
worldObj = transmitter.world();
|
||||
}
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
updateTransmitterOnSide(transmitter, side);
|
||||
}
|
||||
@@ -77,15 +77,15 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
|
||||
if(!changedAcceptors.isEmpty())
|
||||
{
|
||||
for(Entry<IGridTransmitter<A, N>, EnumSet<ForgeDirection>> entry : changedAcceptors.entrySet())
|
||||
for(Entry<IGridTransmitter<A, N>, EnumSet<EnumFacing>> entry : changedAcceptors.entrySet())
|
||||
{
|
||||
IGridTransmitter<A, N> transmitter = entry.getKey();
|
||||
|
||||
if(transmitter.isValid())
|
||||
{
|
||||
EnumSet<ForgeDirection> directionsChanged = entry.getValue();
|
||||
EnumSet<EnumFacing> directionsChanged = entry.getValue();
|
||||
|
||||
for(ForgeDirection side : directionsChanged)
|
||||
for(EnumFacing side : directionsChanged)
|
||||
{
|
||||
updateTransmitterOnSide(transmitter, side);
|
||||
}
|
||||
@@ -96,11 +96,11 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTransmitterOnSide(IGridTransmitter<A, N> transmitter, ForgeDirection side)
|
||||
public void updateTransmitterOnSide(IGridTransmitter<A, N> transmitter, EnumFacing side)
|
||||
{
|
||||
A acceptor = transmitter.getAcceptor(side);
|
||||
Coord4D acceptorCoord = transmitter.coord().getFromSide(side);
|
||||
EnumSet<ForgeDirection> directions = acceptorDirections.get(acceptorCoord);
|
||||
Coord4D acceptorCoord = transmitter.coord().offset(side);
|
||||
EnumSet<EnumFacing> directions = acceptorDirections.get(acceptorCoord);
|
||||
|
||||
if(acceptor != null)
|
||||
{
|
||||
@@ -180,9 +180,9 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
}
|
||||
}
|
||||
|
||||
public void acceptorChanged(IGridTransmitter<A, N> transmitter, ForgeDirection side)
|
||||
public void acceptorChanged(IGridTransmitter<A, N> transmitter, EnumFacing side)
|
||||
{
|
||||
EnumSet<ForgeDirection> directions = changedAcceptors.get(transmitter);
|
||||
EnumSet<EnumFacing> directions = changedAcceptors.get(transmitter);
|
||||
|
||||
if(directions != null)
|
||||
{
|
||||
@@ -206,7 +206,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
|
||||
possibleAcceptors.putAll(net.possibleAcceptors);
|
||||
|
||||
for(Entry<Coord4D, EnumSet<ForgeDirection>> entry : net.acceptorDirections.entrySet())
|
||||
for(Entry<Coord4D, EnumSet<EnumFacing>> entry : net.acceptorDirections.entrySet())
|
||||
{
|
||||
Coord4D coord = entry.getKey();
|
||||
|
||||
@@ -242,26 +242,26 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
IGridTransmitter<A, N> initTransmitter = transmitters.iterator().next();
|
||||
Coord4D initCoord = initTransmitter.coord();
|
||||
|
||||
int minX = initCoord.xCoord;
|
||||
int minY = initCoord.yCoord;
|
||||
int minZ = initCoord.zCoord;
|
||||
int maxX = initCoord.xCoord;
|
||||
int maxY = initCoord.yCoord;
|
||||
int maxZ = initCoord.zCoord;
|
||||
int minX = initCoord.getX();
|
||||
int minY = initCoord.getY();
|
||||
int minZ = initCoord.getZ();
|
||||
int maxX = initCoord.getX();
|
||||
int maxY = initCoord.getY();
|
||||
int maxZ = initCoord.getZ();
|
||||
|
||||
for(IGridTransmitter transmitter : transmitters)
|
||||
{
|
||||
Coord4D coord = transmitter.coord();
|
||||
|
||||
if(coord.xCoord < minX) minX = coord.xCoord;
|
||||
if(coord.yCoord < minY) minY = coord.yCoord;
|
||||
if(coord.zCoord < minZ) minZ = coord.zCoord;
|
||||
if(coord.xCoord > maxX) maxX = coord.xCoord;
|
||||
if(coord.yCoord > maxY) maxY = coord.yCoord;
|
||||
if(coord.zCoord > maxZ) maxZ = coord.zCoord;
|
||||
if(coord.getX() < minX) minX = coord.getX();
|
||||
if(coord.getY() < minY) minY = coord.getY();
|
||||
if(coord.getZ() < minZ) minZ = coord.getZ();
|
||||
if(coord.getX() > maxX) maxX = coord.getX();
|
||||
if(coord.getY() > maxY) maxY = coord.getY();
|
||||
if(coord.getX() > maxZ) maxZ = coord.getZ();
|
||||
}
|
||||
|
||||
return new Range4D(minX, minY, minZ, maxX, maxY, maxZ, initTransmitter.world().provider.dimensionId);
|
||||
return new Range4D(minX, minY, minZ, maxX, maxY, maxZ, initTransmitter.world().provider.getDimensionId());
|
||||
}
|
||||
|
||||
public void register()
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package mekanism.api.transmitters;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public interface IBlockableConnection
|
||||
{
|
||||
public boolean canConnectMutual(ForgeDirection side);
|
||||
public boolean canConnectMutual(EnumFacing side);
|
||||
|
||||
public boolean canConnect(ForgeDirection side);
|
||||
public boolean canConnect(EnumFacing side);
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package mekanism.api.transmitters;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -40,9 +41,9 @@ public interface IGridTransmitter<A, N extends DynamicNetwork<A, N>> extends ITr
|
||||
|
||||
public Coord4D coord();
|
||||
|
||||
public Coord4D getAdjacentConnectableTransmitterCoord(ForgeDirection side);
|
||||
public Coord4D getAdjacentConnectableTransmitterCoord(EnumFacing side);
|
||||
|
||||
public A getAcceptor(ForgeDirection side);
|
||||
public A getAcceptor(EnumFacing side);
|
||||
|
||||
public boolean isValid();
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ import java.util.HashSet;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.MekanismAPI;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -240,10 +241,10 @@ public class TransmitterNetworkRegistry
|
||||
|
||||
public void start()
|
||||
{
|
||||
iterate(startPoint.coord(), ForgeDirection.UNKNOWN);
|
||||
iterate(startPoint.coord(), null);
|
||||
}
|
||||
|
||||
public void iterate(Coord4D from, ForgeDirection fromDirection)
|
||||
public void iterate(Coord4D from, EnumFacing fromDirection)
|
||||
{
|
||||
if(iterated.contains(from))
|
||||
{
|
||||
@@ -261,7 +262,7 @@ public class TransmitterNetworkRegistry
|
||||
connectedTransmitters.add(transmitter);
|
||||
transmitter.setOrphan(false);
|
||||
|
||||
for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(EnumFacing direction : EnumFacing.VALUES)
|
||||
{
|
||||
if(direction != fromDirection)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class StackUtils
|
||||
|
||||
public static boolean equalsWildcardWithNBT(ItemStack wild, ItemStack check)
|
||||
{
|
||||
return equalsWildcard(wild, check) && (wild.stackTagCompound == null ? check.stackTagCompound == null : (wild.stackTagCompound == check.stackTagCompound || wild.stackTagCompound.equals(check.stackTagCompound)));
|
||||
return equalsWildcard(wild, check) && (!wild.hasTagCompound() ? !check.hasTagCompound() : (wild.getTagCompound() == check.getTagCompound() || wild.getTagCompound().equals(check.getTagCompound())));
|
||||
}
|
||||
|
||||
public static List<ItemStack> even(ItemStack stack1, ItemStack stack2)
|
||||
|
||||
@@ -70,7 +70,7 @@ public class SparkleAnimation
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D coord = Coord4D.get(tileEntity).getFromSide(side);
|
||||
Coord4D coord = Coord4D.get(tileEntity).offset(side);
|
||||
|
||||
if(coord.exists(pointer.getWorldObj()))
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RenderTickHandler
|
||||
}
|
||||
|
||||
font.drawStringWithShadow("Block: " + obj.getBlock(world).getUnlocalizedName(), 1, 1, 0x404040);
|
||||
font.drawStringWithShadow("Metadata: " + obj.getMetadata(world), 1, 10, 0x404040);
|
||||
font.drawStringWithShadow("Metadata: " + obj.getBlockState(world), 1, 10, 0x404040);
|
||||
font.drawStringWithShadow("Location: " + MekanismUtils.getCoordDisplay(obj), 1, 19, 0x404040);
|
||||
font.drawStringWithShadow("TileEntity: " + tileDisplay, 1, 28, 0x404040);
|
||||
font.drawStringWithShadow("Side: " + pos.sideHit, 1, 37, 0x404040);
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -40,7 +39,7 @@ public class RenderBin extends TileEntitySpecialRenderer<TileEntityBin>
|
||||
amount = Integer.toString(tileEntity.clientAmount);
|
||||
}
|
||||
|
||||
Coord4D obj = Coord4D.get(tileEntity).getFromSide(ForgeDirection.getOrientation(tileEntity.facing));
|
||||
Coord4D obj = Coord4D.get(tileEntity).offset(ForgeDirection.getOrientation(tileEntity.facing));
|
||||
|
||||
if(tileEntity.getWorldObj().getBlock(obj.xCoord, obj.yCoord, obj.zCoord).isSideSolid(tileEntity.getWorldObj(), obj.xCoord, obj.yCoord, obj.zCoord, ForgeDirection.getOrientation(tileEntity.facing).getOpposite()))
|
||||
{
|
||||
|
||||
@@ -13,7 +13,6 @@ import mekanism.common.tile.TileEntityTeleporter;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -34,10 +33,10 @@ public class RenderTeleporter extends TileEntitySpecialRenderer<TileEntityTelepo
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
|
||||
Coord4D obj = Coord4D.get(tileEntity).getFromSide(ForgeDirection.WEST);
|
||||
Coord4D obj = Coord4D.get(tileEntity).offset(ForgeDirection.WEST);
|
||||
int type = 0;
|
||||
|
||||
if(obj.getBlock(tileEntity.getWorldObj()) == MekanismBlocks.BasicBlock && obj.getMetadata(tileEntity.getWorldObj()) == 7)
|
||||
if(obj.getBlock(tileEntity.getWorldObj()) == MekanismBlocks.BasicBlock && obj.getBlockState(tileEntity.getWorldObj()) == 7)
|
||||
{
|
||||
type = 1;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public class CTMData
|
||||
{
|
||||
Coord4D obj = new Coord4D(x, y, z);
|
||||
Block coordBlock = obj.getBlock(world);
|
||||
int coordMeta = obj.getMetadata(world);
|
||||
int coordMeta = obj.getBlockState(world);
|
||||
boolean valid = false;
|
||||
|
||||
for(Entry<Block, List<Integer>> entry : acceptableBlockMetas.entrySet())
|
||||
|
||||
@@ -80,7 +80,7 @@ public class LaserManager
|
||||
|
||||
List<ItemStack> ret = null;
|
||||
Block blockHit = blockCoord.getBlock(world);
|
||||
int meta = blockCoord.getMetadata(world);
|
||||
int meta = blockCoord.getBlockState(world);
|
||||
|
||||
EntityPlayer dummy = Mekanism.proxy.getDummyPlayer((WorldServer)world, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord).get();
|
||||
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, world, blockHit, meta, dummy);
|
||||
@@ -93,13 +93,13 @@ public class LaserManager
|
||||
|
||||
if(dropAtBlock)
|
||||
{
|
||||
blockHit.dropBlockAsItem(world, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, blockCoord.getMetadata(world), 0);
|
||||
blockHit.dropBlockAsItem(world, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, blockCoord.getBlockState(world), 0);
|
||||
}
|
||||
else {
|
||||
ret = blockHit.getDrops(world, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, blockCoord.getMetadata(world), 0);
|
||||
ret = blockHit.getDrops(world, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, blockCoord.getBlockState(world), 0);
|
||||
}
|
||||
|
||||
blockHit.breakBlock(world, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, blockHit, blockCoord.getMetadata(world));
|
||||
blockHit.breakBlock(world, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, blockHit, blockCoord.getBlockState(world));
|
||||
world.setBlockToAir(blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord);
|
||||
world.playAuxSFX(2001, blockCoord.xCoord, blockCoord.yCoord, blockCoord.zCoord, Block.getIdFromBlock(blockHit));
|
||||
|
||||
|
||||
@@ -991,9 +991,9 @@ public class BlockBasic extends Block implements IBlockCTM, ICustomBlockIcon
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
Coord4D obj = new Coord4D(x, y, z).getFromSide(ForgeDirection.getOrientation(side).getOpposite());
|
||||
Coord4D obj = new Coord4D(x, y, z).offset(ForgeDirection.getOrientation(side).getOpposite());
|
||||
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1 && obj.getMetadata(world) == 10)
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1 && obj.getBlockState(world) == 10)
|
||||
{
|
||||
return ctms[10][0].shouldRenderSide(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
|
||||
{
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tile = Coord4D.get(transporter).getFromSide(dir).getTileEntity(world);
|
||||
TileEntity tile = Coord4D.get(transporter).offset(dir).getTileEntity(world);
|
||||
|
||||
if(tile instanceof IInventory)
|
||||
{
|
||||
@@ -526,7 +526,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
|
||||
{
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tile = Coord4D.get(tileEntity).getFromSide(dir).getTileEntity(world);
|
||||
TileEntity tile = Coord4D.get(tileEntity).offset(dir).getTileEntity(world);
|
||||
|
||||
if(tile instanceof IInventory)
|
||||
{
|
||||
@@ -837,7 +837,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
|
||||
{
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tile = Coord4D.get(tileEntity).getFromSide(dir).getTileEntity(world);
|
||||
TileEntity tile = Coord4D.get(tileEntity).offset(dir).getTileEntity(world);
|
||||
|
||||
if(tile instanceof IInventory)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class TransporterPathfinder
|
||||
return new Destination(ret, true, null, 0).setPathType(Path.NONE);
|
||||
}
|
||||
else {
|
||||
TileEntity tile = start.getFromSide(transportStack.idleDir).getTileEntity(worldObj);
|
||||
TileEntity tile = start.offset(transportStack.idleDir).getTileEntity(worldObj);
|
||||
|
||||
if(transportStack.canInsertToTransporter(tile, transportStack.idleDir))
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public final class TransporterPathfinder
|
||||
|
||||
while(true)
|
||||
{
|
||||
Coord4D coord = start.getFromSide(side, count);
|
||||
Coord4D coord = start.offset(side, count);
|
||||
|
||||
if(transportStack.canInsertToTransporter(coord.getTileEntity(worldObj), side))
|
||||
{
|
||||
@@ -121,7 +121,7 @@ public final class TransporterPathfinder
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tile = start.getFromSide(side).getTileEntity(worldObj);
|
||||
TileEntity tile = start.offset(side).getTileEntity(worldObj);
|
||||
|
||||
if(transportStack.canInsertToTransporter(tile, side))
|
||||
{
|
||||
@@ -132,7 +132,7 @@ public final class TransporterPathfinder
|
||||
else {
|
||||
for(ForgeDirection side : EnumSet.complementOf(EnumSet.of(ForgeDirection.UNKNOWN, transportStack.idleDir.getOpposite())))
|
||||
{
|
||||
TileEntity tile = start.getFromSide(side).getTileEntity(worldObj);
|
||||
TileEntity tile = start.offset(side).getTileEntity(worldObj);
|
||||
|
||||
if(transportStack.canInsertToTransporter(tile, side))
|
||||
{
|
||||
@@ -140,7 +140,7 @@ public final class TransporterPathfinder
|
||||
}
|
||||
}
|
||||
|
||||
TileEntity tile = start.getFromSide(transportStack.idleDir.getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity tile = start.offset(transportStack.idleDir.getOpposite()).getTileEntity(worldObj);
|
||||
|
||||
if(transportStack.canInsertToTransporter(tile, transportStack.idleDir.getOpposite()))
|
||||
{
|
||||
@@ -428,7 +428,7 @@ public final class TransporterPathfinder
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(i);
|
||||
Coord4D neighbor = start.getFromSide(direction);
|
||||
Coord4D neighbor = start.offset(direction);
|
||||
|
||||
if(!transportStack.canInsertToTransporter(neighbor.getTileEntity(worldObj), direction) && (!neighbor.equals(finalNode) || !destChecker.isValid(transportStack, i, neighbor.getTileEntity(worldObj))))
|
||||
{
|
||||
@@ -467,7 +467,7 @@ public final class TransporterPathfinder
|
||||
|
||||
for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D neighbor = currentNode.getFromSide(direction);
|
||||
Coord4D neighbor = currentNode.offset(direction);
|
||||
|
||||
if(transportStack.canInsertToTransporter(neighbor.getTileEntity(worldObj), direction))
|
||||
{
|
||||
|
||||
@@ -180,7 +180,7 @@ public class EntityFlame extends Entity implements IEntityAdditionalSpawnData
|
||||
int meta = worldObj.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ);
|
||||
boolean fluid = MekanismUtils.isFluid(worldObj, new Coord4D(mop)) || MekanismUtils.isDeadFluid(worldObj, new Coord4D(mop));
|
||||
|
||||
Coord4D sideCoord = new Coord4D(mop.blockX, mop.blockY, mop.blockZ, worldObj.provider.dimensionId).getFromSide(ForgeDirection.getOrientation(mop.sideHit));
|
||||
Coord4D sideCoord = new Coord4D(mop.blockX, mop.blockY, mop.blockZ, worldObj.provider.dimensionId).offset(ForgeDirection.getOrientation(mop.sideHit));
|
||||
|
||||
if(general.aestheticWorldDamage && !fluid && (sideCoord.isAirBlock(worldObj) || sideCoord.isReplaceable(worldObj)))
|
||||
{
|
||||
@@ -238,7 +238,7 @@ public class EntityFlame extends Entity implements IEntityAdditionalSpawnData
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
Block b = block.getBlock(worldObj);
|
||||
int meta = block.getMetadata(worldObj);
|
||||
int meta = block.getBlockState(worldObj);
|
||||
|
||||
if(Block.getBlockFromItem(result.getItem()) != Blocks.air)
|
||||
{
|
||||
|
||||
@@ -352,9 +352,9 @@ public class ItemAtomicDisassembler extends ItemEnergized
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D coord = pointer.getFromSide(side);
|
||||
Coord4D coord = pointer.offset(side);
|
||||
|
||||
if(coord.exists(world) && checkID(coord.getBlock(world)) && (coord.getMetadata(world) == stack.getItemDamage() || (MekanismUtils.getOreDictName(stack).contains("logWood") && coord.getMetadata(world) % 4 == stack.getItemDamage() % 4)))
|
||||
if(coord.exists(world) && checkID(coord.getBlock(world)) && (coord.getBlockState(world) == stack.getItemDamage() || (MekanismUtils.getOreDictName(stack).contains("logWood") && coord.getBlockState(world) % 4 == stack.getItemDamage() % 4)))
|
||||
{
|
||||
loop(coord);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public class ItemBalloon extends ItemMekanism
|
||||
Coord4D coord = new Coord4D(source.getXInt(), source.getYInt(), source.getZInt(), source.getWorld().provider.dimensionId);
|
||||
ForgeDirection side = ForgeDirection.getOrientation(BlockDispenser.func_149937_b(source.getBlockMetadata()).ordinal());
|
||||
|
||||
List<EntityLivingBase> entities = source.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, coord.getFromSide(side).getBoundingBox());
|
||||
List<EntityLivingBase> entities = source.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, coord.offset(side).getBoundingBox());
|
||||
boolean latched = false;
|
||||
|
||||
for(EntityLivingBase entity : entities)
|
||||
|
||||
@@ -570,7 +570,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
Coord4D trans = coord.getFromSide(ForgeDirection.getOrientation(pos.sideHit));
|
||||
Coord4D trans = coord.offset(ForgeDirection.getOrientation(pos.sideHit));
|
||||
|
||||
if(!entityplayer.canPlayerEdit(trans.xCoord, trans.yCoord, trans.zCoord, pos.sideHit, itemstack))
|
||||
{
|
||||
|
||||
@@ -74,16 +74,16 @@ public class ItemNetworkReader extends ItemEnergized
|
||||
|
||||
for(ForgeDirection iterSide : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D coord = Coord4D.get(tileEntity).getFromSide(iterSide);
|
||||
Coord4D coord = Coord4D.get(tileEntity).offset(iterSide);
|
||||
|
||||
if(coord.getTileEntity(world) instanceof ITransmitterTile)
|
||||
{
|
||||
IGridTransmitter transmitter = ((ITransmitterTile)coord.getTileEntity(world)).getTransmitter();
|
||||
|
||||
if(transmitter.getTransmitterNetwork().possibleAcceptors.containsKey(coord.getFromSide(iterSide.getOpposite())) && !iteratedNetworks.contains(transmitter.getTransmitterNetwork()))
|
||||
if(transmitter.getTransmitterNetwork().possibleAcceptors.containsKey(coord.offset(iterSide.getOpposite())) && !iteratedNetworks.contains(transmitter.getTransmitterNetwork()))
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[" + transmitter.getTransmissionType().getName() + "]" + EnumColor.GREY + " -------------"));
|
||||
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Connected sides: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().acceptorDirections.get(coord.getFromSide(iterSide.getOpposite()))));
|
||||
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Connected sides: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().acceptorDirections.get(coord.offset(iterSide.getOpposite()))));
|
||||
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
|
||||
iteratedNetworks.add(transmitter.getTransmitterNetwork());
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.tile.TileEntityMultiblock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -211,7 +210,7 @@ public abstract class UpdateProtocol<T extends SynchronizedData<T>>
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get(tile).getFromSide(side).getTileEntity(tile.getWorldObj());
|
||||
TileEntity tileEntity = Coord4D.get(tile).offset(side).getTileEntity(tile.getWorldObj());
|
||||
|
||||
if(MultiblockManager.areEqual(tileEntity, pointer))
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ItemPartTransmitter extends JItemMultiPart
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tile = obj.getFromSide(side).getTileEntity(world);
|
||||
TileEntity tile = obj.offset(side).getTileEntity(world);
|
||||
|
||||
if(tile instanceof ITransmitterTile && TransmissionType.checkTransmissionType(((ITransmitterTile)tile).getTransmitter(), type.getTransmission()))
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ public class MultipartHeatTransmitter extends MultipartTransmitter<IHeatTransfer
|
||||
{
|
||||
if(getPart().connectionMapContainsSide(getPart().getAllCurrentConnections(), side))
|
||||
{
|
||||
TileEntity adj = coord().getFromSide(side).getTileEntity(world());
|
||||
TileEntity adj = coord().offset(side).getTileEntity(world());
|
||||
if(adj instanceof IHeatTransfer)
|
||||
{
|
||||
return (IHeatTransfer)adj;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class MultipartTransmitter<A, N extends DynamicNetwork<A,N>> extends Tran
|
||||
@Override
|
||||
public Coord4D getAdjacentConnectableTransmitterCoord(ForgeDirection side)
|
||||
{
|
||||
Coord4D sideCoord = coord().getFromSide(side);
|
||||
Coord4D sideCoord = coord().offset(side);
|
||||
|
||||
TileEntity potentialTransmitterTile = sideCoord.getTileEntity(world());
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ public class PartGlowPanel extends JCuboidPart implements JNormalOcclusion, JIco
|
||||
|
||||
public boolean canStay()
|
||||
{
|
||||
Coord4D adj = Coord4D.get(tile()).getFromSide(side);
|
||||
Coord4D adj = Coord4D.get(tile()).offset(side);
|
||||
return world().isSideSolid(adj.xCoord, adj.yCoord, adj.zCoord, side.getOpposite()) || tile().partMap(side.ordinal()) instanceof HollowMicroblock;
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
|
||||
|
||||
for(ForgeDirection side : getConnections(ConnectionType.PULL))
|
||||
{
|
||||
TileEntity tile = Coord4D.get(tile()).getFromSide(side).getTileEntity(world());
|
||||
TileEntity tile = Coord4D.get(tile()).offset(side).getTileEntity(world());
|
||||
|
||||
if(tile instanceof IInventory)
|
||||
{
|
||||
|
||||
@@ -240,7 +240,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||
{
|
||||
if(canConnectMutual(side))
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get(tile()).getFromSide(side).getTileEntity(world());
|
||||
TileEntity tileEntity = Coord4D.get(tile()).offset(side).getTileEntity(world());
|
||||
|
||||
if(tileEntity instanceof ITransmitterTile && TransmissionType.checkTransmissionType(((ITransmitterTile)tileEntity).getTransmitter(), getTransmitterType().getTransmission()) && isValidTransmitter(tileEntity))
|
||||
{
|
||||
@@ -261,7 +261,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||
|
||||
if(canConnectMutual(side))
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get(tile()).getFromSide(side).getTileEntity(world());
|
||||
TileEntity tileEntity = Coord4D.get(tile()).offset(side).getTileEntity(world());
|
||||
|
||||
if(isValidAcceptor(tileEntity, side))
|
||||
{
|
||||
@@ -291,7 +291,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||
|
||||
if(canConnectMutual(side))
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get(tile()).getFromSide(side).getTileEntity(world());
|
||||
TileEntity tileEntity = Coord4D.get(tile()).offset(side).getTileEntity(world());
|
||||
|
||||
if(tileEntity instanceof ITransmitterTile && TransmissionType.checkTransmissionType(((ITransmitterTile)tileEntity).getTransmitter(), getTransmitterType().getTransmission()) && isValidTransmitter(tileEntity))
|
||||
{
|
||||
@@ -315,7 +315,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||
{
|
||||
if(canConnectMutual(side))
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get(tile()).getFromSide(side).getTileEntity(world());
|
||||
TileEntity tileEntity = Coord4D.get(tile()).offset(side).getTileEntity(world());
|
||||
|
||||
if(isValidAcceptor(tileEntity, side))
|
||||
{
|
||||
@@ -469,7 +469,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||
{
|
||||
if(!canConnect(side)) return false;
|
||||
|
||||
TileEntity tile = Coord4D.get(tile()).getFromSide(side).getTileEntity(world());
|
||||
TileEntity tile = Coord4D.get(tile()).offset(side).getTileEntity(world());
|
||||
return (!(tile instanceof IBlockableConnection) || ((IBlockableConnection)tile).canConnect(side.getOpposite()));
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
{
|
||||
if(bottomStack != null && isActive)
|
||||
{
|
||||
TileEntity tile = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(0)).getTileEntity(worldObj);
|
||||
TileEntity tile = Coord4D.get(this).offset(ForgeDirection.getOrientation(0)).getTileEntity(worldObj);
|
||||
|
||||
if(tile instanceof ITransporterTile)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||
{
|
||||
GasStack toSend = new GasStack(outputTank.getGas().getGas(), Math.min(outputTank.getStored(), gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
|
||||
@@ -32,8 +32,7 @@ import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -144,7 +143,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
{
|
||||
GasStack toSend = new GasStack(centerTank.getGas().getGas(), Math.min(centerTank.getStored(), gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
|
||||
@@ -138,7 +138,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||
{
|
||||
GasStack toSend = new GasStack(gasTank.getGas().getGas(), Math.min(gasTank.getStored(), gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
|
||||
@@ -127,7 +127,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
{
|
||||
GasStack toSend = new GasStack(outputTank.getGas().getGas(), Math.min(outputTank.getStored(), gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
|
||||
@@ -187,7 +187,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
}
|
||||
|
||||
Block block = coord.getBlock(worldObj);
|
||||
int meta = coord.getMetadata(worldObj);
|
||||
int meta = coord.getBlockState(worldObj);
|
||||
|
||||
if(block == null || coord.isAirBlock(worldObj))
|
||||
{
|
||||
@@ -335,7 +335,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
public boolean setReplace(Coord4D obj, int index)
|
||||
{
|
||||
Block block = obj.getBlock(worldObj);
|
||||
int meta = obj.getMetadata(worldObj);
|
||||
int meta = obj.getBlockState(worldObj);
|
||||
|
||||
EntityPlayer dummy = Mekanism.proxy.getDummyPlayer((WorldServer)worldObj, obj.xCoord, obj.yCoord, obj.zCoord).get();
|
||||
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(obj.xCoord, obj.yCoord, obj.zCoord, worldObj, block, meta, dummy);
|
||||
@@ -351,7 +351,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
|
||||
if(obj.getBlock(worldObj) != null && !obj.getBlock(worldObj).canBlockStay(worldObj, obj.xCoord, obj.yCoord, obj.zCoord))
|
||||
{
|
||||
obj.getBlock(worldObj).dropBlockAsItem(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, obj.getMetadata(worldObj), 1);
|
||||
obj.getBlock(worldObj).dropBlockAsItem(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, obj.getBlockState(worldObj), 1);
|
||||
worldObj.setBlockToAir(obj.xCoord, obj.yCoord, obj.zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.util.EnumSet;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.transmitters.IGridTransmitter;
|
||||
import mekanism.api.transmitters.ITransmitterTile;
|
||||
import mekanism.common.base.IEnergyWrapper;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -375,7 +374,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
@Method(modid = "IC2")
|
||||
public double injectEnergy(ForgeDirection direction, double amount, double voltage)
|
||||
{
|
||||
if(Coord4D.get(this).getFromSide(direction).getTileEntity(worldObj) instanceof ITransmitterTile)
|
||||
if(Coord4D.get(this).offset(direction).getTileEntity(worldObj) instanceof ITransmitterTile)
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
{
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(orientation).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(orientation).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IFluidHandler)
|
||||
{
|
||||
@@ -188,7 +188,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
//First see if there are any fluid blocks touching the pump - if so, sucks and adds the location to the recurring list
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D wrapper = Coord4D.get(this).getFromSide(orientation);
|
||||
Coord4D wrapper = Coord4D.get(this).offset(orientation);
|
||||
|
||||
if(MekanismUtils.isFluid(worldObj, wrapper))
|
||||
{
|
||||
@@ -235,7 +235,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
//Add all the blocks surrounding this recurring node to the recurring node list
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D side = wrapper.getFromSide(orientation);
|
||||
Coord4D side = wrapper.offset(orientation);
|
||||
|
||||
if(Coord4D.get(this).distanceTo(side) <= 80)
|
||||
{
|
||||
|
||||
@@ -198,7 +198,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
{
|
||||
GasStack toSend = new GasStack(leftTank.getGas().getGas(), Math.min(leftTank.getStored(), output));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getLeft(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(MekanismUtils.getLeft(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
@@ -229,7 +229,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
{
|
||||
GasStack toSend = new GasStack(rightTank.getGas().getGas(), Math.min(rightTank.getStored(), output));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
|
||||
@@ -129,7 +129,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
doPlenish();
|
||||
}
|
||||
else {
|
||||
Coord4D below = Coord4D.get(this).getFromSide(ForgeDirection.DOWN);
|
||||
Coord4D below = Coord4D.get(this).offset(ForgeDirection.DOWN);
|
||||
|
||||
if(canReplace(below, false, false) && getEnergy() >= usage.fluidicPlenisherUsage && fluidTank.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
{
|
||||
if(usedNodes.isEmpty())
|
||||
{
|
||||
Coord4D below = Coord4D.get(this).getFromSide(ForgeDirection.DOWN);
|
||||
Coord4D below = Coord4D.get(this).offset(ForgeDirection.DOWN);
|
||||
|
||||
if(!canReplace(below, true, true))
|
||||
{
|
||||
@@ -192,7 +192,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
|
||||
for(ForgeDirection dir : dirs)
|
||||
{
|
||||
Coord4D sideCoord = coord.getFromSide(dir);
|
||||
Coord4D sideCoord = coord.offset(dir);
|
||||
|
||||
if(sideCoord.exists(worldObj) && canReplace(sideCoord, true, true))
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
{
|
||||
GasStack toSend = new GasStack(gasTank.getGas().getGas(), Math.min(gasTank.getStored(), output));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.transmitters.IGridTransmitter;
|
||||
import mekanism.api.transmitters.ITransmitterTile;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IActiveState;
|
||||
@@ -83,7 +82,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
if(structure.locations.contains(Coord4D.get(this).getFromSide(side)))
|
||||
if(structure.locations.contains(Coord4D.get(this).offset(side)))
|
||||
{
|
||||
set.remove(side);
|
||||
}
|
||||
@@ -401,7 +400,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
@Method(modid = "IC2")
|
||||
public double injectEnergy(ForgeDirection direction, double amount, double voltage)
|
||||
{
|
||||
if(Coord4D.get(this).getFromSide(direction).getTileEntity(worldObj) instanceof ITransmitterTile)
|
||||
if(Coord4D.get(this).offset(direction).getTileEntity(worldObj) instanceof ITransmitterTile)
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
if(MekanismUtils.canFunction(this) && delayTicks == 0)
|
||||
{
|
||||
TileEntity back = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity front = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
TileEntity back = Coord4D.get(this).offset(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity front = Coord4D.get(this).offset(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(back instanceof IInventory && (front instanceof ITransporterTile || front instanceof IInventory))
|
||||
{
|
||||
@@ -448,7 +448,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
public boolean canSendHome(ItemStack stack)
|
||||
{
|
||||
TileEntity back = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity back = Coord4D.get(this).offset(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj);
|
||||
|
||||
if(back instanceof IInventory)
|
||||
{
|
||||
@@ -460,12 +460,12 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
public boolean hasInventory()
|
||||
{
|
||||
return Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj) instanceof IInventory;
|
||||
return Coord4D.get(this).offset(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj) instanceof IInventory;
|
||||
}
|
||||
|
||||
public ItemStack sendHome(ItemStack stack)
|
||||
{
|
||||
TileEntity back = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity back = Coord4D.get(this).offset(ForgeDirection.getOrientation(facing).getOpposite()).getTileEntity(worldObj);
|
||||
|
||||
if(back instanceof IInventory)
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ public abstract class TileEntityMultiblock<T extends SynchronizedData<T>> extend
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D obj = Coord4D.get(this).getFromSide(side);
|
||||
Coord4D obj = Coord4D.get(this).offset(side);
|
||||
|
||||
if(!obj.isAirBlock(worldObj) && (obj.getTileEntity(worldObj) == null || obj.getTileEntity(worldObj).getClass() != getClass()))
|
||||
{
|
||||
|
||||
@@ -136,7 +136,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
{
|
||||
if(fluidTank.getFluid() != null)
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(ForgeDirection.DOWN).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(ForgeDirection.DOWN).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IFluidHandler)
|
||||
{
|
||||
@@ -277,7 +277,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
|
||||
public int pushUp(FluidStack fluid, boolean doFill)
|
||||
{
|
||||
Coord4D up = Coord4D.get(this).getFromSide(ForgeDirection.UP);
|
||||
Coord4D up = Coord4D.get(this).offset(ForgeDirection.UP);
|
||||
|
||||
if(up.getTileEntity(worldObj) instanceof TileEntityPortableTank)
|
||||
{
|
||||
@@ -399,7 +399,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
{
|
||||
int needed = fluidTank.getCapacity()-fluidTank.getFluidAmount();
|
||||
|
||||
Coord4D top = Coord4D.get(this).getFromSide(ForgeDirection.UP);
|
||||
Coord4D top = Coord4D.get(this).offset(ForgeDirection.UP);
|
||||
|
||||
if(top.getTileEntity(worldObj) instanceof TileEntityPortableTank)
|
||||
{
|
||||
@@ -542,7 +542,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
{
|
||||
if(from == ForgeDirection.DOWN)
|
||||
{
|
||||
TileEntity tile = Coord4D.get(this).getFromSide(ForgeDirection.DOWN).getTileEntity(worldObj);
|
||||
TileEntity tile = Coord4D.get(this).offset(ForgeDirection.DOWN).getTileEntity(worldObj);
|
||||
|
||||
if(isActive && !(tile instanceof TileEntityPortableTank))
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
{
|
||||
GasStack toSend = new GasStack(gasTank.getGas().getGas(), Math.min(gasTank.getGas().amount, gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getLeft(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(MekanismUtils.getLeft(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
|
||||
@@ -130,7 +130,7 @@ public class TileEntitySolarEvaporationBlock extends TileEntityContainerBlock
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D coord = pos.getFromSide(side);
|
||||
Coord4D coord = pos.offset(side);
|
||||
|
||||
if(!iterated.contains(coord) && coord.getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock)
|
||||
{
|
||||
|
||||
@@ -378,15 +378,15 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
|
||||
Coord4D startPoint = Coord4D.get(this);
|
||||
|
||||
while(startPoint.getFromSide(ForgeDirection.UP).getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock)
|
||||
while(startPoint.offset(ForgeDirection.UP).getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock)
|
||||
{
|
||||
startPoint.step(ForgeDirection.UP);
|
||||
}
|
||||
|
||||
Coord4D test = startPoint.getFromSide(ForgeDirection.DOWN).getFromSide(right, 2);
|
||||
Coord4D test = startPoint.offset(ForgeDirection.DOWN).offset(right, 2);
|
||||
isLeftOnFace = test.getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock;
|
||||
|
||||
startPoint = startPoint.getFromSide(left, isLeftOnFace ? 1 : 2);
|
||||
startPoint = startPoint.offset(left, isLeftOnFace ? 1 : 2);
|
||||
|
||||
if(!scanTopLayer(startPoint))
|
||||
{
|
||||
@@ -395,11 +395,11 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
|
||||
height = 1;
|
||||
|
||||
Coord4D middlePointer = startPoint.getFromSide(ForgeDirection.DOWN);
|
||||
Coord4D middlePointer = startPoint.offset(ForgeDirection.DOWN);
|
||||
|
||||
while(scanLowerLayer(middlePointer))
|
||||
{
|
||||
middlePointer = middlePointer.getFromSide(ForgeDirection.DOWN);
|
||||
middlePointer = middlePointer.offset(ForgeDirection.DOWN);
|
||||
}
|
||||
|
||||
if(height < 3 || height > 18)
|
||||
@@ -424,7 +424,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
{
|
||||
for(int z = 0; z < 4; z++)
|
||||
{
|
||||
Coord4D pointer = current.getFromSide(right, x).getFromSide(back, z);
|
||||
Coord4D pointer = current.offset(right, x).offset(back, z);
|
||||
TileEntity pointerTile = pointer.getTileEntity(worldObj);
|
||||
|
||||
int corner = getCorner(x, z);
|
||||
@@ -435,7 +435,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if(pointer.getFromSide(ForgeDirection.UP).getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock || !addTankPart(pointerTile))
|
||||
else if(pointer.offset(ForgeDirection.UP).getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock || !addTankPart(pointerTile))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -449,7 +449,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(pointer.getFromSide(ForgeDirection.UP).getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock || !addTankPart(pointerTile))
|
||||
if(pointer.offset(ForgeDirection.UP).getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock || !addTankPart(pointerTile))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -499,7 +499,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
{
|
||||
for(int z = 0; z < 4; z++)
|
||||
{
|
||||
Coord4D pointer = current.getFromSide(right, x).getFromSide(back, z);
|
||||
Coord4D pointer = current.offset(right, x).offset(back, z);
|
||||
TileEntity pointerTile = pointer.getTileEntity(worldObj);
|
||||
|
||||
if((x == 1 || x == 2) && (z == 1 || z == 2))
|
||||
@@ -598,10 +598,10 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
}
|
||||
|
||||
ForgeDirection right = MekanismUtils.getRight(facing);
|
||||
Coord4D startPoint = Coord4D.get(this).getFromSide(right);
|
||||
startPoint = isLeftOnFace ? startPoint.getFromSide(right) : startPoint;
|
||||
Coord4D startPoint = Coord4D.get(this).offset(right);
|
||||
startPoint = isLeftOnFace ? startPoint.offset(right) : startPoint;
|
||||
|
||||
startPoint = startPoint.getFromSide(right.getOpposite()).getFromSide(MekanismUtils.getBack(facing));
|
||||
startPoint = startPoint.offset(right.getOpposite()).offset(MekanismUtils.getBack(facing));
|
||||
startPoint.translate(0, -(height-2), 0);
|
||||
|
||||
return startPoint;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class TileEntitySolarEvaporationValve extends TileEntitySolarEvaporationB
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D obj = Coord4D.get(this).getFromSide(side);
|
||||
Coord4D obj = Coord4D.get(this).offset(side);
|
||||
|
||||
if(!obj.isAirBlock(worldObj) && !(obj.getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock))
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
{
|
||||
GasStack toSend = new GasStack(outputTank.getGas().getGas(), Math.min(outputTank.getStored(), gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
@Override
|
||||
public void onPlace()
|
||||
{
|
||||
MekanismUtils.makeBoundingBlock(worldObj, Coord4D.get(this).getFromSide(ForgeDirection.UP), Coord4D.get(this));
|
||||
MekanismUtils.makeBoundingBlock(worldObj, Coord4D.get(this).offset(ForgeDirection.UP), Coord4D.get(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -439,13 +439,13 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
public static void alignPlayer(EntityPlayerMP player, Coord4D coord)
|
||||
{
|
||||
Coord4D upperCoord = coord.getFromSide(ForgeDirection.UP);
|
||||
Coord4D upperCoord = coord.offset(ForgeDirection.UP);
|
||||
ForgeDirection side = null;
|
||||
float yaw = player.rotationYaw;
|
||||
|
||||
for(ForgeDirection iterSide : MekanismUtils.SIDE_DIRS)
|
||||
{
|
||||
if(upperCoord.getFromSide(iterSide).isAirBlock(player.worldObj))
|
||||
if(upperCoord.offset(iterSide).isAirBlock(player.worldObj))
|
||||
{
|
||||
side = iterSide;
|
||||
break;
|
||||
|
||||
@@ -505,7 +505,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
}
|
||||
else
|
||||
{
|
||||
TileEntity adj = Coord4D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
TileEntity adj = Coord4D.get(this).offset(side).getTileEntity(worldObj);
|
||||
if(adj instanceof IHeatTransfer)
|
||||
{
|
||||
return (IHeatTransfer)adj;
|
||||
@@ -522,7 +522,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
return side == innerSide;
|
||||
}
|
||||
|
||||
if(!Coord4D.get(this).getFromSide(side).getBlock(worldObj).isAir(worldObj, xCoord, yCoord, zCoord))
|
||||
if(!Coord4D.get(this).offset(side).getBlock(worldObj).isAir(worldObj, xCoord, yCoord, zCoord))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import mekanism.api.gas.GasTransmission;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.base.IEjector;
|
||||
import mekanism.common.base.ILogisticalTransporter;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.ITileComponent;
|
||||
@@ -185,7 +184,7 @@ public class TileComponentEjector implements ITileComponent, IEjector
|
||||
|
||||
for(ForgeDirection side : outputs)
|
||||
{
|
||||
TileEntity tile = Coord4D.get(tileEntity).getFromSide(side).getTileEntity(tileEntity.getWorldObj());
|
||||
TileEntity tile = Coord4D.get(tileEntity).offset(side).getTileEntity(tileEntity.getWorldObj());
|
||||
ItemStack prev = stack.copy();
|
||||
|
||||
if(tile instanceof IInventory && !(tile instanceof ITransporterTile))
|
||||
|
||||
@@ -6,7 +6,6 @@ import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -54,7 +53,7 @@ public final class CableUtils
|
||||
|
||||
for(ForgeDirection side : sides)
|
||||
{
|
||||
TileEntity tile = coord.getFromSide(side).getTileEntity(tileEntity.getWorldObj());
|
||||
TileEntity tile = coord.offset(side).getTileEntity(tileEntity.getWorldObj());
|
||||
|
||||
connectable[side.ordinal()] = isValidAcceptorOnSide(tileEntity, tile, side);
|
||||
connectable[side.ordinal()] |= isCable(tile);
|
||||
@@ -95,7 +94,7 @@ public final class CableUtils
|
||||
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity outputter = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj());
|
||||
TileEntity outputter = Coord4D.get(tileEntity).offset(orientation).getTileEntity(tileEntity.getWorldObj());
|
||||
|
||||
if(isOutputter(outputter, orientation))
|
||||
{
|
||||
@@ -202,7 +201,7 @@ public final class CableUtils
|
||||
|
||||
for(ForgeDirection side : outputtingSides)
|
||||
{
|
||||
TileEntity tileEntity = Coord4D.get((TileEntity)emitter).getFromSide(side).getTileEntity(((TileEntity)emitter).getWorldObj());
|
||||
TileEntity tileEntity = Coord4D.get((TileEntity)emitter).offset(side).getTileEntity(((TileEntity)emitter).getWorldObj());
|
||||
double toSend = splitSend+remains;
|
||||
remains = 0;
|
||||
|
||||
|
||||
@@ -640,9 +640,9 @@ public final class MekanismUtils
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D sideCoord = coord.getFromSide(side);
|
||||
Coord4D sideCoord = coord.offset(side);
|
||||
|
||||
if(sideCoord.exists(world) && sideCoord.getFromSide(side).exists(world))
|
||||
if(sideCoord.exists(world) && sideCoord.offset(side).exists(world))
|
||||
{
|
||||
Block block = sideCoord.getBlock(world);
|
||||
boolean weakPower = block.shouldCheckWeakPower(world, coord.xCoord, coord.yCoord, coord.zCoord, side.ordinal());
|
||||
@@ -671,7 +671,7 @@ public final class MekanismUtils
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D sideCoord = coord.getFromSide(side);
|
||||
Coord4D sideCoord = coord.offset(side);
|
||||
|
||||
if(sideCoord.exists(world))
|
||||
{
|
||||
@@ -694,7 +694,7 @@ public final class MekanismUtils
|
||||
{
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D offset = coord.getFromSide(dir);
|
||||
Coord4D offset = coord.offset(dir);
|
||||
|
||||
if(offset.exists(world))
|
||||
{
|
||||
@@ -703,7 +703,7 @@ public final class MekanismUtils
|
||||
|
||||
if(block1.isNormalCube(world, offset.xCoord, offset.yCoord, offset.zCoord))
|
||||
{
|
||||
offset = offset.getFromSide(dir);
|
||||
offset = offset.offset(dir);
|
||||
|
||||
if(offset.exists(world))
|
||||
{
|
||||
@@ -803,7 +803,7 @@ public final class MekanismUtils
|
||||
public static FluidStack getFluid(World world, Coord4D pos, boolean filter)
|
||||
{
|
||||
Block block = pos.getBlock(world);
|
||||
int meta = pos.getMetadata(world);
|
||||
int meta = pos.getBlockState(world);
|
||||
|
||||
if(block == null)
|
||||
{
|
||||
@@ -846,7 +846,7 @@ public final class MekanismUtils
|
||||
public static boolean isDeadFluid(World world, Coord4D pos)
|
||||
{
|
||||
Block block = pos.getBlock(world);
|
||||
int meta = pos.getMetadata(world);
|
||||
int meta = pos.getBlockState(world);
|
||||
|
||||
if(block == null || meta == 0)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ public final class MinerUtils
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
int meta = obj.getMetadata(world);
|
||||
int meta = obj.getBlockState(world);
|
||||
|
||||
if(!silk)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ public final class PipeUtils
|
||||
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity acceptor = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj());
|
||||
TileEntity acceptor = Coord4D.get(tileEntity).offset(orientation).getTileEntity(tileEntity.getWorldObj());
|
||||
|
||||
if(acceptor instanceof IFluidHandler && !(acceptor instanceof ITransmitterTile))
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class TransporterUtils
|
||||
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tile = tileEntity.coord().getFromSide(orientation).getTileEntity(tileEntity.world());
|
||||
TileEntity tile = tileEntity.coord().offset(orientation).getTileEntity(tileEntity.world());
|
||||
|
||||
if(tile instanceof ITransporterTile)
|
||||
{
|
||||
@@ -149,7 +149,7 @@ public final class TransporterUtils
|
||||
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity inventory = transporter.coord().getFromSide(orientation).getTileEntity(transporter.world());
|
||||
TileEntity inventory = transporter.coord().offset(orientation).getTileEntity(transporter.world());
|
||||
|
||||
if(inventory instanceof IInventory && !(inventory instanceof ITransmitterTile))
|
||||
{
|
||||
|
||||
@@ -359,7 +359,7 @@ public class FusionReactor implements IFusionReactor
|
||||
updatedThisTick = true;
|
||||
|
||||
Coord4D controllerPosition = Coord4D.get(controller);
|
||||
Coord4D centreOfReactor = controllerPosition.getFromSide(ForgeDirection.DOWN, 2);
|
||||
Coord4D centreOfReactor = controllerPosition.offset(ForgeDirection.DOWN, 2);
|
||||
|
||||
unformMultiblock(true);
|
||||
|
||||
|
||||
@@ -309,11 +309,11 @@ public class BlockReactor extends BlockContainer implements IBlockCTM
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
Coord4D obj = new Coord4D(x, y, z).getFromSide(ForgeDirection.getOrientation(side).getOpposite());
|
||||
Coord4D obj = new Coord4D(x, y, z).offset(ForgeDirection.getOrientation(side).getOpposite());
|
||||
|
||||
if(this == GeneratorsBlocks.ReactorGlass)
|
||||
{
|
||||
int metadata = obj.getMetadata(world);
|
||||
int metadata = obj.getBlockState(world);
|
||||
|
||||
switch(metadata)
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D coord = Coord4D.get(this).getFromSide(side);
|
||||
Coord4D coord = Coord4D.get(this).offset(side);
|
||||
|
||||
if(isLava(coord.xCoord, coord.yCoord, coord.zCoord))
|
||||
{
|
||||
@@ -425,7 +425,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
{
|
||||
if(canConnectHeat(side))
|
||||
{
|
||||
TileEntity adj = Coord4D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
TileEntity adj = Coord4D.get(this).offset(side).getTileEntity(worldObj);
|
||||
|
||||
if(adj instanceof IHeatTransfer)
|
||||
{
|
||||
|
||||
@@ -109,10 +109,10 @@ public class TileEntityWindTurbine extends TileEntityGenerator implements IBound
|
||||
public void onPlace()
|
||||
{
|
||||
Coord4D pos = Coord4D.get(this);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.getFromSide(ForgeDirection.UP, 1), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.getFromSide(ForgeDirection.UP, 2), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.getFromSide(ForgeDirection.UP, 3), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.getFromSide(ForgeDirection.UP, 4), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(ForgeDirection.UP, 1), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(ForgeDirection.UP, 2), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(ForgeDirection.UP, 3), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(ForgeDirection.UP, 4), pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -147,7 +147,7 @@ public abstract class TileEntityReactorBlock extends TileEntityElectricBlock imp
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
Coord4D coord = pos.getFromSide(side);
|
||||
Coord4D coord = pos.offset(side);
|
||||
|
||||
if(!iterated.contains(coord) && coord.getTileEntity(worldObj) instanceof TileEntityReactorBlock)
|
||||
{
|
||||
|
||||
@@ -294,7 +294,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
||||
@Override
|
||||
public IHeatTransfer getAdjacent(ForgeDirection side)
|
||||
{
|
||||
TileEntity adj = Coord4D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
TileEntity adj = Coord4D.get(this).offset(side).getTileEntity(worldObj);
|
||||
|
||||
if(adj instanceof IHeatTransfer && !(adj instanceof IReactorBlock))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user