diff --git a/src/main/java/com/tocard/cam/ExecuteTraveling.java b/src/main/java/com/tocard/cam/ExecuteTraveling.java index 8be8231..cc93d54 100644 --- a/src/main/java/com/tocard/cam/ExecuteTraveling.java +++ b/src/main/java/com/tocard/cam/ExecuteTraveling.java @@ -5,6 +5,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.Bukkit; +import org.bukkit.GameMode; import java.util.Iterator; @@ -43,8 +44,11 @@ public class ExecuteTraveling implements CommandExecutor { return true; } + player.setGameMode(GameMode.SPECTATOR); + curveIterator = Camera.curve.subList(fromIndex * (Camera.nbSubdiv + 1), toIndex * (Camera.nbSubdiv + 1)) .iterator(); + player.teleport(curveIterator.next()); taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Camera.plugin, new Runnable() { diff --git a/src/main/java/com/tocard/cam/NewPoint.java b/src/main/java/com/tocard/cam/NewPoint.java index f07d9a0..746a65e 100644 --- a/src/main/java/com/tocard/cam/NewPoint.java +++ b/src/main/java/com/tocard/cam/NewPoint.java @@ -28,6 +28,9 @@ public class NewPoint implements CommandExecutor { case "fix": fix(args, null, null); break; + case "ins": + ins(args, new ExtendedLocation(player.getLocation()), player.getWorld()); + break; default: break; }