Skip to content

Commit 321a39f

Browse files
authored
Remove PlayerMoveEvent listener and deprecate MovableTool (#2083)
Remove PlayerMoveEventListener and deprecate MovableTool
1 parent f9d6b12 commit 321a39f

File tree

2 files changed

+8
-21
lines changed
  • worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener
  • worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool

2 files changed

+8
-21
lines changed

worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/BrushListener.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
package com.fastasyncworldedit.bukkit.listener;
22

3-
import com.fastasyncworldedit.core.command.tool.MovableTool;
43
import com.fastasyncworldedit.core.command.tool.ResettableTool;
54
import com.fastasyncworldedit.core.command.tool.scroll.ScrollTool;
65
import com.sk89q.worldedit.LocalSession;
76
import com.sk89q.worldedit.bukkit.BukkitAdapter;
87
import com.sk89q.worldedit.bukkit.BukkitPlayer;
98
import com.sk89q.worldedit.command.tool.Tool;
109
import org.bukkit.Bukkit;
11-
import org.bukkit.Location;
1210
import org.bukkit.entity.Player;
1311
import org.bukkit.event.EventHandler;
1412
import org.bukkit.event.EventPriority;
1513
import org.bukkit.event.Listener;
1614
import org.bukkit.event.block.Action;
1715
import org.bukkit.event.player.PlayerInteractEvent;
1816
import org.bukkit.event.player.PlayerItemHeldEvent;
19-
import org.bukkit.event.player.PlayerMoveEvent;
2017
import org.bukkit.plugin.Plugin;
2118

2219
public class BrushListener implements Listener {
@@ -49,24 +46,6 @@ public void onPlayerItemHoldEvent(final PlayerItemHeldEvent event) {
4946
}
5047
}
5148

52-
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
53-
public void onPlayerMove(PlayerMoveEvent event) {
54-
Location from = event.getFrom();
55-
Location to = event.getTo();
56-
if ((from.getYaw() != to.getYaw() && from.getPitch() != to.getPitch()) || from.getBlockX() != to.getBlockX() || from.getBlockZ() != to
57-
.getBlockZ() || from.getBlockY() != to.getBlockY()) {
58-
Player bukkitPlayer = event.getPlayer();
59-
com.sk89q.worldedit.entity.Player player = BukkitAdapter.adapt(bukkitPlayer);
60-
LocalSession session = player.getSession();
61-
Tool tool = session.getTool(player);
62-
if (tool != null) {
63-
if (tool instanceof MovableTool) {
64-
((MovableTool) tool).move(player);
65-
}
66-
}
67-
}
68-
}
69-
7049
@EventHandler(priority = EventPriority.LOWEST)
7150
public void onPlayerInteract(final PlayerInteractEvent event) {
7251
Player bukkitPlayer = event.getPlayer();

worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/MovableTool.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22

33
import com.sk89q.worldedit.entity.Player;
44

5+
/**
6+
* @deprecated This interface has no functionality anymore
7+
*/
8+
@Deprecated(forRemoval = true, since = "TODO")
59
public interface MovableTool {
610

11+
/**
12+
* @deprecated This interface has no functionality anymore
13+
*/
14+
@Deprecated(forRemoval = true, since = "TODO")
715
boolean move(Player player);
816

917
}

0 commit comments

Comments
 (0)