9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/paper-patches/features/0010-Force-peaceful-mode-switch.patch
2025-06-05 17:53:18 +08:00

30 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Thu, 3 Aug 2023 14:21:47 +0800
Subject: [PATCH] Force peaceful mode switch
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 6773681bfaf0edb03cc17bcdfa43b98c8b7c9c20..f1b018774473b52fe3dee56dc78cf5def9030c43 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2383,6 +2383,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Paper - replace feature flag API
+ // Leaves start - unsupported settings
+ @Override
+ public void setPeacefulModeSwitchTick(int tick) {
+ this.getHandle().chunkSource.peacefulModeSwitchTick = tick;
+ }
+
+ @Override
+ public int getPeacefulModeSwitchTick() {
+ return this.getHandle().chunkSource.peacefulModeSwitchTick;
+ }
+ // Leaves end - unsupported settings
+
public void storeBukkitValues(CompoundTag c) {
if (!this.persistentDataContainer.isEmpty()) {
c.put("BukkitValues", this.persistentDataContainer.toTagCompound());