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);
|
||||
setEnergy(getEnergy() - toGive);
|
||||
} else if(entity instanceof EntityPlayer)
|
||||
}
|
||||
else if(entity instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
|
||||
|
@ -122,7 +123,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
|||
}
|
||||
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);
|
||||
}
|
||||
else if(MekanismUtils.useRF() && itemstack.getItem() instanceof IEnergyContainerItem)
|
||||
|
@ -130,9 +131,9 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
|||
IEnergyContainerItem item = (IEnergyContainerItem)itemstack.getItem();
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -312,8 +312,6 @@ public class FusionReactor implements IFusionReactor
|
|||
public void formMultiblock()
|
||||
{
|
||||
updatedThisTick = true;
|
||||
|
||||
Mekanism.logger.info("Attempting to form multiblock");
|
||||
|
||||
Coord4D controllerPosition = Coord4D.get(controller);
|
||||
Coord4D centreOfReactor = controllerPosition.getFromSide(ForgeDirection.DOWN, 2);
|
||||
|
@ -322,32 +320,24 @@ public class FusionReactor implements IFusionReactor
|
|||
|
||||
reactorBlocks.add(controller);
|
||||
|
||||
Mekanism.logger.info("Centre at " + centreOfReactor.toString());
|
||||
if(!createFrame(centreOfReactor))
|
||||
{
|
||||
unformMultiblock();
|
||||
Mekanism.logger.info("Reactor failed: Frame not complete.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mekanism.logger.info("Frame valid");
|
||||
if(!addSides(centreOfReactor))
|
||||
{
|
||||
unformMultiblock();
|
||||
Mekanism.logger.info("Reactor failed: Sides not complete.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mekanism.logger.info("Side Blocks Valid");
|
||||
if(!centreIsClear(centreOfReactor))
|
||||
{
|
||||
unformMultiblock();
|
||||
Mekanism.logger.info("Blocks in chamber.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mekanism.logger.info("Centre is clear");
|
||||
|
||||
formed = true;
|
||||
|
||||
if(!controller.getWorldObj().isRemote)
|
||||
|
|
|
@ -236,7 +236,6 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
|||
tritiumTank.setGas(new GasStack(GasRegistry.getGas("tritium"), dataStream.readInt()));
|
||||
waterTank.setFluid(new FluidStack(FluidRegistry.getFluid("water"), dataStream.readInt()));
|
||||
steamTank.setFluid(new FluidStack(FluidRegistry.getFluid("steam"), dataStream.readInt()));
|
||||
|
||||
}
|
||||
else if(getReactor() != null)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue