Initial Commit

This commit is contained in:
MrHua269
2026-07-09 14:36:37 +08:00
commit de6a4944e6
243 changed files with 21326 additions and 0 deletions
@@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Libalpm64 <levamara@proton.me>
Date: Thu, 9 Jul 2026 10:08:30 +0800
Subject: [PATCH] Add config for item multitask
Allows players to use items while moving or switching hotbar slots. This
is for Anarchy servers or Crystal PVP servers this allows them to pvp
without stopping the item mid animation.
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4c9ea818be83ed3c4dacc762f4d0e8c0f177cd19..9fe5ee1c5578be6f6c5ad9a58e10669a4b7ac75a 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2169,7 +2169,9 @@ public class ServerGamePacketListenerImpl
this.player.sendSpawnProtectionMessage(pos);
} else if (this.awaitingPositionFromClient == null && (level.mayInteract(this.player, pos) || passthroughSignInteraction)) {
// Paper end - Allow using signs inside spawn protection
+ if (!moe.monnairealms.camellia.config.modules.fixes.ItemMultitaskConfig.enabled) { // Camellia - Add config for item multitask
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
+ } // Camellia - Add config for item multitask
InteractionResult interactionResult = this.player.gameMode.useItemOn(this.player, level, itemStack, hand, blockHit);
if (interactionResult.consumesAction()) {
CriteriaTriggers.ANY_BLOCK_USE.trigger(this.player, blockHit.getBlockPos(), itemStack);
@@ -2368,9 +2370,13 @@ public class ServerGamePacketListenerImpl
return;
}
// CraftBukkit end
- if (this.player.getInventory().getSelectedSlot() != packet.getSlot() && this.player.getUsedItemHand() == InteractionHand.MAIN_HAND) {
- this.player.stopUsingItem();
+ // Camellia start - Add item multitask config
+ if (!moe.monnairealms.camellia.config.modules.fixes.ItemMultitaskConfig.enabled) {
+ if (this.player.getInventory().getSelectedSlot() != packet.getSlot() && this.player.getUsedItemHand() == InteractionHand.MAIN_HAND) {
+ this.player.stopUsingItem();
+ }
}
+ // Camellia end
this.player.getInventory().setSelectedSlot(packet.getSlot());
this.player.resetLastActionTime();