geforkt von Mirrors/FastAsyncWorldEdit
Remove a bit of trailing whitespace
Dieser Commit ist enthalten in:
Ursprung
742b6b61fa
Commit
87e40141c6
@ -38,10 +38,10 @@ import java.util.*;
|
|||||||
* a file and call its load() method. For specifying node paths in the
|
* a file and call its load() method. For specifying node paths in the
|
||||||
* various get*() methods, they support SK's path notation, allowing you to
|
* various get*() methods, they support SK's path notation, allowing you to
|
||||||
* select child nodes by delimiting node names with periods.
|
* select child nodes by delimiting node names with periods.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* For example, given the following configuration file:</p>
|
* For example, given the following configuration file:</p>
|
||||||
*
|
*
|
||||||
* <pre>members:
|
* <pre>members:
|
||||||
* - Hollie
|
* - Hollie
|
||||||
* - Jason
|
* - Jason
|
||||||
@ -56,12 +56,12 @@ import java.util.*;
|
|||||||
* cool: false
|
* cool: false
|
||||||
* eats:
|
* eats:
|
||||||
* babies: true</pre>
|
* babies: true</pre>
|
||||||
*
|
*
|
||||||
* <p>Calling code could access sturmeh's baby eating state by using
|
* <p>Calling code could access sturmeh's baby eating state by using
|
||||||
* <code>getBoolean("sturmeh.eats.babies", false)</code>. For lists, there are
|
* <code>getBoolean("sturmeh.eats.babies", false)</code>. For lists, there are
|
||||||
* methods such as <code>getStringList</code> that will return a type safe list.
|
* methods such as <code>getStringList</code> that will return a type safe list.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author sk89q
|
* @author sk89q
|
||||||
*/
|
*/
|
||||||
public class YAMLProcessor extends YAMLNode {
|
public class YAMLProcessor extends YAMLNode {
|
||||||
@ -72,7 +72,7 @@ public class YAMLProcessor extends YAMLNode {
|
|||||||
protected String header = null;
|
protected String header = null;
|
||||||
protected YAMLFormat format;
|
protected YAMLFormat format;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map from property key to comment. Comment may have multiple lines that are newline-separated.
|
* Map from property key to comment. Comment may have multiple lines that are newline-separated.
|
||||||
* Comments support based on ZerothAngel's AnnotatedYAMLConfiguration
|
* Comments support based on ZerothAngel's AnnotatedYAMLConfiguration
|
||||||
* Comments are only supported with YAMLFormat.EXTENDED
|
* Comments are only supported with YAMLFormat.EXTENDED
|
||||||
@ -100,7 +100,7 @@ public class YAMLProcessor extends YAMLNode {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the configuration file.
|
* Loads the configuration file.
|
||||||
*
|
*
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException
|
||||||
*/
|
*/
|
||||||
public void load() throws IOException {
|
public void load() throws IOException {
|
||||||
@ -246,7 +246,7 @@ public class YAMLProcessor extends YAMLNode {
|
|||||||
public String getComment(String key) {
|
public String getComment(String key) {
|
||||||
return comments.get(key);
|
return comments.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComment(String key, String comment) {
|
public void setComment(String key, String comment) {
|
||||||
if (comment != null) {
|
if (comment != null) {
|
||||||
setComment(key, comment.split("\\r?\\n"));
|
setComment(key, comment.split("\\r?\\n"));
|
||||||
@ -298,20 +298,20 @@ public class YAMLProcessor extends YAMLNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an empty ConfigurationNode for using as a
|
* This method returns an empty ConfigurationNode for using as a
|
||||||
* default in methods that select a node from a node list.
|
* default in methods that select a node from a node list.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static YAMLNode getEmptyNode(boolean writeDefaults) {
|
public static YAMLNode getEmptyNode(boolean writeDefaults) {
|
||||||
return new YAMLNode(new LinkedHashMap<String, Object>(), writeDefaults);
|
return new YAMLNode(new LinkedHashMap<String, Object>(), writeDefaults);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will be included in snakeyaml 1.10, but until then we have to do it manually.
|
// This will be included in snakeyaml 1.10, but until then we have to do it manually.
|
||||||
private class FancyDumperOptions extends DumperOptions {
|
private class FancyDumperOptions extends DumperOptions {
|
||||||
@Override
|
@Override
|
||||||
public DumperOptions.ScalarStyle calculateScalarStyle(ScalarAnalysis analysis,
|
public DumperOptions.ScalarStyle calculateScalarStyle(ScalarAnalysis analysis,
|
||||||
DumperOptions.ScalarStyle style) {
|
DumperOptions.ScalarStyle style) {
|
||||||
if (format == YAMLFormat.EXTENDED
|
if (format == YAMLFormat.EXTENDED
|
||||||
&& (analysis.scalar.contains("\n") || analysis.scalar.contains("\r"))) {
|
&& (analysis.scalar.contains("\n") || analysis.scalar.contains("\r"))) {
|
||||||
return ScalarStyle.LITERAL;
|
return ScalarStyle.LITERAL;
|
||||||
} else {
|
} else {
|
||||||
@ -319,7 +319,7 @@ public class YAMLProcessor extends YAMLNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class FancyRepresenter extends Representer {
|
private static class FancyRepresenter extends Representer {
|
||||||
public FancyRepresenter() {
|
public FancyRepresenter() {
|
||||||
this.nullRepresenter = new Represent() {
|
this.nullRepresenter = new Represent() {
|
||||||
|
@ -250,8 +250,8 @@ public class WorldEdit {
|
|||||||
// Have the session use inventory if it's enabled and the player
|
// Have the session use inventory if it's enabled and the player
|
||||||
// doesn't have an override
|
// doesn't have an override
|
||||||
session.setUseInventory(config.useInventory
|
session.setUseInventory(config.useInventory
|
||||||
&& (!config.useInventoryOverride
|
&& !(config.useInventoryOverride
|
||||||
|| !player.hasPermission("worldedit.inventory.unrestricted")));
|
&& player.hasPermission("worldedit.inventory.unrestricted")));
|
||||||
|
|
||||||
// Remember the session
|
// Remember the session
|
||||||
sessions.put(player.getName(), session);
|
sessions.put(player.getName(), session);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren