Class NeoForgeRegistryCallbacks.ItemCallbacks
java.lang.Object
net.neoforged.neoforge.registries.NeoForgeRegistryCallbacks.ItemCallbacks
- All Implemented Interfaces:
AddCallback<net.minecraft.world.item.Item>
,ClearCallback<net.minecraft.world.item.Item>
,RegistryCallback<net.minecraft.world.item.Item>
- Enclosing class:
NeoForgeRegistryCallbacks
static class NeoForgeRegistryCallbacks.ItemCallbacks
extends Object
implements AddCallback<net.minecraft.world.item.Item>, ClearCallback<net.minecraft.world.item.Item>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Map
<net.minecraft.world.level.block.Block, net.minecraft.world.item.Item> (package private) static final NeoForgeRegistryCallbacks.ItemCallbacks
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onAdd
(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, int id, net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item> key, net.minecraft.world.item.Item item) Called when an entry is added to the registry.void
onClear
(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, boolean full) Called when the registry is cleared before anything is done to the registry.
-
Field Details
-
INSTANCE
-
BLOCK_TO_ITEM_MAP
static final Map<net.minecraft.world.level.block.Block,net.minecraft.world.item.Item> BLOCK_TO_ITEM_MAP
-
-
Constructor Details
-
ItemCallbacks
ItemCallbacks()
-
-
Method Details
-
onAdd
public void onAdd(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, int id, net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item> key, net.minecraft.world.item.Item item) Description copied from interface:AddCallback
Called when an entry is added to the registry.- Specified by:
onAdd
in interfaceAddCallback<net.minecraft.world.item.Item>
- Parameters:
registry
- the registryid
- the integer ID assigned to the entrykey
- the resource key for the entryitem
- the entry's value
-
onClear
public void onClear(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, boolean full) Description copied from interface:ClearCallback
Called when the registry is cleared before anything is done to the registry.- Specified by:
onClear
in interfaceClearCallback<net.minecraft.world.item.Item>
- Parameters:
registry
- the registryfull
- iftrue
, all entries in the registry will be cleared. iffalse
, only integer IDs in the registry will be cleared.
-