mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Some server patches work
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
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/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index dc4a4d7de838d8756b0f5cbbc149b1d5cd2b4dd6..e26963501b7608097fc1be8f2c9530b082f2c0ec 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 extends ServerCommonPacketListenerImpl
|
||||
Vec3 vec3d1 = vec3d.subtract(Vec3.atCenterOf(blockposition));
|
||||
double d0 = 1.0000001D;
|
||||
|
||||
- if (Math.abs(vec3d1.x()) < 1.0000001D && Math.abs(vec3d1.y()) < 1.0000001D && Math.abs(vec3d1.z()) < 1.0000001D) {
|
||||
+ if (org.dreeam.leaf.config.modules.gameplay.ConfigurableMaxUseItemDistance.removeUseItemOnPacketTooFarCheck || (Math.abs(vec3d1.x()) < org.dreeam.leaf.config.modules.gameplay.ConfigurableMaxUseItemDistance.maxUseItemDistance && Math.abs(vec3d1.y()) < org.dreeam.leaf.config.modules.gameplay.ConfigurableMaxUseItemDistance.maxUseItemDistance && Math.abs(vec3d1.z()) < org.dreeam.leaf.config.modules.gameplay.ConfigurableMaxUseItemDistance.maxUseItemDistance)) { // Leaf - Remove UseItemOnPacket Too Far Check and make it configurable
|
||||
Direction enumdirection = movingobjectpositionblock.getDirection();
|
||||
|
||||
this.player.resetLastActionTime();
|
||||
diff --git a/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableMaxUseItemDistance.java b/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableMaxUseItemDistance.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..24519e6a4143c80bfbf31a97eea21f15e5263ee4
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableMaxUseItemDistance.java
|
||||
@@ -0,0 +1,25 @@
|
||||
+package org.dreeam.leaf.config.modules.gameplay;
|
||||
+
|
||||
+import org.dreeam.leaf.config.ConfigInfo;
|
||||
+import org.dreeam.leaf.config.EnumConfigCategory;
|
||||
+import org.dreeam.leaf.config.IConfigModule;
|
||||
+
|
||||
+public class ConfigurableMaxUseItemDistance implements IConfigModule {
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
+ return EnumConfigCategory.GAMEPLAY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getBaseName() {
|
||||
+ return "configurable_max_use_item_distance";
|
||||
+ }
|
||||
+
|
||||
+ @ConfigInfo(baseName = "max-use-item-distance", comments = "The max distance of UseItem for players")
|
||||
+ public static double maxUseItemDistance = 1.0000001D;
|
||||
+ @ConfigInfo(baseName = "remove-max-distance-check", comments = """
|
||||
+ To enable this, players can use some packet modules
|
||||
+ with hack clients and the NoCom Exploit!!""")
|
||||
+ public static boolean removeUseItemOnPacketTooFarCheck = false;
|
||||
+}
|
||||
Reference in New Issue
Block a user