diff --git a/src/main/java/fr/zelytra/daedalus/commands/test.java b/src/main/java/fr/zelytra/daedalus/commands/test.java index 1e27f76..83031fb 100644 --- a/src/main/java/fr/zelytra/daedalus/commands/test.java +++ b/src/main/java/fr/zelytra/daedalus/commands/test.java @@ -1,5 +1,6 @@ package fr.zelytra.daedalus.commands; +import fr.zelytra.daedalus.Daedalus; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -10,10 +11,10 @@ public class test implements CommandExecutor { @Override public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { - if(!(sender instanceof Player)){ + if (!(sender instanceof Player)) { return false; } - + Daedalus.getInstance().getGameManager().getTimeManager().episode = Integer.parseInt(args[0]); return true; } } diff --git a/src/main/java/fr/zelytra/daedalus/managers/guardian/Guardian.java b/src/main/java/fr/zelytra/daedalus/managers/guardian/Guardian.java index 5e8b984..0c5953a 100644 --- a/src/main/java/fr/zelytra/daedalus/managers/guardian/Guardian.java +++ b/src/main/java/fr/zelytra/daedalus/managers/guardian/Guardian.java @@ -255,6 +255,10 @@ private void ejection() { if (isPlayer) { for (Entity e : nearbyEntities) { + + if (e instanceof Player && ((Player) e).getGameMode() != GameMode.SURVIVAL) + continue; + Vector delta = new Vector(e.getLocation().getX() - entity.getLocation().getX(), 0, e.getLocation().getZ() - entity.getLocation().getZ()); double norme = Math.sqrt(Math.pow(delta.getX() + 0.01, 2) + Math.pow(delta.getY() + 0.01, 2) + Math.pow(delta.getZ() + 0.01, 2)); final int coef = 2;