Skip to content

Commit

Permalink
Fix Spigot EndPlatform destroy (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Aug 15, 2024
1 parent 202c986 commit e199edf
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
7 changes: 5 additions & 2 deletions patches/server/0006-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ index d97771ecaf06b92d92b5ca0224ae0866e36703a6..439305bb4f5ce232aa6237276c121d53
.withRequiredArg()
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..31845199d4a8148365579152aef11e0e59339fc2
index 0000000000000000000000000000000000000000..59c98fa51afd4fd305852d14509b06f8bef859a1
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,880 @@
@@ -0,0 +1,883 @@
+package org.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -967,6 +967,9 @@ index 0000000000000000000000000000000000000000..31845199d4a8148365579152aef11e0e
+ @GlobalConfig(name = "vanilla-hopper", category = "fix")
+ public static boolean vanillaHopper = false;
+
+ @GlobalConfig(name = "spigot-EndPlatform-destroy", category = "fix")
+ public static boolean spigotEndPlatformDestroy = false;
+
+ // Leaves end - region
+}
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgument.java b/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
Expand Down
25 changes: 25 additions & 0 deletions patches/server/0133-Fix-Spigot-EndPlatform-destroy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Fri, 16 Aug 2024 02:02:06 +0800
Subject: [PATCH] Fix Spigot EndPlatform destroy


diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
index 0bc659a8427b89b5e3211220c55b52eec6a20494..3746721baa1897111c2d30c9e0f388dddca099da 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
@@ -44,7 +44,13 @@ public class EndPlatformFeature extends Feature<NoneFeatureConfiguration> {
// CraftBukkit start
if (!blockList.getBlockState(blockposition_mutableblockposition1).is(block)) {
if (flag) {
- blockList.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null);
+ // Leaves start - spigot!
+ if (!org.leavesmc.leaves.LeavesConfig.spigotEndPlatformDestroy) {
+ blockList.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null);
+ } else {
+ worldaccess.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null);
+ }
+ // Leaves end - spigot!
}

blockList.setBlock(blockposition_mutableblockposition1, block.defaultBlockState(), 3);

0 comments on commit e199edf

Please sign in to comment.