mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-10 11:43:50 +01:00
Less drains More
- Partially filled water cauldrons can no longer be drained by fluid pipes #6506 #6505 - Fixed forge capabilities on modded cauldron blocks getting ignored (?)
This commit is contained in:
parent
a5dc53ba5f
commit
08b5515068
3 changed files with 13 additions and 7 deletions
|
@ -174,7 +174,7 @@ public class FluidPropagator {
|
|||
if (PumpBlock.isPump(connectedState) && connectedState.getValue(PumpBlock.FACING)
|
||||
.getAxis() == side.getAxis())
|
||||
return false;
|
||||
if (VanillaFluidTargets.shouldPipesConnectTo(connectedState))
|
||||
if (VanillaFluidTargets.canProvideFluidWithoutCapability(connectedState))
|
||||
return true;
|
||||
if (BlockHelper.hasBlockSolidSide(connectedState, reader, connectedPos, side.getOpposite())
|
||||
&& !AllBlockTags.FAN_TRANSPARENT.matches(connectedState))
|
||||
|
|
|
@ -183,7 +183,7 @@ public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock,
|
|||
Direction direction) {
|
||||
if (FluidPropagator.hasFluidCapability(world, neighbourPos, direction.getOpposite()))
|
||||
return true;
|
||||
if (VanillaFluidTargets.shouldPipesConnectTo(neighbour))
|
||||
if (VanillaFluidTargets.canProvideFluidWithoutCapability(neighbour))
|
||||
return true;
|
||||
FluidTransportBehaviour transport = BlockEntityBehaviour.get(world, neighbourPos, FluidTransportBehaviour.TYPE);
|
||||
BracketedBlockEntityBehaviour bracket =
|
||||
|
|
|
@ -5,9 +5,9 @@ import static net.minecraft.world.level.block.state.properties.BlockStatePropert
|
|||
import com.simibubi.create.AllFluids;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LayeredCauldronBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
|
@ -15,10 +15,14 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
|
||||
public class VanillaFluidTargets {
|
||||
|
||||
public static boolean shouldPipesConnectTo(BlockState state) {
|
||||
public static boolean canProvideFluidWithoutCapability(BlockState state) {
|
||||
if (state.hasProperty(BlockStateProperties.LEVEL_HONEY))
|
||||
return true;
|
||||
if (state.is(BlockTags.CAULDRONS))
|
||||
if (state.is(Blocks.CAULDRON))
|
||||
return true;
|
||||
if (state.is(Blocks.LAVA_CAULDRON))
|
||||
return true;
|
||||
if (state.is(Blocks.WATER_CAULDRON))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -31,13 +35,15 @@ public class VanillaFluidTargets {
|
|||
.getSource(), 250);
|
||||
}
|
||||
|
||||
if (state.getBlock() == Blocks.LAVA_CAULDRON) {
|
||||
if (state.is(Blocks.LAVA_CAULDRON)) {
|
||||
if (!simulate)
|
||||
level.setBlock(pos, Blocks.CAULDRON.defaultBlockState(), 3);
|
||||
return new FluidStack(Fluids.LAVA, 1000);
|
||||
}
|
||||
|
||||
if (state.getBlock() == Blocks.WATER_CAULDRON) {
|
||||
if (state.is(Blocks.WATER_CAULDRON) && state.getBlock() instanceof LayeredCauldronBlock lcb) {
|
||||
if (!lcb.isFull(state))
|
||||
return FluidStack.EMPTY;
|
||||
if (!simulate)
|
||||
level.setBlock(pos, Blocks.CAULDRON.defaultBlockState(), 3);
|
||||
return new FluidStack(Fluids.WATER, 1000);
|
||||
|
|
Loading…
Reference in a new issue