Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- registerFactory(BuilderFactory)
- addCategory(String, Class)
- registerAssetPath(String, String)
- addBuilderReloadListener(Consumer)
- getCategoryName(Class)
- getIndex(String)
- setAutoReload(boolean)
- lookupName(int)
- getOrCreateIndex(String)
- tryGetBuilderInfo(int)
- unloadBuilders(AssetPack)
- loadBuilders(AssetPack, boolean)
- assetEditorLoadFile(Path)
- assetEditorRemoveFile(Path)
- loadFile(Path, boolean, List)
- loadFile(Path, List, Object2IntMap, boolean, boolean)
- validateBuilder(BuilderInfo)
- getFactory(Class)
- getCachedBuilderInfo(int, Class)
- tryGetCachedValidBuilder(int, Class)
- getCachedBuilder(int, Class)
- isEmpty()
- getAllBuilders()
- collectMatchingBuilders(T, Predicate, BiConsumer)
- getNameToIndexMap()
- findMatchingBuilder(BiPredicate, T)
- getBuilderInfo(Builder)
- getTemplateNames()
- forceValidation(int)
- checkIfDeprecated(Builder, BuilderFactory, JsonElement, String, String)
- generateSchema(SchemaContext)
- generateSchema(SchemaContext, Class)
- generateDescriptors()
- saveDescriptors(List, Path)
- tryGetCachedValidRole(int)
- validateAllLoadedBuilders(Int2ObjectMap, boolean, List)
- onAllBuildersLoaded(Int2ObjectMap)
- onBuilderReloaded(BuilderInfo)
- getPlayerGroupID()
- getSelfGroupID()
Class BuilderManager
java.lang.Object
com.hypixel.hytale.server.npc.asset.builder.BuilderManager
Created with IntelliJ IDEA.
User: Jon
Date: 6/13/2017
Time: 9:31 PM
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBuilderReloadListener(Consumer<BuilderInfo> listener) Registers a listener invoked when any builder is hot-reloaded (after the built-in Role-reload handling).voidaddCategory(String name, Class<?> clazz) voidassetEditorLoadFile(Path fileName) voidassetEditorRemoveFile(Path filePath) voidcheckIfDeprecated(Builder<?> builder, BuilderFactory<?> builderFactory, com.google.gson.JsonElement element, String fileName, String context) <T extends Collection<?>>
TcollectMatchingBuilders(T collection, Predicate<BuilderInfo> filter, BiConsumer<BuilderInfo, T> consumer) <T> BuilderInfofindMatchingBuilder(BiPredicate<BuilderInfo, T> filter, T t) voidforceValidation(int builderIndex) generateSchema(SchemaContext context) generateSchema(SchemaContext context, Class<?> rootCategory) it.unimi.dsi.fastutil.ints.Int2ObjectMap<BuilderInfo> getBuilderInfo(Builder<?> builder) <T> Builder<T> getCachedBuilder(int index, Class<?> classType) getCachedBuilderInfo(int index, Class<?> classType) getCategoryName(Class<?> factoryClass) <T> BuilderFactory<T> getFactory(Class<?> clazz) intit.unimi.dsi.fastutil.objects.Object2IntMap<String> Fetches an unmodifiable version of the role name to index map.intgetOrCreateIndex(String name) static intstatic intbooleanisEmpty()booleanloadBuilders(AssetPack pack, boolean includeTests) intintloadFile(Path fileName, List<String> errors, it.unimi.dsi.fastutil.objects.Object2IntMap<String> typeCounter, boolean includeTests, boolean reloading) lookupName(int index) voidonAllBuildersLoaded(it.unimi.dsi.fastutil.ints.Int2ObjectMap<BuilderInfo> loadedBuilders) static voidonBuilderReloaded(BuilderInfo builderInfo) voidregisterAssetPath(String path, String label) Registers an additional asset directory (relative to the pack root) to scan for top-level builder files, in addition to the default NPC roles directory.<T> voidregisterFactory(BuilderFactory<T> factory) static voidsaveDescriptors(List<BuilderDescriptor> builderDescriptors, Path fileName) voidsetAutoReload(boolean autoReload) tryGetBuilderInfo(int builderIndex) <T> Builder<T> tryGetCachedValidBuilder(int index, Class<?> classType) tryGetCachedValidRole(int builderIndex) voidunloadBuilders(AssetPack pack) voidvalidateAllLoadedBuilders(it.unimi.dsi.fastutil.ints.Int2ObjectMap<BuilderInfo> loadedBuilders, boolean validateDependents, List<String> errors) booleanvalidateBuilder(BuilderInfo builderInfo)
-
Field Details
-
CONTENT_KEY
- See Also:
-
CLASS_KEY
- See Also:
-
SCHEMA_BUILDER_MANAGER
-
-
Constructor Details
-
BuilderManager
public BuilderManager()
-
-
Method Details
-
registerFactory
-
addCategory
-
registerAssetPath
Registers an additional asset directory (relative to the pack root) to scan for top-level builder files, in addition to the default NPC roles directory. Thelabelnames the directory in the per-directory load summary. Files in it declare their category via the "Class" key. Must be called before assets load (e.g. from a plugin'ssetup()). -
addBuilderReloadListener
Registers a listener invoked when any builder is hot-reloaded (after the built-in Role-reload handling). Used by other categories to rebuild their live entities against the reloaded builder. -
getCategoryName
-
getIndex
-
setAutoReload
public void setAutoReload(boolean autoReload) -
lookupName
-
getOrCreateIndex
-
tryGetBuilderInfo
-
unloadBuilders
-
loadBuilders
-
assetEditorLoadFile
-
assetEditorRemoveFile
-
loadFile
-
loadFile
-
validateBuilder
-
getFactory
-
getCachedBuilderInfo
-
tryGetCachedValidBuilder
-
getCachedBuilder
-
isEmpty
public boolean isEmpty() -
getAllBuilders
-
collectMatchingBuilders
public <T extends Collection<?>> T collectMatchingBuilders(T collection, @Nonnull Predicate<BuilderInfo> filter, @Nonnull BiConsumer<BuilderInfo, T> consumer) -
getNameToIndexMap
Fetches an unmodifiable version of the role name to index map. Note that this can include filler keywords (such as $player and $self) which do not map to valid builders Will always return empty if the first load has not been completed- Returns:
- an unmodifiable version of the role name to index map
-
findMatchingBuilder
@Nullable public <T> BuilderInfo findMatchingBuilder(@Nonnull BiPredicate<BuilderInfo, T> filter, T t) -
getBuilderInfo
-
getTemplateNames
-
forceValidation
public void forceValidation(int builderIndex) -
checkIfDeprecated
public void checkIfDeprecated(@Nonnull Builder<?> builder, @Nonnull BuilderFactory<?> builderFactory, @Nonnull com.google.gson.JsonElement element, String fileName, String context) -
generateSchema
-
generateSchema
@Nonnull public Schema generateSchema(@Nonnull SchemaContext context, @Nonnull Class<?> rootCategory) -
generateDescriptors
-
saveDescriptors
public static void saveDescriptors(List<BuilderDescriptor> builderDescriptors, @Nonnull Path fileName) -
tryGetCachedValidRole
-
validateAllLoadedBuilders
public void validateAllLoadedBuilders(@Nonnull it.unimi.dsi.fastutil.ints.Int2ObjectMap<BuilderInfo> loadedBuilders, boolean validateDependents, @Nonnull List<String> errors) -
onAllBuildersLoaded
public void onAllBuildersLoaded(@Nonnull it.unimi.dsi.fastutil.ints.Int2ObjectMap<BuilderInfo> loadedBuilders) -
onBuilderReloaded
-
getPlayerGroupID
public static int getPlayerGroupID() -
getSelfGroupID
public static int getSelfGroupID()
-