Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Made events respect isCancelled()
Dieser Commit ist enthalten in:
Ursprung
4d6bb6d746
Commit
a313f2e93e
@ -70,6 +70,9 @@ public class WorldEditPlayerListener extends PlayerListener {
|
||||
*/
|
||||
@Override
|
||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
String[] split = event.getMessage().split(" ");
|
||||
|
||||
if (plugin.getWorldEdit().handleCommand(wrapPlayer(event.getPlayer()), split)) {
|
||||
@ -84,14 +87,16 @@ public class WorldEditPlayerListener extends PlayerListener {
|
||||
*/
|
||||
@Override
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
LocalWorld world = new BukkitWorld(event.getClickedBlock().getWorld());
|
||||
WorldVector pos = new WorldVector(world, event.getClickedBlock().getX(),
|
||||
event.getClickedBlock().getY(), event.getClickedBlock().getZ());
|
||||
LocalPlayer player = wrapPlayer(event.getPlayer());
|
||||
|
||||
|
||||
if (plugin.getWorldEdit().handleBlockLeftClick(player, pos)) {
|
||||
event.setCancelled(true);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
if (plugin.getWorldEdit().handleArmSwing(wrapPlayer(event.getPlayer()))) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren