fix: auto specmode

This commit is contained in:
gdamms 2022-05-18 14:23:36 +02:00
parent 43cdd95a33
commit 60f42086d7
2 changed files with 7 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import java.util.Iterator; import java.util.Iterator;
@ -43,8 +44,11 @@ public class ExecuteTraveling implements CommandExecutor {
return true; return true;
} }
player.setGameMode(GameMode.SPECTATOR);
curveIterator = Camera.curve.subList(fromIndex * (Camera.nbSubdiv + 1), toIndex * (Camera.nbSubdiv + 1)) curveIterator = Camera.curve.subList(fromIndex * (Camera.nbSubdiv + 1), toIndex * (Camera.nbSubdiv + 1))
.iterator(); .iterator();
player.teleport(curveIterator.next()); player.teleport(curveIterator.next());
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Camera.plugin, new Runnable() { taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Camera.plugin, new Runnable() {

View file

@ -28,6 +28,9 @@ public class NewPoint implements CommandExecutor {
case "fix": case "fix":
fix(args, null, null); fix(args, null, null);
break; break;
case "ins":
ins(args, new ExtendedLocation(player.getLocation()), player.getWorld());
break;
default: default:
break; break;
} }