From e62a885a9887fbea5e6cf495c9b38360a52327a3 Mon Sep 17 00:00:00 2001 From: MaXFeeD Date: Sun, 4 Feb 2024 04:52:02 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BE=D0=B3=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BA=D0=BE=D1=80=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B8=20=D0=BB=D0=BE=D0=BC=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BA=D0=B0=D1=81=D1=82=D0=BE=D0=BC=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=B8=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BC=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/reider745/hooks/LevelHooks.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/reider745/hooks/LevelHooks.java b/src/main/java/com/reider745/hooks/LevelHooks.java index 91834ad5..682ce047 100644 --- a/src/main/java/com/reider745/hooks/LevelHooks.java +++ b/src/main/java/com/reider745/hooks/LevelHooks.java @@ -24,6 +24,8 @@ import com.reider745.api.hooks.annotation.Hooks; import com.reider745.api.hooks.annotation.Inject; import com.reider745.event.EventListener; import com.reider745.world.dimensions.DimensionsMethods; +import com.zhekasmirnov.innercore.api.unlimited.IDRegistry; + import javassist.CtClass; import javassist.CtField; import javassist.Modifier; @@ -39,6 +41,7 @@ public class LevelHooks implements HookClass { field.setModifiers(Modifier.PUBLIC | Modifier.STATIC); } + @SuppressWarnings("unchecked") @Inject public static Item useBreakOn(Level level, Vector3 vector, BlockFace face, Item item, Player player, boolean createParticles) { @@ -118,7 +121,8 @@ public class LevelHooks implements HookClass { } else if (!player.isOp() && level.isInSpawnRadius(target)) { ev.setCancelled(); isNukkitPrevent = true; - } else if (!ev.getInstaBreak() && ev.isFastBreak()) { + // TODO: There are currently no way to prevent cheats, but it constantly breaks overpowered tools + } else if (!ev.getInstaBreak() && ev.isFastBreak() && item.getId() < IDRegistry.ITEM_ID_OFFSET) { ev.setCancelled(); isNukkitPrevent = true; }