Update buildscript & spotlessApply

This commit is contained in:
DianeXD committed 2022-07-03 12:17:51 +08:00
1 parent e4329e2b8f
commit 8683a345c3
818 files changed
+51123 -49403

No files matched your search

@@ -19,237 +19,237 @@ import forestry.api.genetics.IIndividual;
import forestry.api.lepidopterology.EnumFlutterType;
import forestry.api.lepidopterology.IAlleleButterflySpecies;
import forestry.api.lepidopterology.IButterflyRoot;
import java.awt.Color;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.BiomeDictionary;
import java.awt.Color;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
public enum ButterflySpecies implements IAlleleButterflySpecies {
WhiteAdmiral("whiteAdmiral", "Limenitis camilla", new Color(0xfafafa)),
PurpleEmperor("purpleEmperor", "Apatura iris", new Color(0x4232c6)),
RedAdmiral("redAdmiral", "Vanessa atalanta", new Color(0xe66f44)),
PaintedLady("paintedLady", "Vanessa cardui", new Color(0xeda048)),
SmallTortoiseshell("smallTortoiseshell", "Aglais urticae", new Color(0xea750b)),
CamberwellBeauty("camberwellBeauty", "Aglais antiopa", new Color(0x95a2cc)),
Peacock("peacock", "Inachis io", new Color(0xd33802)),
Wall("wall", "Lasiommata megera", new Color(0xefae1e)),
CrimsonRose("crimsonRose", "Atrophaneura hector", new Color(0xff627b)),
KaiserIHind("kaiserIHind", "Teinopalpus imperialis", new Color(0x77a040)),
GoldenBirdwing("goldenBirdwing", "Troides aeacus", new Color(0xf9dc1e)),
MarshFritillary("marshFritillary", "Euphydryas aurinia",new Color(0xff8c00)),
PearlBorderedFritillary("pearlBorderedFritillary", "Boloria euphrosyne", new Color(0xff8b03)),
QueenOfSpainFritillary("queenOfSpainFritillary", "Issoria lathonia", new Color(0xffd13f)),
SpeckledWood("speckledWood", "Pararge aegeria", new Color(0xf5f88d)),
ScotchAngus("scotchAngus", "Erebia aethiops", new Color(0xc25423)),
Gatekeeper("gatekeeper", "Pyronia tithonus", new Color(0xfac32a)),
MeadowBrown("meadowBrown", "Maniola jurtina", new Color(0xe39519)),
SmallHeath("smallHeath", "Coenonympha pamphilus", new Color(0xffa632)),
Ringlet("ringlet", "Aphantopus hyperantus", new Color(0x975d37)),
Monarch("monarch", "Danaus plexippus", new Color(0xffb206)),
MarbledWhite("marbledWhite", "Melanargia galathea", new Color(0xececec));
WhiteAdmiral("whiteAdmiral", "Limenitis camilla", new Color(0xfafafa)),
PurpleEmperor("purpleEmperor", "Apatura iris", new Color(0x4232c6)),
RedAdmiral("redAdmiral", "Vanessa atalanta", new Color(0xe66f44)),
PaintedLady("paintedLady", "Vanessa cardui", new Color(0xeda048)),
SmallTortoiseshell("smallTortoiseshell", "Aglais urticae", new Color(0xea750b)),
CamberwellBeauty("camberwellBeauty", "Aglais antiopa", new Color(0x95a2cc)),
Peacock("peacock", "Inachis io", new Color(0xd33802)),
Wall("wall", "Lasiommata megera", new Color(0xefae1e)),
CrimsonRose("crimsonRose", "Atrophaneura hector", new Color(0xff627b)),
KaiserIHind("kaiserIHind", "Teinopalpus imperialis", new Color(0x77a040)),
GoldenBirdwing("goldenBirdwing", "Troides aeacus", new Color(0xf9dc1e)),
MarshFritillary("marshFritillary", "Euphydryas aurinia", new Color(0xff8c00)),
PearlBorderedFritillary("pearlBorderedFritillary", "Boloria euphrosyne", new Color(0xff8b03)),
QueenOfSpainFritillary("queenOfSpainFritillary", "Issoria lathonia", new Color(0xffd13f)),
SpeckledWood("speckledWood", "Pararge aegeria", new Color(0xf5f88d)),
ScotchAngus("scotchAngus", "Erebia aethiops", new Color(0xc25423)),
Gatekeeper("gatekeeper", "Pyronia tithonus", new Color(0xfac32a)),
MeadowBrown("meadowBrown", "Maniola jurtina", new Color(0xe39519)),
SmallHeath("smallHeath", "Coenonympha pamphilus", new Color(0xffa632)),
Ringlet("ringlet", "Aphantopus hyperantus", new Color(0x975d37)),
Monarch("monarch", "Danaus plexippus", new Color(0xffb206)),
MarbledWhite("marbledWhite", "Melanargia galathea", new Color(0xececec));
public IClassification branch;
public IClassification branch;
protected String name;
protected String branchName;
protected String scientific;
protected BinnieResource texture;
protected int color;
protected String name;
protected String branchName;
protected String scientific;
protected BinnieResource texture;
protected int color;
private Map<ItemStack, Float> butterflyLoot;
private Map<ItemStack, Float> caterpillarLoot;
private Map<ItemStack, Float> butterflyLoot;
private Map<ItemStack, Float> caterpillarLoot;
ButterflySpecies(String name, String scientific, Color color) {
this.name = name;
this.scientific = scientific.split(" ")[1];
this.color = color.getRGB();
butterflyLoot = new HashMap<>();
caterpillarLoot = new HashMap<>();
branchName = scientific.split(" ")[0].toLowerCase();
texture = Binnie.Resource.getPNG(ExtraTrees.instance, ResourceType.Entity, toString());
}
ButterflySpecies(String name, String scientific, Color color) {
this.name = name;
this.scientific = scientific.split(" ")[1];
this.color = color.getRGB();
butterflyLoot = new HashMap<>();
caterpillarLoot = new HashMap<>();
branchName = scientific.split(" ")[0].toLowerCase();
texture = Binnie.Resource.getPNG(ExtraTrees.instance, ResourceType.Entity, toString());
}
@Override
public String getName() {
return I18N.localise("extratrees.butterflies.species." + name);
}
@Override
public String getName() {
return I18N.localise("extratrees.butterflies.species." + name);
}
@Override
public String getDescription() {
return "";
}
@Override
public String getDescription() {
return "";
}
@Override
public EnumTemperature getTemperature() {
return EnumTemperature.NORMAL;
}
@Override
public EnumTemperature getTemperature() {
return EnumTemperature.NORMAL;
}
@Override
public EnumHumidity getHumidity() {
return EnumHumidity.NORMAL;
}
@Override
public EnumHumidity getHumidity() {
return EnumHumidity.NORMAL;
}
@Override
public boolean hasEffect() {
return false;
}
@Override
public boolean hasEffect() {
return false;
}
@Override
public boolean isSecret() {
return false;
}
@Override
public boolean isSecret() {
return false;
}
@Override
public boolean isCounted() {
return true;
}
@Override
public boolean isCounted() {
return true;
}
@Override
public String getBinomial() {
return scientific;
}
@Override
public String getBinomial() {
return scientific;
}
@Override
public String getAuthority() {
return "Binnie";
}
@Override
public String getAuthority() {
return "Binnie";
}
@Override
public IClassification getBranch() {
return branch;
}
@Override
public IClassification getBranch() {
return branch;
}
@Override
@SideOnly(Side.CLIENT)
public IIconProvider getIconProvider() {
return null;
}
@Override
@SideOnly(Side.CLIENT)
public IIconProvider getIconProvider() {
return null;
}
@Override
public String getUID() {
return "extrabutterflies.species." + toString().toLowerCase();
}
@Override
public String getUID() {
return "extrabutterflies.species." + toString().toLowerCase();
}
@Override
public boolean isDominant() {
return true;
}
@Override
public boolean isDominant() {
return true;
}
@Override
public String getEntityTexture() {
return texture.getResourceLocation().toString();
}
@Override
public String getEntityTexture() {
return texture.getResourceLocation().toString();
}
public IAllele[] getTemplate() {
IAllele[] def = getRoot().getDefaultTemplate().clone();
def[0] = this;
return def;
}
public IAllele[] getTemplate() {
IAllele[] def = getRoot().getDefaultTemplate().clone();
def[0] = this;
return def;
}
@Override
public IButterflyRoot getRoot() {
return Binnie.Genetics.getButterflyRoot();
}
@Override
public IButterflyRoot getRoot() {
return Binnie.Genetics.getButterflyRoot();
}
@Override
public float getRarity() {
return 0.5f;
}
@Override
public float getRarity() {
return 0.5f;
}
@Override
public boolean isNocturnal() {
return false;
}
@Override
public boolean isNocturnal() {
return false;
}
@Override
public int getIconColour(int renderPass) {
return (renderPass > 0) ? 0xffffff : color;
}
@Override
public int getIconColour(int renderPass) {
return (renderPass > 0) ? 0xffffff : color;
}
@Override
public Map<ItemStack, Float> getButterflyLoot() {
return new HashMap<>();
}
@Override
public Map<ItemStack, Float> getButterflyLoot() {
return new HashMap<>();
}
@Override
public Map<ItemStack, Float> getCaterpillarLoot() {
return new HashMap<>();
}
@Override
public Map<ItemStack, Float> getCaterpillarLoot() {
return new HashMap<>();
}
@Override
public int getComplexity() {
return 4;
}
@Override
public int getComplexity() {
return 4;
}
@Override
public float getResearchSuitability(ItemStack itemstack) {
if (itemstack == null) {
return 0.0f;
}
if (itemstack.getItem() == Items.glass_bottle) {
return 0.9f;
}
@Override
public float getResearchSuitability(ItemStack itemstack) {
if (itemstack == null) {
return 0.0f;
}
if (itemstack.getItem() == Items.glass_bottle) {
return 0.9f;
}
for (ItemStack stack : butterflyLoot.keySet()) {
if (stack.isItemEqual(itemstack)) {
return 1.0f;
}
}
for (ItemStack stack : butterflyLoot.keySet()) {
if (stack.isItemEqual(itemstack)) {
return 1.0f;
}
}
for (ItemStack stack : caterpillarLoot.keySet()) {
if (stack.isItemEqual(itemstack)) {
return 1.0f;
}
}
for (ItemStack stack : caterpillarLoot.keySet()) {
if (stack.isItemEqual(itemstack)) {
return 1.0f;
}
}
if (itemstack.getItem() == Mods.forestry.item("honeyDrop")) {
return 0.5f;
}
if (itemstack.getItem() == Mods.forestry.item("honeydew")) {
return 0.7f;
}
if (itemstack.getItem() == Mods.forestry.item("beeCombs")) {
return 0.4f;
}
if (AlleleManager.alleleRegistry.isIndividual(itemstack)) {
return 1.0f;
}
if (itemstack.getItem() == Mods.forestry.item("honeyDrop")) {
return 0.5f;
}
if (itemstack.getItem() == Mods.forestry.item("honeydew")) {
return 0.7f;
}
if (itemstack.getItem() == Mods.forestry.item("beeCombs")) {
return 0.4f;
}
if (AlleleManager.alleleRegistry.isIndividual(itemstack)) {
return 1.0f;
}
for (Map.Entry<ItemStack, Float> entry : getRoot().getResearchCatalysts().entrySet()) {
if (entry.getKey().isItemEqual(itemstack)) {
return entry.getValue();
}
}
return 0.0f;
}
for (Map.Entry<ItemStack, Float> entry :
getRoot().getResearchCatalysts().entrySet()) {
if (entry.getKey().isItemEqual(itemstack)) {
return entry.getValue();
}
}
return 0.0f;
}
@Override
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
return new ItemStack[]{getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM.ordinal())};
}
@Override
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
return new ItemStack[] {getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM.ordinal())};
}
@Override
public EnumSet<BiomeDictionary.Type> getSpawnBiomes() {
return EnumSet.noneOf(BiomeDictionary.Type.class);
}
@Override
public EnumSet<BiomeDictionary.Type> getSpawnBiomes() {
return EnumSet.noneOf(BiomeDictionary.Type.class);
}
@Override
public boolean strictSpawnMatch() {
return false;
}
@Override
public boolean strictSpawnMatch() {
return false;
}
@Override
public float getFlightDistance() {
return 5.0f;
}
@Override
public float getFlightDistance() {
return 5.0f;
}
@Override
public String getUnlocalizedName() {
return getUID();
}
@Override
public String getUnlocalizedName() {
return getUID();
}
}
@@ -3,36 +3,36 @@ package binnie.extratrees.genetics;
import forestry.api.genetics.IFruitFamily;
public enum ExtraTreeFruitFamily implements IFruitFamily {
Berry("Berries", "berry", "berri"),
Citrus("Citrus", "citrus", "citrus");
Berry("Berries", "berry", "berri"),
Citrus("Citrus", "citrus", "citrus");
protected String name;
protected String uid;
protected String scientific;
protected String name;
protected String uid;
protected String scientific;
ExtraTreeFruitFamily(String name, String uid, String scientific) {
this.name = name;
this.uid = uid;
this.scientific = scientific;
}
ExtraTreeFruitFamily(String name, String uid, String scientific) {
this.name = name;
this.uid = uid;
this.scientific = scientific;
}
@Override
public String getUID() {
return "binnie.family." + uid;
}
@Override
public String getUID() {
return "binnie.family." + uid;
}
@Override
public String getName() {
return name;
}
@Override
public String getName() {
return name;
}
@Override
public String getScientific() {
return scientific;
}
@Override
public String getScientific() {
return scientific;
}
@Override
public String getDescription() {
return name;
}
@Override
public String getDescription() {
return name;
}
}
@@ -18,424 +18,433 @@ import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IFruitFamily;
import forestry.arboriculture.FruitProviderNone;
import forestry.arboriculture.genetics.alleles.AlleleTreeSpecies;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
Blackthorn(10, 0x6d8f1e, 0xde2f69, FruitSprite.Small),
CherryPlum(10, 0x6d8f1e, 0xe81c4b, FruitSprite.Small),
Peach(10, 0x6d8f1e, 0xfaa023, FruitSprite.Average),
Nectarine(10, 0x6d8f1e, 0xfa5523, FruitSprite.Average),
Apricot(10, 0x6d8f1e, 0xfacf23, FruitSprite.Average),
Almond(10, 0x6d8f1e, 0x8ee376, FruitSprite.Small),
WildCherry(10, 0x6d8f1e, 0xff0000, FruitSprite.Tiny),
SourCherry(10, 0x6d8f1e, 0x9c092b, FruitSprite.Tiny),
BlackCherry(10, 0x6d8f1e, 0x4a0a19, FruitSprite.Tiny),
Orange(10, 0x37f043, 0xff940a, FruitSprite.Average),
Manderin(10, 0x37f043, 0xff940a, FruitSprite.Average),
Tangerine(10, 0x37f043, 0xff940a, FruitSprite.Average),
Satsuma(10, 0x37f043, 0xff940a, FruitSprite.Average),
KeyLime(10, 0x37f043, 0x9bff44, FruitSprite.Small),
Lime(10, 0x37f043, 0x9bff44, FruitSprite.Average),
FingerLime(10, 0x37f043, 0xaa3b38, FruitSprite.Small),
Pomelo(10, 0x37f043, 0x5cd34a, FruitSprite.Larger),
Grapefruit(10, 0x37f043, 0xff940a, FruitSprite.Large),
Kumquat(10, 0x37f043, 0xff940a, FruitSprite.Small),
Citron(10, 0x37f043, 0xffec60, FruitSprite.Large),
BuddhaHand(10, 0x37f043, 0xffec60, FruitSprite.Large),
Apple(10, 0x78c953, 0xf71616, FruitSprite.Average),
Crabapple(10, 0x78c953, 0xffbd4c, FruitSprite.Average),
Banana("Banana", FruitPod.Banana),
RedBanana("Red Banana", FruitPod.RedBanana),
Plantain("Platain", FruitPod.Plantain),
Hazelnut(7, 0x7d791e, 0xdcb276, FruitSprite.Small),
Butternut(7, 0xb2b750, 0xf5b462, FruitSprite.Small),
Beechnut(8, 0xdbbe7c, 0x5f3e35, FruitSprite.Tiny),
Pecan(8, 0xa2ac4c, 0xf0cf89, FruitSprite.Small),
BrazilNut(10, 0x59a769, 0x965530, FruitSprite.Large),
Fig(9, 0xd8b162, 0x6c3f46, FruitSprite.Small),
Acorn(6, 0x72b226, 0xad6a1d, FruitSprite.Tiny),
Elderberry(9, 0x71975d, 0x515b43, FruitSprite.Tiny),
Olive(9, 0x879e35, 0x62572a, FruitSprite.Small),
GingkoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
Coffee(8, 0x716d1d, 0xf84f66, FruitSprite.Tiny),
Pear(10, 0x9f8f51, 0x9fd551, FruitSprite.Pear),
OsangeOsange(10, 0x979752, 0xa2bf27, FruitSprite.Larger),
Clove(9, 0x687c2c, 0xab4445, FruitSprite.Tiny),
Coconut("Coconut", FruitPod.Coconut),
Cashew(8, 0xc4851c, 0xe94b17, FruitSprite.Average),
Avacado(10, 0x9cbe72, 0x211f10, FruitSprite.Pear),
Nutmeg(9, 0xe2c32d, 0xac8355, FruitSprite.Tiny),
Allspice(9, 0xe7a47a, 0x714636, FruitSprite.Tiny),
Chilli(10, 0x716265, 0xe71832, FruitSprite.Small),
StarAnise(8, 0x85442e, 0xd45c05, FruitSprite.Tiny),
Mango(10, 0x658c15, 0xf2a636, FruitSprite.Average),
Starfruit(10, 0x95c20d, 0xe5d22e, FruitSprite.Average),
Candlenut(8, 0x7da873, 0xdecab2, FruitSprite.Small),
Papayimar("Papayimar", FruitPod.Papayimar),
Blackcurrant(8, 0x8f8c53, 0x4b4e53, FruitSprite.Tiny),
Redcurrant(8, 0xc6800e, 0xe61e0e, FruitSprite.Tiny),
Blackberry(8, 0x8f6d71, 0x494371, FruitSprite.Tiny),
Raspberry(8, 0xecd1c5, 0xdd6971, FruitSprite.Tiny),
Blueberry(8, 0x9bb297, 0x6093be, FruitSprite.Tiny),
Cranberry(8, 0xbaa730, 0xde1a30, FruitSprite.Tiny),
Juniper(8, 0x9b8c72, 0x606372, FruitSprite.Tiny),
Gooseberry(8, 0xb99f50, 0xb9cf50, FruitSprite.Tiny),
GoldenRaspberry(8, 0xbeb03b, 0xf3b03b, FruitSprite.Tiny);
Blackthorn(10, 0x6d8f1e, 0xde2f69, FruitSprite.Small),
CherryPlum(10, 0x6d8f1e, 0xe81c4b, FruitSprite.Small),
Peach(10, 0x6d8f1e, 0xfaa023, FruitSprite.Average),
Nectarine(10, 0x6d8f1e, 0xfa5523, FruitSprite.Average),
Apricot(10, 0x6d8f1e, 0xfacf23, FruitSprite.Average),
Almond(10, 0x6d8f1e, 0x8ee376, FruitSprite.Small),
WildCherry(10, 0x6d8f1e, 0xff0000, FruitSprite.Tiny),
SourCherry(10, 0x6d8f1e, 0x9c092b, FruitSprite.Tiny),
BlackCherry(10, 0x6d8f1e, 0x4a0a19, FruitSprite.Tiny),
Orange(10, 0x37f043, 0xff940a, FruitSprite.Average),
Manderin(10, 0x37f043, 0xff940a, FruitSprite.Average),
Tangerine(10, 0x37f043, 0xff940a, FruitSprite.Average),
Satsuma(10, 0x37f043, 0xff940a, FruitSprite.Average),
KeyLime(10, 0x37f043, 0x9bff44, FruitSprite.Small),
Lime(10, 0x37f043, 0x9bff44, FruitSprite.Average),
FingerLime(10, 0x37f043, 0xaa3b38, FruitSprite.Small),
Pomelo(10, 0x37f043, 0x5cd34a, FruitSprite.Larger),
Grapefruit(10, 0x37f043, 0xff940a, FruitSprite.Large),
Kumquat(10, 0x37f043, 0xff940a, FruitSprite.Small),
Citron(10, 0x37f043, 0xffec60, FruitSprite.Large),
BuddhaHand(10, 0x37f043, 0xffec60, FruitSprite.Large),
Apple(10, 0x78c953, 0xf71616, FruitSprite.Average),
Crabapple(10, 0x78c953, 0xffbd4c, FruitSprite.Average),
Banana("Banana", FruitPod.Banana),
RedBanana("Red Banana", FruitPod.RedBanana),
Plantain("Platain", FruitPod.Plantain),
Hazelnut(7, 0x7d791e, 0xdcb276, FruitSprite.Small),
Butternut(7, 0xb2b750, 0xf5b462, FruitSprite.Small),
Beechnut(8, 0xdbbe7c, 0x5f3e35, FruitSprite.Tiny),
Pecan(8, 0xa2ac4c, 0xf0cf89, FruitSprite.Small),
BrazilNut(10, 0x59a769, 0x965530, FruitSprite.Large),
Fig(9, 0xd8b162, 0x6c3f46, FruitSprite.Small),
Acorn(6, 0x72b226, 0xad6a1d, FruitSprite.Tiny),
Elderberry(9, 0x71975d, 0x515b43, FruitSprite.Tiny),
Olive(9, 0x879e35, 0x62572a, FruitSprite.Small),
GingkoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
Coffee(8, 0x716d1d, 0xf84f66, FruitSprite.Tiny),
Pear(10, 0x9f8f51, 0x9fd551, FruitSprite.Pear),
OsangeOsange(10, 0x979752, 0xa2bf27, FruitSprite.Larger),
Clove(9, 0x687c2c, 0xab4445, FruitSprite.Tiny),
Coconut("Coconut", FruitPod.Coconut),
Cashew(8, 0xc4851c, 0xe94b17, FruitSprite.Average),
Avacado(10, 0x9cbe72, 0x211f10, FruitSprite.Pear),
Nutmeg(9, 0xe2c32d, 0xac8355, FruitSprite.Tiny),
Allspice(9, 0xe7a47a, 0x714636, FruitSprite.Tiny),
Chilli(10, 0x716265, 0xe71832, FruitSprite.Small),
StarAnise(8, 0x85442e, 0xd45c05, FruitSprite.Tiny),
Mango(10, 0x658c15, 0xf2a636, FruitSprite.Average),
Starfruit(10, 0x95c20d, 0xe5d22e, FruitSprite.Average),
Candlenut(8, 0x7da873, 0xdecab2, FruitSprite.Small),
Papayimar("Papayimar", FruitPod.Papayimar),
Blackcurrant(8, 0x8f8c53, 0x4b4e53, FruitSprite.Tiny),
Redcurrant(8, 0xc6800e, 0xe61e0e, FruitSprite.Tiny),
Blackberry(8, 0x8f6d71, 0x494371, FruitSprite.Tiny),
Raspberry(8, 0xecd1c5, 0xdd6971, FruitSprite.Tiny),
Blueberry(8, 0x9bb297, 0x6093be, FruitSprite.Tiny),
Cranberry(8, 0xbaa730, 0xde1a30, FruitSprite.Tiny),
Juniper(8, 0x9b8c72, 0x606372, FruitSprite.Tiny),
Gooseberry(8, 0xb99f50, 0xb9cf50, FruitSprite.Tiny),
GoldenRaspberry(8, 0xbeb03b, 0xf3b03b, FruitSprite.Tiny);
protected IFruitFamily family;
protected boolean isRipening;
protected int diffR;
protected int diffG;
protected int diffB;
protected FruitPod pod;
protected int ripeningPeriod;
protected int colorUnripe;
protected int color;
protected FruitSprite index;
protected HashMap<ItemStack, Float> products;
protected IFruitFamily family;
protected boolean isRipening;
protected int diffR;
protected int diffG;
protected int diffB;
protected FruitPod pod;
protected int ripeningPeriod;
protected int colorUnripe;
protected int color;
protected FruitSprite index;
protected HashMap<ItemStack, Float> products;
ExtraTreeFruitGene(int time, int unripe, int color, FruitSprite index) {
this.color = color;
this.index = index;
isRipening = false;
diffB = 0;
pod = null;
ripeningPeriod = 0;
products = new HashMap<>();
setRipening(time, unripe);
}
ExtraTreeFruitGene(int time, int unripe, int color, FruitSprite index) {
this.color = color;
this.index = index;
isRipening = false;
diffB = 0;
pod = null;
ripeningPeriod = 0;
products = new HashMap<>();
setRipening(time, unripe);
}
ExtraTreeFruitGene(String name, FruitPod pod) {
this.pod = pod;
isRipening = false;
diffB = 0;
products = new HashMap<>();
ripeningPeriod = 2;
}
ExtraTreeFruitGene(String name, FruitPod pod) {
this.pod = pod;
isRipening = false;
diffB = 0;
products = new HashMap<>();
ripeningPeriod = 2;
}
public static void init() {
IFruitFamily familyPrune = AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes");
IFruitFamily familyPome = AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes");
IFruitFamily familyJungle = AlleleManager.alleleRegistry.getFruitFamily("forestry.jungle");
IFruitFamily familyNuts = AlleleManager.alleleRegistry.getFruitFamily("forestry.nuts");
IFruitFamily familyBerry = ExtraTreeFruitFamily.Berry;
IFruitFamily familyCitrus = ExtraTreeFruitFamily.Citrus;
AlleleManager.alleleRegistry.registerFruitFamily(familyBerry);
AlleleManager.alleleRegistry.registerFruitFamily(familyCitrus);
ExtraTreeFruitGene.Apple.addProduct(new ItemStack(Items.apple), 1.0f);
ExtraTreeFruitGene.Apple.setFamily(familyPome);
ExtraTreeFruitGene.Crabapple.addProduct(Food.Crabapple.get(1), 1.0f);
ExtraTreeFruitGene.Crabapple.setFamily(familyPome);
ExtraTreeFruitGene.Orange.addProduct(Food.Orange.get(1), 1.0f);
ExtraTreeFruitGene.Orange.setFamily(familyCitrus);
ExtraTreeFruitGene.Manderin.addProduct(Food.Manderin.get(1), 1.0f);
ExtraTreeFruitGene.Manderin.setFamily(familyCitrus);
ExtraTreeFruitGene.Tangerine.addProduct(Food.Tangerine.get(1), 1.0f);
ExtraTreeFruitGene.Tangerine.setFamily(familyCitrus);
ExtraTreeFruitGene.Satsuma.addProduct(Food.Satsuma.get(1), 1.0f);
ExtraTreeFruitGene.Satsuma.setFamily(familyCitrus);
ExtraTreeFruitGene.KeyLime.addProduct(Food.KeyLime.get(1), 1.0f);
ExtraTreeFruitGene.KeyLime.setFamily(familyCitrus);
ExtraTreeFruitGene.Lime.addProduct(Food.Lime.get(1), 1.0f);
ExtraTreeFruitGene.Lime.setFamily(familyCitrus);
ExtraTreeFruitGene.FingerLime.addProduct(Food.FingerLime.get(1), 1.0f);
ExtraTreeFruitGene.FingerLime.setFamily(familyCitrus);
ExtraTreeFruitGene.Pomelo.addProduct(Food.Pomelo.get(1), 1.0f);
ExtraTreeFruitGene.Pomelo.setFamily(familyCitrus);
ExtraTreeFruitGene.Grapefruit.addProduct(Food.Grapefruit.get(1), 1.0f);
ExtraTreeFruitGene.Grapefruit.setFamily(familyCitrus);
ExtraTreeFruitGene.Kumquat.addProduct(Food.Kumquat.get(1), 1.0f);
ExtraTreeFruitGene.Kumquat.setFamily(familyCitrus);
ExtraTreeFruitGene.Citron.addProduct(Food.Citron.get(1), 1.0f);
ExtraTreeFruitGene.Citron.setFamily(familyCitrus);
ExtraTreeFruitGene.BuddhaHand.addProduct(Food.BuddhaHand.get(1), 1.0f);
ExtraTreeFruitGene.BuddhaHand.setFamily(familyCitrus);
ExtraTreeFruitGene.Blackthorn.addProduct(Food.Blackthorn.get(1), 1.0f);
ExtraTreeFruitGene.Blackthorn.setFamily(familyPrune);
ExtraTreeFruitGene.CherryPlum.addProduct(Food.CherryPlum.get(1), 1.0f);
ExtraTreeFruitGene.CherryPlum.setFamily(familyPrune);
ExtraTreeFruitGene.Peach.addProduct(Food.Peach.get(1), 1.0f);
ExtraTreeFruitGene.Peach.setFamily(familyPrune);
ExtraTreeFruitGene.Nectarine.addProduct(Food.Nectarine.get(1), 1.0f);
ExtraTreeFruitGene.Nectarine.setFamily(familyPrune);
ExtraTreeFruitGene.Apricot.addProduct(Food.Apricot.get(1), 1.0f);
ExtraTreeFruitGene.Apricot.setFamily(familyPrune);
ExtraTreeFruitGene.Almond.addProduct(Food.Almond.get(1), 1.0f);
ExtraTreeFruitGene.Almond.setFamily(familyPrune);
ExtraTreeFruitGene.WildCherry.addProduct(Food.WildCherry.get(1), 1.0f);
ExtraTreeFruitGene.WildCherry.setFamily(familyPrune);
ExtraTreeFruitGene.SourCherry.addProduct(Food.SourCherry.get(1), 1.0f);
ExtraTreeFruitGene.SourCherry.setFamily(familyPrune);
ExtraTreeFruitGene.BlackCherry.addProduct(Food.BlackCherry.get(1), 1.0f);
ExtraTreeFruitGene.BlackCherry.setFamily(familyPrune);
ExtraTreeFruitGene.Hazelnut.addProduct(Food.Hazelnut.get(1), 1.0f);
ExtraTreeFruitGene.Hazelnut.setFamily(familyNuts);
ExtraTreeFruitGene.Butternut.addProduct(Food.Butternut.get(1), 1.0f);
ExtraTreeFruitGene.Butternut.setFamily(familyNuts);
ExtraTreeFruitGene.Beechnut.addProduct(Food.Beechnut.get(1), 1.0f);
ExtraTreeFruitGene.Beechnut.setFamily(familyNuts);
ExtraTreeFruitGene.Pecan.addProduct(Food.Pecan.get(1), 1.0f);
ExtraTreeFruitGene.Pecan.setFamily(familyNuts);
ExtraTreeFruitGene.Banana.addProduct(Food.Banana.get(2), 1.0f);
ExtraTreeFruitGene.Banana.setFamily(familyJungle);
ExtraTreeFruitGene.RedBanana.addProduct(Food.RedBanana.get(2), 1.0f);
ExtraTreeFruitGene.RedBanana.setFamily(familyJungle);
ExtraTreeFruitGene.Plantain.addProduct(Food.Plantain.get(2), 1.0f);
ExtraTreeFruitGene.Plantain.setFamily(familyJungle);
ExtraTreeFruitGene.BrazilNut.addProduct(Food.BrazilNut.get(4), 1.0f);
ExtraTreeFruitGene.BrazilNut.setFamily(familyNuts);
ExtraTreeFruitGene.Fig.addProduct(Food.Fig.get(1), 1.0f);
ExtraTreeFruitGene.Fig.setFamily(familyPrune);
ExtraTreeFruitGene.Acorn.addProduct(Food.Acorn.get(1), 1.0f);
ExtraTreeFruitGene.Acorn.setFamily(familyNuts);
ExtraTreeFruitGene.Elderberry.addProduct(Food.Elderberry.get(1), 1.0f);
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
ExtraTreeFruitGene.Olive.addProduct(Food.Olive.get(1), 1.0f);
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
ExtraTreeFruitGene.GingkoNut.addProduct(Food.GingkoNut.get(1), 1.0f);
ExtraTreeFruitGene.GingkoNut.setFamily(familyNuts);
ExtraTreeFruitGene.Coffee.addProduct(Food.Coffee.get(1), 1.0f);
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
ExtraTreeFruitGene.Pear.addProduct(Food.Pear.get(1), 1.0f);
ExtraTreeFruitGene.Pear.setFamily(familyPome);
ExtraTreeFruitGene.OsangeOsange.addProduct(Food.OsangeOrange.get(1), 1.0f);
ExtraTreeFruitGene.OsangeOsange.setFamily(familyPome);
ExtraTreeFruitGene.Clove.addProduct(Food.Clove.get(1), 1.0f);
ExtraTreeFruitGene.Clove.setFamily(familyNuts);
ExtraTreeFruitGene.Blackcurrant.addProduct(Food.Blackcurrant.get(2), 1.0f);
ExtraTreeFruitGene.Blackcurrant.setFamily(familyBerry);
ExtraTreeFruitGene.Redcurrant.addProduct(Food.Redcurrant.get(2), 1.0f);
ExtraTreeFruitGene.Redcurrant.setFamily(familyBerry);
ExtraTreeFruitGene.Blackberry.addProduct(Food.Blackberry.get(2), 1.0f);
ExtraTreeFruitGene.Blackberry.setFamily(familyBerry);
ExtraTreeFruitGene.Raspberry.addProduct(Food.Raspberry.get(2), 1.0f);
ExtraTreeFruitGene.Raspberry.setFamily(familyBerry);
ExtraTreeFruitGene.Blueberry.addProduct(Food.Blueberry.get(2), 1.0f);
ExtraTreeFruitGene.Blueberry.setFamily(familyBerry);
ExtraTreeFruitGene.Cranberry.addProduct(Food.Cranberry.get(2), 1.0f);
ExtraTreeFruitGene.Cranberry.setFamily(familyBerry);
ExtraTreeFruitGene.Juniper.addProduct(Food.Juniper.get(2), 1.0f);
ExtraTreeFruitGene.Juniper.setFamily(familyBerry);
ExtraTreeFruitGene.Gooseberry.addProduct(Food.Gooseberry.get(2), 1.0f);
ExtraTreeFruitGene.Gooseberry.setFamily(familyBerry);
ExtraTreeFruitGene.GoldenRaspberry.addProduct(Food.GoldenRaspberry.get(2), 1.0f);
ExtraTreeFruitGene.GoldenRaspberry.setFamily(familyBerry);
ExtraTreeFruitGene.Coconut.addProduct(Food.Coconut.get(1), 1.0f);
ExtraTreeFruitGene.Coconut.setFamily(familyJungle);
ExtraTreeFruitGene.Cashew.addProduct(Food.Cashew.get(1), 1.0f);
ExtraTreeFruitGene.Cashew.setFamily(familyJungle);
ExtraTreeFruitGene.Avacado.addProduct(Food.Avacado.get(1), 1.0f);
ExtraTreeFruitGene.Avacado.setFamily(familyJungle);
ExtraTreeFruitGene.Nutmeg.addProduct(Food.Nutmeg.get(1), 1.0f);
ExtraTreeFruitGene.Nutmeg.setFamily(familyJungle);
ExtraTreeFruitGene.Allspice.addProduct(Food.Allspice.get(1), 1.0f);
ExtraTreeFruitGene.Allspice.setFamily(familyJungle);
ExtraTreeFruitGene.Chilli.addProduct(Food.Chilli.get(1), 1.0f);
ExtraTreeFruitGene.Chilli.setFamily(familyJungle);
ExtraTreeFruitGene.StarAnise.addProduct(Food.StarAnise.get(1), 1.0f);
ExtraTreeFruitGene.StarAnise.setFamily(familyJungle);
ExtraTreeFruitGene.Mango.addProduct(Food.Mango.get(1), 1.0f);
ExtraTreeFruitGene.Mango.setFamily(familyPome);
ExtraTreeFruitGene.Starfruit.addProduct(Food.Starfruit.get(1), 1.0f);
ExtraTreeFruitGene.Starfruit.setFamily(familyJungle);
ExtraTreeFruitGene.Candlenut.addProduct(Food.Candlenut.get(1), 1.0f);
ExtraTreeFruitGene.Candlenut.setFamily(familyJungle);
public static void init() {
IFruitFamily familyPrune = AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes");
IFruitFamily familyPome = AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes");
IFruitFamily familyJungle = AlleleManager.alleleRegistry.getFruitFamily("forestry.jungle");
IFruitFamily familyNuts = AlleleManager.alleleRegistry.getFruitFamily("forestry.nuts");
IFruitFamily familyBerry = ExtraTreeFruitFamily.Berry;
IFruitFamily familyCitrus = ExtraTreeFruitFamily.Citrus;
AlleleManager.alleleRegistry.registerFruitFamily(familyBerry);
AlleleManager.alleleRegistry.registerFruitFamily(familyCitrus);
ExtraTreeFruitGene.Apple.addProduct(new ItemStack(Items.apple), 1.0f);
ExtraTreeFruitGene.Apple.setFamily(familyPome);
ExtraTreeFruitGene.Crabapple.addProduct(Food.Crabapple.get(1), 1.0f);
ExtraTreeFruitGene.Crabapple.setFamily(familyPome);
ExtraTreeFruitGene.Orange.addProduct(Food.Orange.get(1), 1.0f);
ExtraTreeFruitGene.Orange.setFamily(familyCitrus);
ExtraTreeFruitGene.Manderin.addProduct(Food.Manderin.get(1), 1.0f);
ExtraTreeFruitGene.Manderin.setFamily(familyCitrus);
ExtraTreeFruitGene.Tangerine.addProduct(Food.Tangerine.get(1), 1.0f);
ExtraTreeFruitGene.Tangerine.setFamily(familyCitrus);
ExtraTreeFruitGene.Satsuma.addProduct(Food.Satsuma.get(1), 1.0f);
ExtraTreeFruitGene.Satsuma.setFamily(familyCitrus);
ExtraTreeFruitGene.KeyLime.addProduct(Food.KeyLime.get(1), 1.0f);
ExtraTreeFruitGene.KeyLime.setFamily(familyCitrus);
ExtraTreeFruitGene.Lime.addProduct(Food.Lime.get(1), 1.0f);
ExtraTreeFruitGene.Lime.setFamily(familyCitrus);
ExtraTreeFruitGene.FingerLime.addProduct(Food.FingerLime.get(1), 1.0f);
ExtraTreeFruitGene.FingerLime.setFamily(familyCitrus);
ExtraTreeFruitGene.Pomelo.addProduct(Food.Pomelo.get(1), 1.0f);
ExtraTreeFruitGene.Pomelo.setFamily(familyCitrus);
ExtraTreeFruitGene.Grapefruit.addProduct(Food.Grapefruit.get(1), 1.0f);
ExtraTreeFruitGene.Grapefruit.setFamily(familyCitrus);
ExtraTreeFruitGene.Kumquat.addProduct(Food.Kumquat.get(1), 1.0f);
ExtraTreeFruitGene.Kumquat.setFamily(familyCitrus);
ExtraTreeFruitGene.Citron.addProduct(Food.Citron.get(1), 1.0f);
ExtraTreeFruitGene.Citron.setFamily(familyCitrus);
ExtraTreeFruitGene.BuddhaHand.addProduct(Food.BuddhaHand.get(1), 1.0f);
ExtraTreeFruitGene.BuddhaHand.setFamily(familyCitrus);
ExtraTreeFruitGene.Blackthorn.addProduct(Food.Blackthorn.get(1), 1.0f);
ExtraTreeFruitGene.Blackthorn.setFamily(familyPrune);
ExtraTreeFruitGene.CherryPlum.addProduct(Food.CherryPlum.get(1), 1.0f);
ExtraTreeFruitGene.CherryPlum.setFamily(familyPrune);
ExtraTreeFruitGene.Peach.addProduct(Food.Peach.get(1), 1.0f);
ExtraTreeFruitGene.Peach.setFamily(familyPrune);
ExtraTreeFruitGene.Nectarine.addProduct(Food.Nectarine.get(1), 1.0f);
ExtraTreeFruitGene.Nectarine.setFamily(familyPrune);
ExtraTreeFruitGene.Apricot.addProduct(Food.Apricot.get(1), 1.0f);
ExtraTreeFruitGene.Apricot.setFamily(familyPrune);
ExtraTreeFruitGene.Almond.addProduct(Food.Almond.get(1), 1.0f);
ExtraTreeFruitGene.Almond.setFamily(familyPrune);
ExtraTreeFruitGene.WildCherry.addProduct(Food.WildCherry.get(1), 1.0f);
ExtraTreeFruitGene.WildCherry.setFamily(familyPrune);
ExtraTreeFruitGene.SourCherry.addProduct(Food.SourCherry.get(1), 1.0f);
ExtraTreeFruitGene.SourCherry.setFamily(familyPrune);
ExtraTreeFruitGene.BlackCherry.addProduct(Food.BlackCherry.get(1), 1.0f);
ExtraTreeFruitGene.BlackCherry.setFamily(familyPrune);
ExtraTreeFruitGene.Hazelnut.addProduct(Food.Hazelnut.get(1), 1.0f);
ExtraTreeFruitGene.Hazelnut.setFamily(familyNuts);
ExtraTreeFruitGene.Butternut.addProduct(Food.Butternut.get(1), 1.0f);
ExtraTreeFruitGene.Butternut.setFamily(familyNuts);
ExtraTreeFruitGene.Beechnut.addProduct(Food.Beechnut.get(1), 1.0f);
ExtraTreeFruitGene.Beechnut.setFamily(familyNuts);
ExtraTreeFruitGene.Pecan.addProduct(Food.Pecan.get(1), 1.0f);
ExtraTreeFruitGene.Pecan.setFamily(familyNuts);
ExtraTreeFruitGene.Banana.addProduct(Food.Banana.get(2), 1.0f);
ExtraTreeFruitGene.Banana.setFamily(familyJungle);
ExtraTreeFruitGene.RedBanana.addProduct(Food.RedBanana.get(2), 1.0f);
ExtraTreeFruitGene.RedBanana.setFamily(familyJungle);
ExtraTreeFruitGene.Plantain.addProduct(Food.Plantain.get(2), 1.0f);
ExtraTreeFruitGene.Plantain.setFamily(familyJungle);
ExtraTreeFruitGene.BrazilNut.addProduct(Food.BrazilNut.get(4), 1.0f);
ExtraTreeFruitGene.BrazilNut.setFamily(familyNuts);
ExtraTreeFruitGene.Fig.addProduct(Food.Fig.get(1), 1.0f);
ExtraTreeFruitGene.Fig.setFamily(familyPrune);
ExtraTreeFruitGene.Acorn.addProduct(Food.Acorn.get(1), 1.0f);
ExtraTreeFruitGene.Acorn.setFamily(familyNuts);
ExtraTreeFruitGene.Elderberry.addProduct(Food.Elderberry.get(1), 1.0f);
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
ExtraTreeFruitGene.Olive.addProduct(Food.Olive.get(1), 1.0f);
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
ExtraTreeFruitGene.GingkoNut.addProduct(Food.GingkoNut.get(1), 1.0f);
ExtraTreeFruitGene.GingkoNut.setFamily(familyNuts);
ExtraTreeFruitGene.Coffee.addProduct(Food.Coffee.get(1), 1.0f);
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
ExtraTreeFruitGene.Pear.addProduct(Food.Pear.get(1), 1.0f);
ExtraTreeFruitGene.Pear.setFamily(familyPome);
ExtraTreeFruitGene.OsangeOsange.addProduct(Food.OsangeOrange.get(1), 1.0f);
ExtraTreeFruitGene.OsangeOsange.setFamily(familyPome);
ExtraTreeFruitGene.Clove.addProduct(Food.Clove.get(1), 1.0f);
ExtraTreeFruitGene.Clove.setFamily(familyNuts);
ExtraTreeFruitGene.Blackcurrant.addProduct(Food.Blackcurrant.get(2), 1.0f);
ExtraTreeFruitGene.Blackcurrant.setFamily(familyBerry);
ExtraTreeFruitGene.Redcurrant.addProduct(Food.Redcurrant.get(2), 1.0f);
ExtraTreeFruitGene.Redcurrant.setFamily(familyBerry);
ExtraTreeFruitGene.Blackberry.addProduct(Food.Blackberry.get(2), 1.0f);
ExtraTreeFruitGene.Blackberry.setFamily(familyBerry);
ExtraTreeFruitGene.Raspberry.addProduct(Food.Raspberry.get(2), 1.0f);
ExtraTreeFruitGene.Raspberry.setFamily(familyBerry);
ExtraTreeFruitGene.Blueberry.addProduct(Food.Blueberry.get(2), 1.0f);
ExtraTreeFruitGene.Blueberry.setFamily(familyBerry);
ExtraTreeFruitGene.Cranberry.addProduct(Food.Cranberry.get(2), 1.0f);
ExtraTreeFruitGene.Cranberry.setFamily(familyBerry);
ExtraTreeFruitGene.Juniper.addProduct(Food.Juniper.get(2), 1.0f);
ExtraTreeFruitGene.Juniper.setFamily(familyBerry);
ExtraTreeFruitGene.Gooseberry.addProduct(Food.Gooseberry.get(2), 1.0f);
ExtraTreeFruitGene.Gooseberry.setFamily(familyBerry);
ExtraTreeFruitGene.GoldenRaspberry.addProduct(Food.GoldenRaspberry.get(2), 1.0f);
ExtraTreeFruitGene.GoldenRaspberry.setFamily(familyBerry);
ExtraTreeFruitGene.Coconut.addProduct(Food.Coconut.get(1), 1.0f);
ExtraTreeFruitGene.Coconut.setFamily(familyJungle);
ExtraTreeFruitGene.Cashew.addProduct(Food.Cashew.get(1), 1.0f);
ExtraTreeFruitGene.Cashew.setFamily(familyJungle);
ExtraTreeFruitGene.Avacado.addProduct(Food.Avacado.get(1), 1.0f);
ExtraTreeFruitGene.Avacado.setFamily(familyJungle);
ExtraTreeFruitGene.Nutmeg.addProduct(Food.Nutmeg.get(1), 1.0f);
ExtraTreeFruitGene.Nutmeg.setFamily(familyJungle);
ExtraTreeFruitGene.Allspice.addProduct(Food.Allspice.get(1), 1.0f);
ExtraTreeFruitGene.Allspice.setFamily(familyJungle);
ExtraTreeFruitGene.Chilli.addProduct(Food.Chilli.get(1), 1.0f);
ExtraTreeFruitGene.Chilli.setFamily(familyJungle);
ExtraTreeFruitGene.StarAnise.addProduct(Food.StarAnise.get(1), 1.0f);
ExtraTreeFruitGene.StarAnise.setFamily(familyJungle);
ExtraTreeFruitGene.Mango.addProduct(Food.Mango.get(1), 1.0f);
ExtraTreeFruitGene.Mango.setFamily(familyPome);
ExtraTreeFruitGene.Starfruit.addProduct(Food.Starfruit.get(1), 1.0f);
ExtraTreeFruitGene.Starfruit.setFamily(familyJungle);
ExtraTreeFruitGene.Candlenut.addProduct(Food.Candlenut.get(1), 1.0f);
ExtraTreeFruitGene.Candlenut.setFamily(familyJungle);
if (ConfigurationMain.alterLemon) {
try {
IAlleleFruit lemon = (IAlleleFruit) AlleleManager.alleleRegistry.getAllele("forestry.fruitLemon");
FruitProviderNone prov = (FruitProviderNone) lemon.getProvider();
Field f = FruitProviderNone.class.getDeclaredField("family");
Field modifiersField = Field.class.getDeclaredField("modifiers");
f.setAccessible(true);
modifiersField.setAccessible(true);
modifiersField.setInt(f, f.getModifiers() & 0xFFFFFFEF);
f.set(prov, familyCitrus);
} catch (Exception e) {
e.printStackTrace();
}
}
if (ConfigurationMain.alterLemon) {
try {
IAlleleFruit lemon = (IAlleleFruit) AlleleManager.alleleRegistry.getAllele("forestry.fruitLemon");
FruitProviderNone prov = (FruitProviderNone) lemon.getProvider();
Field f = FruitProviderNone.class.getDeclaredField("family");
Field modifiersField = Field.class.getDeclaredField("modifiers");
f.setAccessible(true);
modifiersField.setAccessible(true);
modifiersField.setInt(f, f.getModifiers() & 0xFFFFFFEF);
f.set(prov, familyCitrus);
} catch (Exception e) {
e.printStackTrace();
}
}
for (IAlleleSpecies tree : Binnie.Genetics.treeBreedingSystem.getAllSpecies()) {
if (tree instanceof AlleleTreeSpecies && ((IAlleleTreeSpecies) tree).getSuitableFruit().contains(familyPrune)) {
((AlleleTreeSpecies) tree).addFruitFamily(familyCitrus);
}
}
}
for (IAlleleSpecies tree : Binnie.Genetics.treeBreedingSystem.getAllSpecies()) {
if (tree instanceof AlleleTreeSpecies
&& ((IAlleleTreeSpecies) tree).getSuitableFruit().contains(familyPrune)) {
((AlleleTreeSpecies) tree).addFruitFamily(familyCitrus);
}
}
}
public void setRipening(int time, int unripe) {
ripeningPeriod = time;
colorUnripe = unripe;
isRipening = true;
diffR = (color >> 16 & 0xFF) - (unripe >> 16 & 0xFF);
diffG = (color >> 8 & 0xFF) - (unripe >> 8 & 0xFF);
diffB = (color & 0xFF) - (unripe & 0xFF);
}
public void setRipening(int time, int unripe) {
ripeningPeriod = time;
colorUnripe = unripe;
isRipening = true;
diffR = (color >> 16 & 0xFF) - (unripe >> 16 & 0xFF);
diffG = (color >> 8 & 0xFF) - (unripe >> 8 & 0xFF);
diffB = (color & 0xFF) - (unripe & 0xFF);
}
public void addProduct(ItemStack product, float chance) {
products.put(product, chance);
}
public void addProduct(ItemStack product, float chance) {
products.put(product, chance);
}
@Override
public String getUID() {
return "extratrees.fruit." + toString().toLowerCase();
}
@Override
public String getUID() {
return "extratrees.fruit." + toString().toLowerCase();
}
@Override
public boolean isDominant() {
return true;
}
@Override
public boolean isDominant() {
return true;
}
@Override
public IFruitProvider getProvider() {
return this;
}
@Override
public IFruitProvider getProvider() {
return this;
}
@Override
public ItemStack[] getProducts() {
return products.keySet().toArray(new ItemStack[0]);
}
@Override
public ItemStack[] getProducts() {
return products.keySet().toArray(new ItemStack[0]);
}
@Override
public ItemStack[] getSpecialty() {
return new ItemStack[0];
}
@Override
public ItemStack[] getSpecialty() {
return new ItemStack[0];
}
@Override
public String getDescription() {
return "extratrees.item.food." + name().toLowerCase();
}
@Override
public String getDescription() {
return "extratrees.item.food." + name().toLowerCase();
}
@Override
public IFruitFamily getFamily() {
return family;
}
@Override
public IFruitFamily getFamily() {
return family;
}
private void setFamily(IFruitFamily family) {
this.family = family;
}
private void setFamily(IFruitFamily family) {
this.family = family;
}
@Override
public int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime) {
if (!isRipening) {
return color;
}
@Override
public int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime) {
if (!isRipening) {
return color;
}
float stage = getRipeningStage(ripeningTime);
int r = (colorUnripe >> 16 & 0xFF) + (int) (diffR * stage);
int g = (colorUnripe >> 8 & 0xFF) + (int) (diffG * stage);
int b = (colorUnripe & 0xFF) + (int) (diffB * stage);
return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF);
}
float stage = getRipeningStage(ripeningTime);
int r = (colorUnripe >> 16 & 0xFF) + (int) (diffR * stage);
int g = (colorUnripe >> 8 & 0xFF) + (int) (diffG * stage);
int b = (colorUnripe & 0xFF) + (int) (diffB * stage);
return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF);
}
@Override
public boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z) {
return pod == null;
}
@Override
public boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z) {
return pod == null;
}
@Override
public int getRipeningPeriod() {
return ripeningPeriod;
}
@Override
public int getRipeningPeriod() {
return ripeningPeriod;
}
@Override
public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) {
if (pod != null) {
if (ripeningTime >= 2) {
List<ItemStack> product = new ArrayList<>();
for (Map.Entry<ItemStack, Float> entry : products.entrySet()) {
ItemStack single = entry.getKey().copy();
single.stackSize = 1;
for (int i = 0; i < entry.getKey().stackSize; ++i) {
if (world.rand.nextFloat() <= entry.getValue()) {
product.add(single.copy());
}
}
}
return product.toArray(new ItemStack[0]);
}
return new ItemStack[0];
}
@Override
public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) {
if (pod != null) {
if (ripeningTime >= 2) {
List<ItemStack> product = new ArrayList<>();
for (Map.Entry<ItemStack, Float> entry : products.entrySet()) {
ItemStack single = entry.getKey().copy();
single.stackSize = 1;
for (int i = 0; i < entry.getKey().stackSize; ++i) {
if (world.rand.nextFloat() <= entry.getValue()) {
product.add(single.copy());
}
}
}
return product.toArray(new ItemStack[0]);
}
return new ItemStack[0];
}
ArrayList<ItemStack> product2 = new ArrayList<>();
float stage = getRipeningStage(ripeningTime);
if (stage < 0.5f) {
return new ItemStack[0];
}
ArrayList<ItemStack> product2 = new ArrayList<>();
float stage = getRipeningStage(ripeningTime);
if (stage < 0.5f) {
return new ItemStack[0];
}
float modeYieldMod = 1.0f;
for (Map.Entry<ItemStack, Float> entry2 : products.entrySet()) {
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * entry2.getValue() * stage) {
product2.add(entry2.getKey().copy());
}
}
return product2.toArray(new ItemStack[0]);
}
float modeYieldMod = 1.0f;
for (Map.Entry<ItemStack, Float> entry2 : products.entrySet()) {
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * entry2.getValue() * stage) {
product2.add(entry2.getKey().copy());
}
}
return product2.toArray(new ItemStack[0]);
}
private float getRipeningStage(int ripeningTime) {
if (ripeningTime >= ripeningPeriod) {
return 1.0f;
}
return ripeningTime / ripeningPeriod;
}
private float getRipeningStage(int ripeningTime) {
if (ripeningTime >= ripeningPeriod) {
return 1.0f;
}
return ripeningTime / ripeningPeriod;
}
@Override
public boolean requiresFruitBlocks() {
return pod != null;
}
@Override
public boolean requiresFruitBlocks() {
return pod != null;
}
@Override
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z) {
return pod != null
&& world.rand.nextFloat() <= genome.getSappiness()
&& Binnie.Genetics.getTreeRoot().setFruitBlock(world, (IAlleleFruit) genome.getActiveAllele(EnumTreeChromosome.FRUITS), genome.getSappiness(), pod.getTextures(), x, y, z);
}
@Override
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z) {
return pod != null
&& world.rand.nextFloat() <= genome.getSappiness()
&& Binnie.Genetics.getTreeRoot()
.setFruitBlock(
world,
(IAlleleFruit) genome.getActiveAllele(EnumTreeChromosome.FRUITS),
genome.getSappiness(),
pod.getTextures(),
x,
y,
z);
}
@Override
public short getIconIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy) {
return index.getIndex();
}
@Override
public short getIconIndex(
ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy) {
return index.getIndex();
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
if (ordinal() == 0) {
for (FruitSprite sprite : FruitSprite.values()) {
sprite.registerIcons(register);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
if (ordinal() == 0) {
for (FruitSprite sprite : FruitSprite.values()) {
sprite.registerIcons(register);
}
}
}
@Override
public String getName() {
return I18N.localise("for." + getDescription());
}
@Override
public String getName() {
return I18N.localise("for." + getDescription());
}
public String getNameOfFruit() {
if (this == ExtraTreeFruitGene.Apple) {
return "Apple";
}
public String getNameOfFruit() {
if (this == ExtraTreeFruitGene.Apple) {
return "Apple";
}
for (ItemStack stack : products.keySet()) {
if (stack.getItem() == ExtraTrees.itemFood) {
return Food.values()[stack.getItemDamage()].toString();
}
}
return "NoFruit";
}
for (ItemStack stack : products.keySet()) {
if (stack.getItem() == ExtraTrees.itemFood) {
return Food.values()[stack.getItemDamage()].toString();
}
}
return "NoFruit";
}
@Override
public String getUnlocalizedName() {
return getUID();
}
@Override
public String getUnlocalizedName() {
return getUID();
}
}
@@ -8,229 +8,247 @@ import forestry.api.arboriculture.ITreeMutation;
import forestry.api.arboriculture.ITreeRoot;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
public class ExtraTreeMutation implements ITreeMutation {
protected int chance;
protected boolean isSecret;
protected IAlleleTreeSpecies allele0;
protected IAlleleTreeSpecies allele1;
protected IAllele[] template;
protected int chance;
protected boolean isSecret;
protected IAlleleTreeSpecies allele0;
protected IAlleleTreeSpecies allele1;
protected IAllele[] template;
private float minTemperature;
private float maxTemperature;
private float minRainfall;
private float maxRainfall;
private float height;
private float minTemperature;
private float maxTemperature;
private float minRainfall;
private float maxRainfall;
private float height;
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele result, int chance) {
this(allele0, allele1, Binnie.Genetics.getTreeRoot().getTemplate(result.getUID()), chance);
}
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele result, int chance) {
this(allele0, allele1, Binnie.Genetics.getTreeRoot().getTemplate(result.getUID()), chance);
}
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele[] template, int chance) {
isSecret = false;
minTemperature = 0.0f;
maxTemperature = 2.0f;
minRainfall = 0.0f;
maxRainfall = 2.0f;
height = -1.0f;
this.allele0 = (IAlleleTreeSpecies) allele0;
this.allele1 = (IAlleleTreeSpecies) allele1;
this.template = template;
this.chance = chance;
Binnie.Genetics.getTreeRoot().registerMutation(this);
}
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele[] template, int chance) {
isSecret = false;
minTemperature = 0.0f;
maxTemperature = 2.0f;
minRainfall = 0.0f;
maxRainfall = 2.0f;
height = -1.0f;
this.allele0 = (IAlleleTreeSpecies) allele0;
this.allele1 = (IAlleleTreeSpecies) allele1;
this.template = template;
this.chance = chance;
Binnie.Genetics.getTreeRoot().registerMutation(this);
}
public static void init() {
IAlleleTreeSpecies lemon = (IAlleleTreeSpecies) getVanilla("Lemon");
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.KeyLime, 10);
new ExtraTreeMutation(ExtraTreeSpecies.KeyLime, lemon, ExtraTreeSpecies.FingerLime, 10);
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.Pomelo, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, getVanilla("Cherry"), ExtraTreeSpecies.Manderin, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, lemon, ExtraTreeSpecies.Citron, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Manderin, getVanilla("Cherry"), ExtraTreeSpecies.Kumquat, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Orange, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Citron, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.BuddhaHand, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Tangerine, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Satsuma, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Orange, ExtraTreeSpecies.Grapefruit, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.KeyLime, ExtraTreeSpecies.Lime, 10);
new ExtraTreeMutation(getVanilla("Oak"), getVanilla("Cherry"), ExtraTreeSpecies.OrchardApple, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Maple"), ExtraTreeSpecies.SweetCrabapple, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, ExtraTreeSpecies.SweetCrabapple, ExtraTreeSpecies.FloweringCrabapple, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.PrairieCrabapple, 10);
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.OrchardApple, ExtraTreeSpecies.Blackthorn, 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Cherry"), ExtraTreeSpecies.CherryPlum, 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Chestnut"), ExtraTreeSpecies.Peach, 10);
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Nectarine, 10);
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Apricot, 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Walnut"), ExtraTreeSpecies.Almond, 10);
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Cherry"), ExtraTreeSpecies.WildCherry, 10);
new ExtraTreeMutation(getVanilla("Willow"), getVanilla("Cherry"), ExtraTreeSpecies.SourCherry, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Cherry"), ExtraTreeSpecies.BlackCherry, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.Banana, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Kapok"), ExtraTreeSpecies.RedBanana, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Teak"), ExtraTreeSpecies.Plantain, 10);
new ExtraTreeMutation(getVanilla("Birch"), getVanilla("Oak"), ExtraTreeSpecies.Beech, 10);
new ExtraTreeMutation(getVanilla("Birch"), ExtraTreeSpecies.Beech, ExtraTreeSpecies.Alder, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Hazel, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Hawthorn, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Elder, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Holly, 10);
new ExtraTreeMutation(getVanilla("Willow"), ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Sallow, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Birch"), ExtraTreeSpecies.Pecan, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Spruce"), ExtraTreeSpecies.CopperBeech, 10);
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Spruce"), ExtraTreeSpecies.Ash, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Birch"), ExtraTreeSpecies.Whitebeam, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Pine"), ExtraTreeSpecies.Elm, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Larch"), ExtraTreeSpecies.Hornbeam, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Maple"), ExtraTreeSpecies.Sycamore, 10);
new ExtraTreeMutation(getVanilla("Larch"), getVanilla("Spruce"), ExtraTreeSpecies.Yew, 10);
new ExtraTreeMutation(getVanilla("Larch"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.BalsamFir, 10);
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.BalsamFir, ExtraTreeSpecies.Fir, 10);
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.Fir, ExtraTreeSpecies.Hemlock, 10).setHeight(80);
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Larch"), ExtraTreeSpecies.Cedar, 10).setHeight(60);
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Spruce"), ExtraTreeSpecies.DouglasFir, 10).setHeight(60);
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.Cypress, 10);
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.LoblollyPine, 10);
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Cherry"), ExtraTreeSpecies.Butternut, 10);
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Oak"), ExtraTreeSpecies.AcornOak, 10);
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.Olive, 10);
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Lime"), ExtraTreeSpecies.RedMaple, 10);
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Larch"), ExtraTreeSpecies.Sweetgum, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Lime"), ExtraTreeSpecies.Locust, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Teak"), ExtraTreeSpecies.Iroko, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.Pear, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.OldFustic, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OldFustic, getVanilla("Kapok"), ExtraTreeSpecies.OsangeOsange, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Brazilwood, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Brazilwood, getVanilla("Kapok"), ExtraTreeSpecies.Purpleheart, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Rosewood, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Rosewood, getVanilla("Kapok"), ExtraTreeSpecies.Logwood, 10);
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Gingko, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Jungle"), ExtraTreeSpecies.Brazilnut, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.RoseGum, 10);
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Mahogony"), ExtraTreeSpecies.SwampGum, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Coffee, getVanilla("Teak"), ExtraTreeSpecies.Clove, 10);
new ExtraTreeMutation(getVanilla("Cherry"), getVanilla("Jungle"), ExtraTreeSpecies.Coffee, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Holly, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Box, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hemlock, getVanilla("Jungle"), ExtraTreeSpecies.MonkeyPuzzle, 10);
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Balsa"), ExtraTreeSpecies.RainbowGum, 10);
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, ExtraTreeSpecies.Brazilwood, ExtraTreeSpecies.PinkIvory, 10);
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Raspberry, 10);
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Redcurrant, 10);
new ExtraTreeMutation(ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Redcurrant, ExtraTreeSpecies.Blackcurrant, 10);
new ExtraTreeMutation(ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blackberry, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blueberry, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.CherryPlum, ExtraTreeSpecies.Cranberry, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Fir, ExtraTreeSpecies.Juniper, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Lime, ExtraTreeSpecies.Gooseberry, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Orange, ExtraTreeSpecies.GoldenRaspberry, 10);
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Rosewood, ExtraTreeSpecies.Cinnamon, 10);
new ExtraTreeMutation(getVanilla("Balsa"), ExtraTreeSpecies.Brazilnut, ExtraTreeSpecies.Coconut, 10);
new ExtraTreeMutation(getVanilla("Teak"), getVanilla("Oak"), ExtraTreeSpecies.Cashew, 10);
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Oak"), ExtraTreeSpecies.Avacado, 10);
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Nutmeg, 10);
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Allspice, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Allspice, ExtraTreeSpecies.Clove, ExtraTreeSpecies.StarAnise, 10);
new ExtraTreeMutation(getVanilla("Jungle"), ExtraTreeSpecies.Orange, ExtraTreeSpecies.Mango, 10);
new ExtraTreeMutation(ExtraTreeSpecies.StarAnise, ExtraTreeSpecies.Mango, ExtraTreeSpecies.Starfruit, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Candlenut, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Chilli, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Alder, ExtraTreeSpecies.DwarfHazel, 10);
}
public static void init() {
IAlleleTreeSpecies lemon = (IAlleleTreeSpecies) getVanilla("Lemon");
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.KeyLime, 10);
new ExtraTreeMutation(ExtraTreeSpecies.KeyLime, lemon, ExtraTreeSpecies.FingerLime, 10);
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.Pomelo, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, getVanilla("Cherry"), ExtraTreeSpecies.Manderin, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, lemon, ExtraTreeSpecies.Citron, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Manderin, getVanilla("Cherry"), ExtraTreeSpecies.Kumquat, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Orange, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Citron, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.BuddhaHand, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Tangerine, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Satsuma, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Orange, ExtraTreeSpecies.Grapefruit, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.KeyLime, ExtraTreeSpecies.Lime, 10);
new ExtraTreeMutation(getVanilla("Oak"), getVanilla("Cherry"), ExtraTreeSpecies.OrchardApple, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Maple"), ExtraTreeSpecies.SweetCrabapple, 10);
new ExtraTreeMutation(
ExtraTreeSpecies.OrchardApple,
ExtraTreeSpecies.SweetCrabapple,
ExtraTreeSpecies.FloweringCrabapple,
10);
new ExtraTreeMutation(
ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.PrairieCrabapple, 10);
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.OrchardApple, ExtraTreeSpecies.Blackthorn, 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Cherry"), ExtraTreeSpecies.CherryPlum, 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Chestnut"), ExtraTreeSpecies.Peach, 10);
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Nectarine, 10);
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Apricot, 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Walnut"), ExtraTreeSpecies.Almond, 10);
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Cherry"), ExtraTreeSpecies.WildCherry, 10);
new ExtraTreeMutation(getVanilla("Willow"), getVanilla("Cherry"), ExtraTreeSpecies.SourCherry, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Cherry"), ExtraTreeSpecies.BlackCherry, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.Banana, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Kapok"), ExtraTreeSpecies.RedBanana, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Teak"), ExtraTreeSpecies.Plantain, 10);
new ExtraTreeMutation(getVanilla("Birch"), getVanilla("Oak"), ExtraTreeSpecies.Beech, 10);
new ExtraTreeMutation(getVanilla("Birch"), ExtraTreeSpecies.Beech, ExtraTreeSpecies.Alder, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Hazel, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Hawthorn, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Elder, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Holly, 10);
new ExtraTreeMutation(getVanilla("Willow"), ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Sallow, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Birch"), ExtraTreeSpecies.Pecan, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Spruce"), ExtraTreeSpecies.CopperBeech, 10);
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Spruce"), ExtraTreeSpecies.Ash, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Birch"), ExtraTreeSpecies.Whitebeam, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Pine"), ExtraTreeSpecies.Elm, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Larch"), ExtraTreeSpecies.Hornbeam, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Maple"), ExtraTreeSpecies.Sycamore, 10);
new ExtraTreeMutation(getVanilla("Larch"), getVanilla("Spruce"), ExtraTreeSpecies.Yew, 10);
new ExtraTreeMutation(getVanilla("Larch"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.BalsamFir, 10);
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.BalsamFir, ExtraTreeSpecies.Fir, 10);
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.Fir, ExtraTreeSpecies.Hemlock, 10).setHeight(80);
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Larch"), ExtraTreeSpecies.Cedar, 10).setHeight(60);
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Spruce"), ExtraTreeSpecies.DouglasFir, 10)
.setHeight(60);
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.Cypress, 10);
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.LoblollyPine, 10);
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Cherry"), ExtraTreeSpecies.Butternut, 10);
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Oak"), ExtraTreeSpecies.AcornOak, 10);
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.Olive, 10);
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Lime"), ExtraTreeSpecies.RedMaple, 10);
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Larch"), ExtraTreeSpecies.Sweetgum, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Lime"), ExtraTreeSpecies.Locust, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Teak"), ExtraTreeSpecies.Iroko, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.Pear, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.OldFustic, 10);
new ExtraTreeMutation(ExtraTreeSpecies.OldFustic, getVanilla("Kapok"), ExtraTreeSpecies.OsangeOsange, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Brazilwood, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Brazilwood, getVanilla("Kapok"), ExtraTreeSpecies.Purpleheart, 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Rosewood, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Rosewood, getVanilla("Kapok"), ExtraTreeSpecies.Logwood, 10);
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Gingko, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Jungle"), ExtraTreeSpecies.Brazilnut, 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.RoseGum, 10);
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Mahogony"), ExtraTreeSpecies.SwampGum, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Coffee, getVanilla("Teak"), ExtraTreeSpecies.Clove, 10);
new ExtraTreeMutation(getVanilla("Cherry"), getVanilla("Jungle"), ExtraTreeSpecies.Coffee, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Holly, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Box, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hemlock, getVanilla("Jungle"), ExtraTreeSpecies.MonkeyPuzzle, 10);
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Balsa"), ExtraTreeSpecies.RainbowGum, 10);
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, ExtraTreeSpecies.Brazilwood, ExtraTreeSpecies.PinkIvory, 10);
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Raspberry, 10);
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Redcurrant, 10);
new ExtraTreeMutation(
ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Redcurrant, ExtraTreeSpecies.Blackcurrant, 10);
new ExtraTreeMutation(
ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blackberry, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blueberry, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.CherryPlum, ExtraTreeSpecies.Cranberry, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Fir, ExtraTreeSpecies.Juniper, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Lime, ExtraTreeSpecies.Gooseberry, 10);
new ExtraTreeMutation(
ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Orange, ExtraTreeSpecies.GoldenRaspberry, 10);
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Rosewood, ExtraTreeSpecies.Cinnamon, 10);
new ExtraTreeMutation(getVanilla("Balsa"), ExtraTreeSpecies.Brazilnut, ExtraTreeSpecies.Coconut, 10);
new ExtraTreeMutation(getVanilla("Teak"), getVanilla("Oak"), ExtraTreeSpecies.Cashew, 10);
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Oak"), ExtraTreeSpecies.Avacado, 10);
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Nutmeg, 10);
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Allspice, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Allspice, ExtraTreeSpecies.Clove, ExtraTreeSpecies.StarAnise, 10);
new ExtraTreeMutation(getVanilla("Jungle"), ExtraTreeSpecies.Orange, ExtraTreeSpecies.Mango, 10);
new ExtraTreeMutation(ExtraTreeSpecies.StarAnise, ExtraTreeSpecies.Mango, ExtraTreeSpecies.Starfruit, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Candlenut, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Chilli, 10);
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Alder, ExtraTreeSpecies.DwarfHazel, 10);
}
public static IAllele getVanilla(String uid) {
IAllele allele = AlleleManager.alleleRegistry.getAllele("forestry.tree" + uid);
if (allele == null) {
throw new RuntimeException("No forestry species with id " + uid);
}
return allele;
}
public static IAllele getVanilla(String uid) {
IAllele allele = AlleleManager.alleleRegistry.getAllele("forestry.tree" + uid);
if (allele == null) {
throw new RuntimeException("No forestry species with id " + uid);
}
return allele;
}
public ExtraTreeMutation setHeight(int minHeight) {
height = minHeight;
return this;
}
public ExtraTreeMutation setHeight(int minHeight) {
height = minHeight;
return this;
}
@Override
public IAlleleTreeSpecies getAllele0() {
return allele0;
}
@Override
public IAlleleTreeSpecies getAllele0() {
return allele0;
}
@Override
public IAlleleTreeSpecies getAllele1() {
return allele1;
}
@Override
public IAlleleTreeSpecies getAllele1() {
return allele1;
}
@Override
public float getBaseChance() {
return chance;
}
@Override
public float getBaseChance() {
return chance;
}
@Override
public IAllele[] getTemplate() {
return template;
}
@Override
public IAllele[] getTemplate() {
return template;
}
@Override
public boolean isPartner(IAllele allele) {
return allele0.getUID().equals(allele.getUID()) || allele1.getUID().equals(allele.getUID());
}
@Override
public boolean isPartner(IAllele allele) {
return allele0.getUID().equals(allele.getUID()) || allele1.getUID().equals(allele.getUID());
}
@Override
public IAllele getPartner(IAllele allele) {
if (allele0.getUID().equals(allele.getUID())) {
return allele1;
}
return allele0;
}
@Override
public IAllele getPartner(IAllele allele) {
if (allele0.getUID().equals(allele.getUID())) {
return allele1;
}
return allele0;
}
@Override
public boolean isSecret() {
return isSecret;
}
@Override
public boolean isSecret() {
return isSecret;
}
@Override
public float getChance(World world, int x, int y, int z, IAlleleTreeSpecies allele0, IAlleleTreeSpecies allele1, ITreeGenome genome0, ITreeGenome genome1) {
int processedChance = chance;
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);
if (biome.temperature < minTemperature || biome.temperature > maxTemperature) {
return 0.0f;
}
if (biome.rainfall < minRainfall || biome.rainfall > maxRainfall) {
return 0.0f;
}
if (height > 0.0f && y < height) {
return 0.0f;
}
if (this.allele0.getUID().equals(allele0.getUID()) && this.allele1.getUID().equals(allele1.getUID())) {
return processedChance;
}
if (this.allele1.getUID().equals(allele0.getUID()) && this.allele0.getUID().equals(allele1.getUID())) {
return processedChance;
}
return 0.0f;
}
@Override
public float getChance(
World world,
int x,
int y,
int z,
IAlleleTreeSpecies allele0,
IAlleleTreeSpecies allele1,
ITreeGenome genome0,
ITreeGenome genome1) {
int processedChance = chance;
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);
if (biome.temperature < minTemperature || biome.temperature > maxTemperature) {
return 0.0f;
}
if (biome.rainfall < minRainfall || biome.rainfall > maxRainfall) {
return 0.0f;
}
if (height > 0.0f && y < height) {
return 0.0f;
}
if (this.allele0.getUID().equals(allele0.getUID())
&& this.allele1.getUID().equals(allele1.getUID())) {
return processedChance;
}
if (this.allele1.getUID().equals(allele0.getUID())
&& this.allele0.getUID().equals(allele1.getUID())) {
return processedChance;
}
return 0.0f;
}
@Override
public Collection<String> getSpecialConditions() {
List<String> conditions = new ArrayList<>();
if (height > 0.0f) {
conditions.add(I18N.localise("extratrees.genetics.requirements.height", height));
}
return conditions;
}
@Override
public Collection<String> getSpecialConditions() {
List<String> conditions = new ArrayList<>();
if (height > 0.0f) {
conditions.add(I18N.localise("extratrees.genetics.requirements.height", height));
}
return conditions;
}
@Override
public ITreeRoot getRoot() {
return Binnie.Genetics.getTreeRoot();
}
@Override
public ITreeRoot getRoot() {
return Binnie.Genetics.getTreeRoot();
}
}
File diff suppressed because it is too large. Load diff
@@ -10,32 +10,33 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public enum FruitSprite implements IIconProvider {
Tiny,
Small,
Average,
Large,
Larger,
Pear;
Tiny,
Small,
Average,
Large,
Larger,
Pear;
protected BinnieIcon icon;
protected BinnieIcon icon;
public short getIndex() {
return (short) (ordinal() + 4200);
}
public short getIndex() {
return (short) (ordinal() + 4200);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(short texUID) {
int index = texUID - 4200;
if (index >= 0 && index < values().length) {
return values()[index].icon.getIcon();
}
return null;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(short texUID) {
int index = texUID - 4200;
if (index >= 0 && index < values().length) {
return values()[index].icon.getIcon();
}
return null;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
icon = Binnie.Resource.getBlockIcon(ExtraTrees.instance, "fruit/" + toString().toLowerCase());
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
icon = Binnie.Resource.getBlockIcon(
ExtraTrees.instance, "fruit/" + toString().toLowerCase());
}
}
@@ -1,22 +1,22 @@
package binnie.extratrees.genetics;
public enum LeafType {
NORMAL((short) 10, (short) 11, (short) 12, "Deciduous"),
CONIFER((short) 15, (short) 16, (short) 17, "Conifers"),
JUNGLE((short) 20, (short) 21, (short) 22, "Jungle"),
WILLOW((short) 25, (short) 26, (short) 27, "Willow"),
MAPLE((short) 30, (short) 31, (short) 32, "Maple"),
PALM((short) 35, (short) 36, (short) 37, "Palm");
NORMAL((short) 10, (short) 11, (short) 12, "Deciduous"),
CONIFER((short) 15, (short) 16, (short) 17, "Conifers"),
JUNGLE((short) 20, (short) 21, (short) 22, "Jungle"),
WILLOW((short) 25, (short) 26, (short) 27, "Willow"),
MAPLE((short) 30, (short) 31, (short) 32, "Maple"),
PALM((short) 35, (short) 36, (short) 37, "Palm");
public short fancyUID;
public short plainUID;
public short changedUID;
public String description;
public short fancyUID;
public short plainUID;
public short changedUID;
public String description;
LeafType(short fancyUID, short plainUID, short changedUID, String description) {
this.fancyUID = fancyUID;
this.plainUID = plainUID;
this.changedUID = changedUID;
this.description = description;
}
LeafType(short fancyUID, short plainUID, short changedUID, String description) {
this.fancyUID = fancyUID;
this.plainUID = plainUID;
this.changedUID = changedUID;
this.description = description;
}
}
@@ -5,117 +5,120 @@ import binnie.core.BinnieCore;
import binnie.core.IInitializable;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IClassification;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class ModuleGenetics implements IInitializable {
protected String[] branches;
protected List<List<String>> classifications;
protected String[] branches;
protected List<List<String>> classifications;
public ModuleGenetics() {
branches = new String[]{
"Malus Maleae Amygdaloideae Rosaceae",
"Musa Musaceae Zingiberales Commelinids Angiosperms",
"Sorbus Maleae",
"Tsuga Pinaceae",
"Fraxinus Oleeae Oleaceae Lamiales Asterids Angiospems"
};
classifications = new ArrayList<>();
}
public ModuleGenetics() {
branches = new String[] {
"Malus Maleae Amygdaloideae Rosaceae",
"Musa Musaceae Zingiberales Commelinids Angiosperms",
"Sorbus Maleae",
"Tsuga Pinaceae",
"Fraxinus Oleeae Oleaceae Lamiales Asterids Angiospems"
};
classifications = new ArrayList<>();
}
@Override
public void preInit() {
for (ExtraTreeFruitGene fruit : ExtraTreeFruitGene.values()) {
AlleleManager.alleleRegistry.registerAllele(fruit);
}
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
AlleleManager.alleleRegistry.registerAllele(species);
}
}
@Override
public void preInit() {
for (ExtraTreeFruitGene fruit : ExtraTreeFruitGene.values()) {
AlleleManager.alleleRegistry.registerAllele(fruit);
}
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
AlleleManager.alleleRegistry.registerAllele(species);
}
}
@Override
public void init() {
// ignored
}
@Override
public void init() {
// ignored
}
@Override
public void postInit() {
ExtraTreeSpecies.init();
ExtraTreeFruitGene.init();
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
Binnie.Genetics.getTreeRoot().registerTemplate(species.getTemplate());
}
@Override
public void postInit() {
ExtraTreeSpecies.init();
ExtraTreeFruitGene.init();
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
Binnie.Genetics.getTreeRoot().registerTemplate(species.getTemplate());
}
ExtraTreeMutation.init();
if (!BinnieCore.isLepidopteryActive()) {
return;
}
ExtraTreeMutation.init();
if (!BinnieCore.isLepidopteryActive()) {
return;
}
for (ButterflySpecies species2 : ButterflySpecies.values()) {
AlleleManager.alleleRegistry.registerAllele(species2);
Binnie.Genetics.getButterflyRoot().registerTemplate(species2.getTemplate());
String scientific = species2.branchName.substring(0, 1).toUpperCase() + species2.branchName.substring(1).toLowerCase();
String uid = "trees." + species2.branchName.toLowerCase();
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
if (branch == null) {
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
}
(species2.branch = branch).addMemberSpecies(species2);
}
}
for (ButterflySpecies species2 : ButterflySpecies.values()) {
AlleleManager.alleleRegistry.registerAllele(species2);
Binnie.Genetics.getButterflyRoot().registerTemplate(species2.getTemplate());
String scientific = species2.branchName.substring(0, 1).toUpperCase()
+ species2.branchName.substring(1).toLowerCase();
String uid = "trees." + species2.branchName.toLowerCase();
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
if (branch == null) {
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(
IClassification.EnumClassLevel.GENUS, uid, scientific);
}
(species2.branch = branch).addMemberSpecies(species2);
}
}
private void generateBranches() {
for (String hierarchy : branches) {
List<String> set = new ArrayList<>();
for (String string : hierarchy.split(" ", 0)) {
set.add(string.toLowerCase());
}
classifications.add(set);
}
private void generateBranches() {
for (String hierarchy : branches) {
List<String> set = new ArrayList<>();
for (String string : hierarchy.split(" ", 0)) {
set.add(string.toLowerCase());
}
classifications.add(set);
}
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
IClassification branch = getOrCreateClassification(IClassification.EnumClassLevel.GENUS, species.branchName);
branch.addMemberSpecies(species);
species.branch = branch;
IClassification clss = branch;
int currentLevel = IClassification.EnumClassLevel.GENUS.ordinal();
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
IClassification branch =
getOrCreateClassification(IClassification.EnumClassLevel.GENUS, species.branchName);
branch.addMemberSpecies(species);
species.branch = branch;
IClassification clss = branch;
int currentLevel = IClassification.EnumClassLevel.GENUS.ordinal();
while (clss.getParent() == null) {
for (List<String> set2 : classifications) {
if (set2.contains(clss.getScientific().toLowerCase())) {
String nextLevel = "";
int index = set2.indexOf(clss.getScientific().toLowerCase()) + 1;
while (nextLevel.length() == 0) {
try {
nextLevel = set2.get(index++);
} catch (IndexOutOfBoundsException ex) {
throw new RuntimeException("Reached end point at " + set2.get(index - 2));
}
currentLevel--;
}
while (clss.getParent() == null) {
for (List<String> set2 : classifications) {
if (set2.contains(clss.getScientific().toLowerCase())) {
String nextLevel = "";
int index = set2.indexOf(clss.getScientific().toLowerCase()) + 1;
while (nextLevel.length() == 0) {
try {
nextLevel = set2.get(index++);
} catch (IndexOutOfBoundsException ex) {
throw new RuntimeException("Reached end point at " + set2.get(index - 2));
}
currentLevel--;
}
IClassification parent = getOrCreateClassification(IClassification.EnumClassLevel.values()[currentLevel], nextLevel);
parent.addMemberGroup(clss);
System.out.println("Went from " + clss.getScientific() + " to " + parent.getScientific());
clss = parent;
break;
}
}
}
}
}
IClassification parent = getOrCreateClassification(
IClassification.EnumClassLevel.values()[currentLevel], nextLevel);
parent.addMemberGroup(clss);
System.out.println("Went from " + clss.getScientific() + " to " + parent.getScientific());
clss = parent;
break;
}
}
}
}
}
private IClassification getOrCreateClassification(IClassification.EnumClassLevel level, String name) {
if (level == IClassification.EnumClassLevel.GENUS) {
name = "trees." + name;
}
private IClassification getOrCreateClassification(IClassification.EnumClassLevel level, String name) {
if (level == IClassification.EnumClassLevel.GENUS) {
name = "trees." + name;
}
String uid = level.name().toLowerCase(Locale.ENGLISH) + "." + name.toLowerCase();
if (AlleleManager.alleleRegistry.getClassification(uid) != null) {
return AlleleManager.alleleRegistry.getClassification(uid);
}
return AlleleManager.alleleRegistry.createAndRegisterClassification(level, name.toLowerCase(), name);
}
String uid = level.name().toLowerCase(Locale.ENGLISH) + "." + name.toLowerCase();
if (AlleleManager.alleleRegistry.getClassification(uid) != null) {
return AlleleManager.alleleRegistry.getClassification(uid);
}
return AlleleManager.alleleRegistry.createAndRegisterClassification(level, name.toLowerCase(), name);
}
}
@@ -3,13 +3,13 @@ package binnie.extratrees.genetics;
import net.minecraft.util.IIcon;
public enum SaplingType {
DEFAULT,
JUNGLE,
CONIFER,
FRUIT,
POPLAR,
PALM,
SHRUB;
DEFAULT,
JUNGLE,
CONIFER,
FRUIT,
POPLAR,
PALM,
SHRUB;
public IIcon[] icon;
public IIcon[] icon;
}