mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-12 03:13:40 +01:00
geter with default values for extended AreFlags data
This commit is contained in:
parent
18c2164049
commit
f821e277de
@ -261,44 +261,56 @@ else if(appSize < 2)
|
||||
|
||||
}
|
||||
|
||||
public String getAreaFlag(String name, String subname, String defaultValue, Boolean inherit, LocalPlayer player)
|
||||
{
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
return data != null ? data : defaultValue;
|
||||
}
|
||||
|
||||
public Boolean getBooleanAreaFlag(String name, String subname, Boolean inherit, LocalPlayer player)
|
||||
{
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Boolean.valueOf(data);
|
||||
return data != null ? Boolean.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Boolean getBooleanAreaFlag(String name, String subname, boolean defaultValue, Boolean inherit, LocalPlayer player)
|
||||
{
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
return data != null ? Boolean.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
public Integer getIntAreaFlag(String name, String subname, Boolean inherit, LocalPlayer player)
|
||||
{
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Integer.valueOf(data);
|
||||
return data != null ? Integer.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Integer getIntAreaFlag(String name, String subname, int defaultValue, Boolean inherit, LocalPlayer player)
|
||||
{
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
return data != null ? Integer.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
public Float getFloatAreaFlag(String name, String subname, Boolean inherit, LocalPlayer player)
|
||||
{
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Float.valueOf(data);
|
||||
return data != null ? Float.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Double getDoubleAreaFlag(String name, String subname, Boolean inherit, LocalPlayer player)
|
||||
public Float getFloatAreaFlag(String name, String subname, float defaultValue, Boolean inherit, LocalPlayer player)
|
||||
{
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Double.valueOf(data);
|
||||
return data != null ? Float.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
public Double getDoubleAreaFlag(String name, String subname, Boolean inherit, LocalPlayer player) {
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
return data != null ? Double.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Double getDoubleAreaFlag(String name, String subname, double defaultValue, Boolean inherit, LocalPlayer player) {
|
||||
String data = getAreaFlag(name, subname, inherit, player);
|
||||
return data != null ? Double.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -234,46 +234,56 @@ public String getFlag(String name, String subname)
|
||||
return getFlagData(name).get(subname);
|
||||
}
|
||||
|
||||
public String getFlag(String name, String subname, String defaultValue)
|
||||
{
|
||||
String data = getFlagData(name).get(subname);
|
||||
return data != null ? data : defaultValue;
|
||||
}
|
||||
|
||||
public Boolean getBooleanFlag(String name, String subname)
|
||||
{
|
||||
String data = getFlagData(name).get(subname);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Boolean.valueOf(data);
|
||||
return data != null ? Boolean.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Boolean getBooleanFlag(String name, String subname, boolean defaultValue)
|
||||
{
|
||||
String data = getFlagData(name).get(subname);
|
||||
return data != null ? Boolean.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
public Integer getIntFlag(String name, String subname)
|
||||
{
|
||||
String data = getFlagData(name).get(subname);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Integer.valueOf(data);
|
||||
return data != null ? Integer.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Integer getIntFlag(String name, String subname, int defaultValue)
|
||||
{
|
||||
String data = getFlagData(name).get(subname);
|
||||
return data != null ? Integer.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
public Float getFloatFlag(String name, String subname)
|
||||
{
|
||||
String data = getFlagData(name).get(subname);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Float.valueOf(data);
|
||||
return data != null ? Float.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Double getDoubleFlag(String name, String subname)
|
||||
public Float getFloatFlag(String name, String subname, float defaultValue)
|
||||
{
|
||||
String data = getFlagData(name).get(subname);
|
||||
if(data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Double.valueOf(data);
|
||||
return data != null ? Float.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
|
||||
public Double getDoubleFlag(String name, String subname) {
|
||||
String data = getFlagData(name).get(subname);
|
||||
return data != null ? Double.valueOf(data) : null;
|
||||
}
|
||||
|
||||
public Double getDoubleFlag(String name, String subname, double defaultValue) {
|
||||
String data = getFlagData(name).get(subname);
|
||||
return data != null ? Double.valueOf(data) : defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user