Skip to content

Commit

Permalink
Renewable deepslate (LeavesMC#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china authored and Lumine1909 committed Sep 15, 2024
1 parent 23a3012 commit 89c0a99
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
7 changes: 5 additions & 2 deletions patches/server/0005-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ index dd95c9d931da5ee2cb3e620c71cc90d178c51fbc..d1ebe4f340c53f987a42fffcc462f2ea
.withRequiredArg()
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..863396656580481e8ed3dfaa0f5b7044e652ea96
index 0000000000000000000000000000000000000000..9b558395d65921b097fd1ab6230496c93f6c97c3
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,870 @@
@@ -0,0 +1,873 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -543,6 +543,9 @@ index 0000000000000000000000000000000000000000..863396656580481e8ed3dfaa0f5b7044
+ }
+ }
+
+ @GlobalConfig(name = "renewable-deepslate", category = "modify")
+ public static boolean renewableDeepslate = false;
+
+ // Leaves start - modify - removed
+
+ @RemovedConfig
Expand Down
32 changes: 32 additions & 0 deletions patches/server/0130-Renewable-deepslate.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <[email protected]>
Date: Mon, 22 Jan 2024 11:15:53 +0800
Subject: [PATCH] Renewable deepslate


diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
index 2bd097203f1e92d3fc343f91dc37220e09dd5066..f1e5b270d46739d8c70d6cab0cda598af331c360 100644
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
@@ -192,7 +192,7 @@ public class LiquidBlock extends Block implements BucketPickup {
BlockPos blockposition1 = pos.relative(enumdirection.getOpposite());

if (world.getFluidState(blockposition1).is(FluidTags.WATER)) {
- Block block = world.getFluidState(pos).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
+ Block block = world.getFluidState(pos).isSource() ? Blocks.OBSIDIAN : (top.leavesmc.leaves.LeavesConfig.renewableDeepslate && world.dimension() == Level.OVERWORLD && pos.getY() < 0 ? Blocks.COBBLED_DEEPSLATE : Blocks.COBBLESTONE); // Leaves - renewable deepslate

// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, pos, block.defaultBlockState())) {
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..f9d386db467b608430b3abcfc609594db8a29b76 100644
--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
@@ -211,7 +211,7 @@ public abstract class LavaFluid extends FlowingFluid {
if (this.is(FluidTags.LAVA) && fluid1.is(FluidTags.WATER)) {
if (state.getBlock() instanceof LiquidBlock) {
// CraftBukkit start
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world.getMinecraftWorld(), pos, Blocks.STONE.defaultBlockState(), 3)) {
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world.getMinecraftWorld(), pos, top.leavesmc.leaves.LeavesConfig.renewableDeepslate && world.getMinecraftWorld().dimension() == Level.OVERWORLD && pos.getY() < 0 ? Blocks.DEEPSLATE.defaultBlockState() : Blocks.STONE.defaultBlockState(), 3)) { // Leaves - renewable deepslate
return;
}
// CraftBukkit end

0 comments on commit 89c0a99

Please sign in to comment.