Fixed a few issues with the is fillable methods
This commit is contained in:
parent
d3c27ca6e9
commit
38e98bab59
1 changed files with 14 additions and 7 deletions
|
@ -143,7 +143,7 @@ public class FluidHelper
|
||||||
/** Checks to see if a non-fluid block is able to be filled with fluid */
|
/** Checks to see if a non-fluid block is able to be filled with fluid */
|
||||||
public static boolean isFillableBlock(World world, Vector3 node)
|
public static boolean isFillableBlock(World world, Vector3 node)
|
||||||
{
|
{
|
||||||
if (world == null || node == null || isFillableFluid(world, node))
|
if (world == null || node == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -151,11 +151,15 @@ public class FluidHelper
|
||||||
int blockID = node.getBlockID(world);
|
int blockID = node.getBlockID(world);
|
||||||
int meta = node.getBlockMetadata(world);
|
int meta = node.getBlockMetadata(world);
|
||||||
Block block = Block.blocksList[blockID];
|
Block block = Block.blocksList[blockID];
|
||||||
if (block == null || block.blockID == 0 || block.isAirBlock(world, node.intX(), node.intY(), node.intZ()))
|
if (drainBlock(world, node, false) != null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (block == null || block.blockID == 0 || block.isAirBlock(world, node.intX(), node.intY(), node.intZ()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (block.isBlockReplaceable(world, node.intX(), node.intY(), node.intZ()) || replacableBlockMeta.contains(new Pair<Integer, Integer>(blockID, meta)) || replacableBlocks.contains(block))
|
else if (!(block instanceof IFluidBlock || block instanceof BlockFluid) && block.isBlockReplaceable(world, node.intX(), node.intY(), node.intZ()) || replacableBlockMeta.contains(new Pair<Integer, Integer>(blockID, meta)) || replacableBlocks.contains(block))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -173,10 +177,13 @@ public class FluidHelper
|
||||||
int blockID = node.getBlockID(world);
|
int blockID = node.getBlockID(world);
|
||||||
int meta = node.getBlockMetadata(world);
|
int meta = node.getBlockMetadata(world);
|
||||||
Block block = Block.blocksList[blockID];
|
Block block = Block.blocksList[blockID];
|
||||||
|
//TODO when added change this to call canFill and fill
|
||||||
if (block instanceof IFluidBlock || block instanceof BlockFluid)
|
if (drainBlock(world, node, false) != null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (block instanceof IFluidBlock || block instanceof BlockFluid)
|
||||||
{
|
{
|
||||||
//TODO when added change this to call canFill and fill
|
|
||||||
return meta != 0;
|
return meta != 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -211,7 +218,7 @@ public class FluidHelper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node.setBlock(world, stack.getFluid().getBlockID(), 0, 2);
|
node.setBlock(world, stack.getFluid().getBlockID());
|
||||||
}
|
}
|
||||||
return FluidContainerRegistry.BUCKET_VOLUME;
|
return FluidContainerRegistry.BUCKET_VOLUME;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue