From cfa397fabc29f8e9ff1f197bfedd5207484c89b6 Mon Sep 17 00:00:00 2001 From: asofold Date: Tue, 4 Dec 2012 05:27:11 +0100 Subject: [PATCH] Add BlockCache to isOnGround (breaking duration). --- src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java b/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java index f2409e3e..fcc997f5 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java +++ b/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java @@ -245,6 +245,7 @@ public class BlockProperties { Material.POTATO, }; + private static BlockCache blockCache = new BlockCache(); private static final PlayerLocation pLoc = new PlayerLocation(); protected static final long[] blockFlags = new long[maxBlocks]; @@ -871,13 +872,16 @@ public class BlockProperties { public static boolean isOnGround(Player player, Location location) { // return blockId != 0 && net.minecraft.server.Block.byId[blockId].//.c();// d(); // Bit fat workaround, maybe put the object through from check listener ? + pLoc.setBlockCache(blockCache); pLoc.set(location, player, 0.3); if (pLoc.isIllegal()) { + blockCache.cleanup(); pLoc.cleanup(); CheckUtils.onIllegalMove(player); return false; } final boolean onGround = pLoc.isOnGround(); + blockCache.cleanup(); pLoc.cleanup(); return onGround; }