Package net.minecraft.server.dedicated
Class AbstractPropertiesHandler<T extends AbstractPropertiesHandler<T>>
java.lang.Object
net.minecraft.server.dedicated.AbstractPropertiesHandler<T>
- Direct Known Subclasses:
ServerPropertiesHandler
public abstract class AbstractPropertiesHandler<T extends AbstractPropertiesHandler<T>> extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractPropertiesHandler.PropertyAccessor<V> -
Field Summary
Fields Modifier and Type Field Description private static LoggerLOGGERprivate Propertiesproperties -
Constructor Summary
Constructors Constructor Description AbstractPropertiesHandler(Properties properties) -
Method Summary
Modifier and Type Method Description protected <V> AbstractPropertiesHandler.PropertyAccessor<V>accessor(String key, Function<String,V> parser, Function<V,String> stringifier, V fallback)protected <V> AbstractPropertiesHandler.PropertyAccessor<V>accessor(String key, Function<String,V> parser, V fallback)protected AbstractPropertiesHandler.PropertyAccessor<Boolean>booleanAccessor(String key, boolean fallback)protected static <V> Function<String,V>combineParser(IntFunction<V> intParser, Function<String,V> fallbackParser)protected PropertiescopyProperties()protected abstract Tcreate(DynamicRegistryManager dynamicRegistryManager, Properties properties)Creates another property handler with the same type as this one from the passed new map of properties.protected <V> Vget(String key, Function<String,V> parser, Function<V,String> stringifier, V fallback)protected <V> Vget(String key, Function<String,V> parser, UnaryOperator<V> parsedTransformer, Function<V,String> stringifier, V fallback)protected <V> Vget(String key, Function<String,V> parser, V fallback)protected <V> VgetDeprecated(String key, Function<String,V> stringifier)protected BooleangetDeprecatedBoolean(String key)protected StringgetDeprecatedString(String key)protected intgetInt(String key, int fallback)protected StringgetString(String key, String fallback)private StringgetStringValue(String key)protected AbstractPropertiesHandler.PropertyAccessor<Integer>intAccessor(String key, int fallback)static PropertiesloadProperties(Path path)Loads a map of properties from thepath.protected booleanparseBoolean(String key, boolean fallback)protected longparseLong(String key, long fallback)voidsaveProperties(Path path)Saves the properties of this handler to thepath.protected inttransformedParseInt(String key, UnaryOperator<Integer> transformer, int fallback)private static <V extends Number>
Function<String,V>wrapNumberParser(Function<String,V> parser)
-
Field Details
-
LOGGER
-
properties
-
-
Constructor Details
-
AbstractPropertiesHandler
-
-
Method Details
-
loadProperties
Loads a map of properties from thepath. -
saveProperties
Saves the properties of this handler to thepath. -
wrapNumberParser
-
combineParser
protected static <V> Function<String,V> combineParser(IntFunction<V> intParser, Function<String,V> fallbackParser) -
getStringValue
-
getDeprecated
-
get
-
accessor
-
get
-
get
-
accessor
protected <V> AbstractPropertiesHandler.PropertyAccessor<V> accessor(String key, Function<String,V> parser, V fallback) -
getString
-
getDeprecatedString
-
getInt
-
intAccessor
protected AbstractPropertiesHandler.PropertyAccessor<Integer> intAccessor(String key, int fallback) -
transformedParseInt
-
parseLong
-
parseBoolean
-
booleanAccessor
protected AbstractPropertiesHandler.PropertyAccessor<Boolean> booleanAccessor(String key, boolean fallback) -
getDeprecatedBoolean
-
copyProperties
-
create
Creates another property handler with the same type as this one from the passed new map of properties.
-