1
0
MasterCake 5 жил өмнө
parent
commit
01e839650e

+ 6 - 3
pom.xml

@@ -117,26 +117,29 @@
 		</dependency>
 		<!-- PlotSquared -->
 		<dependency>
-			<groupId>com.plotsquared</groupId>
-			<artifactId>plotsquared-api</artifactId>
-			<version>18.12.21-SNAPSHOT</version>
+			<groupId>com.github.intellectualsites.plotsquared</groupId>
+			<artifactId>PlotSquared-API</artifactId>
+			<version>4.369-SNAPSHOT</version>
 		</dependency>
 		<!-- Lands -->
 		<dependency>
 			<groupId>me.angeschossen.lands</groupId>
 			<artifactId>Lands</artifactId>
 			<version>2.6.6.2-SNAPSHOT</version>
+			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>com.songoda</groupId>
 			<artifactId>fabledskyblock</artifactId>
 			<version>2.0.0-SNAPSHOT</version>
+			<scope>provided</scope>
 		</dependency>
 		<!-- Placeholder API -->
 		<dependency>
 			<groupId>me.clip</groupId>
 			<artifactId>placeholderapi</artifactId>
 			<version>2.10.2</version>
+			<scope>provided</scope>
 		</dependency>
 		<!--SpaceIO Metrics -->
 		<dependency>

+ 3 - 0
src/xyz/spaceio/customoregen/CustomOreGen.java

@@ -26,6 +26,7 @@ import xyz.spaceio.configutils.JSONConfig;
 import xyz.spaceio.hooks.HookInfo;
 import xyz.spaceio.hooks.HookVanilla;
 import xyz.spaceio.hooks.SkyblockAPIHook;
+import xyz.spaceio.misc.MaterialProvider;
 import xyz.spaceio.misc.NamePlaceholder;
 
 public class CustomOreGen extends JavaPlugin {
@@ -70,6 +71,8 @@ public class CustomOreGen extends JavaPlugin {
 	public void onEnable() {
 		clogger = getServer().getConsoleSender();
 		
+		MaterialProvider.init();
+		
 		PluginManager pm = Bukkit.getPluginManager();
 		
 		pm.registerEvents(new Events(this), this);

+ 17 - 4
src/xyz/spaceio/hooks/HookPlotSquared.java

@@ -5,7 +5,8 @@ import java.util.UUID;
 
 import org.bukkit.Location;
 
-import com.intellectualcrafters.plot.api.PlotAPI;
+import com.github.intellectualsites.plotsquared.api.PlotAPI;
+
 
 public class HookPlotSquared implements SkyblockAPIHook {
 
@@ -23,14 +24,26 @@ public class HookPlotSquared implements SkyblockAPIHook {
 	@Override
 	public Optional<UUID> getIslandOwner(Location loc) {
 		Optional<UUID> optional = Optional.empty();
-		if(api.getPlot(loc) != null) {
-			optional = Optional.of(api.getPlot(loc).getOwners().iterator().next());
+	
+		
+		if(api.getPlotSquared().getApplicablePlotArea(getPSLocation(loc)).getPlotCount() > 0) {
+			UUID owner = api.getPlotSquared().getApplicablePlotArea(getPSLocation(loc)).getPlots().iterator().next().getOwner();
+			optional = Optional.of(owner);
 		}
 		return optional;
 	}
 
 	@Override
 	public String[] getSkyBlockWorldNames() {
-		return api.getPlotWorlds();
+		return api.getPlotSquared().worlds.getConfigurationSection("worlds").getKeys(false).stream().toArray(String[]::new);
+	}
+	
+	private com.github.intellectualsites.plotsquared.plot.object.Location getPSLocation(Location bukkitLoc) {
+		com.github.intellectualsites.plotsquared.plot.object.Location loc = new com.github.intellectualsites.plotsquared.plot.object.Location();
+		loc.setX(bukkitLoc.getBlockX());
+		loc.setY(bukkitLoc.getBlockY());
+		loc.setZ(bukkitLoc.getBlockZ());
+		
+		return loc;
 	}
 }