= [API] Player -> NCPPlayer (to acquire the config/data of the player)

This commit is contained in:
NeatMonster 2012-05-08 20:15:44 +02:00
parent c03cfc1a1f
commit 2bca6481b1
2 changed files with 8 additions and 19 deletions

View File

@ -4,7 +4,7 @@
<!-- Informations --> <!-- Informations -->
<name>NoCheatPlus</name> <name>NoCheatPlus</name>
<version>3.6</version> <version>3.6_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>

View File

@ -1,6 +1,5 @@
package fr.neatmonster.nocheatplus.checks; package fr.neatmonster.nocheatplus.checks;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
@ -29,7 +28,7 @@ public abstract class CheckEvent extends Event implements Cancellable {
private final Check check; private final Check check;
/** The player who has triggered this event. */ /** The player who has triggered this event. */
private NCPPlayer player; private final NCPPlayer player;
/** The actions which are going to be executed if the event isn't cancelled. */ /** The actions which are going to be executed if the event isn't cancelled. */
private ActionList actions; private ActionList actions;
@ -91,8 +90,8 @@ public abstract class CheckEvent extends Event implements Cancellable {
* *
* @return the player * @return the player
*/ */
public Player getPlayer() { public NCPPlayer getPlayer() {
return player.getBukkitPlayer(); return player;
} }
/** /**
@ -132,16 +131,6 @@ public abstract class CheckEvent extends Event implements Cancellable {
this.cancel = cancel; this.cancel = cancel;
} }
/**
* Sets the player who has triggered the event.
*
* @param player
* the new player
*/
public void setPlayer(final Player player) {
this.player = NCPPlayer.getPlayer(player);
}
/** /**
* Sets the violation level of the player for the specified check. * Sets the violation level of the player for the specified check.
* *