mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-03 22:37:44 +01:00
= Fixed an issue with the ladders/vines and the falling check
= Fixed an NPE when the block in the event is null
This commit is contained in:
parent
b08db5bd4b
commit
1c649112ae
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<!-- Informations -->
|
<!-- Informations -->
|
||||||
<name>NoCheatPlus</name>
|
<name>NoCheatPlus</name>
|
||||||
<version>3.5.4</version>
|
<version>3.5.4_1</version>
|
||||||
<description>Detect and fight the exploitation of various flaws/bugs in Minecraft.</description>
|
<description>Detect and fight the exploitation of various flaws/bugs in Minecraft.</description>
|
||||||
<url>http://dev.bukkit.org/server-mods/nocheatplus</url>
|
<url>http://dev.bukkit.org/server-mods/nocheatplus</url>
|
||||||
|
|
||||||
|
@ -141,6 +141,10 @@ public class BlockBreakCheckListener implements Listener, EventManager {
|
|||||||
ignoreCancelled = true, priority = EventPriority.MONITOR)
|
ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||||
public void blockInteract(final PlayerInteractEvent event) {
|
public void blockInteract(final PlayerInteractEvent event) {
|
||||||
|
|
||||||
|
// Do not care about null blocks
|
||||||
|
if (event.getClickedBlock() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
final NoCheatPlusPlayer player = plugin.getPlayer(event.getPlayer());
|
final NoCheatPlusPlayer player = plugin.getPlayer(event.getPlayer());
|
||||||
final BlockBreakData data = BlockBreakCheck.getData(player);
|
final BlockBreakData data = BlockBreakCheck.getData(player);
|
||||||
// Remember this location. Only blockbreakevents for this specific
|
// Remember this location. Only blockbreakevents for this specific
|
||||||
|
@ -73,14 +73,18 @@ public class MovingCheckListener implements Listener, EventManager {
|
|||||||
// Do not do the check if it's disabled, if flying is allowed, if the player is
|
// Do not do the check if it's disabled, if flying is allowed, if the player is
|
||||||
// allowed to fly because of its game mode or if he has the required permission.
|
// allowed to fly because of its game mode or if he has the required permission.
|
||||||
if (!cc.tracker || cc.allowFlying || bukkitPlayer.getGameMode() == GameMode.CREATIVE
|
if (!cc.tracker || cc.allowFlying || bukkitPlayer.getGameMode() == GameMode.CREATIVE
|
||||||
|| bukkitPlayer.getAllowFlight() || bukkitPlayer.hasPermission(Permissions.MOVING_RUNFLY))
|
|| bukkitPlayer.getAllowFlight() || bukkitPlayer.hasPermission(Permissions.MOVING_RUNFLY)) {
|
||||||
|
data.fallingSince = 0;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If the player is in water or in vines, then do not run the check
|
// If the player is in water or in vines, then do not run the check
|
||||||
if (bukkitPlayer.getLocation().getBlock().getType() == Material.WATER
|
if (bukkitPlayer.getLocation().getBlock().getType() == Material.WATER
|
||||||
|| bukkitPlayer.getLocation().getBlock().getType() == Material.STATIONARY_WATER
|
|| bukkitPlayer.getLocation().getBlock().getType() == Material.STATIONARY_WATER
|
||||||
|| bukkitPlayer.getLocation().getBlock().getType() == Material.VINE)
|
|| bukkitPlayer.getLocation().getBlock().getType() == Material.VINE) {
|
||||||
|
data.fallingSince = 0;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If the player isn't falling or jumping
|
// If the player isn't falling or jumping
|
||||||
if (Math.abs(bukkitPlayer.getVelocity().getY()) > 0.1D) {
|
if (Math.abs(bukkitPlayer.getVelocity().getY()) > 0.1D) {
|
||||||
@ -95,8 +99,7 @@ public class MovingCheckListener implements Listener, EventManager {
|
|||||||
bukkitPlayer.kickPlayer("Flying isn't enabled on this server!");
|
bukkitPlayer.kickPlayer("Flying isn't enabled on this server!");
|
||||||
data.fallingSince = 0;
|
data.fallingSince = 0;
|
||||||
}
|
}
|
||||||
} else // The player isn't falling/jumping, check if he was previous on the air
|
} else
|
||||||
if (data.fallingSince > 0)
|
|
||||||
// Reset the timer
|
// Reset the timer
|
||||||
data.fallingSince = 0;
|
data.fallingSince = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user