9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-04 15:41:40 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0105-Remove-UseItemOnPacket-Too-Far-check.patch
Dreeam fbb7d752a0 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@51345a1c Correct nullable fall location type
PaperMC/Paper@93246a07 Fix errors when loading raid files without a PDC
PaperMC/Paper@cb3ffd0b Don't store empty PDCs on raids
PaperMC/Paper@d637ae85 Fix NoSuchElementException in EntityTransformEvent for slimes (#12510)
PaperMC/Paper@10742373 Pass correct draw strength for EntityShootBowEvent (#12308)
PaperMC/Paper@825685f8 Add PlayerPickBlockEvent and PlayerPickEntityEvent (#12425)
PaperMC/Paper@2bd84f6f Expand PotionMeta Api to allow getting effective potion colour and effects (#12390)
PaperMC/Paper@6f1f5b67 Fix ArmorStand items for canceled EntityDeathEvent (#12288)
2025-05-03 08:11:09 -04:00

29 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Fri, 18 Nov 2022 23:26:16 -0500
Subject: [PATCH] Remove UseItemOnPacket Too Far check
This Check is added in 1.17.x -> 1.18.x that updated by Mojang.
By removing this check, it gives ability for hackers to use some modules of hack clients.
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 39d4ae0ae1ec89007fe1c86dc8d3409902890552..470660998d3df511f00936bcaa210142ab8ba7b2 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2075,8 +2075,13 @@ public class ServerGamePacketListenerImpl
BlockPos blockPos = hitResult.getBlockPos();
if (this.player.canInteractWithBlock(blockPos, 1.0)) {
Vec3 vec3 = location.subtract(Vec3.atCenterOf(blockPos));
- double d = 1.0000001;
- if (Math.abs(vec3.x()) < 1.0000001 && Math.abs(vec3.y()) < 1.0000001 && Math.abs(vec3.z()) < 1.0000001) {
+ // Leaf start - Remove UseItemOnPacket Too Far check
+ //double d = 1.0000001;
+ final double maxDistance = org.dreeam.leaf.config.modules.gameplay.ConfigurableMaxUseItemDistance.maxUseItemDistance;
+ if (maxDistance <= 0
+ || (Math.abs(vec3.x()) < maxDistance && Math.abs(vec3.y()) < maxDistance && Math.abs(vec3.z()) < maxDistance)
+ ) {
+ // Leaf end - Remove UseItemOnPacket Too Far check
Direction direction = hitResult.getDirection();
this.player.resetLastActionTime();
int maxY = this.player.level().getMaxY();