Skip to content

Commit

Permalink
Remove deprecated teleport APIs (#6017)
Browse files Browse the repository at this point in the history
They have been no-op deprecations for a while now
  • Loading branch information
JRoy authored Feb 2, 2025
1 parent ea3ea20 commit 42121aa
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 603 deletions.
11 changes: 3 additions & 8 deletions Essentials/src/main/java/com/earth2me/essentials/IUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.earth2me.essentials.api.IAsyncTeleport;
import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.config.entities.CommandCooldown;
import net.ess3.api.ITeleport;
import net.ess3.api.MaxMoneyException;
import net.ess3.api.events.AfkStatusChangeEvent;
import net.essentialsx.api.v2.services.mail.MailMessage;
Expand Down Expand Up @@ -70,13 +69,9 @@ public interface IUser {
* @return whether there is a teleport request
*/
@Deprecated
boolean hasOutstandingTeleportRequest();

/**
* @deprecated This API is not asynchronous. Use {@link com.earth2me.essentials.api.IAsyncTeleport IAsyncTeleport} with {@link IUser#getAsyncTeleport()}
*/
@Deprecated
ITeleport getTeleport();
default boolean hasOutstandingTeleportRequest() {
return getNextTpaRequest(false, false, false) != null;
}

IAsyncTeleport getAsyncTeleport();

Expand Down
24 changes: 1 addition & 23 deletions Essentials/src/main/java/com/earth2me/essentials/Jails.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import static com.earth2me.essentials.I18n.tlLiteral;

public class Jails implements net.ess3.api.IJails {
private static transient boolean enabled = false;
private static boolean enabled = false;
private final IEssentials ess;
private final EssentialsConfiguration config;
private final Map<String, LazyLocation> jails = new HashMap<>();
Expand Down Expand Up @@ -142,28 +142,6 @@ public void removeJail(String jail) throws Exception {
}
}

/**
* @deprecated This method does not use asynchronous teleportation. Use {@link Jails#sendToJail(IUser, String, CompletableFuture)}
*/
@SuppressWarnings("deprecation")
@Override
@Deprecated
public void sendToJail(final IUser user, String jail) throws Exception {
if (jail == null || jail.isEmpty()) {
return;
}

jail = jail.toLowerCase(Locale.ENGLISH);
synchronized (jails) {
if (jails.containsKey(jail)) {
if (user.getBase().isOnline()) {
user.getTeleport().now(getJail(jail), false, TeleportCause.COMMAND);
}
user.setJail(jail);
}
}
}

@Override
public void sendToJail(final IUser user, final String jailName, final CompletableFuture<Boolean> future) throws Exception {
if (jailName == null || jailName.isEmpty()) {
Expand Down
Loading

0 comments on commit 42121aa

Please sign in to comment.