Deprecated and removed WarpListEvent

Cannot be fired because this part of the code needs to run async.

https://github.com/BentoBoxWorld/Warps/issues/93
This commit is contained in:
tastybento 2021-01-08 22:14:03 -08:00
parent c882ca3288
commit 2506d2ac9e
2 changed files with 6 additions and 28 deletions

View File

@ -38,7 +38,6 @@ import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.lists.Flags;
import world.bentobox.bentobox.util.Util;
import world.bentobox.warps.event.WarpInitiateEvent;
import world.bentobox.warps.event.WarpListEvent;
import world.bentobox.warps.objects.WarpsData;
/**
@ -129,7 +128,7 @@ public class WarpSignsManager {
return getWarpMap(location.getWorld()).entrySet().stream().filter(en -> en.getValue().equals(location))
.findFirst().map(en -> plugin.getPlayers().getName(en.getKey())).orElse("");
}
/**
* Get the optional UUID of the warp owner by location
* @param location to search
@ -165,11 +164,6 @@ public class WarpSignsManager {
if (list.size() > MAX_WARPS) {
list.subList(0, MAX_WARPS).clear();
}
// Fire event
WarpListEvent event = new WarpListEvent(addon, list);
Bukkit.getPluginManager().callEvent(event);
// Get the result of any changes by listeners
list = event.getWarps();
return list;
}
@ -262,7 +256,7 @@ public class WarpSignsManager {
if (getWarpMap(world).containsKey(uuid)) {
popSign(getWarpMap(world).get(uuid));
getWarpMap(world).remove(uuid);
}
// Remove sign from warp panel cache
addon.getWarpPanelManager().removeWarp(world, uuid);
@ -353,7 +347,7 @@ public class WarpSignsManager {
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_ARROW_HIT, 1F, 1F);
} else {
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 1F, 1F);
}
}
if (!warpOwner.equals(user)) {
warpOwner.sendMessage("warps.player-warped", "[name]", user.getName());
}

View File

@ -1,20 +1,3 @@
/*******************************************************************************
* This file is part of ASkyBlock.
*
* ASkyBlock is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ASkyBlock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ASkyBlock. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
package world.bentobox.warps.event;
import java.util.List;
@ -30,10 +13,11 @@ import world.bentobox.warps.Warp;
* the API updateWarpPanel method is called.
* A listener to this event can reorder or rewrite the warp list by using setWarps.
* This new order will then be used in the warp panel.
*
*
* @author tastybento
*
* @deprecated this event is not fired any more because the task is async
*/
@Deprecated
public class WarpListEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private List<UUID> warps;