mirror of
https://e.coding.net/circlecloud/Residence.git
synced 2025-11-24 21:46:16 +00:00
@@ -1,289 +1,267 @@
|
|||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates and open the template in the editor.
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
*/
|
||||||
package com.bekvon.bukkit.residence;
|
package com.bekvon.bukkit.residence;
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
|
|
||||||
import com.bekvon.bukkit.residence.protection.FlagPermissions;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
|
||||||
|
import com.bekvon.bukkit.residence.protection.FlagPermissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
*/
|
*/
|
||||||
public class ConfigManager {
|
public class ConfigManager {
|
||||||
protected String defaultGroup;
|
protected String defaultGroup;
|
||||||
protected boolean useLeases;
|
protected boolean useLeases;
|
||||||
protected boolean enableEconomy;
|
protected boolean enableEconomy;
|
||||||
protected String economySystem;
|
protected String economySystem;
|
||||||
protected boolean adminsOnly;
|
protected boolean adminsOnly;
|
||||||
protected boolean allowEmptyResidences;
|
protected boolean allowEmptyResidences;
|
||||||
protected int infoToolId;
|
protected int infoToolId;
|
||||||
protected int selectionToolId;
|
protected int selectionToolId;
|
||||||
protected boolean adminOps;
|
protected boolean adminOps;
|
||||||
protected String multiworldPlugin;
|
protected String multiworldPlugin;
|
||||||
protected boolean enableRentSystem;
|
protected boolean enableRentSystem;
|
||||||
protected boolean leaseAutoRenew;
|
protected boolean leaseAutoRenew;
|
||||||
protected int rentCheckInterval;
|
protected int rentCheckInterval;
|
||||||
protected int leaseCheckInterval;
|
protected int leaseCheckInterval;
|
||||||
protected int autoSaveInt;
|
protected int autoSaveInt;
|
||||||
protected boolean flagsInherit;
|
protected boolean flagsInherit;
|
||||||
protected ChatColor chatColor;
|
protected ChatColor chatColor;
|
||||||
protected boolean chatEnable;
|
protected boolean chatEnable;
|
||||||
protected boolean actionBar;
|
protected boolean actionBar;
|
||||||
protected int minMoveUpdate;
|
protected int minMoveUpdate;
|
||||||
protected FlagPermissions globalCreatorDefaults;
|
protected FlagPermissions globalCreatorDefaults;
|
||||||
protected FlagPermissions globalResidenceDefaults;
|
protected FlagPermissions globalResidenceDefaults;
|
||||||
protected Map<String,FlagPermissions> globalGroupDefaults;
|
protected Map<String, FlagPermissions> globalGroupDefaults;
|
||||||
protected String language;
|
protected String language;
|
||||||
protected boolean preventBuildInRent;
|
protected boolean preventBuildInRent;
|
||||||
protected boolean stopOnSaveError;
|
protected boolean stopOnSaveError;
|
||||||
protected boolean legacyperms;
|
protected boolean legacyperms;
|
||||||
protected String namefix;
|
protected String namefix;
|
||||||
protected boolean showIntervalMessages;
|
protected boolean showIntervalMessages;
|
||||||
protected boolean spoutEnable;
|
protected boolean spoutEnable;
|
||||||
protected boolean enableLeaseMoneyAccount;
|
protected boolean enableLeaseMoneyAccount;
|
||||||
protected boolean enableDebug;
|
protected boolean enableDebug;
|
||||||
protected List<Integer> customContainers;
|
protected List<Integer> customContainers;
|
||||||
protected List<Integer> customBothClick;
|
protected List<Integer> customBothClick;
|
||||||
protected List<Integer> customRightClick;
|
protected List<Integer> customRightClick;
|
||||||
private boolean enforceAreaInsideArea;
|
private boolean enforceAreaInsideArea;
|
||||||
|
|
||||||
public ConfigManager(FileConfiguration config)
|
public ConfigManager(FileConfiguration config) {
|
||||||
{
|
globalCreatorDefaults = new FlagPermissions();
|
||||||
globalCreatorDefaults = new FlagPermissions();
|
globalResidenceDefaults = new FlagPermissions();
|
||||||
globalResidenceDefaults = new FlagPermissions();
|
globalGroupDefaults = new HashMap<String, FlagPermissions>();
|
||||||
globalGroupDefaults = new HashMap<String,FlagPermissions>();
|
this.load(config);
|
||||||
this.load(config);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
public boolean allowAdminsOnly() {
|
||||||
|
return adminsOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean allowEmptyResidences() {
|
||||||
|
return allowEmptyResidences;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean autoRenewLeases() {
|
||||||
|
return leaseAutoRenew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean chatEnabled() {
|
||||||
|
return chatEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean debugEnabled() {
|
||||||
|
return enableDebug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean enabledRentSystem() {
|
||||||
|
return enableRentSystem && enableEconomy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean enableEconomy() {
|
||||||
|
return enableEconomy && Residence.getEconomyManager() != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean enableLeaseMoneyAccount() {
|
||||||
|
return enableLeaseMoneyAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean enableSpout() {
|
||||||
|
return spoutEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean flagsInherit() {
|
||||||
|
return flagsInherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAutoSaveInterval() {
|
||||||
|
return autoSaveInt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatColor getChatColor() {
|
||||||
|
return chatColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getCustomBothClick() {
|
||||||
|
return customBothClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getCustomContainers() {
|
||||||
|
return customContainers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getCustomRightClick() {
|
||||||
|
return customRightClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultGroup() {
|
||||||
|
return defaultGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEconomySystem() {
|
||||||
|
return economySystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getEnforceAreaInsideArea() {
|
||||||
|
return enforceAreaInsideArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FlagPermissions getGlobalCreatorDefaultFlags() {
|
||||||
|
return globalCreatorDefaults;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, FlagPermissions> getGlobalGroupDefaultFlags() {
|
||||||
|
return globalGroupDefaults;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FlagPermissions getGlobalResidenceDefaultFlags() {
|
||||||
|
return globalResidenceDefaults;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInfoToolID() {
|
||||||
|
return infoToolId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLeaseCheckInterval() {
|
||||||
|
return leaseCheckInterval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinMoveUpdateInterval() {
|
||||||
|
return minMoveUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMultiworldPlugin() {
|
||||||
|
return multiworldPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getOpsAreAdmins() {
|
||||||
|
return adminOps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRentCheckInterval() {
|
||||||
|
return rentCheckInterval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResidenceNameRegex() {
|
||||||
|
return namefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSelectionTooldID() {
|
||||||
|
return selectionToolId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void load(FileConfiguration config) {
|
private void load(FileConfiguration config) {
|
||||||
defaultGroup = config.getString("Global.DefaultGroup", "default").toLowerCase();
|
defaultGroup = config.getString("Global.DefaultGroup", "default").toLowerCase();
|
||||||
adminsOnly = config.getBoolean("Global.AdminOnlyCommands", false);
|
adminsOnly = config.getBoolean("Global.AdminOnlyCommands", false);
|
||||||
useLeases = config.getBoolean("Global.UseLeaseSystem", false);
|
useLeases = config.getBoolean("Global.UseLeaseSystem", false);
|
||||||
leaseAutoRenew = config.getBoolean("Global.LeaseAutoRenew", true);
|
leaseAutoRenew = config.getBoolean("Global.LeaseAutoRenew", true);
|
||||||
enableEconomy = config.getBoolean("Global.EnableEconomy", false);
|
enableEconomy = config.getBoolean("Global.EnableEconomy", false);
|
||||||
economySystem = config.getString("Global.EconomySystem", "iConomy");
|
economySystem = config.getString("Global.EconomySystem", "iConomy");
|
||||||
infoToolId = config.getInt("Global.InfoToolId", Material.STRING.getId());
|
infoToolId = config.getInt("Global.InfoToolId", Material.STRING.getId());
|
||||||
selectionToolId = config.getInt("Global.SelectionToolId", Material.WOOD_AXE.getId());
|
selectionToolId = config.getInt("Global.SelectionToolId", Material.WOOD_AXE.getId());
|
||||||
adminOps = config.getBoolean("Global.AdminOPs", true);
|
adminOps = config.getBoolean("Global.AdminOPs", true);
|
||||||
multiworldPlugin = config.getString("Global.MultiWorldPlugin");
|
multiworldPlugin = config.getString("Global.MultiWorldPlugin");
|
||||||
enableRentSystem = config.getBoolean("Global.EnableRentSystem", false);
|
enableRentSystem = config.getBoolean("Global.EnableRentSystem", false);
|
||||||
rentCheckInterval = config.getInt("Global.RentCheckInterval", 10);
|
rentCheckInterval = config.getInt("Global.RentCheckInterval", 10);
|
||||||
leaseCheckInterval = config.getInt("Global.LeaseCheckInterval", 10);
|
leaseCheckInterval = config.getInt("Global.LeaseCheckInterval", 10);
|
||||||
autoSaveInt = config.getInt("Global.SaveInterval", 10);
|
autoSaveInt = config.getInt("Global.SaveInterval", 10);
|
||||||
flagsInherit = config.getBoolean("Global.ResidenceFlagsInherit", false);
|
flagsInherit = config.getBoolean("Global.ResidenceFlagsInherit", false);
|
||||||
minMoveUpdate = config.getInt("Global.MoveCheckInterval", 500);
|
minMoveUpdate = config.getInt("Global.MoveCheckInterval", 500);
|
||||||
chatEnable = config.getBoolean("Global.ResidenceChatEnable", true);
|
chatEnable = config.getBoolean("Global.ResidenceChatEnable", true);
|
||||||
actionBar = config.getBoolean("Global.UseActionBar", true);
|
actionBar = config.getBoolean("Global.UseActionBar", true);
|
||||||
enforceAreaInsideArea = config.getBoolean("Global.EnforceAreaInsideArea", false);
|
enforceAreaInsideArea = config.getBoolean("Global.EnforceAreaInsideArea", false);
|
||||||
language = config.getString("Global.Language","English");
|
language = config.getString("Global.Language", "English");
|
||||||
globalCreatorDefaults = FlagPermissions.parseFromConfigNode("CreatorDefault", config.getConfigurationSection("Global"));
|
globalCreatorDefaults = FlagPermissions.parseFromConfigNode("CreatorDefault",
|
||||||
globalResidenceDefaults = FlagPermissions.parseFromConfigNode("ResidenceDefault", config.getConfigurationSection("Global"));
|
config.getConfigurationSection("Global"));
|
||||||
preventBuildInRent = config.getBoolean("Global.PreventRentModify", true);
|
globalResidenceDefaults = FlagPermissions.parseFromConfigNode("ResidenceDefault",
|
||||||
stopOnSaveError = config.getBoolean("Global.StopOnSaveFault",true);
|
config.getConfigurationSection("Global"));
|
||||||
legacyperms = config.getBoolean("Global.LegacyPermissions",false);
|
preventBuildInRent = config.getBoolean("Global.PreventRentModify", true);
|
||||||
namefix = config.getString("Global.ResidenceNameRegex",null);//"[^a-zA-Z0-9\\-\\_]"
|
stopOnSaveError = config.getBoolean("Global.StopOnSaveFault", true);
|
||||||
showIntervalMessages = config.getBoolean("Global.ShowIntervalMessages", false);
|
legacyperms = config.getBoolean("Global.LegacyPermissions", false);
|
||||||
spoutEnable = config.getBoolean("Global.EnableSpout", false);
|
namefix = config.getString("Global.ResidenceNameRegex", null);// "[^a-zA-Z0-9\\-\\_]"
|
||||||
enableLeaseMoneyAccount = config.getBoolean("Global.EnableLeaseMoneyAccount", true);
|
showIntervalMessages = config.getBoolean("Global.ShowIntervalMessages", false);
|
||||||
enableDebug = config.getBoolean("Global.EnableDebug", false);
|
spoutEnable = config.getBoolean("Global.EnableSpout", false);
|
||||||
customContainers = config.getIntegerList("Global.CustomContainers");
|
enableLeaseMoneyAccount = config.getBoolean("Global.EnableLeaseMoneyAccount", true);
|
||||||
customBothClick = config.getIntegerList("Global.CustomBothClick");
|
enableDebug = config.getBoolean("Global.EnableDebug", false);
|
||||||
customRightClick = config.getIntegerList("Global.CustomRightClick");
|
customContainers = config.getIntegerList("Global.CustomContainers");
|
||||||
ConfigurationSection node = config.getConfigurationSection("Global.GroupDefault");
|
customBothClick = config.getIntegerList("Global.CustomBothClick");
|
||||||
if(node!=null)
|
customRightClick = config.getIntegerList("Global.CustomRightClick");
|
||||||
{
|
ConfigurationSection node = config.getConfigurationSection("Global.GroupDefault");
|
||||||
Set<String> keys = node.getConfigurationSection(defaultGroup).getKeys(false);
|
if (node != null) {
|
||||||
if(keys!=null)
|
Set<String> keys = node.getConfigurationSection(defaultGroup).getKeys(false);
|
||||||
{
|
if (keys != null) {
|
||||||
for(String key: keys)
|
for (String key : keys) {
|
||||||
{
|
globalGroupDefaults.put(
|
||||||
globalGroupDefaults.put(key, FlagPermissions.parseFromConfigNode(key, config.getConfigurationSection("Global.GroupDefault")));
|
key,
|
||||||
}
|
FlagPermissions.parseFromConfigNode(key,
|
||||||
}
|
config.getConfigurationSection("Global.GroupDefault")));
|
||||||
}
|
}
|
||||||
try {
|
}
|
||||||
chatColor = ChatColor.valueOf(config.getString("Global.ResidenceChatColor", "DARK_PURPLE"));
|
}
|
||||||
} catch (Exception ex) {
|
try {
|
||||||
chatColor = ChatColor.DARK_PURPLE;
|
chatColor = ChatColor.valueOf(config.getString("Global.ResidenceChatColor",
|
||||||
}
|
"DARK_PURPLE"));
|
||||||
}
|
} catch (Exception ex) {
|
||||||
|
chatColor = ChatColor.DARK_PURPLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean useLegacyPermissions()
|
public boolean preventRentModify() {
|
||||||
{
|
return preventBuildInRent;
|
||||||
return legacyperms;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultGroup() {
|
public boolean showIntervalMessages() {
|
||||||
return defaultGroup;
|
return showIntervalMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getResidenceNameRegex()
|
public boolean stopOnSaveError() {
|
||||||
{
|
return stopOnSaveError;
|
||||||
return namefix;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public boolean enableEconomy() {
|
public boolean useActionBar() {
|
||||||
return enableEconomy && Residence.getEconomyManager()!=null;
|
return actionBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean enabledRentSystem()
|
public boolean useLeases() {
|
||||||
{
|
return useLeases;
|
||||||
return enableRentSystem && enableEconomy();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public boolean useLeases() {
|
public boolean useLegacyPermissions() {
|
||||||
return useLeases;
|
return legacyperms;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean allowAdminsOnly() {
|
|
||||||
return adminsOnly;
|
|
||||||
}
|
|
||||||
public boolean allowEmptyResidences()
|
|
||||||
{
|
|
||||||
return allowEmptyResidences;
|
|
||||||
}
|
|
||||||
public int getInfoToolID()
|
|
||||||
{
|
|
||||||
return infoToolId;
|
|
||||||
}
|
|
||||||
public int getSelectionTooldID()
|
|
||||||
{
|
|
||||||
return selectionToolId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getOpsAreAdmins()
|
|
||||||
{
|
|
||||||
return adminOps;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMultiworldPlugin()
|
|
||||||
{
|
|
||||||
return multiworldPlugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean autoRenewLeases()
|
|
||||||
{
|
|
||||||
return leaseAutoRenew;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEconomySystem()
|
|
||||||
{
|
|
||||||
return economySystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRentCheckInterval()
|
|
||||||
{
|
|
||||||
return rentCheckInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLeaseCheckInterval()
|
|
||||||
{
|
|
||||||
return leaseCheckInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAutoSaveInterval()
|
|
||||||
{
|
|
||||||
return autoSaveInt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean flagsInherit()
|
|
||||||
{
|
|
||||||
return flagsInherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean chatEnabled()
|
|
||||||
{
|
|
||||||
return chatEnable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean useActionBar()
|
|
||||||
{
|
|
||||||
return actionBar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChatColor getChatColor()
|
|
||||||
{
|
|
||||||
return chatColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMinMoveUpdateInterval()
|
|
||||||
{
|
|
||||||
return minMoveUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FlagPermissions getGlobalCreatorDefaultFlags()
|
|
||||||
{
|
|
||||||
return globalCreatorDefaults;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FlagPermissions getGlobalResidenceDefaultFlags()
|
|
||||||
{
|
|
||||||
return globalResidenceDefaults;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String,FlagPermissions> getGlobalGroupDefaultFlags()
|
|
||||||
{
|
|
||||||
return globalGroupDefaults;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLanguage()
|
|
||||||
{
|
|
||||||
return language;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean preventRentModify()
|
|
||||||
{
|
|
||||||
return preventBuildInRent;
|
|
||||||
}
|
|
||||||
public boolean stopOnSaveError()
|
|
||||||
{
|
|
||||||
return stopOnSaveError;
|
|
||||||
}
|
|
||||||
public boolean showIntervalMessages()
|
|
||||||
{
|
|
||||||
return showIntervalMessages;
|
|
||||||
}
|
|
||||||
public boolean enableSpout()
|
|
||||||
{
|
|
||||||
return spoutEnable;
|
|
||||||
}
|
|
||||||
public boolean enableLeaseMoneyAccount()
|
|
||||||
{
|
|
||||||
return enableLeaseMoneyAccount;
|
|
||||||
}
|
|
||||||
public boolean debugEnabled()
|
|
||||||
{
|
|
||||||
return enableDebug;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Integer> getCustomContainers()
|
|
||||||
{
|
|
||||||
return customContainers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Integer> getCustomBothClick()
|
|
||||||
{
|
|
||||||
return customBothClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Integer> getCustomRightClick()
|
|
||||||
{
|
|
||||||
return customRightClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getEnforceAreaInsideArea() {
|
|
||||||
return enforceAreaInsideArea;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates and open the template in the editor.
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
*/
|
||||||
package com.bekvon.bukkit.residence;
|
package com.bekvon.bukkit.residence;
|
||||||
|
|
||||||
@@ -57,8 +56,8 @@ import com.bekvon.bukkit.residence.selection.WorldEditSelectionManager;
|
|||||||
import com.bekvon.bukkit.residence.text.Language;
|
import com.bekvon.bukkit.residence.text.Language;
|
||||||
import com.bekvon.bukkit.residence.text.help.HelpEntry;
|
import com.bekvon.bukkit.residence.text.help.HelpEntry;
|
||||||
import com.bekvon.bukkit.residence.text.help.InformationPager;
|
import com.bekvon.bukkit.residence.text.help.InformationPager;
|
||||||
|
import com.bekvon.bukkit.residence.utils.ZipLibrary;
|
||||||
import com.bekvon.bukkit.residence.vaultinterface.ResidenceVaultAdapter;
|
import com.bekvon.bukkit.residence.vaultinterface.ResidenceVaultAdapter;
|
||||||
import com.bekvon.bukkit.residence.vaultinterface.ZipLibrary;
|
|
||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,34 +67,34 @@ import com.earth2me.essentials.Essentials;
|
|||||||
*/
|
*/
|
||||||
public class Residence extends JavaPlugin {
|
public class Residence extends JavaPlugin {
|
||||||
|
|
||||||
public static String bukkitver;
|
public static String bukkitver;
|
||||||
protected static ResidenceManager rmanager;
|
protected static ResidenceManager rmanager;
|
||||||
protected static SelectionManager smanager;
|
protected static SelectionManager smanager;
|
||||||
protected static PermissionManager gmanager;
|
protected static PermissionManager gmanager;
|
||||||
protected static ConfigManager cmanager;
|
protected static ConfigManager cmanager;
|
||||||
protected static ResidenceBlockListener blistener;
|
protected static ResidenceBlockListener blistener;
|
||||||
protected static ResidencePlayerListener plistener;
|
protected static ResidencePlayerListener plistener;
|
||||||
protected static ResidenceEntityListener elistener;
|
protected static ResidenceEntityListener elistener;
|
||||||
protected static TransactionManager tmanager;
|
protected static TransactionManager tmanager;
|
||||||
protected static PermissionListManager pmanager;
|
protected static PermissionListManager pmanager;
|
||||||
protected static LeaseManager leasemanager;
|
protected static LeaseManager leasemanager;
|
||||||
protected static WorldItemManager imanager;
|
protected static WorldItemManager imanager;
|
||||||
protected static WorldFlagManager wmanager;
|
protected static WorldFlagManager wmanager;
|
||||||
protected static RentManager rentmanager;
|
protected static RentManager rentmanager;
|
||||||
protected static ChatManager chatmanager;
|
protected static ChatManager chatmanager;
|
||||||
protected static Server server;
|
protected static Server server;
|
||||||
protected static HelpEntry helppages;
|
protected static HelpEntry helppages;
|
||||||
protected static Language language;
|
protected static Language language;
|
||||||
protected static EconomyInterface economy;
|
protected static EconomyInterface economy;
|
||||||
public final static int saveVersion = 1;
|
public final static int saveVersion = 1;
|
||||||
protected static File dataFolder;
|
protected static File dataFolder;
|
||||||
protected static int leaseBukkitId = -1;
|
protected static int leaseBukkitId = -1;
|
||||||
protected static int rentBukkitId = -1;
|
protected static int rentBukkitId = -1;
|
||||||
protected static int healBukkitId = -1;
|
protected static int healBukkitId = -1;
|
||||||
protected static int autosaveBukkitId = -1;
|
protected static int autosaveBukkitId = -1;
|
||||||
protected static boolean initsuccess = false;
|
protected static boolean initsuccess = false;
|
||||||
protected static List<String> resadminToggle;
|
protected static List<String> resadminToggle;
|
||||||
private final static String[] validLanguages = { "English", "Chinese" };
|
private final static String[] validLanguages = { "English", "Chinese" };
|
||||||
|
|
||||||
public static ResidenceBlockListener getBlockListener() {
|
public static ResidenceBlockListener getBlockListener() {
|
||||||
return blistener;
|
return blistener;
|
||||||
@@ -217,40 +216,38 @@ public class Residence extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean firstenable = true;
|
protected boolean firstenable = true;
|
||||||
|
|
||||||
protected Map<String, String> deleteConfirm;
|
protected Map<String, String> deleteConfirm;
|
||||||
|
|
||||||
private Runnable doHeals = new Runnable() {
|
private Runnable doHeals = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
plistener.doHeals();
|
plistener.doHeals();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private Runnable rentExpire = new Runnable() {
|
private Runnable rentExpire = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
rentmanager.checkCurrentRents();
|
rentmanager.checkCurrentRents();
|
||||||
if (cmanager.showIntervalMessages()) {
|
if (cmanager.showIntervalMessages()) {
|
||||||
System.out
|
System.out.println("[Residence] - Rent Expirations checked!");
|
||||||
.println("[Residence] - Rent Expirations checked!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private Runnable leaseExpire = new Runnable() {
|
private Runnable leaseExpire = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
leasemanager.doExpirations();
|
leasemanager.doExpirations();
|
||||||
if (cmanager.showIntervalMessages()) {
|
if (cmanager.showIntervalMessages()) {
|
||||||
System.out
|
System.out.println("[Residence] - Lease Expirations checked!");
|
||||||
.println("[Residence] - Lease Expirations checked!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private Runnable autoSave = new Runnable() {
|
private Runnable autoSave = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -258,9 +255,7 @@ public class Residence extends JavaPlugin {
|
|||||||
saveYml();
|
saveYml();
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger("Minecraft").log(
|
Logger.getLogger("Minecraft").log(Level.SEVERE, "[Residence] 插件数据 保存 错误", ex);
|
||||||
Level.SEVERE,
|
|
||||||
"[Residence] 插件数据 保存 错误", ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user