Package org.cyclops.evilcraft.core.broom
Class BroomPartRegistry
java.lang.Object
org.cyclops.evilcraft.core.broom.BroomPartRegistry
- All Implemented Interfaces:
org.cyclops.cyclopscore.init.IRegistry,IBroomPartRegistry
Default registry for broom parts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeItemsRegistered(net.minecraftforge.event.RegistryEvent<net.minecraft.world.item.Item> event) getBaseModifiersFromBroom(net.minecraft.world.item.ItemStack broomStack) Get the broom base modifiers from the given itemstack.<P extends IBroomPart>
Map<BroomModifier,Float> getBaseModifiersFromPart(P part) Get the base modifiers for the given part.getBroomParts(net.minecraft.world.item.ItemStack broomStack) Get the broom parts in the given itemstack.<P extends IBroomPart>
Collection<net.minecraft.world.item.ItemStack>getItemsFromPart(P part) Get the identifying items of the given part.getPart(net.minecraft.resources.ResourceLocation partId) Get the part from the given id.<P extends IBroomPart>
PgetPartFromItem(net.minecraft.world.item.ItemStack item) Get the part of the given item-form.net.minecraft.resources.ResourceLocationgetPartModel(IBroomPart part) Get the model resource location of the given part.Collection<net.minecraft.resources.ResourceLocation>Get all registered model resource locations for the parts.getParts()voidonTooltipEvent(net.minecraftforge.event.entity.player.ItemTooltipEvent event) <P extends IBroomPart>
voidregisterBaseModifiers(P part, Map<BroomModifier, Float> modifiers) Assign base modifiers to the given part.<P extends IBroomPart>
voidregisterBaseModifiers(P part, BroomModifier modifier, float modifierValue) Assign base modifier to the given part.<P extends IBroomPart>
PregisterPart(P part) Register a new broom part.<P extends IBroomPart>
voidregisterPartItem(P part, net.minecraft.world.item.ItemStack item) Assign a part item to the given part.voidregisterPartModel(IBroomPart part, net.minecraft.resources.ResourceLocation modelLocation) Register a model resource location for the given part.voidsetBroomParts(net.minecraft.world.item.ItemStack broomStack, Collection<IBroomPart> broomParts) Apply the given broom parts to the given itemstack.
-
Constructor Details
-
BroomPartRegistry
public BroomPartRegistry()
-
-
Method Details
-
registerPart
Description copied from interface:IBroomPartRegistryRegister a new broom part.- Specified by:
registerPartin interfaceIBroomPartRegistry- Type Parameters:
P- The type of part.- Parameters:
part- The part.- Returns:
- The registered part.
-
registerPartItem
public <P extends IBroomPart> void registerPartItem(@Nullable P part, net.minecraft.world.item.ItemStack item) Description copied from interface:IBroomPartRegistryAssign a part item to the given part.- Specified by:
registerPartItemin interfaceIBroomPartRegistry- Type Parameters:
P- The type of part.- Parameters:
part- The part.item- The item-form of this part.
-
registerBaseModifiers
public <P extends IBroomPart> void registerBaseModifiers(@Nullable P part, Map<BroomModifier, Float> modifiers) Description copied from interface:IBroomPartRegistryAssign base modifiers to the given part.- Specified by:
registerBaseModifiersin interfaceIBroomPartRegistry- Type Parameters:
P- The type of part.- Parameters:
part- The part.modifiers- The modifiers.
-
registerBaseModifiers
public <P extends IBroomPart> void registerBaseModifiers(@Nullable P part, BroomModifier modifier, float modifierValue) Description copied from interface:IBroomPartRegistryAssign base modifier to the given part.- Specified by:
registerBaseModifiersin interfaceIBroomPartRegistry- Type Parameters:
P- The type of part.- Parameters:
part- The part.modifier- The modifier.modifierValue- The modifier value.
-
getBaseModifiersFromPart
Description copied from interface:IBroomPartRegistryGet the base modifiers for the given part.- Specified by:
getBaseModifiersFromPartin interfaceIBroomPartRegistry- Type Parameters:
P- The part type.- Parameters:
part- The part.- Returns:
- The base modifiers.
-
getBaseModifiersFromBroom
public Map<BroomModifier,Float> getBaseModifiersFromBroom(net.minecraft.world.item.ItemStack broomStack) Description copied from interface:IBroomPartRegistryGet the broom base modifiers from the given itemstack.- Specified by:
getBaseModifiersFromBroomin interfaceIBroomPartRegistry- Parameters:
broomStack- The broom item stack- Returns:
- The broom base modifiers.
-
getItemsFromPart
public <P extends IBroomPart> Collection<net.minecraft.world.item.ItemStack> getItemsFromPart(P part) Description copied from interface:IBroomPartRegistryGet the identifying items of the given part.- Specified by:
getItemsFromPartin interfaceIBroomPartRegistry- Type Parameters:
P- The part type.- Parameters:
part- The part.- Returns:
- The identifying items
-
getPartFromItem
Description copied from interface:IBroomPartRegistryGet the part of the given item-form.- Specified by:
getPartFromItemin interfaceIBroomPartRegistry- Type Parameters:
P- The part type.- Parameters:
item- The item-form of this part.- Returns:
- The part or null.
-
getParts
- Specified by:
getPartsin interfaceIBroomPartRegistry- Returns:
- All broom parts.
-
getPart
Description copied from interface:IBroomPartRegistryGet the part from the given id.- Specified by:
getPartin interfaceIBroomPartRegistry- Parameters:
partId- The unique part id.- Returns:
- The corresponding part or null.
-
getParts
- Specified by:
getPartsin interfaceIBroomPartRegistry- Parameters:
type- The type of parts to retrieve.- Returns:
- All broom parts of the given type..
-
registerPartModel
public void registerPartModel(IBroomPart part, net.minecraft.resources.ResourceLocation modelLocation) Description copied from interface:IBroomPartRegistryRegister a model resource location for the given part.- Specified by:
registerPartModelin interfaceIBroomPartRegistry- Parameters:
part- The partmodelLocation- The model resource location.
-
getPartModel
Description copied from interface:IBroomPartRegistryGet the model resource location of the given part.- Specified by:
getPartModelin interfaceIBroomPartRegistry- Parameters:
part- The part.- Returns:
- The model resource location.
-
getPartModels
Description copied from interface:IBroomPartRegistryGet all registered model resource locations for the parts.- Specified by:
getPartModelsin interfaceIBroomPartRegistry- Returns:
- All model resource locations.
-
getBroomParts
Description copied from interface:IBroomPartRegistryGet the broom parts in the given itemstack.- Specified by:
getBroomPartsin interfaceIBroomPartRegistry- Parameters:
broomStack- The broom item stack- Returns:
- The broom parts.
-
setBroomParts
public void setBroomParts(net.minecraft.world.item.ItemStack broomStack, Collection<IBroomPart> broomParts) Description copied from interface:IBroomPartRegistryApply the given broom parts to the given itemstack.- Specified by:
setBroomPartsin interfaceIBroomPartRegistry- Parameters:
broomStack- The broom item stackbroomParts- The broom parts.
-
onTooltipEvent
public void onTooltipEvent(net.minecraftforge.event.entity.player.ItemTooltipEvent event) -
beforeItemsRegistered
public void beforeItemsRegistered(net.minecraftforge.event.RegistryEvent<net.minecraft.world.item.Item> event)
-