From 389f0b1a96c7564cb953f7bbbfd9ba7c2e905f9b Mon Sep 17 00:00:00 2001 From: Tastybento Date: Sun, 6 May 2018 17:37:49 -0700 Subject: [PATCH] 3.0.8.8 Fuller copy of Island for API. --- pom.xml | 2 +- src/com/wasteofplastic/askyblock/Island.java | 43 ++++++++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 339d71e63..5b7198e57 100644 --- a/pom.xml +++ b/pom.xml @@ -233,6 +233,6 @@ http://maven.sk89q.com/repo/ - 3.0.8.7 + 3.0.8.8 This pom contains reference to a lot of servers that are not included in the GitHub repository because they are binary objects and maybe subject to copyright. These are used so that the NMS code that is used especially for pasting of islands can operate. Before you can build successfully, you need to put zero or more server binaries into the lib directory on your build machine. This version will match the version of the server you will use, for example 1.12. Then delete all the unneeded packages in com.wasteofplastic.askyblock.nms that you do not need or do not have. This will allow you to build. If you have no server binaries and delete all the packages, the Bukkit API will be used instead of NMS, which is slow and not recommended. Good luck! diff --git a/src/com/wasteofplastic/askyblock/Island.java b/src/com/wasteofplastic/askyblock/Island.java index 78211efdf..70ef71fec 100644 --- a/src/com/wasteofplastic/askyblock/Island.java +++ b/src/com/wasteofplastic/askyblock/Island.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.UUID; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; @@ -468,28 +469,28 @@ public Island(ASkyBlock plugin, int x, int z, UUID owner) { */ public Island(Island island) { this.plugin = island.plugin; - this.biome = island.biome; - this.center = island.center; - this.createdDate = island.createdDate; - this.igs = island.igs; - this.islandDistance = island.islandDistance; - this.isSpawn = island.isSpawn; - this.locked = island.locked; - this.levelHandicap = island.levelHandicap; - this.minProtectedX = island.minProtectedX; - this.minProtectedZ = island.minProtectedZ; - this.minX = island.minX; - this.minZ = island.minZ; - this.owner = island.owner; + this.biome = Biome.valueOf(island.biome.name()); + this.center = island.center != null ? island.center.clone() : null; + this.createdDate = Long.valueOf(island.createdDate); + island.igs.forEach((k,v) -> this.igs.put(k, v)); + this.islandDistance = Integer.valueOf(island.islandDistance); + this.isSpawn = Boolean.valueOf(island.isSpawn); + this.locked = Boolean.valueOf(island.locked); + this.levelHandicap = Integer.valueOf(island.levelHandicap); + this.minProtectedX = Integer.valueOf(island.minProtectedX); + this.minProtectedZ = Integer.valueOf(island.minProtectedZ); + this.minX = Integer.valueOf(island.minX); + this.minZ = Integer.valueOf(island.minZ); + this.owner = UUID.fromString(island.owner.toString()); this.password = island.password; - this.protectionRange = island.protectionRange; - this.purgeProtected = island.purgeProtected; - this.spawnPoint = island.spawnPoint; - this.tileEntityCount = island.tileEntityCount; - this.updatedDate = island.updatedDate; - this.votes = island.votes; - this.world = island.world; - this.y = island.y; + this.protectionRange = Integer.valueOf(island.protectionRange); + this.purgeProtected = Boolean.valueOf(island.purgeProtected); + this.spawnPoint = island.spawnPoint == null ? null : island.spawnPoint.clone(); + this.tileEntityCount.addAll(island.tileEntityCount); + this.updatedDate = Long.valueOf(island.updatedDate); + this.votes = Integer.valueOf(island.votes); + this.world = Bukkit.getWorld(island.world.getUID()); + this.y = Integer.valueOf(island.y); } /**