批注接口 ObjectHolder
@Deprecated(since="1.21.4",
forRemoval=true)
@Retention(RUNTIME)
@Target(FIELD)
public @interface ObjectHolder
已过时, 待删除: 此 API 元素将从以后的版本中删除。
ObjectHolder can be used to automatically populate public static final fields with entries
from the registry. These values can then be referred within mod code directly.
-
必需元素概要
所需元素修饰符和类型必需的元素说明已过时, 待删除: 此 API 元素将从以后的版本中删除。The name of the registry to load registry entries from.已过时, 待删除: 此 API 元素将从以后的版本中删除。Represents a name in the form of aResourceLocation
which points to a registry object from the registry given byregistryName()
.
-
元素详细资料
-
registryName
String registryName已过时, 待删除: 此 API 元素将从以后的版本中删除。The name of the registry to load registry entries from. This string is parsed as aResourceLocation
and can contain a namespace.- 返回:
- the registry name
-
value
String value已过时, 待删除: 此 API 元素将从以后的版本中删除。Represents a name in the form of aResourceLocation
which points to a registry object from the registry given byregistryName()
. Must specify the modid if not inside a class annotated withMod
.- 返回:
- a name in the form of a
ResourceLocation
-
DeferredRegister
orRegistryObject
instead. Refer to the MDK for more detailed examples.Example usage of alternatives: