Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 19:02:36 +01:00
Switch Style to Preconditions.
Dieser Commit ist enthalten in:
Ursprung
d7d7b2741a
Commit
d86d81ef21
@ -20,11 +20,13 @@
|
|||||||
package com.sk89q.worldedit.util.formatting;
|
package com.sk89q.worldedit.util.formatting;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All supported color values for chat.
|
* All supported color values for chat.
|
||||||
*
|
*
|
||||||
@ -194,8 +196,8 @@ public enum Style {
|
|||||||
* @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist
|
* @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
public static Style getByChar(String code) {
|
public static Style getByChar(String code) {
|
||||||
Validate.notNull(code, "Code cannot be null");
|
checkNotNull(code);
|
||||||
Validate.isTrue(code.length() > 0, "Code must have at least one char");
|
checkArgument(!code.isEmpty(), "Code must have at least one character");
|
||||||
|
|
||||||
return BY_CHAR.get(code.charAt(0));
|
return BY_CHAR.get(code.charAt(0));
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren