Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
463e408
feat: neo command
MC-XiaoHei Aug 22, 2025
55061cf
feat: add action part
MC-XiaoHei Aug 22, 2025
285e70a
fix: fix bot action command
MC-XiaoHei Aug 23, 2025
eb86035
feat: finish perms system, fix bugs
MC-XiaoHei Aug 23, 2025
67e128d
feat: add bot config command
MC-XiaoHei Aug 24, 2025
ce40c8e
feat: switch to new bot command
MC-XiaoHei Aug 24, 2025
58500b9
fix: fix suppress annotation
MC-XiaoHei Aug 24, 2025
3e2b63c
feat: add bot remove, fix stupid me
MC-XiaoHei Aug 24, 2025
ef6c820
feat: add show all config
MC-XiaoHei Aug 24, 2025
d0fb999
feat: finish leaves command
MC-XiaoHei Aug 24, 2025
e7086a8
Merge branch 'master' into dev/new-command
MC-XiaoHei Aug 24, 2025
a994f8b
refactor: refactor command
MC-XiaoHei Aug 24, 2025
cfafc26
refactor: remove unused check
MC-XiaoHei Aug 24, 2025
69ac9ca
refactor: refactor
MC-XiaoHei Aug 24, 2025
6d5576e
fix: fix logic
MC-XiaoHei Aug 24, 2025
9a7ad6c
refactor: format
MC-XiaoHei Aug 24, 2025
dfeb919
fix: fix msg
MC-XiaoHei Aug 24, 2025
568bf16
refactor: better msg
MC-XiaoHei Aug 24, 2025
5f5dcb5
feat: custom bot action
MC-XiaoHei Aug 25, 2025
f230b76
Merge branch 'master' into dev/new-command
MC-XiaoHei Aug 27, 2025
1241342
Merge branch 'master' into dev/new-command
MC-XiaoHei Aug 31, 2025
d0a41bb
feat: rename patch
MC-XiaoHei Sep 2, 2025
63fdbf0
fix: fix bot command register
MC-XiaoHei Sep 2, 2025
0bdc2db
refactor: format & refactor code
MC-XiaoHei Sep 11, 2025
1d42cd4
Merge branch 'master' into dev/new-command
MC-XiaoHei Sep 11, 2025
0f8a921
Merge branch 'master' into dev/new-command
MC-XiaoHei Sep 12, 2025
018238b
Merge branch 'master' into dev/new-command
MC-XiaoHei Sep 12, 2025
17b84dc
Merge branch 'master' into dev/new-command
MC-XiaoHei Sep 18, 2025
167841e
Merge branch 'master' into dev/new-command
MC-XiaoHei Sep 23, 2025
b155a05
Merge branch 'master' into dev/new-command
MC-XiaoHei Sep 23, 2025
dd3af55
Some format
s-yh-china Sep 23, 2025
9fefded
refactor: refactor config and action
MC-XiaoHei Sep 23, 2025
e5d5c47
refactor: use paper command api
MC-XiaoHei Sep 24, 2025
42845d1
refactor: use paper command api
MC-XiaoHei Sep 24, 2025
d89a099
feat: use raycasting in mount action
MC-XiaoHei Sep 24, 2025
b658777
feat: try to impl custom
MC-XiaoHei Sep 24, 2025
8daf717
Revert "feat: try to impl custom"
MC-XiaoHei Sep 25, 2025
6c4f132
Merge branch 'master' into dev/new-command
MC-XiaoHei Sep 27, 2025
bb8ac99
chore: format
MC-XiaoHei Oct 1, 2025
9d36c03
Merge remote-tracking branch 'origin/dev/1.21.9' into dev/new-command
MC-XiaoHei Oct 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ Subject: [PATCH] No block update command


diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
index 5d4eb61af0b0f39a5d4c37f4a303fa24b3a2936d..48bb795216ca3fb301813080de403a048bbfa98c 100644
index 9cce442c16ced8d9320a5760580ff13f02cbf8f1..6c67c3b9e7c70366c2889932fd4c0265218656d4 100644
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -381,7 +381,7 @@ public class ServerPlayerGameMode {
org.bukkit.block.BlockState state = bblock.getState();
this.level.captureDrops = new java.util.ArrayList<>();
// CraftBukkit end
- BlockState blockState1 = block.playerWillDestroy(this.level, pos, blockState, this.player);
+ BlockState blockState1 = org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate() ? blockState : block.playerWillDestroy(this.level, pos, blockState, this.player); // Leaves - no block update
+ BlockState blockState1 = org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate() ? blockState : block.playerWillDestroy(this.level, pos, blockState, this.player); // Leaves - no block update
boolean flag = this.level.removeBlock(pos, false);
if (flag) {
block.destroy(this.level, pos, blockState1);
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
index ef8a072838558caab19e8a85f4b59cac570c2635..590252ca203124f0b720a73f174c92fbe49bc685 100644
index 6202ea6f6f8e6b751434848fb6551c61162d076b..a8c20ef3be53bd462e4c352a08f4b7201a8af373 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -1089,6 +1089,11 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl

@Override
public boolean setBlock(BlockPos pos, BlockState state, int flags, int recursionLeft) {
+ // Leaves start - no block update
+ if (org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ if (org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ flags = flags & ~1 | net.minecraft.world.level.block.Block.UPDATE_SKIP_ON_PLACE;
+ }
+ // Leaves end - no block update
Expand All @@ -38,7 +38,7 @@ index ef8a072838558caab19e8a85f4b59cac570c2635..590252ca203124f0b720a73f174c92fb
BlockState blockState = oldState;
BlockState blockState1 = currentState;
+ // Leaves start - no block update
+ if (org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ if (org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ flags = flags & ~1 | net.minecraft.world.level.block.Block.UPDATE_SKIP_ON_PLACE;
+ }
+ // Leaves end - no block update
Expand All @@ -51,7 +51,7 @@ index ef8a072838558caab19e8a85f4b59cac570c2635..590252ca203124f0b720a73f174c92fb
int i = flags & -34;
-
+ // Leaves start - no block update
+ if (org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ if (org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ this.updatePOIOnBlockStateChange(pos, blockState, blockState1);
+ return;
+ }
Expand All @@ -60,27 +60,27 @@ index ef8a072838558caab19e8a85f4b59cac570c2635..590252ca203124f0b720a73f174c92fb
blockState.updateIndirectNeighbourShapes(this, pos, i, recursionLeft - 1); // Don't call an event for the old block to limit event spam
boolean cancelledUpdates = false; // Paper - Fix block place logic
diff --git a/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
index 16aa9f5996dc6eda95541fddb01e00e41305357a..31ab92e0769aa4ce09da5073ad9b734eeebac9c5 100644
index 16aa9f5996dc6eda95541fddb01e00e41305357a..6bd7d937bab8baf7c657e689e8a1b4069c207ff9 100644
--- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java
+++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
@@ -105,6 +105,7 @@ public class PistonBaseBlock extends DirectionalBlock {
}

private void checkIfExtend(Level level, BlockPos pos, BlockState state) {
+ if (org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate()) return; // Leaves - no block update
+ if (org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate()) return; // Leaves - no block update
Direction direction = state.getValue(FACING);
boolean neighborSignal = this.getNeighborSignal(level, pos, direction);
if (neighborSignal && !state.getValue(EXTENDED)) {
diff --git a/net/minecraft/world/level/redstone/NeighborUpdater.java b/net/minecraft/world/level/redstone/NeighborUpdater.java
index 263bf2b795057c2d5218bf9cfb684e526601aa77..da1e77ccd8805ac0cb0729720b4a1742da67d35c 100644
index 8942aa2ca4796c7c36c0955141627ea905e0ec64..2d2b7f3284171517d1e68cef802ae197e2e6f8bb 100644
--- a/net/minecraft/world/level/redstone/NeighborUpdater.java
+++ b/net/minecraft/world/level/redstone/NeighborUpdater.java
@@ -34,6 +34,11 @@ public interface NeighborUpdater {
static void executeShapeUpdate(
LevelAccessor level, Direction direction, BlockPos pos, BlockPos neighborPos, BlockState neighborState, int flags, int recursionLeft
) {
+ // Leaves start - no block update
+ if (org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ if (org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ flags = flags & ~1 | net.minecraft.world.level.block.Block.UPDATE_SKIP_ON_PLACE;
+ }
+ // Leaves end - no block update
Expand All @@ -91,7 +91,7 @@ index 263bf2b795057c2d5218bf9cfb684e526601aa77..da1e77ccd8805ac0cb0729720b4a1742

static void executeUpdate(Level level, BlockState state, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston, BlockPos sourcePos) {
// Paper end - Add source block to BlockPhysicsEvent
+ if (org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate()) return; // Leaves - no block update
+ if (org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate()) return; // Leaves - no block update
try {
// CraftBukkit start
org.bukkit.event.block.BlockPhysicsEvent event = new org.bukkit.event.block.BlockPhysicsEvent(org.bukkit.craftbukkit.block.CraftBlock.at(level, pos), org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), org.bukkit.craftbukkit.block.CraftBlock.at(level, sourcePos)); // Paper - Add source block to BlockPhysicsEvent
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Subject: [PATCH] Prevent loss of item drops due to update suppression when


diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
index f258bc30014f94243ad832b33dcb6c9acd1f2f08..9a4eb1f8e01517707befa30b3ccacc7c84c0abe9 100644
index 6c67c3b9e7c70366c2889932fd4c0265218656d4..3cc4ebfb9f083e8872460d6c47ad1d76d2cba990 100644
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -382,7 +382,18 @@ public class ServerPlayerGameMode {
this.level.captureDrops = new java.util.ArrayList<>();
// CraftBukkit end
BlockState blockState1 = org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate() ? blockState : block.playerWillDestroy(this.level, pos, blockState, this.player); // Leaves - no block update
BlockState blockState1 = org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate() ? blockState : block.playerWillDestroy(this.level, pos, blockState, this.player); // Leaves - no block update
- boolean flag = this.level.removeBlock(pos, false);
+ // Leaves start - Prevent loss of item drops due to update suppression when breaking blocks
+ boolean flag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,13 @@ index a63330b232dc41f0a5bb36bb94dfb84f01504699..7fbce8302739ab016f1b64f8227c6d72
+ // Leaves end - Lithium Sleeping Block Entity
}
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
index f31a48530e965f01507c335f50d898ed72767e3c..e5b12f0be3c21b14b1fd8a33b20a9292e3b7b8df 100644
index 3699a9688c15afb2219e504ce6f3f27ea038b575..fc3517a1f14b72f127ab1e9342750491066a56cc 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -1224,6 +1224,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
int i = flags & -34;
// Leaves start - no block update
if (org.leavesmc.leaves.command.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
if (org.leavesmc.leaves.command.leaves.subcommands.BlockUpdateCommand.isNoBlockUpdate()) {
+ if (org.leavesmc.leaves.LeavesConfig.performance.sleepingBlockEntity) org.leavesmc.leaves.lithium.common.hopper.HopperHelper.updateHopperOnUpdateSuppression(this, pos, flags, chunkAt, oldState != currentState); // Leaves - Lithium Sleeping Block Entity
this.updatePOIOnBlockStateChange(pos, blockState, blockState1);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@ index 62e2d5704c348955bc8284dc2d54c933b7bcdd06..7ef20f0138fad39a1d23edd7b26ddc88
@Override
public void executeAsync(final Runnable runnable) {
MCUtil.scheduleAsyncTask(this.catching(runnable, "asynchronous"));
diff --git a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
index 5c52b1563d20d7e977a5bb958c18b19dec5c365a..65664441c5692620a8b22513ded497b7951a3245 100644
--- a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
+++ b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
@@ -106,6 +106,13 @@ public class BukkitCommandNode extends LiteralCommandNode<CommandSourceStack> {
List<String> results = null;
Location pos = context.getSource().getLocation();
try {
+ // Leaves start - custom suggestion
+ if (this.command instanceof org.leavesmc.leaves.command.LeavesSuggestionCommand suggestionCommand) {
+ org.leavesmc.leaves.command.LeavesSuggestionBuilder suggestionBuilder = new org.leavesmc.leaves.command.LeavesSuggestionBuilder(builder.createOffset(builder.getInput().lastIndexOf(' ') + 1));
+ suggestionCommand.suggest(sender, this.literal, args, pos.clone(), suggestionBuilder);
+ return suggestionBuilder.build();
+ }
+ // Leaves end - custom suggestion
results = this.command.tabComplete(sender, this.literal, args, pos.clone());
} catch (CommandException ex) {
sender.sendMessage(Component.text("An internal error occurred while attempting to tab-complete this command", NamedTextColor.RED));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 32fe51b19323e3c4c56e7f9e621e6e808ee5fe38..2eba1d900b20a781c4bb08caa2b30bfeb2d02b9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
Expand Down
Loading