Fix formatting
This commit is contained in:
parent
7506a5b7ad
commit
defaddecec
|
@ -42,7 +42,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
protected float quantaPerBlockFloat = 8F;
|
||||
protected int density = 1;
|
||||
protected int densityDir = -1;
|
||||
protected int temperature = 300;
|
||||
protected int temperature = 300;
|
||||
|
||||
protected int tickRate = 20;
|
||||
protected int renderPass = 1;
|
||||
|
@ -135,18 +135,18 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
}
|
||||
|
||||
int density = getDensity(world, x, y, z);
|
||||
if (density == Integer.MAX_VALUE)
|
||||
if (density == Integer.MAX_VALUE)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (this.density > density)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,19 +183,19 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
}
|
||||
|
||||
int density = getDensity(world, x, y, z);
|
||||
if (density == Integer.MAX_VALUE)
|
||||
if (density == Integer.MAX_VALUE)
|
||||
{
|
||||
block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
return true;
|
||||
block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (this.density > density)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
{
|
||||
return canDisplace(world, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
|
@ -309,7 +309,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
float lightUp = world.getLightBrightness(x, y + 1, z);
|
||||
return lightThis > lightUp ? lightThis : lightUp;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
@Override
|
||||
public int getMixedBrightnessForBlock(IBlockAccess world, int x, int y, int z)
|
||||
|
@ -321,7 +321,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
int lightThisExt = lightThis >> 16 & 255;
|
||||
int lightUpExt = lightUp >> 16 & 255;
|
||||
return (lightThisBase > lightUpBase ? lightThisBase : lightUpBase) |
|
||||
((lightThisExt > lightUpExt ? lightThisExt : lightUpExt) << 16);
|
||||
((lightThisExt > lightUpExt ? lightThisExt : lightUpExt) << 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -351,7 +351,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
}
|
||||
return ((BlockFluidBase)block).density;
|
||||
}
|
||||
|
||||
|
||||
public static final int getTemperature(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
@ -411,10 +411,10 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
|
||||
switch (side)
|
||||
{
|
||||
case 0: --x2; break;
|
||||
case 1: --z2; break;
|
||||
case 2: ++x2; break;
|
||||
case 3: ++z2; break;
|
||||
case 0: --x2; break;
|
||||
case 1: --z2; break;
|
||||
case 2: ++x2; break;
|
||||
case 3: ++z2; break;
|
||||
}
|
||||
|
||||
int otherDecay = quantaPerBlock - getQuantaValue(world, x2, y, z2);
|
||||
|
@ -440,14 +440,14 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
if (world.getBlock(x, y + 1, z) == this)
|
||||
{
|
||||
boolean flag =
|
||||
isBlockSolid(world, x, y, z - 1, 2) ||
|
||||
isBlockSolid(world, x, y, z + 1, 3) ||
|
||||
isBlockSolid(world, x - 1, y, z, 4) ||
|
||||
isBlockSolid(world, x + 1, y, z, 5) ||
|
||||
isBlockSolid(world, x, y + 1, z - 1, 2) ||
|
||||
isBlockSolid(world, x, y + 1, z + 1, 3) ||
|
||||
isBlockSolid(world, x - 1, y + 1, z, 4) ||
|
||||
isBlockSolid(world, x + 1, y + 1, z, 5);
|
||||
isBlockSolid(world, x, y, z - 1, 2) ||
|
||||
isBlockSolid(world, x, y, z + 1, 3) ||
|
||||
isBlockSolid(world, x - 1, y, z, 4) ||
|
||||
isBlockSolid(world, x + 1, y, z, 5) ||
|
||||
isBlockSolid(world, x, y + 1, z - 1, 2) ||
|
||||
isBlockSolid(world, x, y + 1, z + 1, 3) ||
|
||||
isBlockSolid(world, x - 1, y + 1, z, 4) ||
|
||||
isBlockSolid(world, x + 1, y + 1, z, 5);
|
||||
|
||||
if (flag)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ import net.minecraft.item.EnumRarity;
|
|||
*
|
||||
*/
|
||||
public class Fluid
|
||||
{
|
||||
{
|
||||
/** The unique identification name for this fluid. */
|
||||
protected final String fluidName;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class Fluid
|
|||
/**
|
||||
* Temperature of the fluid - completely arbitrary; higher temperature indicates that the fluid is
|
||||
* hotter than air.
|
||||
*
|
||||
*
|
||||
* Default value is approximately the real-life room temperature of water in degrees Kelvin.
|
||||
*/
|
||||
protected int temperature = 300;
|
||||
|
@ -72,10 +72,10 @@ public class Fluid
|
|||
* permissible.
|
||||
*
|
||||
* Default value is approximately the real-life density of water in m/s^2 (x10^-3).
|
||||
*
|
||||
*
|
||||
* Higher viscosity means that a fluid flows more slowly, like molasses.
|
||||
* Lower viscosity means that a fluid flows more quickly, like helium.
|
||||
*
|
||||
*
|
||||
*/
|
||||
protected int viscosity = 1000;
|
||||
|
||||
|
@ -198,7 +198,7 @@ public class Fluid
|
|||
{
|
||||
return getLocalizedName();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Use the FluidStack sensitive version above
|
||||
*/
|
||||
|
@ -258,7 +258,7 @@ public class Fluid
|
|||
{
|
||||
return this.isGaseous;
|
||||
}
|
||||
|
||||
|
||||
public EnumRarity getRarity()
|
||||
{
|
||||
return rarity;
|
||||
|
|
|
@ -20,16 +20,16 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
/**
|
||||
* Register simple items that contain fluids here. Useful for buckets, bottles, and things that have
|
||||
* ID/metadata mappings.
|
||||
*
|
||||
*
|
||||
* For more complex items, use {@link IFluidContainerItem} instead.
|
||||
*
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class FluidContainerRegistry
|
||||
{
|
||||
// Holder object that implements HashCode for an ItemStack,
|
||||
// the local maps are not guaranteed to have the same internal generic structure,
|
||||
// Holder object that implements HashCode for an ItemStack,
|
||||
// the local maps are not guaranteed to have the same internal generic structure,
|
||||
// but the external interface for checking ItemStacks will still exist.
|
||||
private static class ContainerKey
|
||||
{
|
||||
|
@ -89,7 +89,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Register a new fluid containing item.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* FluidStack containing the type and amount of the fluid stored in the item.
|
||||
* @param filledContainer
|
||||
|
@ -106,7 +106,7 @@ public abstract class FluidContainerRegistry
|
|||
/**
|
||||
* Register a new fluid containing item. The item is assumed to hold 1000 mB of fluid. Also
|
||||
* registers the Fluid if possible.
|
||||
*
|
||||
*
|
||||
* @param fluid
|
||||
* Fluid type that is stored in the item.
|
||||
* @param filledContainer
|
||||
|
@ -126,7 +126,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Register a new fluid containing item that does not have an empty container.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* FluidStack containing the type and amount of the fluid stored in the item.
|
||||
* @param filledContainer
|
||||
|
@ -141,7 +141,7 @@ public abstract class FluidContainerRegistry
|
|||
/**
|
||||
* Register a new fluid containing item that does not have an empty container. The item is
|
||||
* assumed to hold 1000 mB of fluid. Also registers the Fluid if possible.
|
||||
*
|
||||
*
|
||||
* @param fluid
|
||||
* Fluid type that is stored in the item.
|
||||
* @param filledContainer
|
||||
|
@ -159,7 +159,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Register a new fluid containing item.
|
||||
*
|
||||
*
|
||||
* @param data
|
||||
* See {@link FluidContainerData}.
|
||||
* @return True if container was successfully registered; false if it already is.
|
||||
|
@ -184,7 +184,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Determines the fluid type and amount inside a container.
|
||||
*
|
||||
*
|
||||
* @param container
|
||||
* The fluid container.
|
||||
* @return FluidStack representing stored fluid.
|
||||
|
@ -202,9 +202,9 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Attempts to fill an empty container with a fluid.
|
||||
*
|
||||
*
|
||||
* NOTE: Returns null on fail, NOT the empty container.
|
||||
*
|
||||
*
|
||||
* @param fluid
|
||||
* FluidStack containing the type and amount of fluid to fill.
|
||||
* @param container
|
||||
|
@ -228,7 +228,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Attempts to empty a full container.
|
||||
*
|
||||
*
|
||||
* @param container
|
||||
* ItemStack representing the full container.
|
||||
* @return Empty container if successful, otherwise null.
|
||||
|
@ -251,7 +251,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Determines the capacity of a full container.
|
||||
*
|
||||
*
|
||||
* @param container
|
||||
* The full container.
|
||||
* @return The containers capacity, or 0 if the ItemStack does not represent
|
||||
|
@ -264,7 +264,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Determines the capacity of a container.
|
||||
*
|
||||
*
|
||||
* @param fluid
|
||||
* FluidStack containing the type of fluid the capacity should be
|
||||
* determined for (ignored for full containers).
|
||||
|
|
|
@ -28,14 +28,14 @@ public abstract class FluidRegistry
|
|||
static BiMap<String, Fluid> fluids = HashBiMap.create();
|
||||
static BiMap<Fluid, Integer> fluidIDs = HashBiMap.create();
|
||||
static BiMap<Block, Fluid> fluidBlocks;
|
||||
|
||||
|
||||
public static final Fluid WATER = new Fluid("water") {
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
return StatCollector.translateToLocal("tile.water.name");
|
||||
}
|
||||
}.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.getUnlocalizedName());
|
||||
|
||||
|
||||
public static final Fluid LAVA = new Fluid("lava") {
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
|
@ -165,7 +165,7 @@ public abstract class FluidRegistry
|
|||
}
|
||||
return fluidBlocks.get(block);
|
||||
}
|
||||
|
||||
|
||||
public static class FluidRegisterEvent extends Event
|
||||
{
|
||||
public final String fluidName;
|
||||
|
|
|
@ -56,7 +56,7 @@ public class FluidStack
|
|||
{
|
||||
this(FluidRegistry.getFluid(fluidID), amount, nbt);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This provides a safe method for retrieving a FluidStack - if the Fluid is invalid, the stack
|
||||
* will return as null.
|
||||
|
@ -103,7 +103,7 @@ public class FluidStack
|
|||
{
|
||||
return FluidRegistry.getFluidID(fluid);
|
||||
}
|
||||
|
||||
|
||||
public String getLocalizedName()
|
||||
{
|
||||
return this.getFluid().getLocalizedName(this);
|
||||
|
|
Loading…
Reference in New Issue