Merge branch 'master' into development

This commit is contained in:
Ben Spiers 2015-04-12 00:13:13 +01:00
commit 75b41170d3
3 changed files with 11 additions and 80 deletions

View file

@ -55,7 +55,7 @@ sourceCompatibility = '1.7'
targetCompatibility = '1.7'
minecraft {
version = config.minecraft_version + "-" + config.forge_version
version = config.minecraft_version + "-" + config.forge_version + "-" + config.minecraft_version
}
processResources

View file

@ -1,7 +1,7 @@
minecraft_version=1.7.10
forge_version=10.13.2.1291
FMP_version=1.1.1.320
CCLIB_version=1.1.1.110
NEI_version=1.0.4.83
CCC_version=1.0.4.35
forge_version=10.13.3.1365
FMP_version=1.1.2.331
CCLIB_version=1.1.3.127
NEI_version=1.0.5.96
CCC_version=1.0.5.36
mod_version=8.1.1

View file

@ -25,30 +25,6 @@ import cofh.api.energy.IEnergyReceiver;
public final class CableUtils
{
private static Set<ForgeDirection> allSides = EnumSet.complementOf(EnumSet.of(ForgeDirection.UNKNOWN));
/**
* Gets all the connected energy acceptors, whether IC2-based or BuildCraft-based, surrounding a specific tile entity.
* @param tileEntity - center tile entity
* @return TileEntity[] of connected acceptors
*/
public static TileEntity[] getConnectedEnergyAcceptors(TileEntity tileEntity)
{
TileEntity[] acceptors = new TileEntity[] {null, null, null, null, null, null};
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
{
TileEntity acceptor = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj());
if(isEnergyAcceptor(acceptor))
{
acceptors[orientation.ordinal()] = acceptor;
}
}
return acceptors;
}
public static boolean isEnergyAcceptor(TileEntity tileEntity)
{
return (tileEntity instanceof IStrictEnergyAcceptor ||
@ -56,28 +32,6 @@ public final class CableUtils
(MekanismUtils.useRF() && tileEntity instanceof IEnergyReceiver));
}
/**
* Gets all the connected cables around a specific tile entity.
* @param tileEntity - center tile entity
* @return TileEntity[] of connected cables
*/
public static TileEntity[] getConnectedCables(TileEntity tileEntity)
{
TileEntity[] cables = new TileEntity[] {null, null, null, null, null, null};
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
{
TileEntity cable = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj());
if(isCable(cable))
{
cables[orientation.ordinal()] = cable;
}
}
return cables;
}
public static boolean isCable(TileEntity tileEntity)
{
if(tileEntity instanceof ITransmitterTile)
@ -87,16 +41,6 @@ public final class CableUtils
return false;
}
/**
* Gets all the adjacent connections to a TileEntity.
* @param tileEntity - center TileEntity
* @return boolean[] of adjacent connections
*/
public static boolean[] getConnections(TileEntity tileEntity)
{
return getConnections(tileEntity, allSides);
}
/**
* Gets the adjacent connections to a TileEntity, from a subset of its sides.
* @param tileEntity - center TileEntity
@ -127,6 +71,11 @@ public final class CableUtils
*/
public static boolean isValidAcceptorOnSide(TileEntity cableEntity, TileEntity tile, ForgeDirection side)
{
if(isCable(tile))
{
return false;
}
if(isEnergyAcceptor(tile) && isConnectable(cableEntity, tile, side))
{
return true;
@ -164,24 +113,6 @@ public final class CableUtils
(MekanismUtils.useRF() && tileEntity instanceof IEnergyProvider && ((IEnergyConnection)tileEntity).canConnectEnergy(side.getOpposite()));
}
/**
* Whether or not a cable can connect to a specific acceptor.
* @param side - side to check
* @param tile - cable TileEntity
* @return whether or not the cable can connect to the specific side
*/
public static boolean canConnectToAcceptor(ForgeDirection side, TileEntity tile)
{
if(tile == null)
{
return false;
}
TileEntity tileEntity = Coord4D.get(tile).getFromSide(side).getTileEntity(tile.getWorldObj());
return isConnectable(tile, tileEntity, side);
}
public static boolean isConnectable(TileEntity orig, TileEntity tileEntity, ForgeDirection side)
{
if(tileEntity instanceof ITransmitterTile)