Fix error message during warp sign creation (#5956)

Fixes #5954
This commit is contained in:
Josh Roy 2024-10-21 06:36:35 -04:00 committed by GitHub
parent a8452b4615
commit cd06e737e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.ChargeException;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import net.ess3.api.IEssentials;
import net.ess3.api.TranslatableException;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import java.util.concurrent.CompletableFuture;
@ -25,6 +26,10 @@ public class SignWarp extends EssentialsSign {
try {
ess.getWarps().getWarp(warpName);
} catch (final Exception ex) {
if (ex instanceof TranslatableException) {
final TranslatableException te = (TranslatableException) ex;
throw new SignException(ex, te.getTlKey(), te.getArgs());
}
throw new SignException(ex, "errorWithMessage", ex.getMessage());
}
final String group = sign.getLine(2);