Updated FML:

MinecraftForge/FML@03fb1879d7 Fix obf error when right clicking a Empty Map.
MinecraftForge/FML@6bb9b8b953 Clean up FMLEventChannel. Closes #367.
MinecraftForge/FML@b7b3450dcd Update MCP mapping snapshot to latest crowdsourced names.
MinecraftForge/FML@8c9e8b5270 Fix isRemote, this is integral to so many parts of the code, everyone knows it by this name, People should not change it.
This commit is contained in:
Lex Manos committed 2014-02-05 01:14:24 -08:00
1 parent 9d919f8ac9
commit e68577ffd3
188 files changed
+1869 -1870

No files matched your search

@@ -24,7 +24,6 @@ import net.minecraft.world.World;
* @author King Lemming, OvermindDL1
*
*/
@SuppressWarnings("unused")
public abstract class BlockFluidBase extends Block implements IFluidBlock
{
protected final static Map<Block, Boolean> defaultDisplacements = Maps.newHashMap();
@@ -54,9 +53,9 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public BlockFluidBase(Fluid fluid, Material material)
{
super(material);
this.func_149676_a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.func_149675_a(true);
this.func_149649_H();
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setTickRandomly(true);
this.disableStats();
this.fluidName = fluid.getName();
this.density = fluid.density;
@@ -115,9 +114,9 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
*/
public boolean canDisplace(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) return true;
if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true;
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block == this)
{
@@ -129,8 +128,8 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
return displacements.get(block);
}
Material material = block.func_149688_o();
if (material.blocksMovement() || material == Material.field_151567_E)
Material material = block.getMaterial();
if (material.blocksMovement() || material == Material.portal)
{
return false;
}
@@ -156,12 +155,12 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
*/
public boolean displaceIfPossible(World world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z))
if (world.getBlock(x, y, z).isAir(world, x, y, z))
{
return true;
}
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block == this)
{
return false;
@@ -171,14 +170,14 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
{
if (displacements.get(block))
{
block.func_149697_b(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
return true;
}
return false;
}
Material material = block.func_149688_o();
if (material.blocksMovement() || material == Material.field_151567_E)
Material material = block.getMaterial();
if (material.blocksMovement() || material == Material.portal)
{
return false;
}
@@ -186,7 +185,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
int density = getDensity(world, x, y, z);
if (density == Integer.MAX_VALUE)
{
block.func_149697_b(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
return true;
}
@@ -203,21 +202,21 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public abstract int getQuantaValue(IBlockAccess world, int x, int y, int z);
@Override
public abstract boolean func_149678_a(int meta, boolean fullHit);
public abstract boolean canCollideCheck(int meta, boolean fullHit);
public abstract int getMaxRenderHeightMeta();
/* BLOCK FUNCTIONS */
@Override
public void func_149726_b(World world, int x, int y, int z)
public void onBlockAdded(World world, int x, int y, int z)
{
world.func_147464_a(x, y, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, this, tickRate);
}
@Override
public void func_149695_a(World world, int x, int y, int z, Block block)
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
world.func_147464_a(x, y, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, this, tickRate);
}
// Used to prevent updates on chunk generation
@@ -228,37 +227,37 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
@Override
public boolean func_149655_b(IBlockAccess world, int x, int y, int z)
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z)
{
return true;
}
@Override
public AxisAlignedBB func_149668_a(World world, int x, int y, int z)
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
return null;
}
@Override
public Item func_149650_a(int par1, Random par2Random, int par3)
public Item getItemDropped(int par1, Random par2Random, int par3)
{
return null;
}
@Override
public int func_149745_a(Random par1Random)
public int quantityDropped(Random par1Random)
{
return 0;
}
@Override
public int func_149738_a(World world)
public int tickRate(World world)
{
return tickRate;
}
@Override
public void func_149640_a(World world, int x, int y, int z, Entity entity, Vec3 vec)
public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec)
{
if (densityDir > 0) return;
Vec3 vec_flow = this.getFlowVector(world, x, y, z);
@@ -279,19 +278,19 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
@Override
public int func_149645_b()
public int getRenderType()
{
return FluidRegistry.renderIdFluid;
}
@Override
public boolean func_149662_c()
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean func_149686_d()
public boolean renderAsNormalBlock()
{
return false;
}
@@ -307,7 +306,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
*/
@Override
public int func_149677_c(IBlockAccess world, int x, int y, int z)
public int getMixedBrightnessForBlock(IBlockAccess world, int x, int y, int z)
{
int lightThis = world.getLightBrightnessForSkyBlocks(x, y, z, 0);
int lightUp = world.getLightBrightnessForSkyBlocks(x, y + 1, z, 0);
@@ -320,26 +319,26 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
@Override
public int func_149701_w()
public int getRenderBlockPass()
{
return renderPass;
}
@Override
public boolean func_149646_a(IBlockAccess world, int x, int y, int z, int side)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block != this)
{
return !block.func_149662_c();
return !block.isOpaqueCube();
}
return block.func_149688_o() == this.func_149688_o() ? false : super.func_149646_a(world, x, y, z, side);
return block.getMaterial() == this.getMaterial() ? false : super.shouldSideBeRendered(world, x, y, z, side);
}
/* FLUID FUNCTIONS */
public static final int getDensity(IBlockAccess world, int x, int y, int z)
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (!(block instanceof BlockFluidBase))
{
return Integer.MAX_VALUE;
@@ -349,7 +348,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public static final int getTemperature(IBlockAccess world, int x, int y, int z)
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (!(block instanceof BlockFluidBase))
{
return Integer.MAX_VALUE;
@@ -359,8 +358,8 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public static double getFlowDirection(IBlockAccess world, int x, int y, int z)
{
Block block = world.func_147439_a(x, y, z);
if (!block.func_149688_o().isLiquid())
Block block = world.getBlock(x, y, z);
if (!block.getMaterial().isLiquid())
{
return -1000.0;
}
@@ -415,7 +414,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
int otherDecay = quantaPerBlock - getQuantaValue(world, x2, y, z2);
if (otherDecay >= quantaPerBlock)
{
if (!world.func_147439_a(x2, y, z2).func_149688_o().blocksMovement())
if (!world.getBlock(x2, y, z2).getMaterial().blocksMovement())
{
otherDecay = quantaPerBlock - getQuantaValue(world, x2, y - 1, z2);
if (otherDecay >= 0)
@@ -432,17 +431,17 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
}
if (world.func_147439_a(x, y + 1, z) == this)
if (world.getBlock(x, y + 1, z) == this)
{
boolean flag =
func_149747_d(world, x, y, z - 1, 2) ||
func_149747_d(world, x, y, z + 1, 3) ||
func_149747_d(world, x - 1, y, z, 4) ||
func_149747_d(world, x + 1, y, z, 5) ||
func_149747_d(world, x, y + 1, z - 1, 2) ||
func_149747_d(world, x, y + 1, z + 1, 3) ||
func_149747_d(world, x - 1, y + 1, z, 4) ||
func_149747_d(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)
{
@@ -43,12 +43,12 @@ public class BlockFluidClassic extends BlockFluidBase
@Override
public int getQuantaValue(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z) == Blocks.air)
if (world.getBlock(x, y, z) == Blocks.air)
{
return 0;
}
if (world.func_147439_a(x, y, z) != this)
if (world.getBlock(x, y, z) != this)
{
return -1;
}
@@ -58,7 +58,7 @@ public class BlockFluidClassic extends BlockFluidBase
}
@Override
public boolean func_149678_a(int meta, boolean fullHit)
public boolean canCollideCheck(int meta, boolean fullHit)
{
return fullHit && meta == 0;
}
@@ -81,7 +81,7 @@ public class BlockFluidClassic extends BlockFluidBase
}
@Override
public void func_149674_a(World world, int x, int y, int z, Random rand)
public void updateTick(World world, int x, int y, int z, Random rand)
{
int quantaRemaining = quantaPerBlock - world.getBlockMetadata(x, y, z);
int expQuanta = -101;
@@ -91,11 +91,11 @@ public class BlockFluidClassic extends BlockFluidBase
{
int y2 = y - densityDir;
if (world.func_147439_a(x, y2, z ) == this ||
world.func_147439_a(x - 1, y2, z ) == this ||
world.func_147439_a(x + 1, y2, z ) == this ||
world.func_147439_a(x, y2, z - 1) == this ||
world.func_147439_a(x, y2, z + 1) == this)
if (world.getBlock(x, y2, z ) == this ||
world.getBlock(x - 1, y2, z ) == this ||
world.getBlock(x + 1, y2, z ) == this ||
world.getBlock(x, y2, z - 1) == this ||
world.getBlock(x, y2, z + 1) == this)
{
expQuanta = quantaPerBlock - 1;
}
@@ -117,13 +117,13 @@ public class BlockFluidClassic extends BlockFluidBase
if (expQuanta <= 0)
{
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, y, z, Blocks.air);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, quantaPerBlock - expQuanta, 3);
world.func_147464_a(x, y, z, this, tickRate);
world.func_147459_d(x, y, z, this);
world.scheduleBlockUpdate(x, y, z, this, tickRate);
world.notifyBlocksOfNeighborChange(x, y, z, this);
}
}
}
@@ -149,7 +149,7 @@ public class BlockFluidClassic extends BlockFluidBase
if (isSourceBlock(world, x, y, z) || !isFlowingVertically(world, x, y, z))
{
if (world.func_147439_a(x, y - densityDir, z) == this)
if (world.getBlock(x, y - densityDir, z) == this)
{
flowMeta = 1;
}
@@ -164,13 +164,13 @@ public class BlockFluidClassic extends BlockFluidBase
public boolean isFlowingVertically(IBlockAccess world, int x, int y, int z)
{
return world.func_147439_a(x, y + densityDir, z) == this ||
(world.func_147439_a(x, y, z) == this && canFlowInto(world, x, y + densityDir, z));
return world.getBlock(x, y + densityDir, z) == this ||
(world.getBlock(x, y, z) == this && canFlowInto(world, x, y + densityDir, z));
}
public boolean isSourceBlock(IBlockAccess world, int x, int y, int z)
{
return world.func_147439_a(x, y, z) == this && world.getBlockMetadata(x, y, z) == 0;
return world.getBlock(x, y, z) == this && world.getBlockMetadata(x, y, z) == 0;
}
protected boolean[] getOptimalFlowDirections(World world, int x, int y, int z)
@@ -275,15 +275,15 @@ public class BlockFluidClassic extends BlockFluidBase
if (meta < 0) return;
if (displaceIfPossible(world, x, y, z))
{
world.func_147465_d(x, y, z, this, meta, 3);
world.setBlock(x, y, z, this, meta, 3);
}
}
protected boolean canFlowInto(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) return true;
if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true;
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block == this)
{
return true;
@@ -294,11 +294,11 @@ public class BlockFluidClassic extends BlockFluidBase
return displacements.get(block);
}
Material material = block.func_149688_o();
Material material = block.getMaterial();
if (material.blocksMovement() ||
material == Material.field_151586_h ||
material == Material.field_151587_i ||
material == Material.field_151567_E)
material == Material.water ||
material == Material.lava ||
material == Material.portal)
{
return false;
}
@@ -340,7 +340,7 @@ public class BlockFluidClassic extends BlockFluidBase
if (doDrain)
{
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, y, z, Blocks.air);
}
return stack.copy();
@@ -26,12 +26,12 @@ public class BlockFluidFinite extends BlockFluidBase
@Override
public int getQuantaValue(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z))
if (world.getBlock(x, y, z).isAir(world, x, y, z))
{
return 0;
}
if (world.func_147439_a(x, y, z) != this)
if (world.getBlock(x, y, z) != this)
{
return -1;
}
@@ -41,7 +41,7 @@ public class BlockFluidFinite extends BlockFluidBase
}
@Override
public boolean func_149678_a(int meta, boolean fullHit)
public boolean canCollideCheck(int meta, boolean fullHit)
{
return fullHit && meta == quantaPerBlock - 1;
}
@@ -53,7 +53,7 @@ public class BlockFluidFinite extends BlockFluidBase
}
@Override
public void func_149674_a(World world, int x, int y, int z, Random rand)
public void updateTick(World world, int x, int y, int z, Random rand)
{
boolean changed = false;
int quantaRemaining = world.getBlockMetadata(x, y, z) + 1;
@@ -82,10 +82,10 @@ public class BlockFluidFinite extends BlockFluidBase
// Flow out if possible
int lowerthan = quantaRemaining - 1;
if (displaceIfPossible(world, x, y, z - 1)) world.func_147449_b(x, y, z - 1, Blocks.air);
if (displaceIfPossible(world, x, y, z + 1)) world.func_147449_b(x, y, z + 1, Blocks.air);
if (displaceIfPossible(world, x - 1, y, z )) world.func_147449_b(x - 1, y, z, Blocks.air);
if (displaceIfPossible(world, x + 1, y, z )) world.func_147449_b(x + 1, y, z, Blocks.air);
if (displaceIfPossible(world, x, y, z - 1)) world.setBlock(x, y, z - 1, Blocks.air);
if (displaceIfPossible(world, x, y, z + 1)) world.setBlock(x, y, z + 1, Blocks.air);
if (displaceIfPossible(world, x - 1, y, z )) world.setBlock(x - 1, y, z, Blocks.air);
if (displaceIfPossible(world, x + 1, y, z )) world.setBlock(x + 1, y, z, Blocks.air);
int north = getQuantaValueBelow(world, x, y, z - 1, lowerthan);
int south = getQuantaValueBelow(world, x, y, z + 1, lowerthan);
int west = getQuantaValueBelow(world, x - 1, y, z, lowerthan);
@@ -141,13 +141,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (newnorth == 0)
{
world.func_147449_b(x, y, z - 1, Blocks.air);
world.setBlock(x, y, z - 1, Blocks.air);
}
else
{
world.func_147465_d(x, y, z - 1, this, newnorth - 1, 2);
world.setBlock(x, y, z - 1, this, newnorth - 1, 2);
}
world.func_147464_a(x, y, z - 1, this, tickRate);
world.scheduleBlockUpdate(x, y, z - 1, this, tickRate);
}
--count;
}
@@ -165,13 +165,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (newsouth == 0)
{
world.func_147449_b(x, y, z + 1, Blocks.air);
world.setBlock(x, y, z + 1, Blocks.air);
}
else
{
world.func_147465_d(x, y, z + 1, this, newsouth - 1, 2);
world.setBlock(x, y, z + 1, this, newsouth - 1, 2);
}
world.func_147464_a(x, y, z + 1, this, tickRate);
world.scheduleBlockUpdate(x, y, z + 1, this, tickRate);
}
--count;
}
@@ -188,13 +188,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (newwest == 0)
{
world.func_147449_b(x - 1, y, z, Blocks.air);
world.setBlock(x - 1, y, z, Blocks.air);
}
else
{
world.func_147465_d(x - 1, y, z, this, newwest - 1, 2);
world.setBlock(x - 1, y, z, this, newwest - 1, 2);
}
world.func_147464_a(x - 1, y, z, this, tickRate);
world.scheduleBlockUpdate(x - 1, y, z, this, tickRate);
}
--count;
}
@@ -212,13 +212,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (neweast == 0)
{
world.func_147449_b(x + 1, y, z, Blocks.air);
world.setBlock(x + 1, y, z, Blocks.air);
}
else
{
world.func_147465_d(x + 1, y, z, this, neweast - 1, 2);
world.setBlock(x + 1, y, z, this, neweast - 1, 2);
}
world.func_147464_a(x + 1, y, z, this, tickRate);
world.scheduleBlockUpdate(x + 1, y, z, this, tickRate);
}
--count;
}
@@ -235,7 +235,7 @@ public class BlockFluidFinite extends BlockFluidBase
int otherY = y + densityDir;
if (otherY < 0 || otherY >= world.getHeight())
{
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, y, z, Blocks.air);
return 0;
}
@@ -245,15 +245,15 @@ public class BlockFluidFinite extends BlockFluidBase
amt += amtToInput;
if (amt > quantaPerBlock)
{
world.func_147465_d(x, otherY, z, this, quantaPerBlock - 1, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.setBlock(x, otherY, z, this, quantaPerBlock - 1, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
return amt - quantaPerBlock;
}
else if (amt > 0)
{
world.func_147465_d(x, otherY, z, this, amt - 1, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, otherY, z, this, amt - 1, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.setBlock(x, y, z, Blocks.air);
return 0;
}
return amtToInput;
@@ -265,9 +265,9 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (displaceIfPossible(world, x, otherY, z))
{
world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, otherY, z, this, amtToInput - 1, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.setBlock(x, y, z, Blocks.air);
return 0;
}
else
@@ -280,12 +280,12 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (density_other < density) // then swap
{
BlockFluidBase block = (BlockFluidBase)world.func_147439_a(x, otherY, z);
BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z);
int otherData = world.getBlockMetadata(x, otherY, z);
world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3);
world.func_147465_d(x, y, z, block, otherData, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147464_a(x, y, z, block, block.func_149738_a(world));
world.setBlock(x, otherY, z, this, amtToInput - 1, 3);
world.setBlock(x, y, z, block, otherData, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world));
return 0;
}
}
@@ -293,12 +293,12 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (density_other > density)
{
BlockFluidBase block = (BlockFluidBase)world.func_147439_a(x, otherY, z);
BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z);
int otherData = world.getBlockMetadata(x, otherY, z);
world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3);
world.func_147465_d(x, y, z, block, otherData, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147464_a(x, y, z, block, block.func_149738_a(world));
world.setBlock(x, otherY, z, this, amtToInput - 1, 3);
world.setBlock(x, y, z, block, otherData, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world));
return 0;
}
}
@@ -26,7 +26,6 @@ import net.minecraftforge.common.MinecraftForge;
* @author King Lemming
*
*/
@SuppressWarnings("unused")
public abstract class FluidContainerRegistry
{
// Holder object that implements HashCode for an ItemStack,
@@ -34,14 +34,14 @@ public abstract class FluidRegistry
public String getLocalizedName() {
return StatCollector.translateToLocal("tile.water.name");
}
}.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.func_149739_a());
}.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.getUnlocalizedName());
public static final Fluid LAVA = new Fluid("lava") {
@Override
public String getLocalizedName() {
return StatCollector.translateToLocal("tile.lava.name");
}
}.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.func_149739_a());
}.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.getUnlocalizedName());
public static int renderIdFluid = -1;
@@ -127,7 +127,7 @@ public class FluidTank implements IFluidTank
if (tile != null)
{
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
}
return fluid.amount;
}
@@ -150,7 +150,7 @@ public class FluidTank implements IFluidTank
if (tile != null)
{
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
}
return filled;
}
@@ -180,7 +180,7 @@ public class FluidTank implements IFluidTank
if (tile != null)
{
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
}
}
return stack;
@@ -55,9 +55,9 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
public float getFluidHeightForRender(IBlockAccess world, int x, int y, int z, BlockFluidBase block)
{
if (world.func_147439_a(x, y, z) == block)
if (world.getBlock(x, y, z) == block)
{
if (world.func_147439_a(x, y - block.densityDir, z).func_149688_o().isLiquid())
if (world.getBlock(x, y - block.densityDir, z).getMaterial().isLiquid())
{
return 1;
}
@@ -67,7 +67,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
return 0.875F;
}
}
return !world.func_147439_a(x, y, z).func_149688_o().isSolid() && world.func_147439_a(x, y - block.densityDir, z) == block ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F;
return !world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y - block.densityDir, z) == block ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F;
}
/* ISimpleBlockRenderingHandler */
@@ -83,7 +83,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
Tessellator tessellator = Tessellator.instance;
int color = block.func_149720_d(world, x, y, z);
int color = block.colorMultiplier(world, x, y, z);
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
@@ -91,16 +91,16 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
BlockFluidBase theFluid = (BlockFluidBase) block;
int bMeta = world.getBlockMetadata(x, y, z);
boolean renderTop = world.func_147439_a(x, y - theFluid.densityDir, z) != theFluid;
boolean renderTop = world.getBlock(x, y - theFluid.densityDir, z) != theFluid;
boolean renderBottom = block.func_149646_a(world, x, y + theFluid.densityDir, z, 0) && world.func_147439_a(x, y + theFluid.densityDir, z) != theFluid;
boolean renderBottom = block.shouldSideBeRendered(world, x, y + theFluid.densityDir, z, 0) && world.getBlock(x, y + theFluid.densityDir, z) != theFluid;
boolean[] renderSides = new boolean[]
{
block.func_149646_a(world, x, y, z - 1, 2),
block.func_149646_a(world, x, y, z + 1, 3),
block.func_149646_a(world, x - 1, y, z, 4),
block.func_149646_a(world, x + 1, y, z, 5)
block.shouldSideBeRendered(world, x, y, z - 1, 2),
block.shouldSideBeRendered(world, x, y, z + 1, 3),
block.shouldSideBeRendered(world, x - 1, y, z, 4),
block.shouldSideBeRendered(world, x + 1, y, z, 5)
};
if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3])
@@ -138,15 +138,15 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
boolean rises = theFluid.densityDir == 1;
if (renderer.field_147837_f || renderTop)
if (renderer.renderAllFaces || renderTop)
{
rendered = true;
IIcon iconStill = getIcon(block.func_149691_a(1, bMeta));
IIcon iconStill = getIcon(block.getIcon(1, bMeta));
float flowDir = (float) BlockFluidBase.getFlowDirection(world, x, y, z);
if (flowDir > -999.0F)
{
iconStill = getIcon(block.func_149691_a(2, bMeta));
iconStill = getIcon(block.getIcon(2, bMeta));
}
heightNW -= RENDER_OFFSET;
@@ -181,7 +181,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
v3 = iconStill.getInterpolatedV(8.0F + (-zFlow - xFlow) * 16.0F);
}
tessellator.setBrightness(block.func_149677_c(world, x, y, z));
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue);
if (!rises)
@@ -200,19 +200,19 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
}
if (renderer.field_147837_f || renderBottom)
if (renderer.renderAllFaces || renderBottom)
{
rendered = true;
tessellator.setBrightness(block.func_149677_c(world, x, y - 1, z));
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z));
if (!rises)
{
tessellator.setColorOpaque_F(LIGHT_Y_NEG * red, LIGHT_Y_NEG * green, LIGHT_Y_NEG * blue);
renderer.func_147768_a(block, x, y + RENDER_OFFSET, z, getIcon(block.func_149691_a(0, bMeta)));
renderer.renderFaceYNeg(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(0, bMeta)));
}
else
{
tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue);
renderer.func_147806_b(block, x, y + RENDER_OFFSET, z, getIcon(block.func_149691_a(1, bMeta)));
renderer.renderFaceYPos(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(1, bMeta)));
}
}
@@ -229,8 +229,8 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
case 3: ++x2; break;
}
IIcon iconFlow = getIcon(block.func_149691_a(side + 2, bMeta));
if (renderer.field_147837_f || renderSides[side])
IIcon iconFlow = getIcon(block.getIcon(side + 2, bMeta));
if (renderer.renderAllFaces || renderSides[side])
{
rendered = true;
@@ -283,7 +283,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
float v1Flow = iconFlow.getInterpolatedV((1.0D - ty1) * 16.0D * 0.5D);
float v2Flow = iconFlow.getInterpolatedV((1.0D - ty2) * 16.0D * 0.5D);
float v3Flow = iconFlow.getInterpolatedV(8.0D);
tessellator.setBrightness(block.func_149677_c(world, x2, y, z2));
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x2, y, z2));
float sideLighting = 1.0F;
if (side < 2)
@@ -313,8 +313,8 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
}
}
renderer.field_147855_j = 0;
renderer.field_147857_k = 1;
renderer.renderMinY = 0;
renderer.renderMaxY = 1;
return rendered;
}
}
@@ -16,16 +16,16 @@ public class TileFluidHandler extends TileEntity implements IFluidHandler
protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
@Override
public void func_145839_a(NBTTagCompound tag)
public void readFromNBT(NBTTagCompound tag)
{
super.func_145839_a(tag);
super.readFromNBT(tag);
tank.readFromNBT(tag);
}
@Override
public void func_145841_b(NBTTagCompound tag)
public void writeToNBT(NBTTagCompound tag)
{
super.func_145841_b(tag);
super.writeToNBT(tag);
tank.writeToNBT(tag);
}