Fixed rendering
This commit is contained in:
parent
a309e88b2b
commit
ffd683a3f3
9 changed files with 26 additions and 29 deletions
|
@ -159,7 +159,6 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
|||
|
||||
if(sent > 0 && FMLCommonHandler.instance().getEffectiveSide().isServer())
|
||||
{
|
||||
refGas = stack.getGas();
|
||||
didTransfer = true;
|
||||
transferDelay = 2;
|
||||
}
|
||||
|
@ -169,7 +168,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
|||
|
||||
public synchronized int emit(GasStack stack)
|
||||
{
|
||||
if(refGas != null && refGas != stack.getGas())
|
||||
if(gasStored != null && gasStored.getGas() != stack.getGas())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -212,7 +211,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
|
|||
|
||||
if(didTransfer != prevTransfer || needsUpdate)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new GasTransferEvent(this, refGas != null ? refGas.getID() : -1, didTransfer, getScale()));
|
||||
MinecraftForge.EVENT_BUS.post(new GasTransferEvent(this, gasStored != null ? gasStored.getGas().getID() : -1, didTransfer, getScale()));
|
||||
needsUpdate = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ public class GasTank
|
|||
{
|
||||
if(stored != null)
|
||||
{
|
||||
stored.write(nbtTags);
|
||||
nbtTags.setCompoundTag("stored", stored.write(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
nbtTags.setInteger("maxGas", maxGas);
|
||||
|
|
|
@ -341,7 +341,7 @@ public class RenderPartTransmitter implements IIconRegister
|
|||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
renderSide(side, transmitter);
|
||||
renderSide(side, transmitter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -160,7 +160,6 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
|
|||
|
||||
if(doTransfer && fluidSent > 0 && FMLCommonHandler.instance().getEffectiveSide().isServer())
|
||||
{
|
||||
refFluid = fluidToSend.getFluid();
|
||||
didTransfer = true;
|
||||
transferDelay = 2;
|
||||
}
|
||||
|
@ -216,7 +215,7 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
|
|||
|
||||
if(didTransfer != prevTransfer || needsUpdate)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new FluidTransferEvent(this, refFluid != null ? refFluid.getID() : -1, didTransfer, getScale()));
|
||||
MinecraftForge.EVENT_BUS.post(new FluidTransferEvent(this, fluidStored != null ? fluidStored.getFluid().getID() : -1, didTransfer, getScale()));
|
||||
needsUpdate = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ public class MultipartMekanism implements IPartFactory, IPartConverter
|
|||
{
|
||||
MultiPartRegistry.registerConverter(this);
|
||||
MultiPartRegistry.registerParts(this, new String[] {"mekanism:universal_cable", "mekanism:mechanical_pipe", "mekanism:pressurized_tube", "mekanism:logistical_transporter"});
|
||||
|
||||
MultipartGenerator.registerPassThroughInterface("mekanism.api.transmitters.ITransmitter");
|
||||
MultipartGenerator.registerPassThroughInterface("ic2.api.energy.tile.IEnergySink");
|
||||
MultipartGenerator.registerPassThroughInterface("cofh.api.energy.IEnergyHandler");
|
||||
|
|
|
@ -37,9 +37,7 @@ public class PartMechanicalPipe extends PartTransmitter<FluidNetwork> implements
|
|||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
|
||||
{
|
||||
if(!world().isRemote)
|
||||
{
|
||||
if(lastWrite != null)
|
||||
|
@ -55,6 +53,8 @@ public class PartMechanicalPipe extends PartTransmitter<FluidNetwork> implements
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -226,21 +226,18 @@ public class PartMechanicalPipe extends PartTransmitter<FluidNetwork> implements
|
|||
{
|
||||
if(!world().isRemote)
|
||||
{
|
||||
if(!world().isRemote)
|
||||
{
|
||||
if(cacheFluid != null)
|
||||
if(cacheFluid != null)
|
||||
{
|
||||
if(getTransmitterNetwork().fluidStored == null)
|
||||
{
|
||||
if(getTransmitterNetwork().fluidStored == null)
|
||||
{
|
||||
getTransmitterNetwork().fluidStored = cacheFluid;
|
||||
}
|
||||
else {
|
||||
getTransmitterNetwork().fluidStored.amount += cacheFluid.amount;
|
||||
}
|
||||
|
||||
cacheFluid = null;
|
||||
getTransmitterNetwork().fluidStored = cacheFluid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
getTransmitterNetwork().fluidStored.amount += cacheFluid.amount;
|
||||
}
|
||||
|
||||
cacheFluid = null;
|
||||
}
|
||||
|
||||
if(isActive)
|
||||
{
|
||||
|
|
|
@ -67,9 +67,7 @@ public class PartPressurizedTube extends PartTransmitter<GasNetwork>
|
|||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
|
||||
{
|
||||
if(!world().isRemote)
|
||||
{
|
||||
if(lastWrite != null)
|
||||
|
@ -85,6 +83,8 @@ public class PartPressurizedTube extends PartTransmitter<GasNetwork>
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -185,9 +185,7 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
|
|||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
|
||||
{
|
||||
if(!world().isRemote)
|
||||
{
|
||||
Mekanism.ic2Registered.remove(Object3D.get(tile()));
|
||||
|
@ -195,6 +193,8 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
|
|||
|
||||
getTransmitterNetwork().electricityStored -= lastWrite;
|
||||
}
|
||||
|
||||
super.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -104,6 +104,7 @@ public class PacketTransmitterUpdate implements IMekanismPacket
|
|||
|
||||
if(tileEntity != null)
|
||||
{
|
||||
System.out.println("UPDATE " + gasType + " " + didGasTransfer + " " + scale);
|
||||
((ITransmitter<GasNetwork>)tileEntity).getTransmitterNetwork().refGas = gasType;
|
||||
((ITransmitter<GasNetwork>)tileEntity).getTransmitterNetwork().didTransfer = didGasTransfer;
|
||||
((ITransmitter<GasNetwork>)tileEntity).getTransmitterNetwork().definedScale = scale;
|
||||
|
|
Loading…
Reference in a new issue