13
0

Hide Ghost in 5 block radius
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-04-08 15:46:28 +02:00
Ursprung 4243669e0b
Commit 61c064bc68
3 geänderte Dateien mit 7 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -4,6 +4,7 @@ import de.steamwar.entity.REntityServer;
import de.steamwar.entity.RPlayer; import de.steamwar.entity.RPlayer;
import de.steamwar.lobby.LobbySystem; import de.steamwar.lobby.LobbySystem;
import de.steamwar.sql.UserConfig; import de.steamwar.sql.UserConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@ -134,7 +135,11 @@ public class GhostJumpAndRun implements Listener {
entityPlayer = null; entityPlayer = null;
return; return;
} }
entityPlayer.move(iterator.next().toLocation(player.getWorld())); Location location = iterator.next().toLocation(player.getWorld());
if (player.getLocation().distanceSquared(location) < 25) {
location.add(0, 1000, 0);
}
entityPlayer.move(location);
} }
}; };
replayRunnable.runTaskTimer(LobbySystem.getPlugin(), 1, 2); replayRunnable.runTaskTimer(LobbySystem.getPlugin(), 1, 2);

Datei anzeigen

@ -27,7 +27,6 @@ public class JumpAndRun extends BasicListener {
public static final String JUMP_AND_RUN_CONFIG = "jump_and_run"; public static final String JUMP_AND_RUN_CONFIG = "jump_and_run";
public static final String JUMP_AND_RUN_REPLAY_CONFIG = "jump_and_run_replay"; public static final String JUMP_AND_RUN_REPLAY_CONFIG = "jump_and_run_replay";
public static final String JUMP_AND_RUN_REPLAY_DISABLED_CONFIG = "jump_and_run_replay_disabled";
private static final String BAR_EMPTY = "||||||||||||||||||||||||||||||"; private static final String BAR_EMPTY = "||||||||||||||||||||||||||||||";
@ -128,10 +127,8 @@ public class JumpAndRun extends BasicListener {
FAILS.put(event.getPlayer(), 0); FAILS.put(event.getPlayer(), 0);
START.put(event.getPlayer(), System.currentTimeMillis()); START.put(event.getPlayer(), System.currentTimeMillis());
GHOSTS.get(event.getPlayer()).record(); GHOSTS.get(event.getPlayer()).record();
if (UserConfig.getConfig(event.getPlayer().getUniqueId(), JUMP_AND_RUN_REPLAY_DISABLED_CONFIG) == null) {
GHOSTS.get(event.getPlayer()).replay(); GHOSTS.get(event.getPlayer()).replay();
} }
}
if (index == points.size() - 1) { if (index == points.size() - 1) {
long time = System.currentTimeMillis() - START.get(event.getPlayer()); long time = System.currentTimeMillis() - START.get(event.getPlayer());
SimpleDateFormat format = new SimpleDateFormat(LobbySystem.getMessage().parse("JUMP_AND_RUN_TIME", event.getPlayer()), Locale.ROOT); SimpleDateFormat format = new SimpleDateFormat(LobbySystem.getMessage().parse("JUMP_AND_RUN_TIME", event.getPlayer()), Locale.ROOT);

Datei anzeigen

@ -9,8 +9,6 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import static de.steamwar.lobby.jumpandrun.JumpAndRun.JUMP_AND_RUN_REPLAY_DISABLED_CONFIG;
public class JumpAndRunCommand extends SWCommand { public class JumpAndRunCommand extends SWCommand {
public JumpAndRunCommand() { public JumpAndRunCommand() {
@ -29,16 +27,4 @@ public class JumpAndRunCommand extends SWCommand {
String parsed = format.format(new Date(timeLong)); String parsed = format.format(new Date(timeLong));
LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_PERSONAL_BEST_TIME", player, parsed); LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_PERSONAL_BEST_TIME", player, parsed);
} }
@Register("togglereplay")
public void toggleReplay(Player player) {
String replay = UserConfig.getConfig(player.getUniqueId(), JUMP_AND_RUN_REPLAY_DISABLED_CONFIG);
if (replay == null) {
UserConfig.updatePlayerConfig(player.getUniqueId(), JUMP_AND_RUN_REPLAY_DISABLED_CONFIG, "");
LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_REPLAY_ENABLED", player);
} else {
UserConfig.updatePlayerConfig(player.getUniqueId(), JUMP_AND_RUN_REPLAY_DISABLED_CONFIG, null);
LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_REPLAY_DISABLED", player);
}
}
} }