@@ -774,6 +774,39 @@ index 631ac128aebcd6388482adb3b1f03673281eaf95..b200e0ea698662d2fab45467bd26bd31
774
774
@Override
775
775
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
776
776
if (isFree(world.getBlockState(pos.below())) && pos.getY() >= world.getMinBuildHeight()) {
777
+ diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
778
+ index 4a1830f85f47014da63e4584f411d13f0f0cd8b3..727a2fc45de4995cafb371bde43db483a760fa6e 100644
779
+ --- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
780
+ +++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
781
+ @@ -160,8 +160,26 @@ public class LiquidBlock extends Block implements BucketPickup {
782
+ BlockPos blockposition1 = pos.relative(enumdirection.getOpposite());
783
+
784
+ if (world.getFluidState(blockposition1).is(FluidTags.WATER)) {
785
+ - Block block = world.getFluidState(pos).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
786
+ -
787
+ + // Sakura start
788
+ + final FluidState fluidState = state.getFluidState();
789
+ + final Block block;
790
+ +
791
+ + if (fluidState.isSource()) {
792
+ + block = Blocks.OBSIDIAN;
793
+ + } else {
794
+ + final me.samsuik.sakura.physics.PhysicsVersion physics = world.localConfig().config(pos).physicsVersion;
795
+ +
796
+ + // SANITY: In legacy a patch by paper removes the fluid level condition from vanilla.
797
+ + if (physics.afterOrEqual(1_16_0) || physics.isLegacy()
798
+ + || physics.afterOrEqual(1_13_0) && fluidState.getHeight(world, pos) >= 0.44444445f
799
+ + || physics.before(1_13_0) && FlowingFluid.getLegacyLevel(fluidState) <= 4
800
+ + ) {
801
+ + block = Blocks.COBBLESTONE;
802
+ + } else {
803
+ + return true;
804
+ + }
805
+ + }
806
+ + // Sakura end
807
+ // CraftBukkit start
808
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, pos, block.defaultBlockState())) {
809
+ this.fizz(world, pos);
777
810
diff --git a/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java b/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
778
811
index e941a4ce35c1bcc84836d04fb97cb1e7f292ae42..ff53e0e47da66ba99e79d1de0c04437a370577f9 100644
779
812
--- a/src/main/java/net/minecraft/world/level/block/piston/MovingPistonBlock.java
@@ -1038,3 +1071,48 @@ index a971bb30ef8620f016a5968a9da40187ee31a3ef..68bac9ea693f4457a8ced072cae85aef
1038
1071
}
1039
1072
}
1040
1073
1074
+ diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
1075
+ index 6d59f8b68d644cb43939bcdf5239fa1caf54ed47..96ccad764cb6424ffe561c558cd11200d89ff541 100644
1076
+ --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
1077
+ +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
1078
+ @@ -528,7 +528,7 @@ public abstract class FlowingFluid extends Fluid {
1079
+ this.spread(world, pos, state);
1080
+ }
1081
+
1082
+ - protected static int getLegacyLevel(FluidState state) {
1083
+ + public static int getLegacyLevel(FluidState state) { // Sakura - protected -> public
1084
+ return state.isSource() ? 0 : 8 - Math.min(state.getAmount(), 8) + ((Boolean) state.getValue(FlowingFluid.FALLING) ? 8 : 0);
1085
+ }
1086
+
1087
+ diff --git a/src/main/java/net/minecraft/world/level/material/LavaFluid.java b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
1088
+ index c3f8e1e2dd89c168b8b4a15b589109db486bc8d7..1dab5318d8693d15ee879456dff3a1916cfad335 100644
1089
+ --- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
1090
+ +++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
1091
+ @@ -175,7 +175,10 @@ public abstract class LavaFluid extends FlowingFluid {
1092
+
1093
+ @Override
1094
+ public boolean canBeReplacedWith(FluidState state, BlockGetter world, BlockPos pos, Fluid fluid, Direction direction) {
1095
+ - return state.getHeight(world, pos) >= 0.44444445F && fluid.is(FluidTags.WATER);
1096
+ + // Sakura start
1097
+ + return state.getHeight(world, pos) >= 0.44444445F && fluid.is(FluidTags.WATER)
1098
+ + && world instanceof Level level && level.localConfig().config(pos).physicsVersion.afterOrEqual(1_13_0);
1099
+ + // Sakura end
1100
+ }
1101
+
1102
+ @Override
1103
+ diff --git a/src/main/java/net/minecraft/world/level/material/WaterFluid.java b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
1104
+ index d280c98aed5262c4ce39526c917de884f25a8584..521b8084e490d5f3ecacd1d7368dddee22647aa9 100644
1105
+ --- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java
1106
+ +++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
1107
+ @@ -104,7 +104,10 @@ public abstract class WaterFluid extends FlowingFluid {
1108
+
1109
+ @Override
1110
+ public boolean canBeReplacedWith(FluidState state, BlockGetter world, BlockPos pos, Fluid fluid, Direction direction) {
1111
+ - return direction == Direction.DOWN && !fluid.is(FluidTags.WATER);
1112
+ + // Sakura start
1113
+ + return direction == Direction.DOWN && !fluid.is(FluidTags.WATER)
1114
+ + || fluid.is(FluidTags.LAVA) && world instanceof Level level && level.localConfig().config(pos).physicsVersion.before(1_13_0);
1115
+ + // Sakura end
1116
+ }
1117
+
1118
+ @Override
0 commit comments