mirror of
https://e.coding.net/circlecloud/Residence.git
synced 2025-11-26 22:06:07 +00:00
Recovery static method in Residence class...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.ResidenceMain;
|
||||
import com.bekvon.bukkit.residence.economy.ResidenceBank;
|
||||
import com.bekvon.bukkit.residence.economy.TransactionManager;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceTPEvent;
|
||||
@@ -41,25 +41,25 @@ public class ClaimedResidence {
|
||||
protected String leaveMessage;
|
||||
protected ClaimedResidence parent;
|
||||
protected ResidencePermissions perms;
|
||||
protected Residence plugin;
|
||||
protected ResidenceMain plugin;
|
||||
protected Map<String, ClaimedResidence> subzones;
|
||||
protected Location tpLoc;
|
||||
|
||||
public ClaimedResidence(final Residence plugin, final String creationWorld) {
|
||||
public ClaimedResidence(final ResidenceMain plugin, final String creationWorld) {
|
||||
this(plugin, "Server Land", creationWorld);
|
||||
}
|
||||
|
||||
public ClaimedResidence(final Residence plugin, final String creator, final String creationWorld) {
|
||||
public ClaimedResidence(final ResidenceMain plugin, final String creator, final String creationWorld) {
|
||||
this(plugin);
|
||||
perms = new ResidencePermissions(plugin, this, creator, creationWorld);
|
||||
}
|
||||
|
||||
public ClaimedResidence(final Residence plugin, final String creator, final String creationWorld, final ClaimedResidence parentResidence) {
|
||||
public ClaimedResidence(final ResidenceMain plugin, final String creator, final String creationWorld, final ClaimedResidence parentResidence) {
|
||||
this(plugin, creator, creationWorld);
|
||||
parent = parentResidence;
|
||||
}
|
||||
|
||||
private ClaimedResidence(final Residence plugin) {
|
||||
private ClaimedResidence(final ResidenceMain plugin) {
|
||||
this.plugin = plugin;
|
||||
subzones = new HashMap<String, ClaimedResidence>();
|
||||
areas = new HashMap<String, CuboidArea>();
|
||||
@@ -69,7 +69,7 @@ public class ClaimedResidence {
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public static ClaimedResidence load(final Residence plugin, final Map root, final ClaimedResidence parent) throws Exception {
|
||||
public static ClaimedResidence load(final ResidenceMain plugin, final Map root, final ClaimedResidence parent) throws Exception {
|
||||
final ClaimedResidence res = new ClaimedResidence(plugin);
|
||||
if (root == null) {
|
||||
throw new Exception("Null residence!");
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.ResidenceMain;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -33,7 +33,7 @@ public class FlagPermissions {
|
||||
protected static ArrayList<String> validFlags = new ArrayList<String>();
|
||||
protected static ArrayList<String> validPlayerFlags = new ArrayList<String>();
|
||||
final static Map<Material, String> matUseFlagList = new EnumMap<Material, String>(Material.class);
|
||||
static Residence plugin;
|
||||
static ResidenceMain plugin;
|
||||
protected Map<String, Boolean> cuboidFlags;
|
||||
protected Map<String, Map<String, Boolean>> groupFlags;
|
||||
protected FlagPermissions parent;
|
||||
@@ -97,7 +97,7 @@ public class FlagPermissions {
|
||||
return (EnumMap<Material, String>) matUseFlagList;
|
||||
}
|
||||
|
||||
public static void initValidFlags(final Residence plugin) {
|
||||
public static void initValidFlags(final ResidenceMain plugin) {
|
||||
FlagPermissions.plugin = plugin;
|
||||
validAreaFlags.clear();
|
||||
validPlayerFlags.clear();
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.Set;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.ResidenceMain;
|
||||
import com.bekvon.bukkit.residence.economy.EconomyInterface;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceDeleteEvent;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceDeleteEvent.DeleteCause;
|
||||
@@ -31,15 +31,15 @@ public class LeaseManager {
|
||||
private Map<String, Long> leaseExpireTime;
|
||||
|
||||
ResidenceManager manager;
|
||||
Residence plugin;
|
||||
ResidenceMain plugin;
|
||||
|
||||
public LeaseManager(final Residence plugin, final ResidenceManager m) {
|
||||
public LeaseManager(final ResidenceMain plugin, final ResidenceManager m) {
|
||||
this.plugin = plugin;
|
||||
manager = m;
|
||||
leaseExpireTime = Collections.synchronizedMap(new HashMap<String, Long>());
|
||||
}
|
||||
|
||||
public static LeaseManager load(final Residence plugin, final Map<String, Long> root, final ResidenceManager m) {
|
||||
public static LeaseManager load(final ResidenceMain plugin, final Map<String, Long> root, final ResidenceManager m) {
|
||||
final LeaseManager l = new LeaseManager(plugin, m);
|
||||
if (root != null) {
|
||||
for (final Object val : root.values()) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Map.Entry;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.ResidenceMain;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -23,15 +23,15 @@ import com.bekvon.bukkit.residence.Residence;
|
||||
public class PermissionListManager {
|
||||
|
||||
private final Map<String, Map<String, FlagPermissions>> lists;
|
||||
Residence plugin;
|
||||
ResidenceMain plugin;
|
||||
|
||||
public PermissionListManager(final Residence plugin) {
|
||||
public PermissionListManager(final ResidenceMain plugin) {
|
||||
this.plugin = plugin;
|
||||
lists = Collections.synchronizedMap(new HashMap<String, Map<String, FlagPermissions>>());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static PermissionListManager load(final Residence plugin, final Map<String, Object> root) {
|
||||
public static PermissionListManager load(final ResidenceMain plugin, final Map<String, Object> root) {
|
||||
final PermissionListManager p = new PermissionListManager(plugin);
|
||||
if (root != null) {
|
||||
for (final Entry<String, Object> players : root.entrySet()) {
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.ResidenceMain;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceCreationEvent;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceDeleteEvent;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceDeleteEvent.DeleteCause;
|
||||
@@ -38,11 +38,11 @@ import com.bekvon.bukkit.residence.text.help.InformationPager;
|
||||
*/
|
||||
public class ResidenceManager {
|
||||
protected Map<String, Map<ChunkRef, List<String>>> chunkResidences;
|
||||
protected Residence plugin;
|
||||
protected ResidenceMain plugin;
|
||||
protected PluginManager pm;
|
||||
protected Map<String, ClaimedResidence> residences;
|
||||
|
||||
public ResidenceManager(final Residence plugin) {
|
||||
public ResidenceManager(final ResidenceMain plugin) {
|
||||
this.plugin = plugin;
|
||||
pm = plugin.getServer().getPluginManager();
|
||||
residences = new HashMap<String, ClaimedResidence>();
|
||||
@@ -50,7 +50,7 @@ public class ResidenceManager {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static ResidenceManager load(final Residence plugin, final Map<String, Object> root) throws Exception {
|
||||
public static ResidenceManager load(final ResidenceMain plugin, final Map<String, Object> root) throws Exception {
|
||||
final ResidenceManager resm = new ResidenceManager(plugin);
|
||||
if (root == null) {
|
||||
return resm;
|
||||
@@ -72,7 +72,7 @@ public class ResidenceManager {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Map<ChunkRef, List<String>> loadMap(final Residence plugin, final Map<String, Object> root, final ResidenceManager resm) throws Exception {
|
||||
public static Map<ChunkRef, List<String>> loadMap(final ResidenceMain plugin, final Map<String, Object> root, final ResidenceManager resm) throws Exception {
|
||||
final Map<ChunkRef, List<String>> retRes = new HashMap<ChunkRef, List<String>>();
|
||||
if (root != null) {
|
||||
for (final Entry<String, Object> res : root.entrySet()) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.ResidenceMain;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceFlagChangeEvent;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceFlagCheckEvent;
|
||||
import com.bekvon.bukkit.residence.event.ResidenceFlagEvent.FlagType;
|
||||
@@ -34,21 +34,21 @@ public class ResidencePermissions extends FlagPermissions {
|
||||
protected PluginManager pm;
|
||||
protected ClaimedResidence residence;
|
||||
protected String world;
|
||||
Residence plugin;
|
||||
ResidenceMain plugin;
|
||||
|
||||
public ResidencePermissions(final Residence plugin, final ClaimedResidence res) {
|
||||
public ResidencePermissions(final ResidenceMain plugin, final ClaimedResidence res) {
|
||||
this.plugin = plugin;
|
||||
this.pm = plugin.getServer().getPluginManager();
|
||||
residence = res;
|
||||
}
|
||||
|
||||
public ResidencePermissions(final Residence plugin, final ClaimedResidence res, final String creator, final String inworld) {
|
||||
public ResidencePermissions(final ResidenceMain plugin, final ClaimedResidence res, final String creator, final String inworld) {
|
||||
this(plugin, res);
|
||||
owner = creator;
|
||||
world = inworld;
|
||||
}
|
||||
|
||||
public static ResidencePermissions load(final Residence plugin, final ClaimedResidence res, final Map<String, Object> root) throws Exception {
|
||||
public static ResidencePermissions load(final ResidenceMain plugin, final ClaimedResidence res, final Map<String, Object> root) throws Exception {
|
||||
final ResidencePermissions newperms = new ResidencePermissions(plugin, res);
|
||||
newperms.owner = (String) root.get("Owner");
|
||||
if (newperms.owner == null)
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.ResidenceMain;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -25,16 +25,16 @@ public class WorldFlagManager {
|
||||
protected FlagPermissions globaldefaults;
|
||||
protected Map<String, Map<String, FlagPermissions>> groupperms;
|
||||
protected Map<String, FlagPermissions> worldperms;
|
||||
Residence plugin;
|
||||
ResidenceMain plugin;
|
||||
|
||||
public WorldFlagManager(final Residence plugin) {
|
||||
public WorldFlagManager(final ResidenceMain plugin) {
|
||||
this.plugin = plugin;
|
||||
globaldefaults = new FlagPermissions();
|
||||
worldperms = new HashMap<String, FlagPermissions>();
|
||||
groupperms = new HashMap<String, Map<String, FlagPermissions>>();
|
||||
}
|
||||
|
||||
public WorldFlagManager(final Residence plugin, final FileConfiguration config) {
|
||||
public WorldFlagManager(final ResidenceMain plugin, final FileConfiguration config) {
|
||||
this(plugin);
|
||||
this.parsePerms(config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user