Package net.minecraftforge.registries
Class RegistryBuilder<T>
java.lang.Object
net.minecraftforge.registries.RegistryBuilder<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate List<IForgeRegistry.AddCallback<T>>
private boolean
private boolean
private List<IForgeRegistry.BakeCallback<T>>
private List<IForgeRegistry.ClearCallback<T>>
private List<IForgeRegistry.CreateCallback<T>>
private boolean
private @Nullable Function<T,
Holder.Reference<T>> private Set<ResourceLocation>
private static final int
private int
private int
private IForgeRegistry.MissingFactory<T>
private ResourceLocation
private ResourceLocation
private boolean
private boolean
private List<IForgeRegistry.ValidateCallback<T>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(IForgeRegistry.AddCallback<T> add) add
(IForgeRegistry.BakeCallback<T> bake) add
(IForgeRegistry.ClearCallback<T> clear) add
(IForgeRegistry.CreateCallback<T> create) add
(IForgeRegistry.ValidateCallback<T> validate) addCallback
(Object inst) (package private) IForgeRegistry<T>
create()
Modders: UseNewRegistryEvent.create(RegistryBuilder)
insteadPrevents the registry from being synced to clients.@Nullable IForgeRegistry.AddCallback<T>
getAdd()
boolean
boolean
@Nullable IForgeRegistry.BakeCallback<T>
getBake()
@Nullable IForgeRegistry.ClearCallback<T>
getClear()
@Nullable IForgeRegistry.CreateCallback<T>
@Nullable ResourceLocation
(package private) boolean
(package private) Function<T,
Holder.Reference<T>> int
getMaxId()
int
getMinId()
@Nullable IForgeRegistry.MissingFactory<T>
boolean
boolean
getSync()
@Nullable IForgeRegistry.ValidateCallback<T>
hasTags()
Enables tags for this registry if not already.(package private) RegistryBuilder<T>
(package private) RegistryBuilder<T>
intrusiveHolderCallback
(Function<T, Holder.Reference<T>> intrusiveHolderCallback) legacyName
(String name) legacyName
(ResourceLocation name) missing
(IForgeRegistry.MissingFactory<T> missing) static <T> RegistryBuilder<T>
of()
static <T> RegistryBuilder<T>
static <T> RegistryBuilder<T>
of
(ResourceLocation name) onAdd
(IForgeRegistry.AddCallback<T> add) onBake
(IForgeRegistry.BakeCallback<T> bake) onClear
(IForgeRegistry.ClearCallback<T> clear) onCreate
(IForgeRegistry.CreateCallback<T> create) onValidate
(IForgeRegistry.ValidateCallback<T> validate) set
(IForgeRegistry.MissingFactory<T> missing) setIDRange
(int min, int max) setMaxID
(int max) setName
(ResourceLocation name)
-
Field Details
-
MAX_ID
private static final int MAX_ID- See Also:
-
registryName
-
optionalDefaultKey
-
minId
private int minId -
maxId
private int maxId -
addCallback
-
clearCallback
-
createCallback
-
validateCallback
-
bakeCallback
-
saveToDisc
private boolean saveToDisc -
sync
private boolean sync -
allowOverrides
private boolean allowOverrides -
allowModifications
private boolean allowModifications -
hasWrapper
private boolean hasWrapper -
missingFactory
-
legacyNames
-
intrusiveHolderCallback
-
-
Constructor Details
-
RegistryBuilder
public RegistryBuilder()
-
-
Method Details
-
of
-
of
-
of
-
setName
-
setIDRange
-
setMaxID
-
setDefaultKey
-
addCallback
-
add
-
onAdd
-
add
-
onClear
-
add
-
onCreate
-
add
-
onValidate
-
add
-
onBake
-
set
-
missing
-
disableSaving
-
disableSync
Prevents the registry from being synced to clients.- Returns:
- this
-
disableOverrides
-
allowModification
-
hasWrapper
RegistryBuilder<T> hasWrapper() -
legacyName
-
legacyName
-
intrusiveHolderCallback
-
hasTags
Enables tags for this registry if not already. All forge registries with wrappers inherently support tags.- Returns:
- this builder
- See Also:
-
create
IForgeRegistry<T> create()Modders: UseNewRegistryEvent.create(RegistryBuilder)
instead -
getAdd
-
getClear
-
getCreate
-
getValidate
-
getBake
-
getDefault
-
getMinId
public int getMinId() -
getMaxId
public int getMaxId() -
getAllowOverrides
public boolean getAllowOverrides() -
getAllowModifications
public boolean getAllowModifications() -
getMissingFactory
-
getSaveToDisc
public boolean getSaveToDisc() -
getSync
public boolean getSync() -
getLegacyNames
-
getIntrusiveHolderCallback
Function<T,Holder.Reference<T>> getIntrusiveHolderCallback() -
getHasWrapper
boolean getHasWrapper()
-