diff --git a/src/de/steamwar/lobby/LobbySystem.properties b/src/de/steamwar/lobby/LobbySystem.properties index 70e0c9c..5b3dbca 100644 --- a/src/de/steamwar/lobby/LobbySystem.properties +++ b/src/de/steamwar/lobby/LobbySystem.properties @@ -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_TIME = mm:ss SSS 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 DIFFICULTY_EASY = §aEasy diff --git a/src/de/steamwar/lobby/LobbySystem_de.properties b/src/de/steamwar/lobby/LobbySystem_de.properties index c5ff141..5bd4406 100644 --- a/src/de/steamwar/lobby/LobbySystem_de.properties +++ b/src/de/steamwar/lobby/LobbySystem_de.properties @@ -120,6 +120,7 @@ PARTICLE_EGG_HUNT_ADVANCED = §5Abheben PARTICLE_EGG_HUNT_HALF = §fDie Jagd ist eröffnet 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 DIFFICULTY_EASY = §aLeicht diff --git a/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java b/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java index f534fed..0ccc96a 100644 --- a/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java +++ b/src/de/steamwar/lobby/jumpandrun/JumpAndRun.java @@ -3,6 +3,7 @@ package de.steamwar.lobby.jumpandrun; import de.steamwar.lobby.LobbySystem; import de.steamwar.lobby.listener.BasicListener; import de.steamwar.lobby.listener.PlayerSpawn; +import de.steamwar.sql.UserConfig; import net.md_5.bungee.api.ChatMessageType; import org.bukkit.Bukkit; 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); 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())); + updateJumpAndRunTime(event.getPlayer(), time); 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 public void onPlayerQuit(PlayerQuitEvent event) { Player player = event.getPlayer(); diff --git a/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java b/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java index 5b73c54..7ba9466 100644 --- a/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java +++ b/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java @@ -15,12 +15,14 @@ import org.bukkit.Particle; @AllArgsConstructor public enum CustomEasterParticle implements ParticleEnum { + /* 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 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 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), new Always(new Sneaking(new Group( new OnlySelf(new Delayed(new SimpleParticle(Particle.EXPLOSION_HUGE, 0, 0, 0, 0.01, 1), 20)),