Ver código fonte

finally commit for hook fixed #16

mastercake10 5 anos atrás
pai
commit
5bf9b6160a
1 arquivos alterados com 36 adições e 0 exclusões
  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();
+	}
+}