Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/com/instancedev/skins/utils/PlotMeSupport.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down