3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-03 01:50:07 +01:00

Remove PlayerMoveEvent listener and deprecate MovableTool (#2083)

Remove PlayerMoveEventListener and deprecate MovableTool
Dieser Commit ist enthalten in:
Hannes Greule 2023-02-07 23:07:57 +01:00 committet von GitHub
Ursprung f9d6b127e6
Commit 321a39f121
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 8 neuen und 21 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,5 @@
package com.fastasyncworldedit.bukkit.listener; package com.fastasyncworldedit.bukkit.listener;
import com.fastasyncworldedit.core.command.tool.MovableTool;
import com.fastasyncworldedit.core.command.tool.ResettableTool; import com.fastasyncworldedit.core.command.tool.ResettableTool;
import com.fastasyncworldedit.core.command.tool.scroll.ScrollTool; import com.fastasyncworldedit.core.command.tool.scroll.ScrollTool;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -8,7 +7,6 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.command.tool.Tool; import com.sk89q.worldedit.command.tool.Tool;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -16,7 +14,6 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
public class BrushListener implements Listener { public class BrushListener implements Listener {
@ -49,24 +46,6 @@ public class BrushListener implements Listener {
} }
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent event) {
Location from = event.getFrom();
Location to = event.getTo();
if ((from.getYaw() != to.getYaw() && from.getPitch() != to.getPitch()) || from.getBlockX() != to.getBlockX() || from.getBlockZ() != to
.getBlockZ() || from.getBlockY() != to.getBlockY()) {
Player bukkitPlayer = event.getPlayer();
com.sk89q.worldedit.entity.Player player = BukkitAdapter.adapt(bukkitPlayer);
LocalSession session = player.getSession();
Tool tool = session.getTool(player);
if (tool != null) {
if (tool instanceof MovableTool) {
((MovableTool) tool).move(player);
}
}
}
}
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteract(final PlayerInteractEvent event) { public void onPlayerInteract(final PlayerInteractEvent event) {
Player bukkitPlayer = event.getPlayer(); Player bukkitPlayer = event.getPlayer();

Datei anzeigen

@ -2,8 +2,16 @@ package com.fastasyncworldedit.core.command.tool;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
/**
* @deprecated This interface has no functionality anymore
*/
@Deprecated(forRemoval = true, since = "TODO")
public interface MovableTool { public interface MovableTool {
/**
* @deprecated This interface has no functionality anymore
*/
@Deprecated(forRemoval = true, since = "TODO")
boolean move(Player player); boolean move(Player player);
} }