13
0

EasterHuntReward #29

Zusammengeführt
YoyoNow hat 6 Commits von EasterHuntReward nach master 2023-04-08 00:53:10 +02:00 zusammengeführt
4 geänderte Dateien mit 21 neuen und 0 gelöschten Zeilen
Nur Änderungen aus Commit 5567b6e3c9 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -130,6 +130,7 @@ JUMP_AND_RUN_PROGRESS = §e{0}§8/§f{1} §c{2} §7{3}
JUMP_AND_RUN_CANCEL = {0} JUMP_AND_RUN_CANCEL = {0}
JUMP_AND_RUN_TIME = mm:ss SSS JUMP_AND_RUN_TIME = mm:ss SSS
JUMP_AND_RUN_FINISHED = §aFinished in {0} with {1} fails JUMP_AND_RUN_FINISHED = §aFinished in {0} with {1} fails
JUMP_AND_RUN_PERSONAL_BEST = §aNice! You beat your personal best by {0}
# Easter Egg Hunt # Easter Egg Hunt
DIFFICULTY_EASY = §aEasy DIFFICULTY_EASY = §aEasy

Datei anzeigen

@ -120,6 +120,7 @@ PARTICLE_EGG_HUNT_ADVANCED = §5Abheben
PARTICLE_EGG_HUNT_HALF = §fDie Jagd ist eröffnet PARTICLE_EGG_HUNT_HALF = §fDie Jagd ist eröffnet
JUMP_AND_RUN_FINISHED = §aBeendet in {0} mit {1} Fails JUMP_AND_RUN_FINISHED = §aBeendet in {0} mit {1} Fails
JUMP_AND_RUN_PERSONAL_BEST = §aNice! Du hast deinen Rekord um {0} Sekunden verbessert!
# Easter Egg Hunt # Easter Egg Hunt
DIFFICULTY_EASY = §aLeicht DIFFICULTY_EASY = §aLeicht

Datei anzeigen

@ -3,6 +3,7 @@ package de.steamwar.lobby.jumpandrun;
import de.steamwar.lobby.LobbySystem; import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.listener.BasicListener; import de.steamwar.lobby.listener.BasicListener;
import de.steamwar.lobby.listener.PlayerSpawn; import de.steamwar.lobby.listener.PlayerSpawn;
import de.steamwar.sql.UserConfig;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@ -121,10 +122,26 @@ public class JumpAndRun extends BasicListener {
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);
String parsed = format.format(new Date(time)); String parsed = format.format(new Date(time));
LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_FINISHED", event.getPlayer(), parsed.substring(0, parsed.length() - 2), FAILS.get(event.getPlayer())); LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_FINISHED", event.getPlayer(), parsed.substring(0, parsed.length() - 2), FAILS.get(event.getPlayer()));
updateJumpAndRunTime(event.getPlayer(), time);
reset(event.getPlayer()); reset(event.getPlayer());
} }
} }
private void updateJumpAndRunTime(Player player, long time) {
String jumpAndRunTimeConfig = UserConfig.getConfig(player.getUniqueId(), "jump_and_run");
if (jumpAndRunTimeConfig == null) {
UserConfig.updatePlayerConfig(player.getUniqueId(), "jump_and_run", time + "");
} else {
long jumpAndRunTime = Long.parseLong(jumpAndRunTimeConfig);
if (time < jumpAndRunTime) {
SimpleDateFormat format = new SimpleDateFormat(LobbySystem.getMessage().parse("JUMP_AND_RUN_TIME", player), Locale.ROOT);
String parsed = format.format(new Date(time - jumpAndRunTime));
LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_PERSONAL_BEST", player, parsed);
UserConfig.updatePlayerConfig(player.getUniqueId(), "jump_and_run", time + "");
}
}
}
@EventHandler @EventHandler
public void onPlayerQuit(PlayerQuitEvent event) { public void onPlayerQuit(PlayerQuitEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();

Datei anzeigen

@ -15,12 +15,14 @@ import org.bukkit.Particle;
@AllArgsConstructor @AllArgsConstructor
public enum CustomEasterParticle implements ParticleEnum { public enum CustomEasterParticle implements ParticleEnum {
/*
Lord_Loading(new ParticleData(Material.ENDER_PEARL, "Loading Test", ParticleRequirement.easterEventSpecificPlayer(1063), Lord_Loading(new ParticleData(Material.ENDER_PEARL, "Loading Test", ParticleRequirement.easterEventSpecificPlayer(1063),
new Always(new DoubleCircle(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), new Always(new DoubleCircle(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1),
new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), 0.5, 4), new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), 0.5, 4),
new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1),
new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), 0.5, 4), 1.5, 1))) new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), 0.5, 4), 1.5, 1)))
), ),
*/
Rongamer99091(new ParticleData(Material.GUNPOWDER, "PARTICLE_PLAYER_RONGAMER99091_AURA", ParticleRequirement.easterEventSpecificPlayer(10697), Rongamer99091(new ParticleData(Material.GUNPOWDER, "PARTICLE_PLAYER_RONGAMER99091_AURA", ParticleRequirement.easterEventSpecificPlayer(10697),
new Always(new Sneaking(new Group( new Always(new Sneaking(new Group(
new OnlySelf(new Delayed(new SimpleParticle(Particle.EXPLOSION_HUGE, 0, 0, 0, 0.01, 1), 20)), new OnlySelf(new Delayed(new SimpleParticle(Particle.EXPLOSION_HUGE, 0, 0, 0, 0.01, 1), 20)),