mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-18 18:01:17 +02:00
Fixed potential nullpointer exception(s)
Not sure if these tecnically could actually happen, but its probably better to fix a nonissue than to not to fix an issue.
This commit is contained in:
parent
e388d44719
commit
6cca892298
@ -3,7 +3,7 @@ name: NoCheatPlugin
|
|||||||
author: Evenprime
|
author: Evenprime
|
||||||
|
|
||||||
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
||||||
version: 0.6.6a
|
version: 0.6.7
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
nocheat:
|
nocheat:
|
||||||
|
@ -392,12 +392,13 @@ public class MovingCheck {
|
|||||||
// to lost vertical momentum to prevent him from getting stuck
|
// to lost vertical momentum to prevent him from getting stuck
|
||||||
data.movingJumpPhase = 0;
|
data.movingJumpPhase = 0;
|
||||||
|
|
||||||
|
Location l = data.movingSetBackPoint;
|
||||||
// If we have stored a location for the player, we put him back there
|
// If we have stored a location for the player, we put him back there
|
||||||
if(data.movingSetBackPoint != null) {
|
if(l != null) {
|
||||||
// Lets try it that way. Maybe now people don't "disappear" any longer
|
// Lets try it that way. Maybe now people don't "disappear" any longer
|
||||||
event.setFrom(data.movingSetBackPoint);
|
event.setFrom(l);
|
||||||
event.setTo(data.movingSetBackPoint);
|
event.setTo(l);
|
||||||
event.getPlayer().teleportTo(data.movingSetBackPoint);
|
event.getPlayer().teleportTo(l);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Lets try it that way. Maybe now people don't "disappear" any longer
|
// Lets try it that way. Maybe now people don't "disappear" any longer
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.checks;
|
package cc.co.evenprime.bukkit.nocheat.checks;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheatConfiguration;
|
import cc.co.evenprime.bukkit.nocheat.NoCheatConfiguration;
|
||||||
@ -85,13 +86,14 @@ public class SpeedhackCheck {
|
|||||||
|
|
||||||
private static void resetPlayer(PlayerMoveEvent event, NoCheatData data) {
|
private static void resetPlayer(PlayerMoveEvent event, NoCheatData data) {
|
||||||
|
|
||||||
|
Location l = data.speedhackSetBackPoint;
|
||||||
// If we have stored a location for the player, we put him back there
|
// If we have stored a location for the player, we put him back there
|
||||||
if(data.speedhackSetBackPoint != null) {
|
if(l != null) {
|
||||||
|
|
||||||
// Lets try it that way. Maybe now people don't "disappear" any longer
|
// Lets try it that way. Maybe now people don't "disappear" any longer
|
||||||
event.setFrom(data.speedhackSetBackPoint);
|
event.setFrom(l);
|
||||||
event.setTo(data.speedhackSetBackPoint);
|
event.setTo(l);
|
||||||
event.getPlayer().teleportTo(data.speedhackSetBackPoint);
|
event.getPlayer().teleportTo(l);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Lets try it that way. Maybe now people don't "disappear" any longer
|
// Lets try it that way. Maybe now people don't "disappear" any longer
|
||||||
|
Loading…
Reference in New Issue
Block a user