diff --git a/leaf-server/minecraft-patches/features/0265-Op-lock.patch b/leaf-server/minecraft-patches/features/0265-Op-lock.patch deleted file mode 100644 index 1af6be38..00000000 --- a/leaf-server/minecraft-patches/features/0265-Op-lock.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Taiyou06 -Date: Tue, 22 Jul 2025 22:31:58 +0200 -Subject: [PATCH] Op lock - - -diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index f0bdc2bbf358d4c5f113b395c6409ff9fa759e2f..203160ddf928b86d12a25c94550bf13b86598e03 100644 ---- a/net/minecraft/server/players/PlayerList.java -+++ b/net/minecraft/server/players/PlayerList.java -@@ -1202,6 +1202,9 @@ public abstract class PlayerList { - } - - public void op(GameProfile profile) { -+ if (org.dreeam.leaf.config.modules.misc.OpLock.preventOpChanges) { -+ return; -+ } - this.ops.add(new ServerOpListEntry(profile, this.server.getOperatorUserPermissionLevel(), this.ops.canBypassPlayerLimit(profile))); - ServerPlayer player = this.getPlayer(profile.getId()); - if (player != null) { -@@ -1210,6 +1213,9 @@ public abstract class PlayerList { - } - - public void deop(GameProfile profile) { -+ if (org.dreeam.leaf.config.modules.misc.OpLock.preventOpChanges) { -+ return; -+ } - this.ops.remove(profile); - ServerPlayer player = this.getPlayer(profile.getId()); - if (player != null) { diff --git a/leaf-server/minecraft-patches/features/0266-Optimise-TextColor.patch b/leaf-server/minecraft-patches/features/0265-Optimise-TextColor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0266-Optimise-TextColor.patch rename to leaf-server/minecraft-patches/features/0265-Optimise-TextColor.patch diff --git a/leaf-server/minecraft-patches/features/0267-Do-not-create-fire-if-explosion-was-cancelled.patch b/leaf-server/minecraft-patches/features/0266-Do-not-create-fire-if-explosion-was-cancelled.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0267-Do-not-create-fire-if-explosion-was-cancelled.patch rename to leaf-server/minecraft-patches/features/0266-Do-not-create-fire-if-explosion-was-cancelled.patch diff --git a/leaf-server/minecraft-patches/features/0268-Skip-BlockPhysicsEvent-if-no-listeners.patch b/leaf-server/minecraft-patches/features/0267-Skip-BlockPhysicsEvent-if-no-listeners.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0268-Skip-BlockPhysicsEvent-if-no-listeners.patch rename to leaf-server/minecraft-patches/features/0267-Skip-BlockPhysicsEvent-if-no-listeners.patch diff --git a/leaf-server/minecraft-patches/features/0269-Lithium-equipment-tracking.patch b/leaf-server/minecraft-patches/features/0268-Lithium-equipment-tracking.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0269-Lithium-equipment-tracking.patch rename to leaf-server/minecraft-patches/features/0268-Lithium-equipment-tracking.patch diff --git a/leaf-server/minecraft-patches/features/0270-fix-purpur-attribute-base-patch.patch b/leaf-server/minecraft-patches/features/0269-fix-purpur-attribute-base-patch.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0270-fix-purpur-attribute-base-patch.patch rename to leaf-server/minecraft-patches/features/0269-fix-purpur-attribute-base-patch.patch diff --git a/leaf-server/minecraft-patches/features/0271-Bump-netty-to-4.2.x.patch b/leaf-server/minecraft-patches/features/0270-Bump-netty-to-4.2.x.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0271-Bump-netty-to-4.2.x.patch rename to leaf-server/minecraft-patches/features/0270-Bump-netty-to-4.2.x.patch diff --git a/leaf-server/minecraft-patches/features/0272-Paper-PR-Optimise-temptation-lookups.patch b/leaf-server/minecraft-patches/features/0271-Paper-PR-Optimise-temptation-lookups.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0272-Paper-PR-Optimise-temptation-lookups.patch rename to leaf-server/minecraft-patches/features/0271-Paper-PR-Optimise-temptation-lookups.patch diff --git a/leaf-server/minecraft-patches/features/0273-fix-temptation-lookups.patch b/leaf-server/minecraft-patches/features/0272-fix-temptation-lookups.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0273-fix-temptation-lookups.patch rename to leaf-server/minecraft-patches/features/0272-fix-temptation-lookups.patch diff --git a/leaf-server/minecraft-patches/features/0274-Lithium-combined-heightmap-update.patch b/leaf-server/minecraft-patches/features/0273-Lithium-combined-heightmap-update.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0274-Lithium-combined-heightmap-update.patch rename to leaf-server/minecraft-patches/features/0273-Lithium-combined-heightmap-update.patch diff --git a/leaf-server/minecraft-patches/features/0275-Skip-PreCreatureSpawnEvent-if-no-listeners.patch b/leaf-server/minecraft-patches/features/0274-Skip-PreCreatureSpawnEvent-if-no-listeners.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0275-Skip-PreCreatureSpawnEvent-if-no-listeners.patch rename to leaf-server/minecraft-patches/features/0274-Skip-PreCreatureSpawnEvent-if-no-listeners.patch diff --git a/leaf-server/minecraft-patches/features/0276-optimize-goal-selector.patch b/leaf-server/minecraft-patches/features/0275-optimize-goal-selector.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0276-optimize-goal-selector.patch rename to leaf-server/minecraft-patches/features/0275-optimize-goal-selector.patch diff --git a/leaf-server/minecraft-patches/features/0277-thread-unsafe-chunk-map.patch b/leaf-server/minecraft-patches/features/0276-thread-unsafe-chunk-map.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0277-thread-unsafe-chunk-map.patch rename to leaf-server/minecraft-patches/features/0276-thread-unsafe-chunk-map.patch diff --git a/leaf-server/minecraft-patches/features/0278-optimize-SimpleBitStorage-object-layout.patch b/leaf-server/minecraft-patches/features/0277-optimize-SimpleBitStorage-object-layout.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0278-optimize-SimpleBitStorage-object-layout.patch rename to leaf-server/minecraft-patches/features/0277-optimize-SimpleBitStorage-object-layout.patch diff --git a/leaf-server/minecraft-patches/features/0279-optimize-get-chunk.patch b/leaf-server/minecraft-patches/features/0278-optimize-get-chunk.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0279-optimize-get-chunk.patch rename to leaf-server/minecraft-patches/features/0278-optimize-get-chunk.patch diff --git a/leaf-server/minecraft-patches/features/0280-remove-shouldTickBlocksAt-check.patch b/leaf-server/minecraft-patches/features/0279-remove-shouldTickBlocksAt-check.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0280-remove-shouldTickBlocksAt-check.patch rename to leaf-server/minecraft-patches/features/0279-remove-shouldTickBlocksAt-check.patch diff --git a/leaf-server/minecraft-patches/features/0281-optimize-PalettedContainer-get.patch b/leaf-server/minecraft-patches/features/0280-optimize-PalettedContainer-get.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0281-optimize-PalettedContainer-get.patch rename to leaf-server/minecraft-patches/features/0280-optimize-PalettedContainer-get.patch diff --git a/leaf-server/minecraft-patches/features/0282-optimize-LevelChunk-getBlockStateFinal.patch b/leaf-server/minecraft-patches/features/0281-optimize-LevelChunk-getBlockStateFinal.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0282-optimize-LevelChunk-getBlockStateFinal.patch rename to leaf-server/minecraft-patches/features/0281-optimize-LevelChunk-getBlockStateFinal.patch diff --git a/leaf-server/minecraft-patches/features/0283-optimize-FluidState-is-TagKey.patch b/leaf-server/minecraft-patches/features/0282-optimize-FluidState-is-TagKey.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0283-optimize-FluidState-is-TagKey.patch rename to leaf-server/minecraft-patches/features/0282-optimize-FluidState-is-TagKey.patch diff --git a/leaf-server/minecraft-patches/features/0284-counting-chunk-section-fluid.patch b/leaf-server/minecraft-patches/features/0283-counting-chunk-section-fluid.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0284-counting-chunk-section-fluid.patch rename to leaf-server/minecraft-patches/features/0283-counting-chunk-section-fluid.patch diff --git a/leaf-server/minecraft-patches/features/0285-optimize-SpreadingSnowyDirtBlock-randomTick.patch b/leaf-server/minecraft-patches/features/0284-optimize-SpreadingSnowyDirtBlock-randomTick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0285-optimize-SpreadingSnowyDirtBlock-randomTick.patch rename to leaf-server/minecraft-patches/features/0284-optimize-SpreadingSnowyDirtBlock-randomTick.patch diff --git a/leaf-server/minecraft-patches/features/0286-optimize-onClimbable.patch b/leaf-server/minecraft-patches/features/0285-optimize-onClimbable.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0286-optimize-onClimbable.patch rename to leaf-server/minecraft-patches/features/0285-optimize-onClimbable.patch diff --git a/leaf-server/minecraft-patches/features/0287-optimize-applyMovementEmissionAndPlaySound.patch b/leaf-server/minecraft-patches/features/0286-optimize-applyMovementEmissionAndPlaySound.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0287-optimize-applyMovementEmissionAndPlaySound.patch rename to leaf-server/minecraft-patches/features/0286-optimize-applyMovementEmissionAndPlaySound.patch diff --git a/leaf-server/minecraft-patches/features/0288-optimize-isStateClimbable.patch b/leaf-server/minecraft-patches/features/0287-optimize-isStateClimbable.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0288-optimize-isStateClimbable.patch rename to leaf-server/minecraft-patches/features/0287-optimize-isStateClimbable.patch diff --git a/leaf-server/minecraft-patches/features/0289-optimize-getOnPos.patch b/leaf-server/minecraft-patches/features/0288-optimize-getOnPos.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0289-optimize-getOnPos.patch rename to leaf-server/minecraft-patches/features/0288-optimize-getOnPos.patch diff --git a/leaf-server/minecraft-patches/features/0290-cache-eye-block-position.patch b/leaf-server/minecraft-patches/features/0289-cache-eye-block-position.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0290-cache-eye-block-position.patch rename to leaf-server/minecraft-patches/features/0289-cache-eye-block-position.patch diff --git a/leaf-server/minecraft-patches/features/0291-optimize-updateFluidHeightAndDoFluidPushing.patch b/leaf-server/minecraft-patches/features/0290-optimize-updateFluidHeightAndDoFluidPushing.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0291-optimize-updateFluidHeightAndDoFluidPushing.patch rename to leaf-server/minecraft-patches/features/0290-optimize-updateFluidHeightAndDoFluidPushing.patch diff --git a/leaf-server/minecraft-patches/features/0292-optimize-checkInsideBlocks.patch b/leaf-server/minecraft-patches/features/0291-optimize-checkInsideBlocks.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0292-optimize-checkInsideBlocks.patch rename to leaf-server/minecraft-patches/features/0291-optimize-checkInsideBlocks.patch diff --git a/leaf-server/minecraft-patches/features/0293-replace-entity-fluid-height-map.patch b/leaf-server/minecraft-patches/features/0292-replace-entity-fluid-height-map.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0293-replace-entity-fluid-height-map.patch rename to leaf-server/minecraft-patches/features/0292-replace-entity-fluid-height-map.patch diff --git a/leaf-server/minecraft-patches/features/0294-optimize-collision-shape.patch b/leaf-server/minecraft-patches/features/0293-optimize-collision-shape.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0294-optimize-collision-shape.patch rename to leaf-server/minecraft-patches/features/0293-optimize-collision-shape.patch diff --git a/leaf-server/minecraft-patches/features/0295-cache-collision-list.patch b/leaf-server/minecraft-patches/features/0294-cache-collision-list.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0295-cache-collision-list.patch rename to leaf-server/minecraft-patches/features/0294-cache-collision-list.patch diff --git a/leaf-server/minecraft-patches/features/0296-fast-bit-radix-sort.patch b/leaf-server/minecraft-patches/features/0295-fast-bit-radix-sort.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0296-fast-bit-radix-sort.patch rename to leaf-server/minecraft-patches/features/0295-fast-bit-radix-sort.patch diff --git a/leaf-server/minecraft-patches/features/0297-optimize-tickEffects.patch b/leaf-server/minecraft-patches/features/0296-optimize-tickEffects.patch similarity index 94% rename from leaf-server/minecraft-patches/features/0297-optimize-tickEffects.patch rename to leaf-server/minecraft-patches/features/0296-optimize-tickEffects.patch index bdb4733a..fc459616 100644 --- a/leaf-server/minecraft-patches/features/0297-optimize-tickEffects.patch +++ b/leaf-server/minecraft-patches/features/0296-optimize-tickEffects.patch @@ -5,7 +5,7 @@ Subject: [PATCH] optimize tickEffects diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 8baa17d2eadfa83b1fcb36fcd1408e917b883989..0d28c1b11dacd6487185d9f8a5a042afa3a9863b 100644 +index 8baa17d2eadfa83b1fcb36fcd1408e917b883989..1799cdc0b6c1e585e7e1eeab3828ea0252ae2097 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -950,6 +950,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin diff --git a/leaf-server/paper-patches/features/0059-Op-lock.patch b/leaf-server/paper-patches/features/0059-Op-lock.patch deleted file mode 100644 index 6ac0e51b..00000000 --- a/leaf-server/paper-patches/features/0059-Op-lock.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Taiyou06 -Date: Tue, 22 Jul 2025 22:33:07 +0200 -Subject: [PATCH] Op lock - - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 3b516f57854f6482b3748d0c3a037fdeacfe78ab..b4e393da9d445aa7779868310cabfebff78f64dc 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -@@ -100,10 +100,14 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa - - @Override - public void setOp(boolean value) { -+ if (org.dreeam.leaf.config.modules.misc.OpLock.preventOpChanges) { -+ Bukkit.getLogger().severe("[Leaf] A plugin tried to change the player op! Dumping stacktrace now."); -+ Thread.dumpStack(); -+ return; -+ } - if (value == this.isOp()) { - return; - } -- - if (value) { - this.server.getHandle().op(this.profile); - } else { -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index b02826fc7390eb1fd7c2a1b597a5f1abf156b1c1..736563bd3a462911ec99a8158fc5bd3e4115aa62 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -306,6 +306,11 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { - - @Override - public void setOp(boolean value) { -+ if (org.dreeam.leaf.config.modules.misc.OpLock.preventOpChanges) { -+ org.bukkit.Bukkit.getLogger().severe("[Leaf] A plugin tried to change the player op! Dumping stacktrace now."); -+ Thread.dumpStack(); -+ return; -+ } - this.op = value; - this.perm.recalculatePermissions(); - } -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a5c0b4bed976c314cee3947caf1c6db78dcf53ae..1fd4bea31ed92903a3727b1f311dfaa37d5bc684 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -279,6 +279,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa - - @Override - public void setOp(boolean value) { -+ if (org.dreeam.leaf.config.modules.misc.OpLock.preventOpChanges) { -+ Bukkit.getLogger().severe("[Leaf] A plugin tried to change the player op! Dumping stacktrace now."); -+ Thread.dumpStack(); -+ return; -+ } - if (value == this.isOp()) return; - - if (value) { diff --git a/leaf-server/paper-patches/features/0060-cache-profile-data.patch b/leaf-server/paper-patches/features/0059-cache-profile-data.patch similarity index 100% rename from leaf-server/paper-patches/features/0060-cache-profile-data.patch rename to leaf-server/paper-patches/features/0059-cache-profile-data.patch diff --git a/leaf-server/paper-patches/features/0061-Bump-netty-to-4.2.x.patch b/leaf-server/paper-patches/features/0060-Bump-netty-to-4.2.x.patch similarity index 100% rename from leaf-server/paper-patches/features/0061-Bump-netty-to-4.2.x.patch rename to leaf-server/paper-patches/features/0060-Bump-netty-to-4.2.x.patch diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/OpLock.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/OpLock.java deleted file mode 100644 index cb8c3e2a..00000000 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/OpLock.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.dreeam.leaf.config.modules.misc; - -import org.dreeam.leaf.config.ConfigModules; -import org.dreeam.leaf.config.EnumConfigCategory; - -public class OpLock extends ConfigModules { - - public String getBasePath() { - return EnumConfigCategory.MISC.getBaseKeyName() + ".op-system-protection"; - } - - public static boolean preventOpChanges = false; - - @Override - public void onLoaded() { - config.addCommentRegionBased(getBasePath(), """ - When enabled, prevents plugins from programmatically changing player operator status. - This helps maintain server security by blocking unauthorized op modifications. - Server administrators can still manually manage ops through console/commands.""", - """ - 启用后,防止插件以编程方式更改玩家操作员状态。 - 这有助于通过阻止未经授权的op修改来维护服务器安全性。 - 服务器管理员仍可通过控制台/命令手动管理ops。"""); - - preventOpChanges = config.getBoolean(getBasePath() + ".prevent-op-changes", preventOpChanges); - } -}