Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-12 22:20:08 +01:00
Changed Bukkit listeners to cancel the event.
Dieser Commit ist enthalten in:
Ursprung
a36ceecaab
Commit
98afdd7df6
@ -65,7 +65,9 @@ public class WorldEditBlockListener extends BlockListener {
|
||||
event.getBlock().getY(), event.getBlock().getZ());
|
||||
LocalPlayer player = wrapPlayer(event.getPlayer());
|
||||
|
||||
plugin.controller.handleBlockRightClick(player, pos);
|
||||
if (plugin.controller.handleBlockRightClick(player, pos)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private BukkitPlayer wrapPlayer(Player player) {
|
||||
|
@ -57,8 +57,10 @@ public class WorldEditPlayerListener extends PlayerListener {
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onPlayerCommand(PlayerChatEvent event) {
|
||||
plugin.controller.handleCommand(wrapPlayer(event.getPlayer()),
|
||||
event.getMessage().split(" "));
|
||||
if (plugin.controller.handleCommand(wrapPlayer(event.getPlayer()),
|
||||
event.getMessage().split(" "))) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private BukkitPlayer wrapPlayer(Player player) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren