delete EntityTeleportHinderedEvent

This commit is contained in:
granny
2025-12-10 20:49:48 -08:00
parent c396a803f6
commit 780e6029ab
2 changed files with 0 additions and 188 deletions

View File

@@ -1,116 +0,0 @@
package org.purpurmc.purpur.event.entity;
import org.bukkit.entity.Entity;
import org.bukkit.event.HandlerList;
import org.bukkit.event.entity.EntityEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* Fired when an entity is hindered from teleporting.
* @deprecated no longer needed
*/
@NullMarked
@Deprecated(since = "1.21.10")
public class EntityTeleportHinderedEvent extends EntityEvent {
private static final HandlerList handlers = new HandlerList();
private final Reason reason;
private final @Nullable TeleportCause teleportCause;
private boolean retry = false;
@ApiStatus.Internal
public EntityTeleportHinderedEvent(Entity what, Reason reason, @Nullable TeleportCause teleportCause) {
super(what);
this.reason = reason;
this.teleportCause = teleportCause;
}
/**
* @return why the teleport was hindered.
*/
public Reason getReason() {
return reason;
}
/**
* @return why the teleport occurred if cause was given, otherwise {@code null}.
*/
@Nullable
public TeleportCause getTeleportCause() {
return teleportCause;
}
/**
* Whether the teleport should be retried.
* <p>
* Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack
* overflow. Do not retry more than necessary.
* </p>
*
* @return whether the teleport should be retried.
*/
public boolean shouldRetry() {
return retry;
}
/**
* Sets whether the teleport should be retried.
* <p>
* Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack
* overflow. Do not retry more than necessary.
* </p>
*
* @param retry whether the teleport should be retried.
*/
public void setShouldRetry(boolean retry) {
this.retry = retry;
}
/**
* Calls the event and tests if should retry.
*
* @return whether the teleport should be retried.
*/
@Override
public boolean callEvent() {
super.callEvent();
return shouldRetry();
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Reason for hindrance in teleports.
*/
public enum Reason {
/**
* The teleported entity is a passenger of another entity.
*/
IS_PASSENGER,
/**
* The teleported entity has passengers.
*/
IS_VEHICLE,
/**
* The teleport event was cancelled.
* <p>
* This is only caused by players teleporting.
* </p>
*/
EVENT_CANCELLED,
}
}