Interface IMutationsRegistration


public interface IMutationsRegistration
Used to register possible mutations resulting in a species.
  • Method Summary

    Modifier and Type
    Method
    Description
    add(net.minecraft.resources.ResourceLocation firstParent, net.minecraft.resources.ResourceLocation secondParent, float chance)
    Registers a mutation that results in this species.
    add(net.minecraft.resources.ResourceLocation firstParent, net.minecraft.resources.ResourceLocation secondParent, int chance)
    Deprecated.
    Use the overload that takes a float instead.
    get(net.minecraft.resources.ResourceLocation firstParent, net.minecraft.resources.ResourceLocation secondParent)
    Retrieves an already existing mutation so that it can be further customized.
  • Method Details

    • add

      IMutationBuilder add(net.minecraft.resources.ResourceLocation firstParent, net.minecraft.resources.ResourceLocation secondParent, float chance)
      Registers a mutation that results in this species. The species of the parents must be different. The ordering of the parents does not matter for mutations.
      Parameters:
      firstParent - One of the species involved in this mutation.
      secondParent - The other species involved in this mutation. Must not be the same as firstParent.
      chance - The chance (between 0 and 1 inclusive) of this mutation occurring.
      Throws:
      IllegalArgumentException - If both parent species are the same species, or if chance is not [0,1].
      IllegalStateException - If there is already a mutation builder for the given parents. Use get(net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation) to modify the existing one.
    • add

      @Deprecated default IMutationBuilder add(net.minecraft.resources.ResourceLocation firstParent, net.minecraft.resources.ResourceLocation secondParent, int chance)
      Deprecated.
      Use the overload that takes a float instead.
      Shortcut method for using legacy chance values. Chance must be between 0 and 100, inclusive.
    • get

      IMutationBuilder get(net.minecraft.resources.ResourceLocation firstParent, net.minecraft.resources.ResourceLocation secondParent)
      Retrieves an already existing mutation so that it can be further customized.
      Returns:
      A mutation builder for an already registered mutation between these two parents.
      Throws:
      IllegalArgumentException - If both parent species are the same species.
      IllegalStateException - If there is no existing mutation between those two parents.