diff --git a/src/main/java/com/volmit/iris/manager/IrisProject.java b/src/main/java/com/volmit/iris/manager/IrisProject.java index e297ef66e..8c78553da 100644 --- a/src/main/java/com/volmit/iris/manager/IrisProject.java +++ b/src/main/java/com/volmit/iris/manager/IrisProject.java @@ -14,6 +14,8 @@ import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.World; import org.bukkit.WorldCreator; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; import org.zeroturnaround.zip.ZipUtil; import java.awt.*; @@ -59,6 +61,11 @@ public class IrisProject { sender.sendMessage("Can't find dimension: " + getName()); return; + } else if(sender.isPlayer()){ + sender.player().setGameMode(GameMode.SPECTATOR); + sender.player().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 2000, 10)); + sender.player().addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 2000, 10)); + sender.player().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(C.BLUE + "Creating studio world. Please wait...")); } J.attemptAsync(() -> diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java index 7590a9c93..927c3ed61 100644 --- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java +++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java @@ -2,15 +2,9 @@ package com.volmit.iris.manager.command.studio; import com.volmit.iris.Iris; import com.volmit.iris.IrisSettings; -import com.volmit.iris.util.C; import com.volmit.iris.util.KList; import com.volmit.iris.util.MortarCommand; import com.volmit.iris.util.MortarSender; -import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.GameMode; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; public class CommandIrisStudioOpen extends MortarCommand { @@ -42,14 +36,6 @@ public class CommandIrisStudioOpen extends MortarCommand return true; } - if(sender.isPlayer()) - { - sender.player().setGameMode(GameMode.SPECTATOR); - sender.player().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 2000, 10)); - sender.player().addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 2000, 10)); - sender.player().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(C.BLUE + "Creating studio world. Please wait...")); - } - Iris.proj.open(sender, args[0]); return true; }