mirror of
https://github.com/CodeMC/WorldGuardWrapper.git
synced 2024-11-13 22:25:19 +01:00
Replace tabs with spaces
This commit is contained in:
parent
71eb53c38f
commit
35e1d50c25
|
@ -16,18 +16,18 @@ public class BooleanFlag extends AbstractFlag<Boolean> {
|
||||||
super(name, boolean.class, defaultValue);
|
super(name, boolean.class, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object serialize(Boolean value) {
|
public Object serialize(Boolean value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deserialize(Object serialized) {
|
public Boolean deserialize(Object serialized) {
|
||||||
return (Boolean) serialized;
|
return (Boolean) serialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean parse(Player player, String userInput) {
|
public Boolean parse(Player player, String userInput) {
|
||||||
if (userInput.equalsIgnoreCase("true") || userInput.equalsIgnoreCase("yes")
|
if (userInput.equalsIgnoreCase("true") || userInput.equalsIgnoreCase("yes")
|
||||||
|| userInput.equalsIgnoreCase("on")
|
|| userInput.equalsIgnoreCase("on")
|
||||||
|| userInput.equalsIgnoreCase("1")) {
|
|| userInput.equalsIgnoreCase("1")) {
|
||||||
|
@ -39,6 +39,6 @@ public class BooleanFlag extends AbstractFlag<Boolean> {
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,31 +8,31 @@ import org.codemc.worldguardwrapper.implementation.AbstractFlag;
|
||||||
*/
|
*/
|
||||||
public class DoubleFlag extends AbstractFlag<Double> {
|
public class DoubleFlag extends AbstractFlag<Double> {
|
||||||
|
|
||||||
public DoubleFlag(String name) {
|
public DoubleFlag(String name) {
|
||||||
this(name, 0d);
|
this(name, 0d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoubleFlag(String name, double defaultValue) {
|
public DoubleFlag(String name, double defaultValue) {
|
||||||
super(name, double.class, defaultValue);
|
super(name, double.class, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object serialize(Double value) {
|
public Object serialize(Double value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Double deserialize(Object serialized) {
|
public Double deserialize(Object serialized) {
|
||||||
if (serialized instanceof Number) {
|
if (serialized instanceof Number) {
|
||||||
return ((Number) serialized).doubleValue();
|
return ((Number) serialized).doubleValue();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Double parse(Player player, String userInput) {
|
public Double parse(Player player, String userInput) {
|
||||||
return Double.parseDouble(userInput);
|
return Double.parseDouble(userInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,31 +8,31 @@ import org.codemc.worldguardwrapper.implementation.AbstractFlag;
|
||||||
*/
|
*/
|
||||||
public class IntegerFlag extends AbstractFlag<Integer> {
|
public class IntegerFlag extends AbstractFlag<Integer> {
|
||||||
|
|
||||||
public IntegerFlag(String name) {
|
public IntegerFlag(String name) {
|
||||||
this(name, 0);
|
this(name, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntegerFlag(String name, int defaultValue) {
|
public IntegerFlag(String name, int defaultValue) {
|
||||||
super(name, int.class, defaultValue);
|
super(name, int.class, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object serialize(Integer value) {
|
public Object serialize(Integer value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer deserialize(Object serialized) {
|
public Integer deserialize(Object serialized) {
|
||||||
if (serialized instanceof Number) {
|
if (serialized instanceof Number) {
|
||||||
return ((Number) serialized).intValue();
|
return ((Number) serialized).intValue();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer parse(Player player, String userInput) {
|
public Integer parse(Player player, String userInput) {
|
||||||
return Integer.parseInt(userInput);
|
return Integer.parseInt(userInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -16,19 +16,19 @@ public class StringFlag extends AbstractFlag<String> {
|
||||||
super(name, String.class, defaultValue);
|
super(name, String.class, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object serialize(String value) {
|
public Object serialize(String value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String deserialize(Object serialized) {
|
public String deserialize(Object serialized) {
|
||||||
return (String) serialized;
|
return (String) serialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String parse(Player player, String userInput) {
|
public String parse(Player player, String userInput) {
|
||||||
return userInput;
|
return userInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user