Fix a few bugs!
This commit is contained in:
parent
97bf92375a
commit
eb8e02a39a
4 changed files with 30 additions and 25 deletions
|
@ -100,7 +100,7 @@ public class CommonProxy
|
||||||
GameRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner");
|
GameRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner");
|
||||||
GameRegistry.registerTileEntity(TileEntityObsidianTNT.class, "ObsidianTNT");
|
GameRegistry.registerTileEntity(TileEntityObsidianTNT.class, "ObsidianTNT");
|
||||||
GameRegistry.registerTileEntity(TileEntityRotaryCondensentrator.class, "RotaryCondensentrator");
|
GameRegistry.registerTileEntity(TileEntityRotaryCondensentrator.class, "RotaryCondensentrator");
|
||||||
GameRegistry.registerTileEntity(TileEntityTeleporter.class, "Teleporter");
|
GameRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -269,11 +269,7 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
|
||||||
|
|
||||||
if(handler.canInterface(side.getOpposite()))
|
if(handler.canInterface(side.getOpposite()))
|
||||||
{
|
{
|
||||||
if(handler.receiveEnergy(side.getOpposite(), 1, true) > 0)
|
if(handler.getMaxEnergyStored(side.getOpposite()) - handler.getEnergyStored(side.getOpposite()) > 0)
|
||||||
{
|
|
||||||
toReturn.add(acceptor);
|
|
||||||
}
|
|
||||||
else if(handler.getMaxEnergyStored(side.getOpposite()) - handler.getEnergyStored(side.getOpposite()) > 0)
|
|
||||||
{
|
{
|
||||||
toReturn.add(acceptor);
|
toReturn.add(acceptor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,6 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, IIt
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
list.add(EnumColor.BRIGHT_GREEN + "Stored Energy: " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
|
list.add(EnumColor.BRIGHT_GREEN + "Stored Energy: " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
|
||||||
list.add(EnumColor.BRIGHT_GREEN + "Voltage: " + EnumColor.GREY + (getVoltage(itemstack)*Mekanism.FROM_UE) + "v");
|
|
||||||
|
|
||||||
if(hasTank(itemstack))
|
if(hasTank(itemstack))
|
||||||
{
|
{
|
||||||
|
|
|
@ -151,10 +151,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||||
|
|
||||||
if(worldObj.rand.nextInt(3) == 2)
|
if(worldObj.rand.nextInt(3) == 2)
|
||||||
{
|
{
|
||||||
ArrayList data = new ArrayList();
|
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Object3D.get(this), getParticlePacket(new ArrayList())), Object3D.get(this), 40D);
|
||||||
data.add(2);
|
|
||||||
|
|
||||||
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Object3D.get(this), data), Object3D.get(this), 40D);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,30 +317,35 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||||
{
|
{
|
||||||
dumpType = GasRegistry.getGas(dataStream.readInt());
|
dumpType = GasRegistry.getGas(dataStream.readInt());
|
||||||
}
|
}
|
||||||
else if(type == 2)
|
|
||||||
{
|
|
||||||
spawnParticle();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.handlePacketData(dataStream);
|
super.handlePacketData(dataStream);
|
||||||
|
|
||||||
int amount = dataStream.readInt();
|
int type = dataStream.readInt();
|
||||||
|
|
||||||
if(amount != 0)
|
if(type == 0)
|
||||||
{
|
{
|
||||||
waterTank.setFluid(new FluidStack(FluidRegistry.WATER, amount));
|
int amount = dataStream.readInt();
|
||||||
|
|
||||||
|
if(amount != 0)
|
||||||
|
{
|
||||||
|
waterTank.setFluid(new FluidStack(FluidRegistry.WATER, amount));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
waterTank.setFluid(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
oxygenStored = dataStream.readInt();
|
||||||
|
hydrogenStored = dataStream.readInt();
|
||||||
|
outputType = GasRegistry.getGas(dataStream.readInt());
|
||||||
|
dumpType = GasRegistry.getGas(dataStream.readInt());
|
||||||
}
|
}
|
||||||
else {
|
else if(type == 1)
|
||||||
waterTank.setFluid(null);
|
{
|
||||||
|
spawnParticle();
|
||||||
}
|
}
|
||||||
|
|
||||||
oxygenStored = dataStream.readInt();
|
|
||||||
hydrogenStored = dataStream.readInt();
|
|
||||||
outputType = GasRegistry.getGas(dataStream.readInt());
|
|
||||||
dumpType = GasRegistry.getGas(dataStream.readInt());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -351,6 +353,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||||
{
|
{
|
||||||
super.getNetworkedData(data);
|
super.getNetworkedData(data);
|
||||||
|
|
||||||
|
data.add(0);
|
||||||
if(waterTank.getFluid() != null)
|
if(waterTank.getFluid() != null)
|
||||||
{
|
{
|
||||||
data.add(waterTank.getFluid().amount);
|
data.add(waterTank.getFluid().amount);
|
||||||
|
@ -367,6 +370,13 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList getParticlePacket(ArrayList data)
|
||||||
|
{
|
||||||
|
super.getNetworkedData(data);
|
||||||
|
data.add(1);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbtTags)
|
public void readFromNBT(NBTTagCompound nbtTags)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue