mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Remove PlayerMoveBlockEvent
Unused and now unnecessary.
This commit is contained in:
@@ -10,7 +10,6 @@ import vg.civcraft.mc.civmodcore.commands.CommandManager;
|
||||
import vg.civcraft.mc.civmodcore.commands.StatCommand;
|
||||
import vg.civcraft.mc.civmodcore.dao.DatabaseCredentials;
|
||||
import vg.civcraft.mc.civmodcore.dao.ManagedDatasource;
|
||||
import vg.civcraft.mc.civmodcore.events.CustomEventMapper;
|
||||
import vg.civcraft.mc.civmodcore.inventory.gui.ClickableInventoryListener;
|
||||
import vg.civcraft.mc.civmodcore.inventory.items.EnchantUtils;
|
||||
import vg.civcraft.mc.civmodcore.inventory.items.MoreTags;
|
||||
@@ -77,7 +76,6 @@ public final class CivModCorePlugin extends ACivMod {
|
||||
registerListener(new ClickableInventoryListener());
|
||||
registerListener(DialogManager.INSTANCE);
|
||||
registerListener(new ScoreBoardListener());
|
||||
registerListener(new CustomEventMapper());
|
||||
registerListener(new WorldTracker());
|
||||
registerListener(ChunkOperationManager.INSTANCE);
|
||||
// Register commands
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package vg.civcraft.mc.civmodcore.events;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import vg.civcraft.mc.civmodcore.world.WorldUtils;
|
||||
|
||||
public class CustomEventMapper implements Listener {
|
||||
|
||||
/**
|
||||
* Glue map for {@link PlayerMoveBlockEvent}.
|
||||
* @param event The event to map from.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void detectPlayerMoveBlock(PlayerMoveEvent event) {
|
||||
Location formerLocation = event.getFrom();
|
||||
Location latterLocation = event.getTo();
|
||||
// If no block movement has occurred, exit out
|
||||
if (!WorldUtils.doLocationsHaveSameWorld(formerLocation, latterLocation)
|
||||
|| formerLocation.getBlockX() != latterLocation.getBlockX()
|
||||
|| formerLocation.getBlockY() != latterLocation.getBlockY()
|
||||
|| formerLocation.getBlockZ() != latterLocation.getBlockZ()) {
|
||||
return;
|
||||
}
|
||||
PlayerMoveBlockEvent better = new PlayerMoveBlockEvent(event.getPlayer(), formerLocation, latterLocation);
|
||||
Bukkit.getPluginManager().callEvent(better);
|
||||
event.setCancelled(better.isCancelled());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package vg.civcraft.mc.civmodcore.events;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
|
||||
public class PlayerMoveBlockEvent extends PlayerMoveEvent {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public PlayerMoveBlockEvent(Player player, Location from, Location to) {
|
||||
super(player, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user