Make SpeciesCustom classes into SpeciesBuilder

This commit is contained in:
mezz committed 2016-03-03 21:46:21 -08:00
1 parent efcab41e04
commit 5a901ffa36
20 files changed
+250 -191

No files matched your search

@@ -7,37 +7,40 @@ package forestry.api.apiculture;
import net.minecraft.item.ItemStack;
import forestry.api.genetics.IAlleleSpeciesCustom;
import forestry.api.genetics.IAlleleSpeciesBuilder;
public interface IAlleleBeeSpeciesCustom extends IAlleleBeeSpecies, IAlleleSpeciesCustom {
public interface IAlleleBeeSpeciesBuilder extends IAlleleSpeciesBuilder {
@Override
IAlleleBeeSpecies build();
/**
* Add a product for this bee species.
* Chance is between 0 and 1.
*/
IAlleleBeeSpeciesCustom addProduct(ItemStack product, Float chance);
IAlleleBeeSpeciesBuilder addProduct(ItemStack product, Float chance);
/**
* Add a specialty product for this bee species.
* Bees only produce their specialty when they are Jubilant (see IJubilanceProvider)
* Chance is between 0 and 1.
*/
IAlleleBeeSpeciesCustom addSpecialty(ItemStack specialty, Float chance);
IAlleleBeeSpeciesBuilder addSpecialty(ItemStack specialty, Float chance);
/**
* Set the Jubilance Provider for this bee species.
* Bees only produce their specialty when they are Jubilant (see IJubilanceProvider)
*/
IAlleleBeeSpeciesCustom setJubilanceProvider(IJubilanceProvider provider);
IAlleleBeeSpeciesBuilder setJubilanceProvider(IJubilanceProvider provider);
/**
* Make this species only active at night.
*/
IAlleleBeeSpeciesCustom setNocturnal();
IAlleleBeeSpeciesBuilder setNocturnal();
/** Use this if you have custom icons for bees. */
IAlleleBeeSpeciesCustom setCustomBeeModelProvider(IBeeModelProvider beeIconProvider);
IAlleleBeeSpeciesBuilder setCustomBeeModelProvider(IBeeModelProvider beeIconProvider);
/** Use this if you have custom icon colours for bees (other than the default static primary + secondary colours). */
IAlleleBeeSpeciesCustom setCustomBeeSpriteColourProvider(IBeeSpriteColourProvider beeIconColourProvider);
IAlleleBeeSpeciesBuilder setCustomBeeSpriteColourProvider(IBeeSpriteColourProvider beeIconColourProvider);
}
@@ -12,7 +12,7 @@ public interface IBeeFactory {
/**
* Creates a new bee species.
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
* See IAlleleBeeSpeciesCustom and IAlleleSpeciesCustom for adding additional properties to the returned species.
* See IAlleleBeeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
*
* @param uid Unique Identifier for this species
* @param dominant Whether this species is genetically dominant (false means it is recessive)
@@ -25,7 +25,7 @@ public interface IBeeFactory {
* @param secondaryColor The body color of this species
* @return a new bee species allele.
*/
IAlleleBeeSpeciesCustom createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
/**
* Creates a new bee branch.