mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-28 11:28:11 +01:00
Add BlockCache to isOnGround (breaking duration).
This commit is contained in:
parent
2d1beaf3a9
commit
cfa397fabc
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user