This commit is contained in:
raoulvdberge
2017-01-07 01:54:47 +01:00
parent ff4c9ca42e
commit c191b41682

View File

@@ -105,12 +105,15 @@ public class NetworkNodeConstructor extends NetworkNode implements IComparable,
} else if (type == IType.FLUIDS) { } else if (type == IType.FLUIDS) {
FluidStack stack = fluidFilters.getFluidStackInSlot(0); FluidStack stack = fluidFilters.getFluidStackInSlot(0);
if (stack != null && stack.getFluid().canBePlacedInWorld() && stack.amount >= Fluid.BUCKET_VOLUME) { if (stack != null && stack.getFluid().canBePlacedInWorld()) {
BlockPos front = holder.pos().offset(holder.getDirection()); BlockPos front = holder.pos().offset(holder.getDirection());
Block block = stack.getFluid().getBlock(); Block block = stack.getFluid().getBlock();
if (holder.world().isAirBlock(front) && block.canPlaceBlockAt(holder.world(), front)) { if (holder.world().isAirBlock(front) && block.canPlaceBlockAt(holder.world(), front)) {
FluidStack stored = network.getFluidStorageCache().getList().get(stack, compare);
if (stored != null && stored.amount >= Fluid.BUCKET_VOLUME) {
FluidStack took = network.extractFluid(stack, Fluid.BUCKET_VOLUME, compare, false); FluidStack took = network.extractFluid(stack, Fluid.BUCKET_VOLUME, compare, false);
if (took != null) { if (took != null) {
@@ -133,6 +136,7 @@ public class NetworkNodeConstructor extends NetworkNode implements IComparable,
} }
} }
} }
}
private boolean canPlace(BlockPos pos, IBlockState state) { private boolean canPlace(BlockPos pos, IBlockState state) {
BlockEvent.PlaceEvent e = new BlockEvent.PlaceEvent(new BlockSnapshot(holder.world(), pos, state), holder.world().getBlockState(holder.pos()), FakePlayerFactory.getMinecraft((WorldServer) holder.world()), null); BlockEvent.PlaceEvent e = new BlockEvent.PlaceEvent(new BlockSnapshot(holder.world(), pos, state), holder.world().getBlockState(holder.pos()), FakePlayerFactory.getMinecraft((WorldServer) holder.world()), null);