Skip to content

Commit

Permalink
Revert removal of InvalidWorldException (EssentialsX#5984)
Browse files Browse the repository at this point in the history
Fixes API breakage for people who catch the exception.
  • Loading branch information
JRoy authored Dec 3, 2024
1 parent d31ff55 commit bc8aa76
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.earth2me.essentials.api;

import net.ess3.api.TranslatableException;

/**
* @deprecated This exception is unused. Use {@link net.ess3.api.InvalidWorldException} instead.
*/
@Deprecated
public class InvalidWorldException extends TranslatableException {
private final String world;

public InvalidWorldException(final String world) {
super("invalidWorld");
this.world = world;
}

public String getWorld() {
return this.world;
}
}
20 changes: 20 additions & 0 deletions Essentials/src/main/java/net/ess3/api/InvalidWorldException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.ess3.api;
/**
* Fired when trying to teleport a user to an invalid world. This usually only occurs if a world has been removed from
* the server and a player tries to teleport to a warp or home in that world.
*
* @deprecated no longer thrown.
*/
@Deprecated
public class InvalidWorldException extends TranslatableException {
private final String world;

public InvalidWorldException(final String world) {
super("invalidWorld");
this.world = world;
}

public String getWorld() {
return this.world;
}
}

0 comments on commit bc8aa76

Please sign in to comment.