diff --git a/patches/server/0050-Carpet-alternative-block-placement-Protocol.patch b/patches/server/0050-Carpet-alternative-block-placement-Protocol.patch index 0e8cdae5..fab863e4 100644 --- a/patches/server/0050-Carpet-alternative-block-placement-Protocol.patch +++ b/patches/server/0050-Carpet-alternative-block-placement-Protocol.patch @@ -5,19 +5,6 @@ Subject: [PATCH] Carpet alternative block placement Protocol This patch is Powered by carpet-extra(https://github.com/gnembon/carpet-extra) -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9f3898e3b079a1d59e66546c66a64b3f5179b0b5..cbf9750994ca008f467d82e34a455efd7d7e87bb 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1948,7 +1948,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - Vec3 vec3d2 = vec3d.subtract(vec3d1); - double d0 = 1.0000001D; - -- if (Math.abs(vec3d2.x()) < 1.0000001D && Math.abs(vec3d2.y()) < 1.0000001D && Math.abs(vec3d2.z()) < 1.0000001D) { -+ if (top.leavesmc.leaves.LeavesConfig.carpetAlternativeBlockPlacement || (Math.abs(vec3d2.x()) < 1.0000001D && Math.abs(vec3d2.y()) < 1.0000001D && Math.abs(vec3d2.z()) < 1.0000001D)) { // Leaves - carpetAlternativeBlockPlacement - Direction enumdirection = movingobjectpositionblock.getDirection(); - - this.player.resetLastActionTime(); diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java index ebee8de2ed831755b6fd154f6cc77ac993839bb9..1015b3c5f6969709bb8ebfbd66eb9cede444385c 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java @@ -78,20 +65,16 @@ index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..08e456ee6a537c5cc8b6314f9f899b25 public BlockState getStateForPlacement(BlockPlaceContext ctx) { return this.defaultBlockState(); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 696d290df17274b7e82b2d12ea2c16b28173f660..be07458a96a0e7da995ce349a70be9f1b648da23 100644 +index 696d290df17274b7e82b2d12ea2c16b28173f660..0860bfdfbb8938cebad4b9662f26375082823c8a 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -434,6 +434,15 @@ public final class LeavesConfig { +@@ -434,6 +434,11 @@ public final class LeavesConfig { jadeProtocol = getBoolean("settings.protocol.jade-protocol", jadeProtocol); } + public static boolean carpetAlternativeBlockPlacement = false; + private static void carpetAlternativeBlockPlacement() { + carpetAlternativeBlockPlacement = getBoolean("settings.protocol.carpet-alternative-block-placement", carpetAlternativeBlockPlacement); -+ if (carpetAlternativeBlockPlacement) { -+ LeavesLogger.LOGGER.warning("If use carpet-alternative-block-placement, too far away form hit block check of UseItemOnPacket will be broken."); -+ LeavesLogger.LOGGER.warning("If you do not use it, you need to set it to false"); -+ } + } + public static final class WorldConfig { diff --git a/patches/server/0051-Player-operation-limiter.patch b/patches/server/0051-Player-operation-limiter.patch index 776fc276..37f47155 100644 --- a/patches/server/0051-Player-operation-limiter.patch +++ b/patches/server/0051-Player-operation-limiter.patch @@ -132,11 +132,11 @@ index 1015b3c5f6969709bb8ebfbd66eb9cede444385c..437ed8d4cba5e3393ac6370f6b8e364e return InteractionResult.FAIL; } else if (!this.placeBlock(blockactioncontext1, iblockdata)) { diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index be07458a96a0e7da995ce349a70be9f1b648da23..dbcc4046b447ef6d5f22948552cc54afd9d1b6f5 100644 +index 0860bfdfbb8938cebad4b9662f26375082823c8a..72a750e05f7abe71bf3be8884c4b396cb715d99f 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -443,6 +443,11 @@ public final class LeavesConfig { - } +@@ -439,6 +439,11 @@ public final class LeavesConfig { + carpetAlternativeBlockPlacement = getBoolean("settings.protocol.carpet-alternative-block-placement", carpetAlternativeBlockPlacement); } + public static boolean playerOperationLimiter = false; diff --git a/patches/server/0052-Renewable-Elytra.patch b/patches/server/0052-Renewable-Elytra.patch index eb98b4cd..b8cb3d46 100644 --- a/patches/server/0052-Renewable-Elytra.patch +++ b/patches/server/0052-Renewable-Elytra.patch @@ -40,10 +40,10 @@ index 97fb1d2110a51498f6419841081b500b3f190370..8fb8bc48342183b978b4bfb0845f2cc2 java.util.UUID spawningEntity; diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index dbcc4046b447ef6d5f22948552cc54afd9d1b6f5..760eb626aedf93b84e4ba0fbb05c85869f6131b1 100644 +index 72a750e05f7abe71bf3be8884c4b396cb715d99f..35c1e3e82f372c5290725f80621f7b9850a29acd 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -448,6 +448,11 @@ public final class LeavesConfig { +@@ -444,6 +444,11 @@ public final class LeavesConfig { playerOperationLimiter = getBoolean("settings.modify.player-operation-limiter", playerOperationLimiter); } diff --git a/patches/server/0053-Stackable-ShulkerBoxes.patch b/patches/server/0053-Stackable-ShulkerBoxes.patch index c028a26c..aec5675e 100644 --- a/patches/server/0053-Stackable-ShulkerBoxes.patch +++ b/patches/server/0053-Stackable-ShulkerBoxes.patch @@ -278,7 +278,7 @@ index 47468086c1cae252aa99c55b0065f225357dee62..bca757ea05403fe46f5bf0dfa75561b8 public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { return SHAPE; diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 760eb626aedf93b84e4ba0fbb05c85869f6131b1..2d75a91da7cea7e40f18fbb200c6507b3164f3de 100644 +index 35c1e3e82f372c5290725f80621f7b9850a29acd..5d41d1309e133a4b6dc0e73c43168385256446cb 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -9,6 +9,7 @@ import org.bukkit.configuration.ConfigurationSection; @@ -289,7 +289,7 @@ index 760eb626aedf93b84e4ba0fbb05c85869f6131b1..2d75a91da7cea7e40f18fbb200c6507b import java.io.File; import java.lang.reflect.InvocationTargetException; -@@ -453,6 +454,14 @@ public final class LeavesConfig { +@@ -449,6 +450,14 @@ public final class LeavesConfig { renewableElytra = getDouble("settings.modify.renewable-elytra", renewableElytra); } diff --git a/patches/server/0054-Improve-fluid-direction-caching.patch b/patches/server/0054-Improve-fluid-direction-caching.patch index 9330b215..89d4b29f 100644 --- a/patches/server/0054-Improve-fluid-direction-caching.patch +++ b/patches/server/0054-Improve-fluid-direction-caching.patch @@ -117,10 +117,10 @@ index bf4de7b8fd630c596e096a411a8c84c64c13ebf7..72a1414efbcf62c888c3f4542985709c public abstract Fluid getFlowing(); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 2d75a91da7cea7e40f18fbb200c6507b3164f3de..ecf0c849a514eaf63f13ebf5f5af70c7b84433ea 100644 +index 5d41d1309e133a4b6dc0e73c43168385256446cb..b3ae62eebb15ca41b55b0f994aa7230ec35d4a0e 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -462,6 +462,15 @@ public final class LeavesConfig { +@@ -458,6 +458,15 @@ public final class LeavesConfig { shulkerBoxStackSize = Integer.parseInt(stackableShulkerBoxes); } diff --git a/patches/server/0055-MC-Technical-Survival-Mode.patch b/patches/server/0055-MC-Technical-Survival-Mode.patch index fe97d272..aa91eb2c 100644 --- a/patches/server/0055-MC-Technical-Survival-Mode.patch +++ b/patches/server/0055-MC-Technical-Survival-Mode.patch @@ -70,7 +70,7 @@ index 7a3bd3e7aa208ade1d33f59ba684354d000dd011..164dd501456542c16e2e36262ba560f9 entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { continue; diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index ecf0c849a514eaf63f13ebf5f5af70c7b84433ea..01f2fcbdae8bfd3fcce13fed959bb5922a463cbc 100644 +index b3ae62eebb15ca41b55b0f994aa7230ec35d4a0e..9b73017d8ace6229aff2688981ffa69caf336dd5 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -2,11 +2,13 @@ package top.leavesmc.leaves; @@ -87,7 +87,7 @@ index ecf0c849a514eaf63f13ebf5f5af70c7b84433ea..01f2fcbdae8bfd3fcce13fed959bb592 import top.leavesmc.leaves.bot.BotCommand; import top.leavesmc.leaves.bot.agent.Actions; import top.leavesmc.leaves.util.MathUtils; -@@ -471,6 +473,24 @@ public final class LeavesConfig { +@@ -467,6 +469,24 @@ public final class LeavesConfig { } } diff --git a/patches/server/0056-Return-nether-portal-fix.patch b/patches/server/0056-Return-nether-portal-fix.patch index de6e9e84..e23bb584 100644 --- a/patches/server/0056-Return-nether-portal-fix.patch +++ b/patches/server/0056-Return-nether-portal-fix.patch @@ -134,10 +134,10 @@ index 523a46eb4a23b4a4aa9e5ea38771a5953c1bdccc..00d88ed58b8fe93e8655d675f9d5e4f8 @Nullable private DamageSource lastDamageSource; diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 01f2fcbdae8bfd3fcce13fed959bb5922a463cbc..238458774bb335b5479f58bd38b195cf14f165bb 100644 +index 9b73017d8ace6229aff2688981ffa69caf336dd5..9cd0abc273391be06511d1f60fe594711ef16f00 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -491,6 +491,11 @@ public final class LeavesConfig { +@@ -487,6 +487,11 @@ public final class LeavesConfig { } } diff --git a/patches/server/0057-Appleskin-Protocol.patch b/patches/server/0057-Appleskin-Protocol.patch index 8375c0c0..43b71d06 100644 --- a/patches/server/0057-Appleskin-Protocol.patch +++ b/patches/server/0057-Appleskin-Protocol.patch @@ -55,10 +55,10 @@ index b669bfc2b3d9271e173015d20fa8753423307ec8..79dbeceee5a89dd97873f06a2c08b079 // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 238458774bb335b5479f58bd38b195cf14f165bb..72d97a4a632bac3766d74f9155f2ab66a2b8e4ad 100644 +index 9cd0abc273391be06511d1f60fe594711ef16f00..ec4bb4e4b08ba3165d978ffd3f055e1aeb6f3f50 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -496,6 +496,11 @@ public final class LeavesConfig { +@@ -492,6 +492,11 @@ public final class LeavesConfig { netherPortalFix = getBoolean("settings.modify.return-nether-portal-fix", netherPortalFix); } diff --git a/patches/server/0058-Xaero-Map-Protocol.patch b/patches/server/0058-Xaero-Map-Protocol.patch index 4e31821a..268b2d3f 100644 --- a/patches/server/0058-Xaero-Map-Protocol.patch +++ b/patches/server/0058-Xaero-Map-Protocol.patch @@ -17,7 +17,7 @@ index afb3bbe9589e5398cd6a2252417f225ae773de43..3d2302c87160be94f73b43625049efd6 // CraftBukkit start - handle player weather // entityplayer.connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.START_RAINING, 0.0F)); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 72d97a4a632bac3766d74f9155f2ab66a2b8e4ad..3c4b65fee57c4bb074d2770f974329118e2104c1 100644 +index ec4bb4e4b08ba3165d978ffd3f055e1aeb6f3f50..e265d335d57b3f4639c9ad03cb80e9997fa26695 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -20,6 +20,7 @@ import java.lang.reflect.Modifier; @@ -28,7 +28,7 @@ index 72d97a4a632bac3766d74f9155f2ab66a2b8e4ad..3c4b65fee57c4bb074d2770f97432911 import java.util.logging.Level; // Powered by Tuinity(https://github.com/Tuinity/Tuinity) -@@ -501,6 +502,13 @@ public final class LeavesConfig { +@@ -497,6 +498,13 @@ public final class LeavesConfig { appleskinProtocol = getBoolean("settings.protocol.appleskin-protocol", appleskinProtocol); } diff --git a/patches/server/0059-Leaves-Extra-Yggdrasil-Service.patch b/patches/server/0059-Leaves-Extra-Yggdrasil-Service.patch index 5ce06949..ce947ba8 100644 --- a/patches/server/0059-Leaves-Extra-Yggdrasil-Service.patch +++ b/patches/server/0059-Leaves-Extra-Yggdrasil-Service.patch @@ -31,7 +31,7 @@ index cdbf10339a8e8846a8c364de483a0ccd95cd225a..60bfeafed9a6ce7a8b9de128268f462b String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 3c4b65fee57c4bb074d2770f974329118e2104c1..704118ad6a19df9a5ee9428265efe8c776504109 100644 +index e265d335d57b3f4639c9ad03cb80e9997fa26695..fd79c97dc8bda65b47e8e0e792e3525bae9e2b7b 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -11,6 +11,7 @@ import org.bukkit.configuration.file.YamlConfiguration; @@ -42,7 +42,7 @@ index 3c4b65fee57c4bb074d2770f974329118e2104c1..704118ad6a19df9a5ee9428265efe8c7 import top.leavesmc.leaves.util.MathUtils; import java.io.File; -@@ -509,6 +510,18 @@ public final class LeavesConfig { +@@ -505,6 +506,18 @@ public final class LeavesConfig { xaeroMapServerID = getInt("settings.protocol.xaero-map-server-id", xaeroMapServerID); } diff --git a/patches/server/0060-Use-vanilla-random-config.patch b/patches/server/0060-Use-vanilla-random-config.patch index 67301c03..4a5083eb 100644 --- a/patches/server/0060-Use-vanilla-random-config.patch +++ b/patches/server/0060-Use-vanilla-random-config.patch @@ -31,10 +31,10 @@ index 72eea6e512060fc622ca79ca87437f19a64604cc..f5413946fecaa0d7b9d41dd06f12c460 } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 704118ad6a19df9a5ee9428265efe8c776504109..e1017c5cf088fe90b10e87bd04d4f33ba29cfb0b 100644 +index fd79c97dc8bda65b47e8e0e792e3525bae9e2b7b..201eca1046fd296899538fc630d3857b3579f4a3 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -522,6 +522,15 @@ public final class LeavesConfig { +@@ -518,6 +518,15 @@ public final class LeavesConfig { } } diff --git a/patches/server/0061-Fix-update-suppression-crash.patch b/patches/server/0061-Fix-update-suppression-crash.patch index 20f943e8..8698ca46 100644 --- a/patches/server/0061-Fix-update-suppression-crash.patch +++ b/patches/server/0061-Fix-update-suppression-crash.patch @@ -61,10 +61,10 @@ index 19faa8f5f891c1ffbed0af8391dee8202433c447..0f8d5495f9f7306f3267a0741cb6a1a6 CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Block being updated"); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index e1017c5cf088fe90b10e87bd04d4f33ba29cfb0b..206f4256775a1527dfee1ed38f8c8c07a49269f6 100644 +index 201eca1046fd296899538fc630d3857b3579f4a3..dc27195871590ba2b13d299cca5a63193a3da9d5 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -531,6 +531,11 @@ public final class LeavesConfig { +@@ -527,6 +527,11 @@ public final class LeavesConfig { } } diff --git a/patches/server/0062-Bedrock-break-list.patch b/patches/server/0062-Bedrock-break-list.patch index 39dcc6b2..d8b0e90a 100644 --- a/patches/server/0062-Bedrock-break-list.patch +++ b/patches/server/0062-Bedrock-break-list.patch @@ -79,10 +79,10 @@ index f456ad8a74464414f69b616a48ee9a2c1cee4d90..ab39df0ea273a5c9a67b34caa68e9262 } else { ((ServerLevel)world).getChunkSource().blockChanged(headPos); // ... fix client desync diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 206f4256775a1527dfee1ed38f8c8c07a49269f6..9500f0fe556b7a35e97c97c8cf4726fd68e8170c 100644 +index dc27195871590ba2b13d299cca5a63193a3da9d5..7936ede1225be757c89e24af8a56530cfc7042f3 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -536,6 +536,15 @@ public final class LeavesConfig { +@@ -532,6 +532,15 @@ public final class LeavesConfig { updateSuppressionCrashFix = getBoolean("settings.modify.fix-update-suppression-crash", updateSuppressionCrashFix); } diff --git a/patches/server/0063-Syncmatica-Protocol.patch b/patches/server/0063-Syncmatica-Protocol.patch index de80ae3f..a6e5772b 100644 --- a/patches/server/0063-Syncmatica-Protocol.patch +++ b/patches/server/0063-Syncmatica-Protocol.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Syncmatica Protocol This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica) diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cbf9750994ca008f467d82e34a455efd7d7e87bb..fa6400b62905d7cbf8ec35b220121240e8651cd5 100644 +index 9f3898e3b079a1d59e66546c66a64b3f5179b0b5..c098ad149f5dd7829aa2ffde5f45fd5c43ac4d59 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -322,6 +322,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -54,7 +54,7 @@ index cbf9750994ca008f467d82e34a455efd7d7e87bb..fa6400b62905d7cbf8ec35b220121240 ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); this.disconnect("Invalid custom payload!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 9500f0fe556b7a35e97c97c8cf4726fd68e8170c..130a5b9a6b08cd3ec022d27b861f17819cd27f94 100644 +index 7936ede1225be757c89e24af8a56530cfc7042f3..1fd9d864d76f264eec4b8413f2653460c181521b 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -12,6 +12,7 @@ import org.spigotmc.SpigotConfig; @@ -65,7 +65,7 @@ index 9500f0fe556b7a35e97c97c8cf4726fd68e8170c..130a5b9a6b08cd3ec022d27b861f1781 import top.leavesmc.leaves.util.MathUtils; import java.io.File; -@@ -545,6 +546,18 @@ public final class LeavesConfig { +@@ -541,6 +542,18 @@ public final class LeavesConfig { } } diff --git a/patches/server/0065-Disable-distance-check-for-UseItemOnPacket.patch b/patches/server/0065-Disable-distance-check-for-UseItemOnPacket.patch new file mode 100644 index 00000000..99b5872a --- /dev/null +++ b/patches/server/0065-Disable-distance-check-for-UseItemOnPacket.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: violetc <58360096+s-yh-china@users.noreply.github.com> +Date: Tue, 23 May 2023 17:10:00 +0800 +Subject: [PATCH] Disable distance check for UseItemOnPacket + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index c098ad149f5dd7829aa2ffde5f45fd5c43ac4d59..b8b9ee4b023510bb672bb2b6bbf8d792632932c8 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -1956,7 +1956,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + Vec3 vec3d2 = vec3d.subtract(vec3d1); + double d0 = 1.0000001D; + +- if (Math.abs(vec3d2.x()) < 1.0000001D && Math.abs(vec3d2.y()) < 1.0000001D && Math.abs(vec3d2.z()) < 1.0000001D) { ++ if (top.leavesmc.leaves.LeavesConfig.disableDistanceCheckForUseItem || (Math.abs(vec3d2.x()) < 1.0000001D && Math.abs(vec3d2.y()) < 1.0000001D && Math.abs(vec3d2.z()) < 1.0000001D)) { // Leaves - disable check + Direction enumdirection = movingobjectpositionblock.getDirection(); + + this.player.resetLastActionTime(); +diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java +index 1fd9d864d76f264eec4b8413f2653460c181521b..0c852de41030dd0e2cab49790903de8097a0124d 100644 +--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java ++++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java +@@ -554,6 +554,14 @@ public final class LeavesConfig { + } + } + ++ public static boolean disableDistanceCheckForUseItem = false; ++ private static void disableDistanceCheckForUseItem() { ++ disableDistanceCheckForUseItem = getBoolean("settings.modify.disable-distance-check-for-use-item", disableDistanceCheckForUseItem); ++ if (carpetAlternativeBlockPlacement) { ++ disableDistanceCheckForUseItem = true; ++ } ++ } ++ + public static final class WorldConfig { + + public final String worldName;