Bladeren bron

finally commit for hook fixed #16

mastercake10 5 jaren geleden
bovenliggende
commit
5bf9b6160a
1 gewijzigde bestanden met toevoegingen van 36 en 0 verwijderingen
  1. 36 0
      src/xyz/spaceio/hooks/HookPlotSquared.java

+ 36 - 0
src/xyz/spaceio/hooks/HookPlotSquared.java

@@ -0,0 +1,36 @@
+package xyz.spaceio.hooks;
+
+import java.util.Optional;
+import java.util.UUID;
+
+import org.bukkit.Location;
+
+import com.intellectualcrafters.plot.api.PlotAPI;
+
+public class HookPlotSquared implements SkyblockAPIHook {
+
+	private PlotAPI api;
+
+	public HookPlotSquared() {
+		api = new PlotAPI();
+	}
+
+	@Override
+	public int getIslandLevel(UUID uuid, String world) {
+		return 0;
+	}
+
+	@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());
+		}
+		return optional;
+	}
+
+	@Override
+	public String[] getSkyBlockWorldNames() {
+		return api.getPlotWorlds();
+	}
+}