Skip to content

Commit

Permalink
Remove direction correction, as it does not seem to be effective.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed May 15, 2014
1 parent 24bc281 commit c93edcb
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 149 deletions.
Expand Up @@ -233,9 +233,9 @@ public boolean hasGravity(final Material mat) {
}
}

@Override
public void correctDirection(Player player) {
// TODO: Consider using reflection (detect CraftPlayer, access EntityPlayer + check if possible (!), use flags for if valid or invalid.)
}
// @Override
// public void correctDirection(Player player) {
// // TODO: Consider using reflection (detect CraftPlayer, access EntityPlayer + check if possible (!), use flags for if valid or invalid.)
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -163,13 +162,13 @@ public boolean hasGravity(final Material mat) {
}
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -163,13 +162,13 @@ public boolean hasGravity(final Material mat) {
}
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -165,13 +164,13 @@ public boolean hasGravity(final Material mat) {
}
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -165,13 +164,13 @@ public boolean hasGravity(final Material mat) {
}
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -167,13 +166,13 @@ public boolean hasGravity(final Material mat) {
}
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -166,13 +165,13 @@ public boolean hasGravity(final Material mat) {
}
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -160,13 +159,13 @@ public boolean hasGravity(final Material mat) {
return mat.hasGravity();
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -161,13 +160,13 @@ public boolean hasGravity(final Material mat) {
return mat.hasGravity();
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -162,13 +161,13 @@ public boolean hasGravity(final Material mat) {
return mat.hasGravity();
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,10 +18,8 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.compat.cb2922.BlockCacheCB2922;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;

Expand Down Expand Up @@ -163,13 +161,13 @@ public boolean hasGravity(final Material mat) {
return mat.hasGravity();
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -162,13 +161,13 @@ public boolean hasGravity(final Material mat) {
return mat.hasGravity();
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}
Expand Up @@ -18,7 +18,6 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

import fr.neatmonster.nocheatplus.checks.moving.LocUtil;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.BlockCache;
Expand Down Expand Up @@ -181,13 +180,13 @@ public boolean hasGravity(final Material mat) {
return mat.hasGravity();
}

@Override
public void correctDirection(final Player player) {
final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// Main direction.
mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// Consider setting the lastYaw here too.
}
// @Override
// public void correctDirection(final Player player) {
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
// // Main direction.
// mcPlayer.yaw = LocUtil.correctYaw(mcPlayer.yaw);
// mcPlayer.pitch = LocUtil.correctPitch(mcPlayer.pitch);
// // Consider setting the lastYaw here too.
// }

}

0 comments on commit c93edcb

Please sign in to comment.