Introduce error message for a failed teleport (#46)

Co-authored-by: RodneyMKay <herr-fant@web.de>
This commit is contained in:
Minetown 2020-11-05 16:55:05 +01:00 committed by GitHub
parent dbdf7d6a60
commit 9ef95e5d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -60,6 +60,7 @@ public class RTPPlayer {
// Compressed code for MaxAttempts being met
private void metMax(CommandSender sendi, Player p) {
settings.teleport.failed(p);
if (p == sendi)
getPl().getText().getFailedNotSafe(sendi, settings.maxAttempts);
else

View File

@ -2,7 +2,6 @@ package me.SuperRonanCraft.BetterRTP.player.rtp;
import io.papermc.lib.PaperLib;
import me.SuperRonanCraft.BetterRTP.Main;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
@ -10,7 +9,6 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@ -136,4 +134,8 @@ public class RTPTeleport {
private Main getPl() {
return Main.getInstance();
}
public void failed(Player p) {
eTitles.showTitle(RTPTitles.RTP_TITLE_TYPE.FAILED, p, p.getLocation(), 0, 0);
}
}

View File

@ -54,7 +54,7 @@ public class RTPTitles {
}
enum RTP_TITLE_TYPE {
NODELAY("NoDelay"), TELEPORT("Teleport"), DELAY("Delay"), CANCEL("Cancelled"), LOADING("Loading");
NODELAY("NoDelay"), TELEPORT("Teleport"), DELAY("Delay"), CANCEL("Cancelled"), LOADING("Loading"), FAILED("Failed");
String path;
RTP_TITLE_TYPE(String path) {
this.path = path;