v5.5.6 Beta #24
*Removed Mechanical Pipe & Universal Cable redstone toggle. *Fixed render crash. *Fixed version println.
This commit is contained in:
parent
8f6ad2688e
commit
a667f9a3b6
12 changed files with 73 additions and 132 deletions
|
@ -83,6 +83,11 @@ public class MekanismRenderer
|
|||
|
||||
public static void renderObject(Model3D object)
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
renderBlocks.renderMaxX = object.maxX;
|
||||
renderBlocks.renderMinX = object.minX;
|
||||
renderBlocks.renderMaxY = object.maxY;
|
||||
|
|
|
@ -44,14 +44,11 @@ public class RenderMechanicalPipe extends TileEntitySpecialRenderer
|
|||
|
||||
boolean[] connectable = PipeUtils.getConnections(tileEntity);
|
||||
|
||||
if(tileEntity.canTransferLiquids())
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
if(connectable[i])
|
||||
{
|
||||
if(connectable[i])
|
||||
{
|
||||
model.renderSide(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
model.renderSide(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,15 +67,12 @@ public class RenderMechanicalPipe extends TileEntitySpecialRenderer
|
|||
bindTextureByName(tileEntity.refLiquid.getTextureSheet());
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
|
||||
if(tileEntity.canTransferLiquids())
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
if(connectable[i])
|
||||
{
|
||||
if(connectable[i])
|
||||
{
|
||||
int[] displayList = getListAndRender(ForgeDirection.getOrientation(i), tileEntity.refLiquid, tileEntity.worldObj);
|
||||
GL11.glCallList(displayList[Math.max(3, (int)((float)tileEntity.liquidScale*(stages-1)))]);
|
||||
}
|
||||
int[] displayList = getListAndRender(ForgeDirection.getOrientation(i), tileEntity.refLiquid, tileEntity.worldObj);
|
||||
GL11.glCallList(displayList[Math.max(3, (int)((float)tileEntity.liquidScale*(stages-1)))]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,14 +40,11 @@ public class RenderUniversalCable extends TileEntitySpecialRenderer
|
|||
|
||||
boolean[] connectable = CableUtils.getConnections(tileEntity);
|
||||
|
||||
if(tileEntity.canTransferEnergy())
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
if(connectable[i])
|
||||
{
|
||||
if(connectable[i])
|
||||
{
|
||||
model.renderSide(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
model.renderSide(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,14 +60,11 @@ public class RenderUniversalCable extends TileEntitySpecialRenderer
|
|||
bindTextureByName("/mods/mekanism/textures/items/LiquidEnergy.png");
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
|
||||
if(tileEntity.canTransferEnergy())
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
for(int i = 0; i < 6; i++)
|
||||
if(connectable[i])
|
||||
{
|
||||
if(connectable[i])
|
||||
{
|
||||
renderEnergy(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
renderEnergy(ForgeDirection.getOrientation(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,17 +28,14 @@ public final class CableUtils
|
|||
{
|
||||
TileEntity[] acceptors = new TileEntity[] {null, null, null, null, null, null};
|
||||
|
||||
if(!(tileEntity instanceof IUniversalCable) || ((IUniversalCable)tileEntity).canTransferEnergy())
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity acceptor = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(acceptor instanceof IStrictEnergyAcceptor || acceptor instanceof IEnergySink || (acceptor instanceof IPowerReceptor && !(acceptor instanceof IUniversalCable) && Mekanism.hooks.BuildCraftLoaded))
|
||||
{
|
||||
acceptors[orientation.ordinal()] = acceptor;
|
||||
}
|
||||
}
|
||||
TileEntity acceptor = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(acceptor instanceof IStrictEnergyAcceptor || acceptor instanceof IEnergySink || (acceptor instanceof IPowerReceptor && !(acceptor instanceof IUniversalCable) && Mekanism.hooks.BuildCraftLoaded))
|
||||
{
|
||||
acceptors[orientation.ordinal()] = acceptor;
|
||||
}
|
||||
}
|
||||
|
||||
return acceptors;
|
||||
|
@ -53,17 +50,14 @@ public final class CableUtils
|
|||
{
|
||||
TileEntity[] cables = new TileEntity[] {null, null, null, null, null, null};
|
||||
|
||||
if(!(tileEntity instanceof IUniversalCable) || ((IUniversalCable)tileEntity).canTransferEnergy())
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity cable = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(cable instanceof IUniversalCable && ((IUniversalCable)cable).canTransferEnergy())
|
||||
{
|
||||
cables[orientation.ordinal()] = cable;
|
||||
}
|
||||
}
|
||||
TileEntity cable = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(cable instanceof IUniversalCable)
|
||||
{
|
||||
cables[orientation.ordinal()] = cable;
|
||||
}
|
||||
}
|
||||
|
||||
return cables;
|
||||
|
@ -124,17 +118,14 @@ public final class CableUtils
|
|||
{
|
||||
TileEntity[] outputters = new TileEntity[] {null, null, null, null, null, null};
|
||||
|
||||
if(!(tileEntity instanceof IUniversalCable) || ((IUniversalCable)tileEntity).canTransferEnergy())
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity outputter = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(outputter instanceof ICableOutputter && ((ICableOutputter)outputter).canOutputTo(orientation.getOpposite()) || outputter instanceof IEnergySource && ((IEnergySource)outputter).emitsEnergyTo(tileEntity, MekanismUtils.toIC2Direction(orientation.getOpposite())))
|
||||
{
|
||||
outputters[orientation.ordinal()] = outputter;
|
||||
}
|
||||
}
|
||||
TileEntity outputter = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(outputter instanceof ICableOutputter && ((ICableOutputter)outputter).canOutputTo(orientation.getOpposite()) || outputter instanceof IEnergySource && ((IEnergySource)outputter).emitsEnergyTo(tileEntity, MekanismUtils.toIC2Direction(orientation.getOpposite())))
|
||||
{
|
||||
outputters[orientation.ordinal()] = outputter;
|
||||
}
|
||||
}
|
||||
|
||||
return outputters;
|
||||
|
|
|
@ -288,7 +288,7 @@ public class EnergyNetwork
|
|||
|
||||
public void loopThrough(Object3D location)
|
||||
{
|
||||
if(location.getTileEntity(worldObj) instanceof IUniversalCable && ((IUniversalCable)location.getTileEntity(worldObj)).canTransferEnergy())
|
||||
if(location.getTileEntity(worldObj) instanceof IUniversalCable)
|
||||
{
|
||||
iterated.add(location);
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ public class EnergyNetwork
|
|||
{
|
||||
TileEntity tileEntity = obj.getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IUniversalCable && ((IUniversalCable)tileEntity).canTransferEnergy())
|
||||
if(tileEntity instanceof IUniversalCable)
|
||||
{
|
||||
loopThrough(obj);
|
||||
}
|
||||
|
|
|
@ -9,12 +9,6 @@ import net.minecraftforge.liquids.LiquidStack;
|
|||
*/
|
||||
public interface IMechanicalPipe
|
||||
{
|
||||
/**
|
||||
* Whether or not this pipe can transfer liquids.
|
||||
* @return if the pipe can transfer liquids
|
||||
*/
|
||||
public boolean canTransferLiquids();
|
||||
|
||||
/**
|
||||
* Called when liquid is transferred through this pipe.
|
||||
* @param liquidStack - the liquid transferred
|
||||
|
|
|
@ -7,12 +7,6 @@ package mekanism.common;
|
|||
*/
|
||||
public interface IUniversalCable
|
||||
{
|
||||
/**
|
||||
* Whether or not this cable can transfer energy.
|
||||
* @return if the cable can transfer energy
|
||||
*/
|
||||
public boolean canTransferEnergy();
|
||||
|
||||
/**
|
||||
* Gets the EnergyNetwork currently in use by this cable segment.
|
||||
* @return EnergyNetwork this cable is using
|
||||
|
|
|
@ -250,7 +250,7 @@ public class LiquidNetwork
|
|||
{
|
||||
TileEntity tileEntity = obj.getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IMechanicalPipe && ((IMechanicalPipe)tileEntity).canTransferLiquids())
|
||||
if(tileEntity instanceof IMechanicalPipe)
|
||||
{
|
||||
loopThrough(obj);
|
||||
}
|
||||
|
|
|
@ -19,17 +19,14 @@ public final class PipeUtils
|
|||
{
|
||||
TileEntity[] pipes = new TileEntity[] {null, null, null, null, null, null};
|
||||
|
||||
if(!(tileEntity instanceof IMechanicalPipe) || ((IMechanicalPipe)tileEntity).canTransferLiquids())
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity pipe = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(pipe instanceof IMechanicalPipe && ((IMechanicalPipe)pipe).canTransferLiquids())
|
||||
{
|
||||
pipes[orientation.ordinal()] = pipe;
|
||||
}
|
||||
}
|
||||
TileEntity pipe = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(pipe instanceof IMechanicalPipe)
|
||||
{
|
||||
pipes[orientation.ordinal()] = pipe;
|
||||
}
|
||||
}
|
||||
|
||||
return pipes;
|
||||
|
@ -86,17 +83,14 @@ public final class PipeUtils
|
|||
{
|
||||
ITankContainer[] acceptors = new ITankContainer[] {null, null, null, null, null, null};
|
||||
|
||||
if(!(tileEntity instanceof IMechanicalPipe) || ((IMechanicalPipe)tileEntity).canTransferLiquids())
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity acceptor = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(acceptor instanceof ITankContainer && !(acceptor instanceof IMechanicalPipe))
|
||||
{
|
||||
acceptors[orientation.ordinal()] = (ITankContainer)acceptor;
|
||||
}
|
||||
}
|
||||
TileEntity acceptor = Object3D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.worldObj);
|
||||
|
||||
if(acceptor instanceof ITankContainer && !(acceptor instanceof IMechanicalPipe))
|
||||
{
|
||||
acceptors[orientation.ordinal()] = (ITankContainer)acceptor;
|
||||
}
|
||||
}
|
||||
|
||||
return acceptors;
|
||||
|
|
|
@ -38,12 +38,6 @@ public class TileEntityMechanicalPipe extends TileEntity implements IMechanicalP
|
|||
/** The scale (0F -> 1F) of this pipe's liquid level. */
|
||||
public float liquidScale;
|
||||
|
||||
@Override
|
||||
public boolean canTransferLiquids()
|
||||
{
|
||||
return worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransfer(LiquidStack liquidStack)
|
||||
{
|
||||
|
@ -91,23 +85,17 @@ public class TileEntityMechanicalPipe extends TileEntity implements IMechanicalP
|
|||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
if(canTransferLiquids())
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tileEntity = Object3D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IMechanicalPipe && ((IMechanicalPipe)tileEntity).canTransferLiquids())
|
||||
{
|
||||
getNetwork().merge(((IMechanicalPipe)tileEntity).getNetwork());
|
||||
}
|
||||
}
|
||||
TileEntity tileEntity = Object3D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
|
||||
getNetwork().refresh();
|
||||
}
|
||||
else {
|
||||
getNetwork().split(this);
|
||||
if(tileEntity instanceof IMechanicalPipe)
|
||||
{
|
||||
getNetwork().merge(((IMechanicalPipe)tileEntity).getNetwork());
|
||||
}
|
||||
}
|
||||
|
||||
getNetwork().refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,31 +65,19 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa
|
|||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
if(canTransferEnergy())
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
TileEntity tileEntity = Object3D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IUniversalCable && ((IUniversalCable)tileEntity).canTransferEnergy())
|
||||
{
|
||||
getNetwork().merge(((IUniversalCable)tileEntity).getNetwork());
|
||||
}
|
||||
}
|
||||
TileEntity tileEntity = Object3D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
|
||||
getNetwork().refresh();
|
||||
}
|
||||
else {
|
||||
getNetwork().split(this);
|
||||
if(tileEntity instanceof IUniversalCable)
|
||||
{
|
||||
getNetwork().merge(((IUniversalCable)tileEntity).getNetwork());
|
||||
}
|
||||
}
|
||||
|
||||
getNetwork().refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTransferEnergy()
|
||||
{
|
||||
return worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPowerProvider(IPowerProvider provider) {}
|
||||
|
@ -108,7 +96,7 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa
|
|||
{
|
||||
ArrayList<TileEntity> ignored = new ArrayList<TileEntity>();
|
||||
ignored.add(Object3D.get(this).getFromSide(from).getTileEntity(worldObj));
|
||||
return canTransferEnergy() ? (int)Math.min(100, getNetwork().getEnergyNeeded(ignored)*Mekanism.TO_BC) : 0;
|
||||
return (int)Math.min(100, getNetwork().getEnergyNeeded(ignored)*Mekanism.TO_BC);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -92,7 +92,6 @@ public class Version
|
|||
|
||||
if(split.length != 3)
|
||||
{
|
||||
System.out.println(split.length);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue