mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-30 14:43:49 +01:00
Use Spigot only events. (#2029)
I missed that EntityMoveEvent is only Paper. Interesting why Spigot does not have such... Fixes #2028
This commit is contained in:
parent
52bca66149
commit
b263c92c13
@ -18,12 +18,12 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||||
import org.bukkit.event.entity.EntityPortalEvent;
|
import org.bukkit.event.entity.EntityPortalEvent;
|
||||||
|
import org.bukkit.event.entity.EntityPortalExitEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
import org.eclipse.jdt.annotation.NonNull;
|
import org.eclipse.jdt.annotation.NonNull;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import io.papermc.paper.event.entity.EntityMoveEvent;
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.lists.Flags;
|
import world.bentobox.bentobox.lists.Flags;
|
||||||
import world.bentobox.bentobox.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
@ -170,21 +170,17 @@ public class EntityTeleportListener extends AbstractTeleportListener implements
|
|||||||
* @param event entity move event
|
* @param event entity move event
|
||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onEntityExitPortal(EntityMoveEvent event)
|
public void onEntityExitPortal(EntityPortalExitEvent event)
|
||||||
{
|
{
|
||||||
if (!this.inPortal.contains(event.getEntity().getUniqueId()))
|
if (!this.inPortal.contains(event.getEntity().getUniqueId()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.getTo().getBlock().getType().equals(Material.NETHER_PORTAL))
|
|
||||||
{
|
|
||||||
// Player exits nether portal.
|
|
||||||
this.inPortal.remove(event.getEntity().getUniqueId());
|
this.inPortal.remove(event.getEntity().getUniqueId());
|
||||||
this.inTeleport.remove(event.getEntity().getUniqueId());
|
this.inTeleport.remove(event.getEntity().getUniqueId());
|
||||||
this.teleportOrigin.remove(event.getEntity().getUniqueId());
|
this.teleportOrigin.remove(event.getEntity().getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user