|
@@ -1,9 +1,11 @@
|
|
|
package me.lethunderhawk.world.manager;
|
|
package me.lethunderhawk.world.manager;
|
|
|
|
|
|
|
|
import me.lethunderhawk.fluxapi.FluxService;
|
|
import me.lethunderhawk.fluxapi.FluxService;
|
|
|
|
|
+import me.lethunderhawk.fluxapi.npc.abstraction.NPC;
|
|
|
|
|
+import me.lethunderhawk.fluxapi.npc.abstraction.NPCOptions;
|
|
|
|
|
+import me.lethunderhawk.fluxapi.npc.manager.NPCManager;
|
|
|
import me.lethunderhawk.main.BazaarFlux;
|
|
import me.lethunderhawk.main.BazaarFlux;
|
|
|
-import me.lethunderhawk.npc.abstraction.NPC;
|
|
|
|
|
-import me.lethunderhawk.npc.abstraction.NPCOptions;
|
|
|
|
|
|
|
+import me.lethunderhawk.npc.types.IslandNPC;
|
|
|
import me.lethunderhawk.world.abstraction.WorldStorageManager;
|
|
import me.lethunderhawk.world.abstraction.WorldStorageManager;
|
|
|
import me.lethunderhawk.world.island.IslandWorld;
|
|
import me.lethunderhawk.world.island.IslandWorld;
|
|
|
import me.lethunderhawk.world.util.schematic.Rotation;
|
|
import me.lethunderhawk.world.util.schematic.Rotation;
|
|
@@ -176,8 +178,8 @@ public final class NestedWorldStorageManager implements WorldStorageManager {
|
|
|
return worldFolder.exists();
|
|
return worldFolder.exists();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public World createIslandWorld(String playerUUID) {
|
|
|
|
|
- World world = createWorld("islands", playerUUID, creator -> {
|
|
|
|
|
|
|
+ public World createIslandWorld(UUID playerUUID, String worldName) {
|
|
|
|
|
+ World world = createWorld("islands", worldName, creator -> {
|
|
|
creator.environment(World.Environment.NORMAL);
|
|
creator.environment(World.Environment.NORMAL);
|
|
|
creator.type(WorldType.NORMAL);
|
|
creator.type(WorldType.NORMAL);
|
|
|
creator.generateStructures(false);
|
|
creator.generateStructures(false);
|
|
@@ -200,27 +202,15 @@ public final class NestedWorldStorageManager implements WorldStorageManager {
|
|
|
pdc.set(GENERATED_KEY, PersistentDataType.BYTE, (byte) 1);
|
|
pdc.set(GENERATED_KEY, PersistentDataType.BYTE, (byte) 1);
|
|
|
FluxService.get(BazaarFlux.class).getLogger().info("Created island in world: " + world.getName());
|
|
FluxService.get(BazaarFlux.class).getLogger().info("Created island in world: " + world.getName());
|
|
|
}
|
|
}
|
|
|
- NPCOptions options = new NPCOptions()
|
|
|
|
|
- .setLocation(spawn)
|
|
|
|
|
|
|
+ NPCOptions options = new NPCOptions(UUID.randomUUID())
|
|
|
.setName("Local Guide")
|
|
.setName("Local Guide")
|
|
|
.setLookingAtNearest(true)
|
|
.setLookingAtNearest(true)
|
|
|
.setEntityType(EntityType.VILLAGER)
|
|
.setEntityType(EntityType.VILLAGER)
|
|
|
- .setLocation(spawn.add(-2, 0, 0));
|
|
|
|
|
-
|
|
|
|
|
- NPC npc = new NPC(options){
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onLeftClick(Player player) {
|
|
|
|
|
- player.sendMessage("<"+this.getName()+"> Im your guide for now!");
|
|
|
|
|
- player.sendMessage("<"+this.getName()+"> Still a lot of work ahead though!");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onRightClick(Player player) {
|
|
|
|
|
- onLeftClick(player);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- npc.register();
|
|
|
|
|
|
|
+ .setBukkitLocation(spawn.add(-2, 0, 0));
|
|
|
|
|
|
|
|
|
|
+ NPC npc = new IslandNPC(playerUUID, options);
|
|
|
|
|
+ npc.spawn();
|
|
|
|
|
+ FluxService.get(NPCManager.class).registerNPC(npc);
|
|
|
return world;
|
|
return world;
|
|
|
}
|
|
}
|
|
|
|
|
|