Move potion effects so they dont trigger on accident

This commit is contained in:
CocoTheOwner 2021-03-09 20:34:57 +01:00
parent dd20a06f80
commit d15228656f
2 changed files with 7 additions and 14 deletions

View File

@ -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(() ->

View File

@ -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;
}