A few minor cleanups
This commit is contained in:
parent
5fd1217837
commit
607eb31316
3 changed files with 5 additions and 15 deletions
|
@ -71,7 +71,8 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||||
|
|
||||||
robit.setEnergy(robit.getEnergy() + toGive);
|
robit.setEnergy(robit.getEnergy() + toGive);
|
||||||
setEnergy(getEnergy() - toGive);
|
setEnergy(getEnergy() - toGive);
|
||||||
} else if(entity instanceof EntityPlayer)
|
}
|
||||||
|
else if(entity instanceof EntityPlayer)
|
||||||
{
|
{
|
||||||
EntityPlayer player = (EntityPlayer) entity;
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
|
|
||||||
|
@ -122,7 +123,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||||
}
|
}
|
||||||
else if(MekanismUtils.useIC2() && itemstack.getItem() instanceof IElectricItem)
|
else if(MekanismUtils.useIC2() && itemstack.getItem() instanceof IElectricItem)
|
||||||
{
|
{
|
||||||
double sent = ElectricItem.manager.charge(itemstack, (int)(getEnergy()* general.TO_IC2), 4, true, false)* general.FROM_IC2;
|
double sent = ElectricItem.manager.charge(itemstack, (int)(getEnergy()*general.TO_IC2), 4, true, false)*general.FROM_IC2;
|
||||||
setEnergy(getEnergy() - sent);
|
setEnergy(getEnergy() - sent);
|
||||||
}
|
}
|
||||||
else if(MekanismUtils.useRF() && itemstack.getItem() instanceof IEnergyContainerItem)
|
else if(MekanismUtils.useRF() && itemstack.getItem() instanceof IEnergyContainerItem)
|
||||||
|
@ -130,9 +131,9 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||||
IEnergyContainerItem item = (IEnergyContainerItem)itemstack.getItem();
|
IEnergyContainerItem item = (IEnergyContainerItem)itemstack.getItem();
|
||||||
|
|
||||||
int itemEnergy = (int)Math.round(Math.min(Math.sqrt(item.getMaxEnergyStored(itemstack)), item.getMaxEnergyStored(itemstack) - item.getEnergyStored(itemstack)));
|
int itemEnergy = (int)Math.round(Math.min(Math.sqrt(item.getMaxEnergyStored(itemstack)), item.getMaxEnergyStored(itemstack) - item.getEnergyStored(itemstack)));
|
||||||
int toTransfer = (int)Math.round(Math.min(itemEnergy, (getEnergy()* general.TO_TE)));
|
int toTransfer = (int)Math.round(Math.min(itemEnergy, (getEnergy()*general.TO_TE)));
|
||||||
|
|
||||||
setEnergy(getEnergy() - (item.receiveEnergy(itemstack, toTransfer, false)* general.FROM_TE));
|
setEnergy(getEnergy() - (item.receiveEnergy(itemstack, toTransfer, false)*general.FROM_TE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,8 +313,6 @@ public class FusionReactor implements IFusionReactor
|
||||||
{
|
{
|
||||||
updatedThisTick = true;
|
updatedThisTick = true;
|
||||||
|
|
||||||
Mekanism.logger.info("Attempting to form multiblock");
|
|
||||||
|
|
||||||
Coord4D controllerPosition = Coord4D.get(controller);
|
Coord4D controllerPosition = Coord4D.get(controller);
|
||||||
Coord4D centreOfReactor = controllerPosition.getFromSide(ForgeDirection.DOWN, 2);
|
Coord4D centreOfReactor = controllerPosition.getFromSide(ForgeDirection.DOWN, 2);
|
||||||
|
|
||||||
|
@ -322,32 +320,24 @@ public class FusionReactor implements IFusionReactor
|
||||||
|
|
||||||
reactorBlocks.add(controller);
|
reactorBlocks.add(controller);
|
||||||
|
|
||||||
Mekanism.logger.info("Centre at " + centreOfReactor.toString());
|
|
||||||
if(!createFrame(centreOfReactor))
|
if(!createFrame(centreOfReactor))
|
||||||
{
|
{
|
||||||
unformMultiblock();
|
unformMultiblock();
|
||||||
Mekanism.logger.info("Reactor failed: Frame not complete.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mekanism.logger.info("Frame valid");
|
|
||||||
if(!addSides(centreOfReactor))
|
if(!addSides(centreOfReactor))
|
||||||
{
|
{
|
||||||
unformMultiblock();
|
unformMultiblock();
|
||||||
Mekanism.logger.info("Reactor failed: Sides not complete.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mekanism.logger.info("Side Blocks Valid");
|
|
||||||
if(!centreIsClear(centreOfReactor))
|
if(!centreIsClear(centreOfReactor))
|
||||||
{
|
{
|
||||||
unformMultiblock();
|
unformMultiblock();
|
||||||
Mekanism.logger.info("Blocks in chamber.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mekanism.logger.info("Centre is clear");
|
|
||||||
|
|
||||||
formed = true;
|
formed = true;
|
||||||
|
|
||||||
if(!controller.getWorldObj().isRemote)
|
if(!controller.getWorldObj().isRemote)
|
||||||
|
|
|
@ -236,7 +236,6 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
||||||
tritiumTank.setGas(new GasStack(GasRegistry.getGas("tritium"), dataStream.readInt()));
|
tritiumTank.setGas(new GasStack(GasRegistry.getGas("tritium"), dataStream.readInt()));
|
||||||
waterTank.setFluid(new FluidStack(FluidRegistry.getFluid("water"), dataStream.readInt()));
|
waterTank.setFluid(new FluidStack(FluidRegistry.getFluid("water"), dataStream.readInt()));
|
||||||
steamTank.setFluid(new FluidStack(FluidRegistry.getFluid("steam"), dataStream.readInt()));
|
steamTank.setFluid(new FluidStack(FluidRegistry.getFluid("steam"), dataStream.readInt()));
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(getReactor() != null)
|
else if(getReactor() != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue