Comments, order, init values.

This commit is contained in:
asofold 2012-12-17 17:57:07 +01:00
parent 923b4ebdca
commit 817ac36f8b
2 changed files with 49 additions and 45 deletions

View File

@ -226,11 +226,10 @@ public class MovingListener extends CheckListener{
if (bedLeave.isEnabled(player) && bedLeave.checkBed(player)) {
// Check if the player has to be reset.
// To cancel the event, we teleport the player.
// To "cancel" the event, we teleport the player.
final Location loc = player.getLocation();
final MovingData data = MovingData.getData(player);
final MovingConfig cc = MovingConfig.getConfig(player);
// TODO: Check if survivalfly is active at all for tp loc?
Location target = null;
final boolean sfCheck = shouldCheckSurvivalFly(player, data, cc);
if (sfCheck) target = data.setBack;

View File

@ -32,39 +32,9 @@ import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
* given.
*/
public class PlayerLocation {
/** Type id of the block at the position. */
private Integer typeId;
/** Type id of the block below. */
private Integer typeIdBelow;
private Integer data;
/** Is the player above stairs? */
private Boolean aboveStairs;
/** Is the player in lava? */
private Boolean inLava;
/** Is the player in water? */
private Boolean inWater;
/** Is the player is web? */
private Boolean inWeb;
/** Is the player on the ground? */
private Boolean onGround;
/** Is the player on ice? */
private Boolean onIce;
/** Is the player on ladder? */
private Boolean onClimbable;
/** Simple test if the exact position is passable. */
private Boolean passable;
// Simple members //
/** Y parameter for growing the bounding box with the isOnGround check. */
private double yOnGround = 0.001;
@ -80,20 +50,55 @@ public class PlayerLocation {
/** Bounding box of the player. */
private double minX, maxX, minY, maxY, minZ, maxZ;
// Members that need cleanup //
/** The player ! */
private Player player;
/** Bukkit world. */
private World world;
// Object members (reset to null) //
/** Optional block property cache. */
private BlockCache blockCache;
/** Type id of the block at the position. */
private Integer typeId = null;
/** Type id of the block below. */
private Integer typeIdBelow = null;
/** Data value of the block this position is on. */
private Integer data = null;
/** Is the player above stairs? */
private Boolean aboveStairs = null;
/** Is the player in lava? */
private Boolean inLava = null;
/** Is the player in water? */
private Boolean inWater = null;
/** Is the player is web? */
private Boolean inWeb = null;
/** Is the player on the ground? */
private Boolean onGround = null;
/** Is the player on ice? */
private Boolean onIce = null;
/** Is the player on ladder? */
private Boolean onClimbable = null;
/** Simple test if the exact position is passable. */
private Boolean passable = null;
/** All block flags collected for maximum used bounds. */
private Long blockFlags;
private Long blockFlags = null;
// "Heavy" members (should be reset to null or cleaned up at some point) //
/** The player ! */
private Player player = null;
/** Bukkit world. */
private World world = null;
/** Optional block property cache. */
private BlockCache blockCache = null;
public PlayerLocation(final BlockCache blockCache){