diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java index 3ed7d2d6..028003ec 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java @@ -1,14 +1,5 @@ package com.onarandombox.MultiverseCore.commands; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Random; -import java.util.stream.Collectors; - -import co.aikar.commands.BukkitCommandIssuer; -import co.aikar.commands.InvalidCommandArgument; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.CommandPermission; @@ -18,7 +9,6 @@ import co.aikar.commands.annotation.Optional; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import com.dumptruckman.minecraft.util.Logging; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.commandtools.MVCommandIssuer; import com.onarandombox.MultiverseCore.commandtools.MVCommandManager; import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand; @@ -38,6 +28,11 @@ import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; +import java.util.Arrays; +import java.util.Collections; +import java.util.Random; +import java.util.stream.Collectors; + @Service @CommandAlias("mv") public class CreateCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java index 0aff0a0c..57ef5686 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java @@ -1,6 +1,5 @@ package com.onarandombox.MultiverseCore.commands; -import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.CommandPermission; @@ -8,8 +7,6 @@ import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import com.dumptruckman.minecraft.util.Logging; -import com.onarandombox.MultiverseCore.api.MVWorld; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.commandtools.MVCommandIssuer; import com.onarandombox.MultiverseCore.commandtools.MVCommandManager; import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand; diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java index 9d9250fe..23dbf81e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java @@ -5,11 +5,12 @@ import java.util.Collections; import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; -import com.onarandombox.MultiverseCore.api.MVWorld; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.api.Teleporter; +import com.onarandombox.MultiverseCore.worldnew.MVWorld; +import com.onarandombox.MultiverseCore.worldnew.WorldManager; import jakarta.inject.Inject; import org.bukkit.Location; +import org.bukkit.World; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; @@ -17,10 +18,10 @@ import org.jvnet.hk2.annotations.Service; @Service public class CannonDestination implements Destination { - private final MVWorldManager worldManager; + private final WorldManager worldManager; @Inject - public CannonDestination(MVWorldManager worldManager) { + public CannonDestination(WorldManager worldManager) { this.worldManager = worldManager; } @@ -53,7 +54,7 @@ public class CannonDestination implements Destination return null; } - MVWorld world = this.worldManager.getMVWorld(worldName); + World world = this.worldManager.getMVWorld(worldName).map(MVWorld::getBukkitWorld).getOrNull().getOrNull(); if (world == null) { return null; } @@ -62,7 +63,7 @@ public class CannonDestination implements Destination double dSpeed; try { location = new Location( - world.getCBWorld(), + world, Double.parseDouble(coordinatesParams[0]), Double.parseDouble(coordinatesParams[1]), Double.parseDouble(coordinatesParams[2]), diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java index 33946e10..ca504c78 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java @@ -5,11 +5,12 @@ import java.util.Collections; import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; -import com.onarandombox.MultiverseCore.api.MVWorld; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.api.Teleporter; +import com.onarandombox.MultiverseCore.worldnew.MVWorld; +import com.onarandombox.MultiverseCore.worldnew.WorldManager; import jakarta.inject.Inject; import org.bukkit.Location; +import org.bukkit.World; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; @@ -17,10 +18,10 @@ import org.jvnet.hk2.annotations.Service; @Service public class ExactDestination implements Destination { - private final MVWorldManager worldManager; + private final WorldManager worldManager; @Inject - public ExactDestination(MVWorldManager worldManager) { + public ExactDestination(WorldManager worldManager) { this.worldManager = worldManager; } @@ -49,7 +50,7 @@ public class ExactDestination implements Destination { return null; } - MVWorld world = this.worldManager.getMVWorld(worldName); + World world = this.worldManager.getMVWorld(worldName).map(MVWorld::getBukkitWorld).getOrNull().getOrNull(); if (world == null) { return null; } @@ -57,7 +58,7 @@ public class ExactDestination implements Destination { Location location; try { location = new Location( - world.getCBWorld(), + world, Double.parseDouble(coordinatesParams[0]), Double.parseDouble(coordinatesParams[1]), Double.parseDouble(coordinatesParams[2]) diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java index 301cb74c..f0c63da4 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java @@ -6,9 +6,9 @@ import java.util.Collections; import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; import com.onarandombox.MultiverseCore.api.LocationManipulation; -import com.onarandombox.MultiverseCore.api.MVWorld; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.api.Teleporter; +import com.onarandombox.MultiverseCore.worldnew.MVWorld; +import com.onarandombox.MultiverseCore.worldnew.WorldManager; import jakarta.inject.Inject; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -17,11 +17,11 @@ import org.jvnet.hk2.annotations.Service; @Service public class WorldDestination implements Destination { - private final MVWorldManager worldManager; + private final WorldManager worldManager; private final LocationManipulation locationManipulation; @Inject - public WorldDestination(MVWorldManager worldManager, LocationManipulation locationManipulation) { + public WorldDestination(WorldManager worldManager, LocationManipulation locationManipulation) { this.worldManager = worldManager; this.locationManipulation = locationManipulation; } @@ -45,7 +45,7 @@ public class WorldDestination implements Destination { } String worldName = items[0]; - MVWorld world = this.worldManager.getMVWorld(worldName); + MVWorld world = this.worldManager.getMVWorld(worldName).getOrNull(); if (world == null) { return null; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestinationInstance.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestinationInstance.java index e3ed6428..b1ac6353 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestinationInstance.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestinationInstance.java @@ -1,7 +1,7 @@ package com.onarandombox.MultiverseCore.destination.core; import com.onarandombox.MultiverseCore.api.DestinationInstance; -import com.onarandombox.MultiverseCore.api.MVWorld; +import com.onarandombox.MultiverseCore.worldnew.MVWorld; import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.util.Vector; @@ -59,8 +59,8 @@ public class WorldDestinationInstance implements DestinationInstance { @Override public @NotNull String serialise() { if (this.direction != null) { - return this.world.getCBWorld().getName() + ":" + this.direction; + return this.world.getName() + ":" + this.direction; } - return this.world.getCBWorld().getName(); + return this.world.getName(); } }