mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
78 lines
3.4 KiB
Diff
78 lines
3.4 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 lava
|
|
|
|
|
|
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 6e3e873efa1f50f53cb6503bde8a981f9cefd006..cf396fb5d68f22917ed990f6c4ed18f9b0b3012f 100644
|
|
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
|
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
|
@@ -217,7 +217,7 @@ public abstract class FlowingFluid extends Fluid {
|
|
}
|
|
}
|
|
|
|
- if (this.canConvertToSource() && j >= 2) {
|
|
+ if (this.canConvertToSource(world) && j >= getRequiredSources(world)) {
|
|
BlockState iblockdata2 = world.getBlockState(pos.below());
|
|
FluidState fluid1 = iblockdata2.getFluidState();
|
|
|
|
@@ -288,6 +288,16 @@ public abstract class FlowingFluid extends Fluid {
|
|
return (FluidState) this.getSource().defaultFluidState().setValue(FlowingFluid.FALLING, falling);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ protected boolean canConvertToSource(LevelReader world) {
|
|
+ return canConvertToSource();
|
|
+ }
|
|
+
|
|
+ protected int getRequiredSources(LevelReader world) {
|
|
+ return 2;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
protected abstract boolean canConvertToSource();
|
|
|
|
protected void spreadTo(LevelAccessor world, BlockPos pos, BlockState state, Direction direction, FluidState 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 695783e64564b1d2a178d57a89737d2a97ab9014..cd1a33a1f10d04a91358f51d736bda34110324c4 100644
|
|
--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
|
+++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
|
@@ -199,6 +199,18 @@ public abstract class LavaFluid extends FlowingFluid {
|
|
world.levelEvent(1501, pos, 0);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ protected boolean canConvertToSource(LevelReader world) {
|
|
+ return world.getWorldBorder().world.purpurConfig.lavaInfinite;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ protected int getRequiredSources(LevelReader world) {
|
|
+ return world.getWorldBorder().world.purpurConfig.lavaInfiniteRequiredSources;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
protected boolean canConvertToSource() {
|
|
return false;
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index b0b4a47ddaaf010466ef771bedd217571eb444d2..bb33cc21ba25ed4f42bb1f3965440ac16d8c4708 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -202,6 +202,13 @@ public class PurpurWorldConfig {
|
|
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
|
}
|
|
|
|
+ public boolean lavaInfinite = false;
|
|
+ public int lavaInfiniteRequiredSources = 2;
|
|
+ private void lavaSettings() {
|
|
+ lavaInfinite = getBoolean("blocks.lava.infinite-source", lavaInfinite);
|
|
+ lavaInfiniteRequiredSources = getInt("blocks.lava.infinite-required-sources", lavaInfiniteRequiredSources);
|
|
+ }
|
|
+
|
|
public boolean signAllowColors = false;
|
|
public boolean signRightClickEdit = false;
|
|
private void signSettings() {
|