mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@5e73c55 [ci skip] Add more identifying patch comments PaperMC/Paper@3e20d3a [ci skip] Add more identifying patch comments PaperMC/Paper@f61ebdc Fix issue with kick event causes being passed improperly PaperMC/Paper@106c67a [ci skip] Add more identifying patch comments PaperMC/Paper@cc693ce [ci skip] Add more identifying patch comments, merge related patches PaperMC/Paper@eeb6afc [ci skip] Add more identifying patch comments, merge related patches PaperMC/Paper@1c956ab [ci skip] Add more identifying patch comments, merge related patches PaperMC/Paper@42e88a8 [ci skip] Add more identifying patch comments PaperMC/Paper@8e41ef4 Add visual blockdata api for primed tnt (#10146) PaperMC/Paper@68c3297 [ci skip] Add more identifying patch comments PaperMC/Paper@4a98986 Add back Reduce allocation of Vec3D by entity tracker patch (#10179) PaperMC/Paper@b48d737 Async world data IO saving (#10171) PaperMC/Paper@8d94596 [ci skip] Add more identifying patch comments PaperMC/Paper@f7dd304 [ci skip] Add more identifying patch comments PaperMC/Paper@98e6d20 [ci skip] Add more identifying patch comments PaperMC/Paper@e9e0bc1 [ci skip] Add more identifying patch comments PaperMC/Paper@d9df6bc [ci skip] Add more patch identifying comments, cleanup PaperMC/Paper@27cabc1 [ci skip] Add more patch identifying comments Pufferfish Changes: pufferfish-gg/Pufferfish@8e208d3 Fix Async World Saving attribution
97 lines
4.6 KiB
Diff
97 lines
4.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Sat, 23 Nov 2019 17:55:42 -0600
|
|
Subject: [PATCH] Implement infinite liquids
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
|
index 6411aa4ff6bd4cabb25c426fa8f4a7eedb969c03..0fe597d32a0e15ea67b32925c1a62e8c143ff81d 100644
|
|
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
|
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
|
@@ -227,7 +227,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
}
|
|
}
|
|
|
|
- if (this.canConvertToSource(world) && j >= 2) {
|
|
+ if (this.canConvertToSource(world) && j >= getRequiredSources(world)) {
|
|
BlockState iblockdata2 = world.getBlockState(pos.below());
|
|
FluidState fluid1 = iblockdata2.getFluidState();
|
|
|
|
@@ -336,6 +336,12 @@ public abstract class FlowingFluid extends Fluid {
|
|
|
|
protected abstract boolean canConvertToSource(Level world);
|
|
|
|
+ // Purpur start
|
|
+ protected int getRequiredSources(Level level) {
|
|
+ return 2;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
protected void spreadTo(LevelAccessor world, BlockPos pos, BlockState state, Direction direction, FluidState fluidState) {
|
|
if (state.getBlock() instanceof LiquidBlockContainer) {
|
|
((LiquidBlockContainer) state.getBlock()).placeLiquid(world, pos, state, fluidState);
|
|
diff --git a/src/main/java/net/minecraft/world/level/material/LavaFluid.java b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
|
index 3bb4a9a1a6249e8ba2de237f801210e7f4fd5825..4c230136d832d50ae16ffa037b0b30ff1101b50a 100644
|
|
--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
|
+++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
|
@@ -198,6 +198,13 @@ public abstract class LavaFluid extends FlowingFluid {
|
|
world.levelEvent(1501, pos, 0);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ protected int getRequiredSources(Level level) {
|
|
+ return level.purpurConfig.lavaInfiniteRequiredSources;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
protected boolean canConvertToSource(Level world) {
|
|
return world.getGameRules().getBoolean(GameRules.RULE_LAVA_SOURCE_CONVERSION);
|
|
diff --git a/src/main/java/net/minecraft/world/level/material/WaterFluid.java b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
|
|
index cde93efaecd42b9081405638af3ba91cb5e184c9..c664fd77dd865037293a3e86699fd1fa6b703882 100644
|
|
--- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java
|
|
+++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
|
|
@@ -64,6 +64,13 @@ public abstract class WaterFluid extends FlowingFluid {
|
|
return world.getGameRules().getBoolean(GameRules.RULE_WATER_SOURCE_CONVERSION);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ protected int getRequiredSources(Level level) {
|
|
+ return level.purpurConfig.waterInfiniteRequiredSources;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
// Paper start - Add BlockBreakBlockEvent
|
|
@Override
|
|
protected void beforeDestroyingBlock(LevelAccessor world, BlockPos pos, BlockState state, BlockPos source) {
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 40a0cd68b1e35894360f0edc45bc30a5bd47622f..783c238cc0e68e52b0f20ea535a208d3bec663de 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -221,6 +221,11 @@ public class PurpurWorldConfig {
|
|
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
|
}
|
|
|
|
+ public int lavaInfiniteRequiredSources = 2;
|
|
+ private void lavaSettings() {
|
|
+ lavaInfiniteRequiredSources = getInt("blocks.lava.infinite-required-sources", lavaInfiniteRequiredSources);
|
|
+ }
|
|
+
|
|
public boolean turtleEggsBreakFromExpOrbs = true;
|
|
public boolean turtleEggsBreakFromItems = true;
|
|
public boolean turtleEggsBreakFromMinecarts = true;
|
|
@@ -230,6 +235,11 @@ public class PurpurWorldConfig {
|
|
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
|
}
|
|
|
|
+ public int waterInfiniteRequiredSources = 2;
|
|
+ private void waterSources() {
|
|
+ waterInfiniteRequiredSources = getInt("blocks.water.infinite-required-sources", waterInfiniteRequiredSources);
|
|
+ }
|
|
+
|
|
public boolean babiesAreRidable = true;
|
|
public boolean untamedTamablesAreRidable = true;
|
|
public boolean useNightVisionWhenRiding = false;
|