mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-15 21:39:21 +00:00
[trunk] Protect, merging changes in
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1581 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
aef2dd35d6
commit
541fc51780
2 changed files with 37 additions and 35 deletions
|
@ -198,9 +198,9 @@ public class Settings implements IConf
|
||||||
return config.getBoolean("non-ess-in-help", true);
|
return config.getBoolean("non-ess-in-help", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Boolean> getEpSettings()
|
public Map<String, Boolean> getEpSettings()
|
||||||
{
|
{
|
||||||
HashMap<String, Boolean> epSettings = new HashMap<String, Boolean>();
|
Map<String, Boolean> epSettings = new HashMap<String, Boolean>();
|
||||||
|
|
||||||
epSettings.put("protect.protect.signs", config.getBoolean("protect.protect.signs", true));
|
epSettings.put("protect.protect.signs", config.getBoolean("protect.protect.signs", true));
|
||||||
epSettings.put("protect.protect.rails", config.getBoolean("protect.protect.rails", true));
|
epSettings.put("protect.protect.rails", config.getBoolean("protect.protect.rails", true));
|
||||||
|
@ -210,9 +210,9 @@ public class Settings implements IConf
|
||||||
return epSettings;
|
return epSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, String> getEpDBSettings()
|
public Map<String, String> getEpDBSettings()
|
||||||
{
|
{
|
||||||
HashMap<String, String> epSettings = new HashMap<String, String>();
|
Map<String, String> epSettings = new HashMap<String, String>();
|
||||||
epSettings.put("protect.datatype", config.getString("protect.datatype", "sqlite"));
|
epSettings.put("protect.datatype", config.getString("protect.datatype", "sqlite"));
|
||||||
epSettings.put("protect.username", config.getString("protect.username", "root"));
|
epSettings.put("protect.username", config.getString("protect.username", "root"));
|
||||||
epSettings.put("protect.password", config.getString("protect.password", "root"));
|
epSettings.put("protect.password", config.getString("protect.password", "root"));
|
||||||
|
@ -220,9 +220,9 @@ public class Settings implements IConf
|
||||||
return epSettings;
|
return epSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList getEpAlertOnPlacement()
|
public List<Integer> getEpAlertOnPlacement()
|
||||||
{
|
{
|
||||||
final ArrayList epAlertPlace = new ArrayList();
|
final List<Integer> epAlertPlace = new ArrayList<Integer>();
|
||||||
for (String itemName : config.getString("protect.alert.on-placement", "").split(",")) {
|
for (String itemName : config.getString("protect.alert.on-placement", "").split(",")) {
|
||||||
itemName = itemName.trim();
|
itemName = itemName.trim();
|
||||||
if (itemName.isEmpty()) {
|
if (itemName.isEmpty()) {
|
||||||
|
@ -239,9 +239,9 @@ public class Settings implements IConf
|
||||||
return epAlertPlace;
|
return epAlertPlace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList getEpAlertOnUse()
|
public List<Integer> getEpAlertOnUse()
|
||||||
{
|
{
|
||||||
final ArrayList epAlertUse = new ArrayList();
|
final List<Integer> epAlertUse = new ArrayList<Integer>();
|
||||||
for (String itemName : config.getString("protect.alert.on-use", "").split(",")) {
|
for (String itemName : config.getString("protect.alert.on-use", "").split(",")) {
|
||||||
itemName = itemName.trim();
|
itemName = itemName.trim();
|
||||||
if (itemName.isEmpty()) {
|
if (itemName.isEmpty()) {
|
||||||
|
@ -258,9 +258,9 @@ public class Settings implements IConf
|
||||||
return epAlertUse;
|
return epAlertUse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList getEpAlertOnBreak()
|
public List<Integer> getEpAlertOnBreak()
|
||||||
{
|
{
|
||||||
final ArrayList epAlertPlace = new ArrayList();
|
final List<Integer> epAlertPlace = new ArrayList<Integer>();
|
||||||
for (String itemName : config.getString("protect.alert.on-break", "").split(",")) {
|
for (String itemName : config.getString("protect.alert.on-break", "").split(",")) {
|
||||||
itemName = itemName.trim();
|
itemName = itemName.trim();
|
||||||
if (itemName.isEmpty()) {
|
if (itemName.isEmpty()) {
|
||||||
|
@ -277,9 +277,9 @@ public class Settings implements IConf
|
||||||
return epAlertPlace;
|
return epAlertPlace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList epBlackListPlacement()
|
public List<Integer> epBlackListPlacement()
|
||||||
{
|
{
|
||||||
final ArrayList epBlacklistPlacement = new ArrayList();
|
final List<Integer> epBlacklistPlacement = new ArrayList<Integer>();
|
||||||
for (String itemName : config.getString("protect.blacklist.placement", "").split(",")) {
|
for (String itemName : config.getString("protect.blacklist.placement", "").split(",")) {
|
||||||
itemName = itemName.trim();
|
itemName = itemName.trim();
|
||||||
if (itemName.isEmpty()) {
|
if (itemName.isEmpty()) {
|
||||||
|
@ -296,9 +296,9 @@ public class Settings implements IConf
|
||||||
return epBlacklistPlacement;
|
return epBlacklistPlacement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList epBlackListUsage()
|
public List<Integer> epBlackListUsage()
|
||||||
{
|
{
|
||||||
final ArrayList epBlackListUsage = new ArrayList();
|
final List<Integer> epBlackListUsage = new ArrayList<Integer>();
|
||||||
for (String itemName : config.getString("protect.blacklist.usage", "").split(",")) {
|
for (String itemName : config.getString("protect.blacklist.usage", "").split(",")) {
|
||||||
itemName = itemName.trim();
|
itemName = itemName.trim();
|
||||||
if (itemName.isEmpty()) {
|
if (itemName.isEmpty()) {
|
||||||
|
@ -315,9 +315,9 @@ public class Settings implements IConf
|
||||||
return epBlackListUsage;
|
return epBlackListUsage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Boolean> getEpGuardSettings()
|
public Map<String, Boolean> getEpGuardSettings()
|
||||||
{
|
{
|
||||||
final HashMap<String, Boolean> epSettings = new HashMap<String, Boolean>();
|
final Map<String, Boolean> epSettings = new HashMap<String, Boolean>();
|
||||||
epSettings.put("protect.prevent.lava-flow", config.getBoolean("protect.prevent.lava-flow", false));
|
epSettings.put("protect.prevent.lava-flow", config.getBoolean("protect.prevent.lava-flow", false));
|
||||||
epSettings.put("protect.prevent.water-flow", config.getBoolean("protect.prevent.water-flow", false));
|
epSettings.put("protect.prevent.water-flow", config.getBoolean("protect.prevent.water-flow", false));
|
||||||
epSettings.put("protect.prevent.water-bucket-flow", config.getBoolean("protect.prevent.water-bucket-flow", false));
|
epSettings.put("protect.prevent.water-bucket-flow", config.getBoolean("protect.prevent.water-bucket-flow", false));
|
||||||
|
@ -338,9 +338,9 @@ public class Settings implements IConf
|
||||||
return epSettings;
|
return epSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Boolean> getEpPlayerSettings()
|
public Map<String, Boolean> getEpPlayerSettings()
|
||||||
{
|
{
|
||||||
final HashMap<String, Boolean> epPlayerSettings = new HashMap<String, Boolean>();
|
final Map<String, Boolean> epPlayerSettings = new HashMap<String, Boolean>();
|
||||||
epPlayerSettings.put("protect.disable.fall", config.getBoolean("protect.disable.fall", false));
|
epPlayerSettings.put("protect.disable.fall", config.getBoolean("protect.disable.fall", false));
|
||||||
epPlayerSettings.put("protect.disable.pvp", config.getBoolean("protect.disable.pvp", false));
|
epPlayerSettings.put("protect.disable.pvp", config.getBoolean("protect.disable.pvp", false));
|
||||||
epPlayerSettings.put("protect.disable.drown", config.getBoolean("protect.disable.drown", false));
|
epPlayerSettings.put("protect.disable.drown", config.getBoolean("protect.disable.drown", false));
|
||||||
|
@ -441,9 +441,9 @@ public class Settings implements IConf
|
||||||
return epItemSpwn;
|
return epItemSpwn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList epBlockBreakingBlacklist()
|
public ArrayList<Integer> epBlockBreakingBlacklist()
|
||||||
{
|
{
|
||||||
ArrayList epBreakList = new ArrayList();
|
ArrayList<Integer> epBreakList = new ArrayList<Integer>();
|
||||||
for (String itemName : config.getString("protect.blacklist.break", "").split(",")) {
|
for (String itemName : config.getString("protect.blacklist.break", "").split(",")) {
|
||||||
itemName = itemName.trim();
|
itemName = itemName.trim();
|
||||||
if (itemName.isEmpty()) {
|
if (itemName.isEmpty()) {
|
||||||
|
|
|
@ -12,6 +12,8 @@ import com.earth2me.essentials.protect.data.ProtectedBlockSQLite;
|
||||||
import java.beans.PropertyVetoException;
|
import java.beans.PropertyVetoException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
@ -30,16 +32,16 @@ public class EssentialsProtect extends JavaPlugin implements IConf
|
||||||
private EssentialsProtectWeatherListener weatherListener = null;
|
private EssentialsProtectWeatherListener weatherListener = null;
|
||||||
public static final String AUTHORS = Essentials.AUTHORS;
|
public static final String AUTHORS = Essentials.AUTHORS;
|
||||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||||
public static HashMap<String, Boolean> genSettings = null;
|
public static Map<String, Boolean> genSettings = null;
|
||||||
public static HashMap<String, String> dataSettings = null;
|
public static Map<String, String> dataSettings = null;
|
||||||
public static HashMap<String, Boolean> guardSettings = null;
|
public static Map<String, Boolean> guardSettings = null;
|
||||||
public static HashMap<String, Boolean> playerSettings = null;
|
public static Map<String, Boolean> playerSettings = null;
|
||||||
public static ArrayList usageList = null;
|
public static List<Integer> usageList = null;
|
||||||
public static ArrayList blackListPlace = null;
|
public static List<Integer> blackListPlace = null;
|
||||||
public static ArrayList breakBlackList = null;
|
public static List<Integer> breakBlackList = null;
|
||||||
public static ArrayList onPlaceAlert = null;
|
public static List<Integer> onPlaceAlert = null;
|
||||||
public static ArrayList onUseAlert = null;
|
public static List<Integer> onUseAlert = null;
|
||||||
public static ArrayList onBreakAlert = null;
|
public static List<Integer> onBreakAlert = null;
|
||||||
private IProtectedBlock storage = null;
|
private IProtectedBlock storage = null;
|
||||||
IEssentials ess = null;
|
IEssentials ess = null;
|
||||||
private static EssentialsProtect instance = null;
|
private static EssentialsProtect instance = null;
|
||||||
|
@ -54,8 +56,6 @@ public class EssentialsProtect extends JavaPlugin implements IConf
|
||||||
PluginManager pm = this.getServer().getPluginManager();
|
PluginManager pm = this.getServer().getPluginManager();
|
||||||
ess = Essentials.getStatic();
|
ess = Essentials.getStatic();
|
||||||
ess.getDependancyChecker().checkProtectDependancies();
|
ess.getDependancyChecker().checkProtectDependancies();
|
||||||
instance = this;
|
|
||||||
reloadConfig();
|
|
||||||
|
|
||||||
playerListener = new EssentialsProtectPlayerListener(this);
|
playerListener = new EssentialsProtectPlayerListener(this);
|
||||||
blockListener = new EssentialsProtectBlockListener(this);
|
blockListener = new EssentialsProtectBlockListener(this);
|
||||||
|
@ -77,13 +77,15 @@ public class EssentialsProtect extends JavaPlugin implements IConf
|
||||||
if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion()))
|
if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion()))
|
||||||
{
|
{
|
||||||
logger.log(Level.WARNING, "Version mismatch! Please update all Essentials jars to the same version.");
|
logger.log(Level.WARNING, "Version mismatch! Please update all Essentials jars to the same version.");
|
||||||
|
reloadConfig();
|
||||||
|
Essentials.getStatic().addReloadListener(this);
|
||||||
}
|
}
|
||||||
logger.info("Loaded " + this.getDescription().getName() + " build " + this.getDescription().getVersion() + " maintained by " + AUTHORS);
|
logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Essentials.AUTHORS));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkProtectionItems(ArrayList itemList, int id)
|
public static boolean checkProtectionItems(List<Integer> itemList, int id)
|
||||||
{
|
{
|
||||||
return !itemList.isEmpty() && itemList.contains(String.valueOf(id));
|
return !itemList.isEmpty() && itemList.contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue