From d204bdb0726a8b45319c4d982a6a195a6cd2097c Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 10 Mar 2015 15:40:03 -0400 Subject: [PATCH] Update PlotMe Not building upon the latest version of PlotMe or even updating your plugin can cause major compatibility issues. --- .../skins/utils/PlotMeSupport.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/com/instancedev/skins/utils/PlotMeSupport.java b/src/com/instancedev/skins/utils/PlotMeSupport.java index 4cc713e..1f5575f 100644 --- a/src/com/instancedev/skins/utils/PlotMeSupport.java +++ b/src/com/instancedev/skins/utils/PlotMeSupport.java @@ -1,30 +1,32 @@ package com.instancedev.skins.utils; +import com.worldcretornica.plotme_core.Plot; +import com.worldcretornica.plotme_core.PlotMeCoreManager; +import com.worldcretornica.plotme_core.api.IPlayer; +import com.worldcretornica.plotme_core.bukkit.PlotMe_CorePlugin; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import com.worldcretornica.plotme.Plot; -import com.worldcretornica.plotme.PlotManager; -import com.worldcretornica.plotme.PlotMe; - public class PlotMeSupport { - public static PlotMe getPlotMe() { + public static PlotMe_CorePlugin getPlotMe() { Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("PlotMe"); - if (plugin == null || !(plugin instanceof PlotMe)) { + if (plugin == null || !(plugin instanceof PlotMe_CorePlugin)) { return null; } - return (PlotMe) plugin; + return (PlotMe_CorePlugin) plugin; } public static boolean canBuildPlotMe(Player p, Location l) { - String id = PlotManager.getPlotId(l); - if (!id.equalsIgnoreCase("")) { - Plot plot = PlotManager.getMap(p).plots.get(id); + final PlotMeCoreManager manager = PlotMeCoreManager.getInstance(); + IPlayer player = getPlotMe().wrapPlayer(p); + String id = manager.getPlotId(player); + if (!id.isEmpty()) { + Plot plot = manager.getMap(player).getPlot(id); if (plot == null) { if (!p.isOp()) { return false;