Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -9,28 +9,23 @@ import net.minecraftforge.fluids.Fluid;
|
|||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
public class TileBloodTank extends TileBase
|
||||
{
|
||||
public class TileBloodTank extends TileBase {
|
||||
public static final int[] CAPACITIES = {16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65336, 131072, 262144, 524288};
|
||||
public int capacity;
|
||||
protected FluidTank tank;
|
||||
|
||||
public static final int[] CAPACITIES = { 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65336, 131072, 262144, 524288 };
|
||||
|
||||
public TileBloodTank(int meta)
|
||||
{
|
||||
public TileBloodTank(int meta) {
|
||||
capacity = CAPACITIES[meta] * Fluid.BUCKET_VOLUME;
|
||||
tank = new FluidTank(capacity);
|
||||
}
|
||||
|
||||
public TileBloodTank()
|
||||
{
|
||||
public TileBloodTank() {
|
||||
capacity = CAPACITIES[0] * Fluid.BUCKET_VOLUME;
|
||||
tank = new FluidTank(capacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(NBTTagCompound tagCompound)
|
||||
{
|
||||
public void deserialize(NBTTagCompound tagCompound) {
|
||||
super.deserialize(tagCompound);
|
||||
tank.readFromNBT(tagCompound.getCompoundTag(Constants.NBT.TANK));
|
||||
capacity = tagCompound.getInteger(Constants.NBT.ALTAR_CAPACITY);
|
||||
|
@ -38,8 +33,7 @@ public class TileBloodTank extends TileBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound serialize(NBTTagCompound tagCompound)
|
||||
{
|
||||
public NBTTagCompound serialize(NBTTagCompound tagCompound) {
|
||||
super.serialize(tagCompound);
|
||||
if (tank.getFluidAmount() != 0)
|
||||
tagCompound.setTag(Constants.NBT.TANK, tank.writeToNBT(new NBTTagCompound()));
|
||||
|
@ -47,45 +41,38 @@ public class TileBloodTank extends TileBase
|
|||
return tagCompound;
|
||||
}
|
||||
|
||||
public int getCapacity()
|
||||
{
|
||||
public int getCapacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public FluidTank getTank()
|
||||
{
|
||||
public FluidTank getTank() {
|
||||
return tank;
|
||||
}
|
||||
|
||||
public Fluid getClientRenderFluid()
|
||||
{
|
||||
public Fluid getClientRenderFluid() {
|
||||
if (tank != null && tank.getFluid() != null)
|
||||
return tank.getFluid().getFluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
public float getRenderHeight()
|
||||
{
|
||||
public float getRenderHeight() {
|
||||
if (tank != null && tank.getFluidAmount() > 0)
|
||||
return (float) tank.getFluidAmount() / (float) getCapacity();
|
||||
return 0F;
|
||||
}
|
||||
|
||||
public int getComparatorOutput()
|
||||
{
|
||||
public int getComparatorOutput() {
|
||||
return tank.getFluidAmount() > 0 ? (int) (1 + ((double) tank.getFluidAmount() / (double) tank.getCapacity()) * 14) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
|
||||
{
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
|
||||
{
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
|
||||
return (T) tank;
|
||||
return super.getCapability(capability, facing);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue