From 15c204fe68b032e2331c5a1ffe9442211d0d4822 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 28 Dec 2022 21:35:54 +0100 Subject: [PATCH] Fix SpaceListener --- .../misslewars/listener/special/SpaceListener.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/misslewars/listener/special/SpaceListener.java b/src/de/steamwar/misslewars/listener/special/SpaceListener.java index eaee4c5..cd60bf2 100644 --- a/src/de/steamwar/misslewars/listener/special/SpaceListener.java +++ b/src/de/steamwar/misslewars/listener/special/SpaceListener.java @@ -23,7 +23,9 @@ package de.steamwar.misslewars.listener.special; import de.steamwar.misslewars.Config; import de.steamwar.misslewars.FightState; +import de.steamwar.misslewars.MissileWars; import de.steamwar.misslewars.listener.BasicListener; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; @@ -44,9 +46,11 @@ public class SpaceListener extends BasicListener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { if (!Config.Space) return; - Player player = event.getPlayer(); - player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 2)); - player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, Integer.MAX_VALUE, 2)); + Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), () -> { + Player player = event.getPlayer(); + player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 3)); + player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, Integer.MAX_VALUE, 3)); + }, 1); } @EventHandler