Class BroomPartRegistry

java.lang.Object
org.cyclops.evilcraft.core.broom.BroomPartRegistry
All Implemented Interfaces:
org.cyclops.cyclopscore.init.IRegistry, IBroomPartRegistry

public class BroomPartRegistry extends Object implements IBroomPartRegistry
Default registry for broom parts.
  • Constructor Details

    • BroomPartRegistry

      public BroomPartRegistry()
  • Method Details

    • registerPart

      public <P extends IBroomPart> P registerPart(P part)
      Description copied from interface: IBroomPartRegistry
      Register a new broom part.
      Specified by:
      registerPart in interface IBroomPartRegistry
      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: IBroomPartRegistry
      Assign a part item to the given part.
      Specified by:
      registerPartItem in interface IBroomPartRegistry
      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: IBroomPartRegistry
      Assign base modifiers to the given part.
      Specified by:
      registerBaseModifiers in interface IBroomPartRegistry
      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: IBroomPartRegistry
      Assign base modifier to the given part.
      Specified by:
      registerBaseModifiers in interface IBroomPartRegistry
      Type Parameters:
      P - The type of part.
      Parameters:
      part - The part.
      modifier - The modifier.
      modifierValue - The modifier value.
    • getBaseModifiersFromPart

      public <P extends IBroomPart> Map<BroomModifier,Float> getBaseModifiersFromPart(P part)
      Description copied from interface: IBroomPartRegistry
      Get the base modifiers for the given part.
      Specified by:
      getBaseModifiersFromPart in interface IBroomPartRegistry
      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: IBroomPartRegistry
      Get the broom base modifiers from the given itemstack.
      Specified by:
      getBaseModifiersFromBroom in interface IBroomPartRegistry
      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: IBroomPartRegistry
      Get the identifying items of the given part.
      Specified by:
      getItemsFromPart in interface IBroomPartRegistry
      Type Parameters:
      P - The part type.
      Parameters:
      part - The part.
      Returns:
      The identifying items
    • getPartFromItem

      public <P extends IBroomPart> P getPartFromItem(net.minecraft.world.item.ItemStack item)
      Description copied from interface: IBroomPartRegistry
      Get the part of the given item-form.
      Specified by:
      getPartFromItem in interface IBroomPartRegistry
      Type Parameters:
      P - The part type.
      Parameters:
      item - The item-form of this part.
      Returns:
      The part or null.
    • getParts

      public Collection<IBroomPart> getParts()
      Specified by:
      getParts in interface IBroomPartRegistry
      Returns:
      All broom parts.
    • getPart

      public IBroomPart getPart(net.minecraft.resources.ResourceLocation partId)
      Description copied from interface: IBroomPartRegistry
      Get the part from the given id.
      Specified by:
      getPart in interface IBroomPartRegistry
      Parameters:
      partId - The unique part id.
      Returns:
      The corresponding part or null.
    • getParts

      Specified by:
      getParts in interface IBroomPartRegistry
      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: IBroomPartRegistry
      Register a model resource location for the given part.
      Specified by:
      registerPartModel in interface IBroomPartRegistry
      Parameters:
      part - The part
      modelLocation - The model resource location.
    • getPartModel

      public net.minecraft.resources.ResourceLocation getPartModel(IBroomPart part)
      Description copied from interface: IBroomPartRegistry
      Get the model resource location of the given part.
      Specified by:
      getPartModel in interface IBroomPartRegistry
      Parameters:
      part - The part.
      Returns:
      The model resource location.
    • getPartModels

      public Collection<net.minecraft.resources.ResourceLocation> getPartModels()
      Description copied from interface: IBroomPartRegistry
      Get all registered model resource locations for the parts.
      Specified by:
      getPartModels in interface IBroomPartRegistry
      Returns:
      All model resource locations.
    • getBroomParts

      public Collection<IBroomPart> getBroomParts(net.minecraft.world.item.ItemStack broomStack)
      Description copied from interface: IBroomPartRegistry
      Get the broom parts in the given itemstack.
      Specified by:
      getBroomParts in interface IBroomPartRegistry
      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: IBroomPartRegistry
      Apply the given broom parts to the given itemstack.
      Specified by:
      setBroomParts in interface IBroomPartRegistry
      Parameters:
      broomStack - The broom item stack
      broomParts - 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)