mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-30 20:37:52 +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,
|
Material.POTATO,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static BlockCache blockCache = new BlockCache();
|
||||||
private static final PlayerLocation pLoc = new PlayerLocation();
|
private static final PlayerLocation pLoc = new PlayerLocation();
|
||||||
|
|
||||||
protected static final long[] blockFlags = new long[maxBlocks];
|
protected static final long[] blockFlags = new long[maxBlocks];
|
||||||
@ -871,13 +872,16 @@ public class BlockProperties {
|
|||||||
public static boolean isOnGround(Player player, Location location) {
|
public static boolean isOnGround(Player player, Location location) {
|
||||||
// return blockId != 0 && net.minecraft.server.Block.byId[blockId].//.c();// d();
|
// return blockId != 0 && net.minecraft.server.Block.byId[blockId].//.c();// d();
|
||||||
// Bit fat workaround, maybe put the object through from check listener ?
|
// Bit fat workaround, maybe put the object through from check listener ?
|
||||||
|
pLoc.setBlockCache(blockCache);
|
||||||
pLoc.set(location, player, 0.3);
|
pLoc.set(location, player, 0.3);
|
||||||
if (pLoc.isIllegal()) {
|
if (pLoc.isIllegal()) {
|
||||||
|
blockCache.cleanup();
|
||||||
pLoc.cleanup();
|
pLoc.cleanup();
|
||||||
CheckUtils.onIllegalMove(player);
|
CheckUtils.onIllegalMove(player);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final boolean onGround = pLoc.isOnGround();
|
final boolean onGround = pLoc.isOnGround();
|
||||||
|
blockCache.cleanup();
|
||||||
pLoc.cleanup();
|
pLoc.cleanup();
|
||||||
return onGround;
|
return onGround;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user