mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Changed Bukkit listeners to cancel the event.
This commit is contained in:
parent
a36ceecaab
commit
98afdd7df6
@ -65,7 +65,9 @@ public class WorldEditBlockListener extends BlockListener {
|
|||||||
event.getBlock().getY(), event.getBlock().getZ());
|
event.getBlock().getY(), event.getBlock().getZ());
|
||||||
LocalPlayer player = wrapPlayer(event.getPlayer());
|
LocalPlayer player = wrapPlayer(event.getPlayer());
|
||||||
|
|
||||||
plugin.controller.handleBlockRightClick(player, pos);
|
if (plugin.controller.handleBlockRightClick(player, pos)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BukkitPlayer wrapPlayer(Player player) {
|
private BukkitPlayer wrapPlayer(Player player) {
|
||||||
|
@ -57,8 +57,10 @@ public class WorldEditPlayerListener extends PlayerListener {
|
|||||||
* @param event Relevant event details
|
* @param event Relevant event details
|
||||||
*/
|
*/
|
||||||
public void onPlayerCommand(PlayerChatEvent event) {
|
public void onPlayerCommand(PlayerChatEvent event) {
|
||||||
plugin.controller.handleCommand(wrapPlayer(event.getPlayer()),
|
if (plugin.controller.handleCommand(wrapPlayer(event.getPlayer()),
|
||||||
event.getMessage().split(" "));
|
event.getMessage().split(" "))) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BukkitPlayer wrapPlayer(Player player) {
|
private BukkitPlayer wrapPlayer(Player player) {
|
||||||
|
Loading…
Reference in New Issue
Block a user