mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 19:59:49 +00:00
Some localization and refactoring
Move binnie.extratrees.gen classes to binnie.extratrees.worldgen package Drop binnie.extratrees.gen package
This commit is contained in:
1 parent
0d8c5b9230
commit
47cca224df
47 files changed
+643
-555
No files matched your search
@@ -3,11 +3,11 @@ package binnie.botany.genetics;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
|
||||
public class AlleleColor implements IAlleleInteger {
|
||||
protected String uid;
|
||||
protected boolean dominant;
|
||||
protected String name;
|
||||
protected int value;
|
||||
protected EnumFlowerColor color;
|
||||
private String uid;
|
||||
private String name;
|
||||
private int value;
|
||||
private EnumFlowerColor color;
|
||||
private boolean dominant = true;
|
||||
|
||||
public AlleleColor(EnumFlowerColor color, String uid, String name, int value) {
|
||||
this.color = color;
|
||||
@@ -23,7 +23,7 @@ public class AlleleColor implements IAlleleInteger {
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
return dominant;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,8 @@ package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.api.IAlleleFlowerEffect;
|
||||
import binnie.botany.api.IFlowerGenome;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -28,7 +30,7 @@ public class AlleleEffectNone implements IAlleleFlowerEffect {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "None";
|
||||
return I18N.localise(BinnieCore.instance, "allele.none");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
@@ -20,7 +19,6 @@ import forestry.api.core.IIconProvider;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleRegistry;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
@@ -597,18 +595,17 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
|
||||
public IAllele[] getTemplate() {
|
||||
forestry.core.genetics.alleles.AlleleHelper alleleHelper = forestry.core.genetics.alleles.AlleleHelper.instance;
|
||||
IAlleleRegistry alleleRegistry = AlleleManager.alleleRegistry;
|
||||
IAllele[] template = FlowerTemplates.getDefaultTemplate();
|
||||
template[0] = this;
|
||||
alleleHelper.set(template, EnumFlowerChromosome.PRIMARY, primaryColor.getAllele());
|
||||
alleleHelper.set(template, EnumFlowerChromosome.SECONDARY, secondaryColor.getAllele());
|
||||
alleleHelper.set(template, EnumFlowerChromosome.TEMPERATURE_TOLERANCE, Binnie.Genetics.getToleranceAllele(tempTolerance));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.PH_TOLERANCE, Binnie.Genetics.getToleranceAllele(pHTolerance));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.HUMIDITY_TOLERANCE, Binnie.Genetics.getToleranceAllele(moistureTolerance));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.FERTILITY, alleleRegistry.getAllele(AlleleHelper.getUid(fert)));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.LIFESPAN, alleleRegistry.getAllele(AlleleHelper.getUid(life)));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.SAPPINESS, alleleRegistry.getAllele(AlleleHelper.getUid(sap)));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.STEM, stemColor.getAllele());
|
||||
alleleHelper.set(template, EnumFlowerChromosome.PRIMARY, AlleleHelper.getAllele(primaryColor));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.SECONDARY, AlleleHelper.getAllele(secondaryColor));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.TEMPERATURE_TOLERANCE, AlleleHelper.getAllele(tempTolerance));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.PH_TOLERANCE, AlleleHelper.getAllele(pHTolerance));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.HUMIDITY_TOLERANCE, AlleleHelper.getAllele(moistureTolerance));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.FERTILITY, AlleleHelper.getAllele(fert));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.LIFESPAN, AlleleHelper.getAllele(life));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.SAPPINESS, AlleleHelper.getAllele(sap));
|
||||
alleleHelper.set(template, EnumFlowerChromosome.STEM, AlleleHelper.getAllele(stemColor));
|
||||
return template;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.core.genetics.alleles.EnumAllele;
|
||||
|
||||
public class FlowerTemplates {
|
||||
public static IAllele[] getDefaultTemplate() {
|
||||
IAllele[] alleles = new IAllele[EnumFlowerChromosome.values().length];
|
||||
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.POPPY;
|
||||
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = EnumFlowerColor.RED.getAllele();
|
||||
alleles[EnumFlowerChromosome.SECONDARY.ordinal()] = EnumFlowerColor.RED.getAllele();
|
||||
alleles[EnumFlowerChromosome.FERTILITY.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.fertilityNormal");
|
||||
alleles[EnumFlowerChromosome.TERRITORY.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.territoryDefault");
|
||||
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||
alleles[EnumFlowerChromosome.SECONDARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||
alleles[EnumFlowerChromosome.FERTILITY.ordinal()] = AlleleHelper.getAllele(EnumAllele.Fertility.NORMAL);
|
||||
alleles[EnumFlowerChromosome.TERRITORY.ordinal()] = AlleleHelper.getAllele(EnumAllele.Territory.AVERAGE);
|
||||
alleles[EnumFlowerChromosome.EFFECT.ordinal()] = ModuleGenetics.alleleEffectNone;
|
||||
alleles[EnumFlowerChromosome.LIFESPAN.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.lifespanNormal");
|
||||
alleles[EnumFlowerChromosome.TEMPERATURE_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.toleranceNone");
|
||||
alleles[EnumFlowerChromosome.HUMIDITY_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.toleranceNone");
|
||||
alleles[EnumFlowerChromosome.PH_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.toleranceNone");
|
||||
alleles[EnumFlowerChromosome.SAPPINESS.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.sappinessAverage");
|
||||
alleles[EnumFlowerChromosome.STEM.ordinal()] = EnumFlowerColor.GREEN.getAllele();
|
||||
alleles[EnumFlowerChromosome.LIFESPAN.ordinal()] = AlleleHelper.getAllele(EnumAllele.Lifespan.NORMAL);
|
||||
alleles[EnumFlowerChromosome.TEMPERATURE_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||
alleles[EnumFlowerChromosome.HUMIDITY_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||
alleles[EnumFlowerChromosome.PH_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||
alleles[EnumFlowerChromosome.SAPPINESS.ordinal()] = AlleleHelper.getAllele(EnumAllele.Sappiness.AVERAGE);
|
||||
alleles[EnumFlowerChromosome.STEM.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.GREEN);
|
||||
return alleles;
|
||||
}
|
||||
}
|
||||
@@ -115,8 +115,8 @@ class FlowerBreedingSystem extends BreedingSystem {
|
||||
case PRIMARY:
|
||||
case SECONDARY:
|
||||
case STEM:
|
||||
for (EnumFlowerColor a4 : EnumFlowerColor.values()) {
|
||||
alleles.add(a4.getAllele());
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
alleles.add(color.getAllele());
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -110,10 +110,6 @@ public class ManagerGenetics extends ManagerBase {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IAllele getToleranceAllele(EnumTolerance tol) {
|
||||
return AlleleManager.alleleRegistry.getAllele(Tolerance.values()[tol.ordinal()].getUID());
|
||||
}
|
||||
|
||||
public int[] getTolerance(EnumTolerance tol) {
|
||||
return Tolerance.values()[tol.ordinal()].getBounds();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
public enum EnumBeeSpeciesState {
|
||||
ACTIVE,
|
||||
INACTIVE,
|
||||
DEPRECATED
|
||||
}
|
||||
@@ -46,25 +46,26 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
// TODO drop this and replace for ExtraBeeDefinition
|
||||
public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
ARID("aridus", 12511316),
|
||||
BARREN("infelix", 14733923),
|
||||
DESOLATE("desolo", 13744272),
|
||||
GNAWING("apica", 15234224),
|
||||
ROTTEN("caries", 12574902),
|
||||
BONE("os", 15330792),
|
||||
CREEPER("erepo", 2942485),
|
||||
DECOMPOSING("aegrus", 5388049),
|
||||
ROCK("saxum", 11053224),
|
||||
STONE("lapis", 7697781),
|
||||
GRANITE("granum", 6903125),
|
||||
MINERAL("minerale", 7239037),
|
||||
COPPER("cuprous", 13722376),
|
||||
TIN("stannus", 12431805),
|
||||
IRON("ferrous", 11038808),
|
||||
LEAD("plumbous", 11373483),
|
||||
ZINC("spelta", 15592447),
|
||||
TITANIUM("titania", 11578083),
|
||||
ARID("aridus", 0xbee854),
|
||||
BARREN("infelix", 0xe0d263),
|
||||
DESOLATE("desolo", 0xd1b890),
|
||||
GNAWING("apica", 0xe874b0),
|
||||
ROTTEN("caries", 0xbfe0b6),
|
||||
BONE("os", 0xe9ede8),
|
||||
CREEPER("erepo", 0x2ce615),
|
||||
DECOMPOSING("aegrus", 0x523711),
|
||||
ROCK("saxum", 0xa8a8a8),
|
||||
STONE("lapis", 0x757575),
|
||||
GRANITE("granum", 0x695555),
|
||||
MINERAL("minerale", 0x6e757d),
|
||||
COPPER("cuprous", 0xd16308),
|
||||
TIN("stannus", 0xbdb1bd),
|
||||
IRON("ferrous", 0xa87058),
|
||||
LEAD("plumbous", 0xad8bab),
|
||||
ZINC("spelta", 0xedebff),
|
||||
TITANIUM("titania", 0xb0aae3),
|
||||
BRONZE,
|
||||
BRASS,
|
||||
STEEL,
|
||||
@@ -174,26 +175,26 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
BLUTONIUM("caruthus", 1769702),
|
||||
MYSTICAL("mystica", 4630306);
|
||||
|
||||
public HashMap<ItemStack, Float> allProducts;
|
||||
public HashMap<ItemStack, Float> allSpecialties;
|
||||
public State state;
|
||||
public HashMap<ItemStack, Float> allProducts = new LinkedHashMap<>();
|
||||
public HashMap<ItemStack, Float> allSpecialties = new LinkedHashMap<>();
|
||||
public EnumBeeSpeciesState state;
|
||||
|
||||
protected boolean nocturnal;
|
||||
protected boolean nocturnal = false;
|
||||
|
||||
private int primaryColor;
|
||||
private int secondaryColor;
|
||||
private EnumTemperature temperature;
|
||||
private EnumHumidity humidity;
|
||||
private boolean hasEffect;
|
||||
private boolean isSecret;
|
||||
private boolean isCounted;
|
||||
private int secondaryColor = 0xffdc16;
|
||||
private EnumTemperature temperature = EnumTemperature.NORMAL;
|
||||
private EnumHumidity humidity = EnumHumidity.NORMAL;
|
||||
private boolean hasEffect = false;
|
||||
private boolean isSecret = true;
|
||||
private boolean isCounted = true;
|
||||
private String binomial;
|
||||
private IClassification branch;
|
||||
private IClassification branch = null;
|
||||
private String uid;
|
||||
private Achievement achievement;
|
||||
private boolean dominant;
|
||||
private HashMap<ItemStack, Float> products;
|
||||
private HashMap<ItemStack, Float> specialties;
|
||||
private Achievement achievement = null;
|
||||
private boolean dominant = true;
|
||||
private HashMap<ItemStack, Float> products = new LinkedHashMap<>();
|
||||
private HashMap<ItemStack, Float> specialties = new LinkedHashMap<>();
|
||||
private IAllele[] template;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -202,43 +203,15 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
ExtraBeesSpecies(String binomial, int color) {
|
||||
this.binomial = binomial;
|
||||
primaryColor = color;
|
||||
secondaryColor = 0xffdc16;
|
||||
temperature = EnumTemperature.NORMAL;
|
||||
humidity = EnumHumidity.NORMAL;
|
||||
hasEffect = false;
|
||||
isSecret = true;
|
||||
isCounted = true;
|
||||
branch = null;
|
||||
achievement = null;
|
||||
dominant = true;
|
||||
products = new LinkedHashMap<>();
|
||||
specialties = new LinkedHashMap<>();
|
||||
allProducts = new LinkedHashMap<>();
|
||||
allSpecialties = new LinkedHashMap<>();
|
||||
state = State.Active;
|
||||
nocturnal = false;
|
||||
state = EnumBeeSpeciesState.ACTIVE;
|
||||
uid = toString().toLowerCase();
|
||||
}
|
||||
|
||||
ExtraBeesSpecies() {
|
||||
primaryColor = 0xffffff;
|
||||
secondaryColor = 0xffdc16;
|
||||
temperature = EnumTemperature.NORMAL;
|
||||
humidity = EnumHumidity.NORMAL;
|
||||
hasEffect = false;
|
||||
isSecret = true;
|
||||
isCounted = true;
|
||||
binomial = "";
|
||||
branch = null;
|
||||
primaryColor = 0xffffff;
|
||||
state = EnumBeeSpeciesState.DEPRECATED;
|
||||
uid = "";
|
||||
achievement = null;
|
||||
dominant = true;
|
||||
products = new LinkedHashMap<>();
|
||||
specialties = new LinkedHashMap<>();
|
||||
allProducts = new LinkedHashMap<>();
|
||||
allSpecialties = new LinkedHashMap<>();
|
||||
nocturnal = false;
|
||||
state = State.Deprecated;
|
||||
}
|
||||
|
||||
public static IAllele[] getDefaultTemplate() {
|
||||
@@ -253,83 +226,96 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
int aridBody = 0xcbe374;
|
||||
int rockBody = 0x999999;
|
||||
|
||||
ExtraBeesSpecies.ARID.importTemplate(ForestryAllele.BeeSpecies.Modest);
|
||||
ExtraBeesSpecies.ARID.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
ExtraBeesSpecies.ARID.setHumidity(EnumHumidity.ARID);
|
||||
ExtraBeesSpecies.ARID.setFlowerProvider(ExtraBeesFlowers.DEAD.getUID());
|
||||
ExtraBeesSpecies.ARID.setTemperatureTolerance(EnumTolerance.UP_1);
|
||||
ExtraBeesSpecies.ARID.setSecondaryColor(aridBody);
|
||||
ExtraBeesSpecies.ARID
|
||||
.importTemplate(ForestryAllele.BeeSpecies.Modest)
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.30f)
|
||||
.setHumidity(EnumHumidity.ARID)
|
||||
.setFlowerProvider(ExtraBeesFlowers.DEAD.getUID())
|
||||
.setTemperatureTolerance(EnumTolerance.UP_1)
|
||||
.setSecondaryColor(aridBody);
|
||||
|
||||
ExtraBeesSpecies.BARREN.importTemplate(ExtraBeesSpecies.ARID);
|
||||
ExtraBeesSpecies.BARREN.setFertility(EnumAllele.Fertility.LOW);
|
||||
ExtraBeesSpecies.BARREN.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
ExtraBeesSpecies.BARREN
|
||||
.importTemplate(ExtraBeesSpecies.ARID)
|
||||
.setFertility(EnumAllele.Fertility.LOW)
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
|
||||
ExtraBeesSpecies.DESOLATE.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
ExtraBeesSpecies.DESOLATE.importTemplate(ExtraBeesSpecies.BARREN);
|
||||
ExtraBeesSpecies.DESOLATE.setEffect(ExtraBeesEffect.HUNGER.getUID());
|
||||
ExtraBeesSpecies.DESOLATE.recessive();
|
||||
ExtraBeesSpecies.DESOLATE.setNocturnal();
|
||||
ExtraBeesSpecies.DESOLATE.setHasEffect(true);
|
||||
ExtraBeesSpecies.DESOLATE
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.30f)
|
||||
.importTemplate(ExtraBeesSpecies.BARREN)
|
||||
.setEffect(ExtraBeesEffect.HUNGER.getUID())
|
||||
.recessive()
|
||||
.setNocturnal()
|
||||
.setHasEffect(true);
|
||||
|
||||
ExtraBeesSpecies.GNAWING.importTemplate(ExtraBeesSpecies.BARREN);
|
||||
ExtraBeesSpecies.GNAWING.setFlowerProvider(ExtraBeesFlowers.WOOD.getUID());
|
||||
ExtraBeesSpecies.GNAWING.addProduct(EnumHoneyComb.BARREN, 0.25f);
|
||||
ExtraBeesSpecies.GNAWING.addSpecialty(EnumHoneyComb.SAWDUST, 0.25f);
|
||||
ExtraBeesSpecies.GNAWING
|
||||
.importTemplate(ExtraBeesSpecies.BARREN)
|
||||
.setFlowerProvider(ExtraBeesFlowers.WOOD.getUID())
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.25f)
|
||||
.addSpecialty(EnumHoneyComb.SAWDUST, 0.25f);
|
||||
|
||||
ExtraBeesSpecies.ROTTEN.importTemplate(ExtraBeesSpecies.DESOLATE);
|
||||
ExtraBeesSpecies.ROTTEN.setNocturnal();
|
||||
ExtraBeesSpecies.ROTTEN.setCaveDwelling();
|
||||
ExtraBeesSpecies.ROTTEN.setTolerantFlyer();
|
||||
ExtraBeesSpecies.ROTTEN.setEffect(ExtraBeesEffect.SPAWN_ZOMBIE.getUID());
|
||||
ExtraBeesSpecies.ROTTEN.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
ExtraBeesSpecies.ROTTEN.addSpecialty(EnumHoneyComb.ROTTEN, 0.10f);
|
||||
ExtraBeesSpecies.ROTTEN
|
||||
.importTemplate(ExtraBeesSpecies.DESOLATE)
|
||||
.setNocturnal()
|
||||
.setCaveDwelling()
|
||||
.setTolerantFlyer()
|
||||
.setEffect(ExtraBeesEffect.SPAWN_ZOMBIE.getUID())
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.30f)
|
||||
.addSpecialty(EnumHoneyComb.ROTTEN, 0.10f);
|
||||
|
||||
ExtraBeesSpecies.BONE.importTemplate(ExtraBeesSpecies.ROTTEN);
|
||||
ExtraBeesSpecies.BONE.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
ExtraBeesSpecies.BONE.addSpecialty(EnumHoneyComb.BONE, 0.10f);
|
||||
ExtraBeesSpecies.BONE.setEffect(ExtraBeesEffect.SPAWN_SKELETON.getUID());
|
||||
ExtraBeesSpecies.BONE
|
||||
.importTemplate(ExtraBeesSpecies.ROTTEN)
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.30f)
|
||||
.addSpecialty(EnumHoneyComb.BONE, 0.10f)
|
||||
.setEffect(ExtraBeesEffect.SPAWN_SKELETON.getUID());
|
||||
|
||||
ExtraBeesSpecies.CREEPER.importTemplate(ExtraBeesSpecies.ROTTEN);
|
||||
ExtraBeesSpecies.CREEPER.setAllDay();
|
||||
ExtraBeesSpecies.CREEPER.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
ExtraBeesSpecies.CREEPER.addSpecialty(ItemHoneyComb.VanillaComb.POWDERY.get(), 0.08f);
|
||||
ExtraBeesSpecies.CREEPER.setEffect(ExtraBeesEffect.SPAWN_CREEPER.getUID());
|
||||
ExtraBeesSpecies.CREEPER
|
||||
.importTemplate(ExtraBeesSpecies.ROTTEN)
|
||||
.setAllDay()
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.30f)
|
||||
.addSpecialty(ItemHoneyComb.VanillaComb.POWDERY.get(), 0.08f)
|
||||
.setEffect(ExtraBeesEffect.SPAWN_CREEPER.getUID());
|
||||
|
||||
ExtraBeesSpecies.DECOMPOSING.importTemplate(ExtraBeesSpecies.BARREN);
|
||||
ExtraBeesSpecies.DECOMPOSING.addProduct(EnumHoneyComb.BARREN, 0.30f);
|
||||
ExtraBeesSpecies.DECOMPOSING.addSpecialty(EnumHoneyComb.COMPOST, 0.08f);
|
||||
ExtraBeesSpecies.DECOMPOSING
|
||||
.importTemplate(ExtraBeesSpecies.BARREN)
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.30f)
|
||||
.addSpecialty(EnumHoneyComb.COMPOST, 0.08f);
|
||||
|
||||
ExtraBeesSpecies.ROCK.addProduct(EnumHoneyComb.STONE, 0.30f);
|
||||
ExtraBeesSpecies.ROCK.setIsSecret(false);
|
||||
ExtraBeesSpecies.ROCK.setAllDay();
|
||||
ExtraBeesSpecies.ROCK.setCaveDwelling();
|
||||
ExtraBeesSpecies.ROCK.setTolerantFlyer();
|
||||
ExtraBeesSpecies.ROCK.setTemperatureTolerance(EnumTolerance.BOTH_1);
|
||||
ExtraBeesSpecies.ROCK.setHumidityTolerance(EnumTolerance.BOTH_1);
|
||||
ExtraBeesSpecies.ROCK.setFlowerProvider(ExtraBeesFlowers.ROCK.getUID());
|
||||
ExtraBeesSpecies.ROCK.setFertility(EnumAllele.Fertility.LOW);
|
||||
ExtraBeesSpecies.ROCK.setLifespan(EnumAllele.Lifespan.SHORT);
|
||||
ExtraBeesSpecies.ROCK.setSecondaryColor(rockBody);
|
||||
ExtraBeesSpecies.ROCK
|
||||
.addProduct(EnumHoneyComb.STONE, 0.30f)
|
||||
.setIsSecret(false)
|
||||
.setAllDay()
|
||||
.setCaveDwelling()
|
||||
.setTolerantFlyer()
|
||||
.setTemperatureTolerance(EnumTolerance.BOTH_1)
|
||||
.setHumidityTolerance(EnumTolerance.BOTH_1)
|
||||
.setFlowerProvider(ExtraBeesFlowers.ROCK.getUID())
|
||||
.setFertility(EnumAllele.Fertility.LOW)
|
||||
.setLifespan(EnumAllele.Lifespan.SHORT)
|
||||
.setSecondaryColor(rockBody);
|
||||
|
||||
ExtraBeesSpecies.STONE.addProduct(EnumHoneyComb.STONE, 0.30f);
|
||||
ExtraBeesSpecies.STONE.importTemplate(ExtraBeesSpecies.ROCK);
|
||||
ExtraBeesSpecies.STONE.recessive();
|
||||
ExtraBeesSpecies.STONE.setSecondaryColor(rockBody);
|
||||
ExtraBeesSpecies.STONE
|
||||
.addProduct(EnumHoneyComb.STONE, 0.30f)
|
||||
.importTemplate(ExtraBeesSpecies.ROCK)
|
||||
.recessive()
|
||||
.setSecondaryColor(rockBody);
|
||||
|
||||
ExtraBeesSpecies.GRANITE.addProduct(EnumHoneyComb.STONE, 0.30f);
|
||||
ExtraBeesSpecies.GRANITE.importTemplate(ExtraBeesSpecies.STONE);
|
||||
ExtraBeesSpecies.GRANITE.setTemperatureTolerance(EnumTolerance.BOTH_2);
|
||||
ExtraBeesSpecies.GRANITE.setHumidityTolerance(EnumTolerance.BOTH_2);
|
||||
ExtraBeesSpecies.GRANITE.setSecondaryColor(rockBody);
|
||||
ExtraBeesSpecies.GRANITE
|
||||
.addProduct(EnumHoneyComb.STONE, 0.30f)
|
||||
.importTemplate(ExtraBeesSpecies.STONE)
|
||||
.setTemperatureTolerance(EnumTolerance.BOTH_2)
|
||||
.setHumidityTolerance(EnumTolerance.BOTH_2)
|
||||
.setSecondaryColor(rockBody);
|
||||
|
||||
ExtraBeesSpecies.MINERAL.addProduct(EnumHoneyComb.STONE, 0.30f);
|
||||
ExtraBeesSpecies.MINERAL.importTemplate(ExtraBeesSpecies.GRANITE);
|
||||
ExtraBeesSpecies.MINERAL.setSecondaryColor(rockBody);
|
||||
ExtraBeesSpecies.MINERAL
|
||||
.addProduct(EnumHoneyComb.STONE, 0.30f)
|
||||
.importTemplate(ExtraBeesSpecies.GRANITE)
|
||||
.setSecondaryColor(rockBody);
|
||||
|
||||
ExtraBeesSpecies.COPPER.addProduct(EnumHoneyComb.STONE, 0.20f);
|
||||
ExtraBeesSpecies.COPPER.addSpecialty(EnumHoneyComb.COPPER, 0.06f);
|
||||
ExtraBeesSpecies.COPPER.importTemplate(ExtraBeesSpecies.MINERAL);
|
||||
ExtraBeesSpecies.COPPER.setSecondaryColor(rockBody);
|
||||
ExtraBeesSpecies.COPPER
|
||||
.addProduct(EnumHoneyComb.STONE, 0.20f)
|
||||
.addSpecialty(EnumHoneyComb.COPPER, 0.06f)
|
||||
.importTemplate(ExtraBeesSpecies.MINERAL)
|
||||
.setSecondaryColor(rockBody);
|
||||
|
||||
ExtraBeesSpecies.TIN.addProduct(EnumHoneyComb.STONE, 0.20f);
|
||||
ExtraBeesSpecies.TIN.addSpecialty(EnumHoneyComb.TIN, 0.06f);
|
||||
@@ -737,20 +723,23 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
ExtraBeesSpecies.QUANTUM.addSpecialty(EnumHoneyComb.CERTUS, 0.15f);
|
||||
ExtraBeesSpecies.QUANTUM.addSpecialty(EnumHoneyComb.ENDERPEARL, 0.15f);
|
||||
|
||||
ExtraBeesSpecies.YELLORIUM.importTemplate(ExtraBeesSpecies.NUCLEAR);
|
||||
ExtraBeesSpecies.YELLORIUM.addProduct(EnumHoneyComb.BARREN, 0.20f);
|
||||
ExtraBeesSpecies.YELLORIUM.addSpecialty(EnumHoneyComb.YELLORIUM, 0.02f);
|
||||
ExtraBeesSpecies.YELLORIUM.setEffect(ExtraBeesEffect.RADIOACTIVE.getUID());
|
||||
ExtraBeesSpecies.YELLORIUM.setFertility(EnumAllele.Fertility.LOW);
|
||||
ExtraBeesSpecies.YELLORIUM.setLifespan(EnumAllele.Lifespan.SHORTEST);
|
||||
ExtraBeesSpecies.YELLORIUM
|
||||
.importTemplate(ExtraBeesSpecies.NUCLEAR)
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.20f)
|
||||
.addSpecialty(EnumHoneyComb.YELLORIUM, 0.02f)
|
||||
.setEffect(ExtraBeesEffect.RADIOACTIVE.getUID())
|
||||
.setFertility(EnumAllele.Fertility.LOW)
|
||||
.setLifespan(EnumAllele.Lifespan.SHORTEST);
|
||||
|
||||
ExtraBeesSpecies.CYANITE.importTemplate(ExtraBeesSpecies.YELLORIUM);
|
||||
ExtraBeesSpecies.CYANITE.addProduct(EnumHoneyComb.BARREN, 0.20f);
|
||||
ExtraBeesSpecies.CYANITE.addSpecialty(EnumHoneyComb.CYANITE, 0.01f);
|
||||
ExtraBeesSpecies.CYANITE
|
||||
.importTemplate(ExtraBeesSpecies.YELLORIUM)
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.20f)
|
||||
.addSpecialty(EnumHoneyComb.CYANITE, 0.01f);
|
||||
|
||||
ExtraBeesSpecies.BLUTONIUM.importTemplate(ExtraBeesSpecies.CYANITE);
|
||||
ExtraBeesSpecies.BLUTONIUM.addProduct(EnumHoneyComb.BARREN, 0.20f);
|
||||
ExtraBeesSpecies.BLUTONIUM.addSpecialty(EnumHoneyComb.BLUTONIUM, 0.01f);
|
||||
ExtraBeesSpecies.BLUTONIUM
|
||||
.importTemplate(ExtraBeesSpecies.CYANITE)
|
||||
.addProduct(EnumHoneyComb.BARREN, 0.20f)
|
||||
.addSpecialty(EnumHoneyComb.BLUTONIUM, 0.01f);
|
||||
|
||||
ExtraBeesSpecies.MYSTICAL.importTemplate(ForestryAllele.BeeSpecies.Noble);
|
||||
for (Map.Entry<ItemStack, Float> entry : ForestryAllele.BeeSpecies.Noble.getAllele().getProductChances().entrySet()) {
|
||||
@@ -759,7 +748,7 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
|
||||
ExtraBeesSpecies.MYSTICAL.setFlowerProvider(ExtraBeesFlowers.MYSTICAL.getUID());
|
||||
for (ExtraBeesSpecies species2 : values()) {
|
||||
if (species2.state != State.Active) {
|
||||
if (species2.state != EnumBeeSpeciesState.ACTIVE) {
|
||||
AlleleManager.alleleRegistry.blacklistAllele(species2.getUID());
|
||||
}
|
||||
|
||||
@@ -778,7 +767,7 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
EnumHoneyComb comb = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
species3.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 0.75f);
|
||||
species3.addSpecialty(comb, 0.25f);
|
||||
species3.setSecondaryColor(9240320);
|
||||
species3.setSecondaryColor(0x8cff00);
|
||||
}
|
||||
|
||||
for (ExtraBeesSpecies species2 : values()) {
|
||||
@@ -810,8 +799,9 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
return humidity;
|
||||
}
|
||||
|
||||
private void setHumidity(EnumHumidity humidity) {
|
||||
private ExtraBeesSpecies setHumidity(EnumHumidity humidity) {
|
||||
this.humidity = humidity;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -866,51 +856,54 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
return specialties;
|
||||
}
|
||||
|
||||
private void setState(State state) {
|
||||
private void setState(EnumBeeSpeciesState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void registerTemplate() {
|
||||
Binnie.Genetics.getBeeRoot().registerTemplate(getTemplate());
|
||||
if (state != State.Active) {
|
||||
if (state != EnumBeeSpeciesState.ACTIVE) {
|
||||
AlleleManager.alleleRegistry.blacklistAllele(getUID());
|
||||
}
|
||||
}
|
||||
|
||||
public void addProduct(ItemStack product, Float chance) {
|
||||
if (product == null) {
|
||||
setState(State.Inactive);
|
||||
setState(EnumBeeSpeciesState.INACTIVE);
|
||||
} else {
|
||||
products.put(product, chance);
|
||||
allProducts.put(product, chance);
|
||||
}
|
||||
}
|
||||
|
||||
public void addProduct(IItemEnum product, Float chance) {
|
||||
public ExtraBeesSpecies addProduct(IItemEnum product, Float chance) {
|
||||
if (product.isActive()) {
|
||||
addProduct(product.get(1), chance);
|
||||
} else {
|
||||
allProducts.put(product.get(1), chance);
|
||||
setState(State.Inactive);
|
||||
setState(EnumBeeSpeciesState.INACTIVE);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void addSpecialty(ItemStack product, Float chance) {
|
||||
public ExtraBeesSpecies addSpecialty(ItemStack product, Float chance) {
|
||||
if (product == null) {
|
||||
setState(State.Inactive);
|
||||
setState(EnumBeeSpeciesState.INACTIVE);
|
||||
} else {
|
||||
specialties.put(product, chance);
|
||||
allSpecialties.put(product, chance);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private void addSpecialty(IItemEnum product, Float chance) {
|
||||
private ExtraBeesSpecies addSpecialty(IItemEnum product, Float chance) {
|
||||
if (product.isActive()) {
|
||||
addSpecialty(product.get(1), chance);
|
||||
} else {
|
||||
setState(State.Inactive);
|
||||
setState(EnumBeeSpeciesState.INACTIVE);
|
||||
allSpecialties.put(product.get(1), chance);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public IAllele[] getTemplate() {
|
||||
@@ -918,12 +911,14 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
return template;
|
||||
}
|
||||
|
||||
public void importTemplate(ForestryAllele.BeeSpecies species) {
|
||||
public ExtraBeesSpecies importTemplate(ForestryAllele.BeeSpecies species) {
|
||||
importTemplate(species.getTemplate());
|
||||
return this;
|
||||
}
|
||||
|
||||
public void importTemplate(ExtraBeesSpecies species) {
|
||||
public ExtraBeesSpecies importTemplate(ExtraBeesSpecies species) {
|
||||
importTemplate(species.getTemplate());
|
||||
return this;
|
||||
}
|
||||
|
||||
public void importTemplate(IAllele[] template) {
|
||||
@@ -934,24 +929,24 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
this.template[EnumBeeChromosome.SPECIES.ordinal()] = this;
|
||||
}
|
||||
|
||||
public void recessive() {
|
||||
public ExtraBeesSpecies recessive() {
|
||||
dominant = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setIsSecret(boolean secret) {
|
||||
public ExtraBeesSpecies setIsSecret(boolean secret) {
|
||||
isSecret = secret;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setHasEffect(boolean effect) {
|
||||
public ExtraBeesSpecies setHasEffect(boolean effect) {
|
||||
hasEffect = effect;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSecondaryColor(int colour) {
|
||||
public ExtraBeesSpecies setSecondaryColor(int colour) {
|
||||
secondaryColor = colour;
|
||||
}
|
||||
|
||||
public boolean isJubilant(World world, int biomeid, int x, int y, int z) {
|
||||
return true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -961,7 +956,13 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
|
||||
@Override
|
||||
public int getIconColour(int renderPass) {
|
||||
return (renderPass == 0) ? primaryColor : ((renderPass == 1) ? secondaryColor : 16777215);
|
||||
if (renderPass == 0) {
|
||||
return primaryColor;
|
||||
}
|
||||
if (renderPass == 1) {
|
||||
return secondaryColor;
|
||||
}
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1014,70 +1015,79 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
return nocturnal;
|
||||
}
|
||||
|
||||
public void setNocturnal() {
|
||||
public ExtraBeesSpecies setNocturnal() {
|
||||
nocturnal = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setAllDay() {
|
||||
setAllDay(true);
|
||||
public ExtraBeesSpecies setAllDay() {
|
||||
return setAllDay(true);
|
||||
}
|
||||
|
||||
public void setAllDay(boolean allDay) {
|
||||
if (allDay) {
|
||||
template[EnumBeeChromosome.NOCTURNAL.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolTrue");
|
||||
} else {
|
||||
template[EnumBeeChromosome.NOCTURNAL.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolFalse");
|
||||
}
|
||||
public ExtraBeesSpecies setAllDay(boolean allDay) {
|
||||
template[EnumBeeChromosome.NOCTURNAL.ordinal()] = AlleleHelper.getAllele(allDay);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setCaveDwelling() {
|
||||
template[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolTrue");
|
||||
public ExtraBeesSpecies setCaveDwelling() {
|
||||
template[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = AlleleHelper.getAllele(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setTolerantFlyer() {
|
||||
template[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolTrue");
|
||||
public ExtraBeesSpecies setTolerantFlyer() {
|
||||
template[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = AlleleHelper.getAllele(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setFlowerProvider(String uid) {
|
||||
public ExtraBeesSpecies setFlowerProvider(String uid) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele(uid);
|
||||
if (allele instanceof IAlleleFlowers) {
|
||||
template[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = allele;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setEffect(String uid) {
|
||||
public ExtraBeesSpecies setEffect(String uid) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele(uid);
|
||||
if (allele instanceof IAlleleBeeEffect) {
|
||||
template[EnumBeeChromosome.EFFECT.ordinal()] = allele;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setFertility(EnumAllele.Fertility fertility) {
|
||||
template[EnumBeeChromosome.FERTILITY.ordinal()] = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(fertility));
|
||||
private ExtraBeesSpecies setFertility(EnumAllele.Fertility fertility) {
|
||||
template[EnumBeeChromosome.FERTILITY.ordinal()] = AlleleHelper.getAllele(fertility);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setLifespan(EnumAllele.Lifespan lifespan) {
|
||||
template[EnumBeeChromosome.LIFESPAN.ordinal()] = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(lifespan));
|
||||
private ExtraBeesSpecies setLifespan(EnumAllele.Lifespan lifespan) {
|
||||
template[EnumBeeChromosome.LIFESPAN.ordinal()] = AlleleHelper.getAllele(lifespan);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setSpeed(EnumAllele.Speed speed) {
|
||||
template[EnumBeeChromosome.SPEED.ordinal()] = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(speed));
|
||||
private ExtraBeesSpecies setSpeed(EnumAllele.Speed speed) {
|
||||
template[EnumBeeChromosome.SPEED.ordinal()] = AlleleHelper.getAllele(speed);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setTerritory(EnumAllele.Territory territory) {
|
||||
template[EnumBeeChromosome.TERRITORY.ordinal()] = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(territory));
|
||||
private ExtraBeesSpecies setTerritory(EnumAllele.Territory territory) {
|
||||
template[EnumBeeChromosome.TERRITORY.ordinal()] = AlleleHelper.getAllele(territory);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setFlowering(EnumAllele.Flowering flowering) {
|
||||
template[EnumBeeChromosome.FLOWERING.ordinal()] = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(flowering));
|
||||
private ExtraBeesSpecies setFlowering(EnumAllele.Flowering flowering) {
|
||||
template[EnumBeeChromosome.FLOWERING.ordinal()] = AlleleHelper.getAllele(flowering);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setHumidityTolerance(EnumTolerance humidityTolerance) {
|
||||
template[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(humidityTolerance));
|
||||
private ExtraBeesSpecies setHumidityTolerance(EnumTolerance humidityTolerance) {
|
||||
template[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = AlleleHelper.getAllele(humidityTolerance);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setTemperatureTolerance(EnumTolerance temperatureTolerance) {
|
||||
template[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(temperatureTolerance));
|
||||
private ExtraBeesSpecies setTemperatureTolerance(EnumTolerance temperatureTolerance) {
|
||||
template[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = AlleleHelper.getAllele(temperatureTolerance);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1201,10 +1211,4 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
public Map<ItemStack, Float> getSpecialtyChances() {
|
||||
return getSpecialty();
|
||||
}
|
||||
|
||||
public enum State {
|
||||
Active,
|
||||
Inactive,
|
||||
Deprecated
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,18 @@ public class ModuleGenetics implements IInitializable {
|
||||
++ebSpeciesCount;
|
||||
}
|
||||
}*/
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), null, new ItemStack(ExtraBees.dictionary), "X#X", "YEY", "RDR", '#', Blocks.glass_pane, 'X', Items.gold_ingot, 'Y', "ingotTin", 'R', Items.redstone, 'D', Items.diamond, 'E', Items.emerald);
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
100,
|
||||
Binnie.Liquid.getLiquidStack("water", 2000),
|
||||
null,
|
||||
new ItemStack(ExtraBees.dictionary),
|
||||
"X#X", "YEY", "RDR",
|
||||
'#', Blocks.glass_pane,
|
||||
'X', Items.gold_ingot,
|
||||
'Y', "ingotTin",
|
||||
'R', Items.redstone,
|
||||
'D', Items.diamond,
|
||||
'E', Items.emerald
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.extratrees.block.ModuleBlocks;
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import binnie.extratrees.genetics.LeafType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
@@ -34,8 +34,8 @@ public class BlockHedge extends Block implements IBlockFence {
|
||||
}
|
||||
|
||||
public static int getColor(int meta) {
|
||||
ExtraTreeSpecies.LeafType type = ExtraTreeSpecies.LeafType.values()[meta % 6];
|
||||
if (type == ExtraTreeSpecies.LeafType.Conifer) {
|
||||
LeafType type = LeafType.values()[meta % 6];
|
||||
if (type == LeafType.CONIFER) {
|
||||
return ColorizerFoliage.getFoliageColorPine();
|
||||
}
|
||||
double d0 = 0.5;
|
||||
@@ -151,8 +151,8 @@ public class BlockHedge extends Block implements IBlockFence {
|
||||
// ignored
|
||||
}
|
||||
|
||||
private ExtraTreeSpecies.LeafType getType(int meta) {
|
||||
return ExtraTreeSpecies.LeafType.values()[meta % 8];
|
||||
private LeafType getType(int meta) {
|
||||
return LeafType.values()[meta % 8];
|
||||
}
|
||||
|
||||
private boolean isFull(int meta) {
|
||||
@@ -162,7 +162,7 @@ public class BlockHedge extends Block implements IBlockFence {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
ExtraTreeSpecies.LeafType type = getType(meta);
|
||||
LeafType type = getType(meta);
|
||||
return ForestryAPI.textureManager.getIcon(isFull(meta) ? type.plainUID : type.fancyUID);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import binnie.extratrees.genetics.LeafType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -14,6 +14,6 @@ public class ItemHedge extends ItemBlockWithMetadata {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack item) {
|
||||
int meta = item.getItemDamage();
|
||||
return ExtraTreeSpecies.LeafType.values()[meta % 6].descript + ((meta >= 8) ? " Full" : "") + " Hedge";
|
||||
return LeafType.values()[meta % 6].description + ((meta >= 8) ? " Full" : "") + " Hedge";
|
||||
}
|
||||
}
|
||||
@@ -4,28 +4,29 @@ import binnie.Binnie;
|
||||
import binnie.core.Mods;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import binnie.extratrees.gen.WorldGenAlder;
|
||||
import binnie.extratrees.gen.WorldGenApple;
|
||||
import binnie.extratrees.gen.WorldGenAsh;
|
||||
import binnie.extratrees.gen.WorldGenBanana;
|
||||
import binnie.extratrees.gen.WorldGenBeech;
|
||||
import binnie.extratrees.gen.WorldGenConifer;
|
||||
import binnie.extratrees.gen.WorldGenDefault;
|
||||
import binnie.extratrees.gen.WorldGenEucalyptus;
|
||||
import binnie.extratrees.gen.WorldGenFir;
|
||||
import binnie.extratrees.gen.WorldGenHolly;
|
||||
import binnie.extratrees.gen.WorldGenJungle;
|
||||
import binnie.extratrees.gen.WorldGenLazy;
|
||||
import binnie.extratrees.gen.WorldGenMaple;
|
||||
import binnie.extratrees.gen.WorldGenPalm;
|
||||
import binnie.extratrees.gen.WorldGenPoplar;
|
||||
import binnie.extratrees.gen.WorldGenShrub;
|
||||
import binnie.extratrees.gen.WorldGenSorbus;
|
||||
import binnie.extratrees.gen.WorldGenTree;
|
||||
import binnie.extratrees.gen.WorldGenTree2;
|
||||
import binnie.extratrees.gen.WorldGenTree3;
|
||||
import binnie.extratrees.gen.WorldGenTropical;
|
||||
import binnie.extratrees.gen.WorldGenWalnut;
|
||||
import binnie.extratrees.worldgen.DefaultTreeGenerator;
|
||||
import binnie.extratrees.worldgen.WorldGenAlder;
|
||||
import binnie.extratrees.worldgen.WorldGenApple;
|
||||
import binnie.extratrees.worldgen.WorldGenAsh;
|
||||
import binnie.extratrees.worldgen.WorldGenBanana;
|
||||
import binnie.extratrees.worldgen.WorldGenBeech;
|
||||
import binnie.extratrees.worldgen.WorldGenConifer;
|
||||
import binnie.extratrees.worldgen.WorldGenDefault;
|
||||
import binnie.extratrees.worldgen.WorldGenEucalyptus;
|
||||
import binnie.extratrees.worldgen.WorldGenFir;
|
||||
import binnie.extratrees.worldgen.WorldGenHolly;
|
||||
import binnie.extratrees.worldgen.WorldGenJungle;
|
||||
import binnie.extratrees.worldgen.WorldGenLazy;
|
||||
import binnie.extratrees.worldgen.WorldGenMaple;
|
||||
import binnie.extratrees.worldgen.WorldGenPalm;
|
||||
import binnie.extratrees.worldgen.WorldGenPoplar;
|
||||
import binnie.extratrees.worldgen.WorldGenShrub;
|
||||
import binnie.extratrees.worldgen.WorldGenSorbus;
|
||||
import binnie.extratrees.worldgen.WorldGenTree;
|
||||
import binnie.extratrees.worldgen.WorldGenTree2;
|
||||
import binnie.extratrees.worldgen.WorldGenTree3;
|
||||
import binnie.extratrees.worldgen.WorldGenTropical;
|
||||
import binnie.extratrees.worldgen.WorldGenWalnut;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -39,7 +40,6 @@ import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.IGermlingIconProvider;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.ITreeGenerator;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
@@ -52,22 +52,16 @@ import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import forestry.arboriculture.blocks.BlockForestryLeaves;
|
||||
import forestry.arboriculture.genetics.Tree;
|
||||
import forestry.arboriculture.render.TextureLeaves;
|
||||
import forestry.arboriculture.tiles.TileLeaves;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.genetics.alleles.EnumAllele;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.plugins.PluginArboriculture;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.awt.*;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -174,6 +168,8 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
Candlenut("aleurites", "moluccana", 0x8aa36c, 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.Tree.class),
|
||||
DwarfHazel("Corylus", "americana", 0x9bb552, 0x9be152, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.Shrub.class);
|
||||
|
||||
public ILogType wood;
|
||||
|
||||
protected ArrayList<IFruitFamily> families;
|
||||
protected int girth;
|
||||
protected Class<? extends WorldGenerator> gen;
|
||||
@@ -182,7 +178,6 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
protected int color;
|
||||
protected String binomial;
|
||||
protected String uid;
|
||||
protected ILogType wood;
|
||||
protected String branchName;
|
||||
protected IClassification branch;
|
||||
protected int colorPollineted;
|
||||
@@ -196,8 +191,8 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
this.fruit = fruit;
|
||||
this.gen = ((gen == null) ? WorldGenTree.class : gen);
|
||||
this.binomial = binomial;
|
||||
leafType = LeafType.Normal;
|
||||
saplingType = SaplingType.Default;
|
||||
leafType = LeafType.NORMAL;
|
||||
saplingType = SaplingType.DEFAULT;
|
||||
families = new ArrayList<>();
|
||||
girth = 1;
|
||||
colorPollineted = new Color(color).brighter().getRGB();
|
||||
@@ -206,130 +201,50 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
String bookArborist = "Arborist Manual";
|
||||
for (ExtraTreeSpecies species : values()) {
|
||||
species.preInit();
|
||||
}
|
||||
|
||||
ExtraTreeSpecies.OrchardApple.finished();
|
||||
ExtraTreeSpecies.SweetCrabapple.finished();
|
||||
ExtraTreeSpecies.FloweringCrabapple.finished();
|
||||
ExtraTreeSpecies.PrairieCrabapple.finished();
|
||||
ExtraTreeSpecies[] pruneSpecies = new ExtraTreeSpecies[]{ExtraTreeSpecies.Blackthorn, ExtraTreeSpecies.CherryPlum, ExtraTreeSpecies.Almond, ExtraTreeSpecies.Apricot, ExtraTreeSpecies.Peach, ExtraTreeSpecies.Nectarine, ExtraTreeSpecies.WildCherry, ExtraTreeSpecies.SourCherry, ExtraTreeSpecies.BlackCherry};
|
||||
ExtraTreeSpecies[] pruneSpecies = new ExtraTreeSpecies[]{
|
||||
ExtraTreeSpecies.Blackthorn,
|
||||
ExtraTreeSpecies.CherryPlum,
|
||||
ExtraTreeSpecies.Almond,
|
||||
ExtraTreeSpecies.Apricot,
|
||||
ExtraTreeSpecies.Peach,
|
||||
ExtraTreeSpecies.Nectarine,
|
||||
ExtraTreeSpecies.WildCherry,
|
||||
ExtraTreeSpecies.SourCherry,
|
||||
ExtraTreeSpecies.BlackCherry
|
||||
};
|
||||
for (ExtraTreeSpecies species2 : pruneSpecies) {
|
||||
IAlleleTreeSpecies citrus = (IAlleleTreeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.treePlum");
|
||||
species2.setWorldGen(citrus.getGenerator().getWorldGenerator(TreeManager.treeRoot.templateAsIndividual(citrus.getRoot().getDefaultTemplate())).getClass());
|
||||
species2.saplingType = SaplingType.Fruit;
|
||||
species2.finished();
|
||||
species2
|
||||
.setWorldGen(citrus.getGenerator().getWorldGenerator(TreeManager.treeRoot.templateAsIndividual(citrus.getRoot().getDefaultTemplate())).getClass())
|
||||
.setSaplingType(SaplingType.FRUIT);
|
||||
}
|
||||
|
||||
ExtraTreeSpecies[] citrusSpecies = new ExtraTreeSpecies[]{ExtraTreeSpecies.Orange, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Satsuma, ExtraTreeSpecies.Tangerine, ExtraTreeSpecies.Lime, ExtraTreeSpecies.KeyLime, ExtraTreeSpecies.FingerLime, ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Grapefruit, ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Citron, ExtraTreeSpecies.BuddhaHand};
|
||||
ExtraTreeSpecies[] citrusSpecies = new ExtraTreeSpecies[]{
|
||||
ExtraTreeSpecies.Orange,
|
||||
ExtraTreeSpecies.Manderin,
|
||||
ExtraTreeSpecies.Satsuma,
|
||||
ExtraTreeSpecies.Tangerine,
|
||||
ExtraTreeSpecies.Lime,
|
||||
ExtraTreeSpecies.KeyLime,
|
||||
ExtraTreeSpecies.FingerLime,
|
||||
ExtraTreeSpecies.Pomelo,
|
||||
ExtraTreeSpecies.Grapefruit,
|
||||
ExtraTreeSpecies.Kumquat,
|
||||
ExtraTreeSpecies.Citron,
|
||||
ExtraTreeSpecies.BuddhaHand
|
||||
};
|
||||
for (ExtraTreeSpecies species3 : citrusSpecies) {
|
||||
species3.setLeafType(LeafType.Jungle);
|
||||
species3.saplingType = SaplingType.Fruit;
|
||||
IAlleleTreeSpecies citrus2 = (IAlleleTreeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.treeLemon");
|
||||
species3.setWorldGen(citrus2.getGenerator().getWorldGenerator(TreeManager.treeRoot.templateAsIndividual(citrus2.getRoot().getDefaultTemplate())).getClass());
|
||||
species3.finished();
|
||||
species3
|
||||
.setWorldGen(citrus2.getGenerator().getWorldGenerator(TreeManager.treeRoot.templateAsIndividual(citrus2.getRoot().getDefaultTemplate())).getClass())
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setSaplingType(SaplingType.FRUIT);
|
||||
}
|
||||
|
||||
ExtraTreeSpecies.Banana.setLeafType(LeafType.Palm);
|
||||
ExtraTreeSpecies.RedBanana.setLeafType(LeafType.Palm);
|
||||
ExtraTreeSpecies.Plantain.setLeafType(LeafType.Palm);
|
||||
ExtraTreeSpecies.Banana.finished();
|
||||
ExtraTreeSpecies.RedBanana.finished();
|
||||
ExtraTreeSpecies.Plantain.finished();
|
||||
ExtraTreeSpecies.Hemlock.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.Butternut.finished();
|
||||
ExtraTreeSpecies.Butternut.setGirth(2);
|
||||
ExtraTreeSpecies.Rowan.finished();
|
||||
ExtraTreeSpecies.Hemlock.finished();
|
||||
ExtraTreeSpecies.Hemlock.setGirth(2);
|
||||
ExtraTreeSpecies.Ash.finished();
|
||||
ExtraTreeSpecies.Alder.finished();
|
||||
ExtraTreeSpecies.Beech.finished();
|
||||
ExtraTreeSpecies.CopperBeech.finished();
|
||||
ExtraTreeSpecies.Aspen.finished();
|
||||
ExtraTreeSpecies.Yew.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.Cypress.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.DouglasFir.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.Yew.finished();
|
||||
ExtraTreeSpecies.Cypress.finished();
|
||||
ExtraTreeSpecies.Cypress.saplingType = SaplingType.Poplar;
|
||||
ExtraTreeSpecies.DouglasFir.finished();
|
||||
ExtraTreeSpecies.DouglasFir.setGirth(2);
|
||||
ExtraTreeSpecies.Hazel.finished();
|
||||
ExtraTreeSpecies.DwarfHazel.finished();
|
||||
ExtraTreeSpecies.DwarfHazel.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Sycamore.finished();
|
||||
ExtraTreeSpecies.Whitebeam.finished();
|
||||
ExtraTreeSpecies.Hawthorn.finished();
|
||||
ExtraTreeSpecies.Pecan.finished();
|
||||
ExtraTreeSpecies.Fir.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.Cedar.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.Sallow.setLeafType(LeafType.Willow);
|
||||
ExtraTreeSpecies.Elm.finished();
|
||||
ExtraTreeSpecies.Elder.finished();
|
||||
ExtraTreeSpecies.Holly.finished();
|
||||
ExtraTreeSpecies.Hornbeam.finished();
|
||||
ExtraTreeSpecies.Sallow.finished();
|
||||
ExtraTreeSpecies.AcornOak.finished();
|
||||
ExtraTreeSpecies.AcornOak.setGirth(2);
|
||||
ExtraTreeSpecies.Fir.finished();
|
||||
ExtraTreeSpecies.Cedar.finished();
|
||||
ExtraTreeSpecies.Cedar.setGirth(2);
|
||||
ExtraTreeSpecies.RedMaple.setLeafType(LeafType.Maple);
|
||||
ExtraTreeSpecies.BalsamFir.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.LoblollyPine.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.Olive.finished();
|
||||
ExtraTreeSpecies.RedMaple.finished();
|
||||
ExtraTreeSpecies.BalsamFir.finished();
|
||||
ExtraTreeSpecies.LoblollyPine.finished();
|
||||
ExtraTreeSpecies.Sweetgum.finished();
|
||||
ExtraTreeSpecies.Locust.finished();
|
||||
ExtraTreeSpecies.Pear.finished();
|
||||
ExtraTreeSpecies.OsangeOsange.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.OldFustic.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Brazilwood.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Logwood.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Rosewood.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Purpleheart.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.OsangeOsange.finished();
|
||||
ExtraTreeSpecies.OldFustic.finished();
|
||||
ExtraTreeSpecies.Brazilwood.finished();
|
||||
ExtraTreeSpecies.Logwood.finished();
|
||||
ExtraTreeSpecies.Rosewood.finished();
|
||||
ExtraTreeSpecies.Purpleheart.finished();
|
||||
ExtraTreeSpecies.Gingko.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Brazilnut.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.RoseGum.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.SwampGum.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Coffee.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.MonkeyPuzzle.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.RainbowGum.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Iroko.finished();
|
||||
ExtraTreeSpecies.Gingko.finished();
|
||||
ExtraTreeSpecies.Brazilnut.finished();
|
||||
ExtraTreeSpecies.RoseGum.finished();
|
||||
ExtraTreeSpecies.SwampGum.finished();
|
||||
ExtraTreeSpecies.SwampGum.setGirth(2);
|
||||
ExtraTreeSpecies.Box.finished();
|
||||
ExtraTreeSpecies.Clove.finished();
|
||||
ExtraTreeSpecies.Coffee.finished();
|
||||
ExtraTreeSpecies.MonkeyPuzzle.finished();
|
||||
ExtraTreeSpecies.MonkeyPuzzle.setGirth(2);
|
||||
ExtraTreeSpecies.RainbowGum.finished();
|
||||
ExtraTreeSpecies.PinkIvory.finished();
|
||||
ExtraTreeSpecies.Juniper.setLeafType(LeafType.Conifer);
|
||||
ExtraTreeSpecies.Blackcurrant.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Redcurrant.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Blackberry.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Raspberry.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Blueberry.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Cranberry.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Juniper.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.Gooseberry.saplingType = SaplingType.Shrub;
|
||||
ExtraTreeSpecies.GoldenRaspberry.saplingType = SaplingType.Shrub;
|
||||
|
||||
citrusSpecies = values();
|
||||
for (ExtraTreeSpecies species3 : citrusSpecies) {
|
||||
String scientific = species3.branchName.substring(0, 1).toUpperCase() + species3.branchName.substring(1).toLowerCase();
|
||||
@@ -338,20 +253,10 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
if (branch == null) {
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
}
|
||||
(species3.branch = branch).addMemberSpecies(species3);
|
||||
species3.branch = branch;
|
||||
branch.addMemberSpecies(species3);
|
||||
}
|
||||
|
||||
ExtraTreeSpecies.Cinnamon.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Coconut.setLeafType(LeafType.Palm);
|
||||
ExtraTreeSpecies.Cashew.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Avacado.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Nutmeg.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Allspice.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Chilli.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.StarAnise.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Mango.setLeafType(LeafType.Jungle);
|
||||
ExtraTreeSpecies.Starfruit.setLeafType(LeafType.Jungle);
|
||||
|
||||
IFruitFamily familyPrune = AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes");
|
||||
IFruitFamily familyPome = AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes");
|
||||
IFruitFamily familyJungle = AlleleManager.alleleRegistry.getFruitFamily("forestry.jungle");
|
||||
@@ -580,6 +485,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Banana
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.PALM)
|
||||
.setYield(EnumAllele.Yield.LOW)
|
||||
.setSappiness(EnumAllele.Sappiness.LOW)
|
||||
.setMaturation(EnumAllele.Maturation.FAST);
|
||||
@@ -587,6 +493,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.RedBanana
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.PALM)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.LOWER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER);
|
||||
@@ -594,10 +501,12 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Plantain
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.PALM)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setYield(EnumAllele.Yield.LOWER);
|
||||
|
||||
ExtraTreeSpecies.Butternut
|
||||
.setGirth(2)
|
||||
.addFamily(familyPome)
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
@@ -712,6 +621,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPome)
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyCitrus)
|
||||
.setLeafType(LeafType.WILLOW)
|
||||
.setHeight(EnumAllele.Height.LARGE)
|
||||
.setFertility(EnumAllele.Saplings.LOW);
|
||||
|
||||
@@ -721,9 +631,11 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyNuts)
|
||||
.setHeight(EnumAllele.Height.LARGE)
|
||||
.setYield(EnumAllele.Yield.LOW)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER);
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
.setGirth(2);
|
||||
|
||||
ExtraTreeSpecies.Fir
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setHeight(EnumAllele.Height.LARGE)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
.setMaturation(EnumAllele.Maturation.SLOW);
|
||||
@@ -735,23 +647,28 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.setYield(EnumAllele.Yield.AVERAGE);
|
||||
|
||||
ExtraTreeSpecies.Cedar
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
.setMaturation(EnumAllele.Maturation.SLOWER);
|
||||
.setMaturation(EnumAllele.Maturation.SLOWER)
|
||||
.setGirth(2);
|
||||
|
||||
ExtraTreeSpecies.RedMaple
|
||||
.addFamily(familyPome)
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyCitrus)
|
||||
.setLeafType(LeafType.MAPLE)
|
||||
.setFertility(EnumAllele.Saplings.AVERAGE)
|
||||
.setSappiness(EnumAllele.Sappiness.HIGH);
|
||||
|
||||
ExtraTreeSpecies.BalsamFir
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
.setMaturation(EnumAllele.Maturation.SLOW);
|
||||
|
||||
ExtraTreeSpecies.LoblollyPine
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
.setMaturation(EnumAllele.Maturation.SLOW);
|
||||
@@ -784,15 +701,18 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyCitrus)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setYield(EnumAllele.Yield.LOWER);
|
||||
|
||||
ExtraTreeSpecies.OldFustic
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER);
|
||||
|
||||
ExtraTreeSpecies.Brazilwood
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.LOWER)
|
||||
@@ -800,17 +720,20 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
ExtraTreeSpecies.Logwood
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER);
|
||||
|
||||
ExtraTreeSpecies.Rosewood
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER);
|
||||
|
||||
ExtraTreeSpecies.Purpleheart
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.LARGE)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER);
|
||||
|
||||
@@ -823,6 +746,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Gingko
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.LARGE)
|
||||
.setYield(EnumAllele.Yield.LOWER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOW);
|
||||
@@ -830,12 +754,14 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Brazilnut
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.LARGER)
|
||||
.setYield(EnumAllele.Yield.LOW)
|
||||
.setSappiness(EnumAllele.Sappiness.LOW);
|
||||
|
||||
ExtraTreeSpecies.RoseGum
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.LARGEST)
|
||||
.setFertility(EnumAllele.Saplings.LOWEST)
|
||||
.setYield(EnumAllele.Yield.LOWER)
|
||||
@@ -844,9 +770,11 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
ExtraTreeSpecies.SwampGum
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.LOWEST)
|
||||
.setMaturation(EnumAllele.Maturation.SLOWER);
|
||||
.setMaturation(EnumAllele.Maturation.SLOWER)
|
||||
.setGirth(2);
|
||||
|
||||
ExtraTreeSpecies.Box
|
||||
.addFamily(familyPome)
|
||||
@@ -868,6 +796,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Coffee
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.LARGE)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
.setMaturation(EnumAllele.Maturation.FAST);
|
||||
@@ -875,13 +804,16 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.MonkeyPuzzle
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setYield(EnumAllele.Yield.LOWER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOW);
|
||||
.setSappiness(EnumAllele.Sappiness.LOW)
|
||||
.setGirth(2);
|
||||
|
||||
ExtraTreeSpecies.RainbowGum
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.LOWER);
|
||||
|
||||
@@ -894,6 +826,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
@@ -904,6 +837,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.AVERAGE)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
@@ -914,6 +848,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setYield(EnumAllele.Yield.HIGH)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
@@ -923,6 +858,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
@@ -933,6 +869,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.AVERAGE)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
@@ -943,6 +880,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.AVERAGE)
|
||||
.setYield(EnumAllele.Yield.HIGH)
|
||||
@@ -953,6 +891,8 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.LOW)
|
||||
@@ -963,6 +903,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.HIGH)
|
||||
.setYield(EnumAllele.Yield.HIGH)
|
||||
@@ -972,6 +913,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyBerry)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
@@ -980,6 +922,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
ExtraTreeSpecies.Cinnamon
|
||||
.addFamily(familyNuts)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.addFamily(familyJungle)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setYield(EnumAllele.Yield.LOWER)
|
||||
@@ -987,6 +930,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
ExtraTreeSpecies.Coconut
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.PALM)
|
||||
.setHeight(EnumAllele.Height.LARGER)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
@@ -995,18 +939,21 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Cashew
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setYield(EnumAllele.Yield.LOW);
|
||||
|
||||
ExtraTreeSpecies.Avacado
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyCitrus)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setYield(EnumAllele.Yield.AVERAGE);
|
||||
|
||||
ExtraTreeSpecies.Nutmeg
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setYield(EnumAllele.Yield.HIGH)
|
||||
.setSappiness(EnumAllele.Sappiness.LOW);
|
||||
@@ -1014,6 +961,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Allspice
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLEST)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.HIGH);
|
||||
@@ -1021,6 +969,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Chilli
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setYield(EnumAllele.Yield.HIGHER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
@@ -1029,6 +978,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.StarAnise
|
||||
.addFamily(familyNuts)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setYield(EnumAllele.Yield.HIGH);
|
||||
|
||||
@@ -1037,6 +987,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyCitrus)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
@@ -1047,6 +998,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyCitrus)
|
||||
.addFamily(familyJungle)
|
||||
.setLeafType(LeafType.JUNGLE)
|
||||
.setYield(EnumAllele.Yield.AVERAGE)
|
||||
.setMaturation(EnumAllele.Maturation.FAST);
|
||||
|
||||
@@ -1061,26 +1013,34 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.DwarfHazel
|
||||
.addFamily(familyPrune)
|
||||
.addFamily(familyNuts)
|
||||
.setSaplingType(SaplingType.SHRUB)
|
||||
.setFertility(EnumAllele.Saplings.AVERAGE)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
.setMaturation(EnumAllele.Maturation.FASTER);
|
||||
|
||||
ExtraTreeSpecies.Yew
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setHeight(EnumAllele.Height.LARGE)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER);
|
||||
|
||||
ExtraTreeSpecies.Cypress
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setSaplingType(SaplingType.POPLAR)
|
||||
.setHeight(EnumAllele.Height.LARGER)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setSappiness(EnumAllele.Sappiness.LOWER)
|
||||
.setMaturation(EnumAllele.Maturation.SLOW);
|
||||
|
||||
ExtraTreeSpecies.DouglasFir
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setHeight(EnumAllele.Height.SMALLER)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setMaturation(EnumAllele.Maturation.SLOWER);
|
||||
.setMaturation(EnumAllele.Maturation.SLOWER)
|
||||
.setGirth(2);
|
||||
|
||||
ExtraTreeSpecies.Hemlock
|
||||
.setLeafType(LeafType.CONIFER)
|
||||
.setGirth(2)
|
||||
.setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setFertility(EnumAllele.Saplings.LOW)
|
||||
.setMaturation(EnumAllele.Maturation.SLOWER);
|
||||
@@ -1104,12 +1064,14 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setWorldGen(Class<? extends WorldGenerator> gen) {
|
||||
private ExtraTreeSpecies setWorldGen(Class<? extends WorldGenerator> gen) {
|
||||
this.gen = gen;
|
||||
return this;
|
||||
}
|
||||
|
||||
private void setGirth(int i) {
|
||||
template[EnumTreeChromosome.GIRTH.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.i" + i + "d");
|
||||
private ExtraTreeSpecies setGirth(int girth) {
|
||||
template[EnumTreeChromosome.GIRTH.ordinal()] = AlleleHelper.getAllele(girth);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void preInit() {
|
||||
@@ -1119,7 +1081,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
template[EnumTreeChromosome.FRUITS.ordinal()] = fruit;
|
||||
}
|
||||
|
||||
template[EnumTreeChromosome.GIRTH.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.i" + girth + "d");
|
||||
template[EnumTreeChromosome.GIRTH.ordinal()] = AlleleHelper.getAllele(girth);
|
||||
IClassification clas = AlleleManager.alleleRegistry.getClassification("trees." + branch);
|
||||
if (clas != null) {
|
||||
clas.addMemberSpecies(this);
|
||||
@@ -1194,57 +1156,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
@Override
|
||||
public ITreeGenerator getGenerator() {
|
||||
return new ITreeGenerator() {
|
||||
|
||||
@Override
|
||||
public void setLogBlock(ITreeGenome arg0, World arg1, int arg2, int arg3, int arg4, ForgeDirection arg5) {
|
||||
if (wood != null)
|
||||
wood.placeBlock(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLeaves(ITreeGenome genome, World world, GameProfile owner, int x, int y, int z, boolean decorative) {
|
||||
boolean placed = world.setBlock(x, y, z, PluginArboriculture.blocks.leaves, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
if (!placed) {
|
||||
return;
|
||||
}
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (PluginArboriculture.blocks.leaves != block) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
TileLeaves tileLeaves = BlockForestryLeaves.getLeafTile(world, x, y, z);
|
||||
if (tileLeaves == null) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
tileLeaves.setOwner(owner);
|
||||
if (decorative) {
|
||||
tileLeaves.setDecorative();
|
||||
}
|
||||
|
||||
tileLeaves.setTree(new Tree(genome));
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogBlock(World world, int x, int y, int z, ForgeDirection direction) {
|
||||
wood.placeBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLeaves(World world, GameProfile player, int x, int y, int z, boolean arg5) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldGenerator getWorldGenerator(ITreeGenData tree) {
|
||||
return getGenerator(tree);
|
||||
}
|
||||
};
|
||||
return new DefaultTreeGenerator(this);
|
||||
}
|
||||
|
||||
public WorldGenerator getGenerator(ITreeGenData tree) {
|
||||
@@ -1260,18 +1172,23 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
protected ExtraTreeSpecies setLeafType(LeafType type) {
|
||||
leafType = type;
|
||||
if (leafType == LeafType.Conifer) {
|
||||
saplingType = SaplingType.Conifer;
|
||||
if (leafType == LeafType.CONIFER) {
|
||||
saplingType = SaplingType.CONIFER;
|
||||
}
|
||||
if (leafType == LeafType.Jungle) {
|
||||
saplingType = SaplingType.Jungle;
|
||||
if (leafType == LeafType.JUNGLE) {
|
||||
saplingType = SaplingType.JUNGLE;
|
||||
}
|
||||
if (leafType == LeafType.Palm) {
|
||||
saplingType = SaplingType.Palm;
|
||||
if (leafType == LeafType.PALM) {
|
||||
saplingType = SaplingType.PALM;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
protected ExtraTreeSpecies setSaplingType(SaplingType saplingType) {
|
||||
this.saplingType = saplingType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IAllele[] getTemplate() {
|
||||
return template;
|
||||
}
|
||||
@@ -1286,7 +1203,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
}
|
||||
|
||||
public ExtraTreeSpecies setHeight(EnumAllele.Height height) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(height));
|
||||
IAllele allele = AlleleHelper.getAllele(height);
|
||||
if (allele != null) {
|
||||
template[EnumTreeChromosome.HEIGHT.ordinal()] = allele;
|
||||
}
|
||||
@@ -1294,7 +1211,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
}
|
||||
|
||||
public ExtraTreeSpecies setSappiness(EnumAllele.Sappiness sappiness) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(sappiness));
|
||||
IAllele allele = AlleleHelper.getAllele(sappiness);
|
||||
if (allele != null) {
|
||||
template[EnumTreeChromosome.SAPPINESS.ordinal()] = allele;
|
||||
}
|
||||
@@ -1302,7 +1219,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
}
|
||||
|
||||
public ExtraTreeSpecies setMaturation(EnumAllele.Maturation maturation) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(maturation));
|
||||
IAllele allele = AlleleHelper.getAllele(maturation);
|
||||
if (allele != null) {
|
||||
template[EnumTreeChromosome.MATURATION.ordinal()] = allele;
|
||||
}
|
||||
@@ -1310,7 +1227,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
}
|
||||
|
||||
public ExtraTreeSpecies setYield(EnumAllele.Yield yield) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(yield));
|
||||
IAllele allele = AlleleHelper.getAllele(yield);
|
||||
if (allele != null) {
|
||||
template[EnumTreeChromosome.YIELD.ordinal()] = allele;
|
||||
}
|
||||
@@ -1318,16 +1235,13 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
}
|
||||
|
||||
public ExtraTreeSpecies setFertility(EnumAllele.Saplings saplings) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele(AlleleHelper.getUid(saplings));
|
||||
IAllele allele = AlleleHelper.getAllele(saplings);
|
||||
if (allele != null) {
|
||||
template[EnumTreeChromosome.FERTILITY.ordinal()] = allele;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void finished() {
|
||||
}
|
||||
|
||||
public int getLeafColour(ITree tree) {
|
||||
return color;
|
||||
}
|
||||
@@ -1466,6 +1380,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
highest = otherAdvance;
|
||||
}
|
||||
}
|
||||
|
||||
if (!exclude.contains(mutation.getAllele1())) {
|
||||
int otherAdvance = getGeneticAdvancement(mutation.getAllele1(), exclude);
|
||||
if (otherAdvance <= highest) {
|
||||
@@ -1477,13 +1392,6 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
return own + ((highest < 0) ? 0 : highest);
|
||||
}
|
||||
|
||||
public ItemStack[] getLogStacks() {
|
||||
if (wood == null) {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
return new ItemStack[]{wood.getItemStack()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "extratrees.species." + toString().toLowerCase() + ".name";
|
||||
@@ -1498,11 +1406,15 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
@Override
|
||||
public IIcon getLeafIcon(boolean pollinated, boolean fancy) {
|
||||
try {
|
||||
if (pollinated)
|
||||
return TextureLeaves.get(EnumLeafType.valueOf(leafType.descript.toUpperCase())).getPollinated();
|
||||
if (fancy)
|
||||
return TextureLeaves.get(EnumLeafType.valueOf(leafType.descript.toUpperCase())).getFancy();
|
||||
return TextureLeaves.get(EnumLeafType.valueOf(leafType.descript.toUpperCase())).getPlain();
|
||||
EnumLeafType leaf = EnumLeafType.valueOf(leafType.description.toUpperCase());
|
||||
TextureLeaves texture = TextureLeaves.get(leaf);
|
||||
if (pollinated) {
|
||||
return texture.getPollinated();
|
||||
}
|
||||
if (fancy) {
|
||||
return texture.getFancy();
|
||||
}
|
||||
return texture.getPlain();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -1514,37 +1426,4 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
public IIcon getIcon(EnumGermlingType type, int renderPass) {
|
||||
return getGermlingIcon(type, renderPass);
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
public short fancyUID;
|
||||
public short plainUID;
|
||||
public short changedUID;
|
||||
public String descript;
|
||||
|
||||
LeafType(short fancyUID, short plainUID, short changedUID, String descript) {
|
||||
this.fancyUID = fancyUID;
|
||||
this.plainUID = plainUID;
|
||||
this.changedUID = changedUID;
|
||||
this.descript = descript;
|
||||
}
|
||||
}
|
||||
|
||||
public enum SaplingType {
|
||||
Default,
|
||||
Jungle,
|
||||
Conifer,
|
||||
Fruit,
|
||||
Poplar,
|
||||
Palm,
|
||||
Shrub;
|
||||
|
||||
protected IIcon[] icon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +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");
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum SaplingType {
|
||||
DEFAULT,
|
||||
JUNGLE,
|
||||
CONIFER,
|
||||
FRUIT,
|
||||
POPLAR,
|
||||
PALM,
|
||||
SHRUB;
|
||||
|
||||
public IIcon[] icon;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.arboriculture.ITreeGenerator;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import forestry.arboriculture.blocks.BlockForestryLeaves;
|
||||
import forestry.arboriculture.genetics.Tree;
|
||||
import forestry.arboriculture.tiles.TileLeaves;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.plugins.PluginArboriculture;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class DefaultTreeGenerator implements ITreeGenerator {
|
||||
private ExtraTreeSpecies extraTreeSpecies;
|
||||
|
||||
public DefaultTreeGenerator(ExtraTreeSpecies extraTreeSpecies) {
|
||||
this.extraTreeSpecies = extraTreeSpecies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogBlock(ITreeGenome genome, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
if (extraTreeSpecies.wood != null)
|
||||
extraTreeSpecies.wood.placeBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLeaves(ITreeGenome genome, World world, GameProfile owner, int x, int y, int z, boolean decorative) {
|
||||
boolean placed = world.setBlock(x, y, z, PluginArboriculture.blocks.leaves, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
if (!placed) {
|
||||
return;
|
||||
}
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (PluginArboriculture.blocks.leaves != block) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
TileLeaves tileLeaves = BlockForestryLeaves.getLeafTile(world, x, y, z);
|
||||
if (tileLeaves == null) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
tileLeaves.setOwner(owner);
|
||||
if (decorative) {
|
||||
tileLeaves.setDecorative();
|
||||
}
|
||||
|
||||
tileLeaves.setTree(new Tree(genome));
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogBlock(World world, int x, int y, int z, ForgeDirection direction) {
|
||||
extraTreeSpecies.wood.placeBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLeaves(World world, GameProfile player, int x, int y, int z, boolean arg5) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldGenerator getWorldGenerator(ITreeGenData tree) {
|
||||
return extraTreeSpecies.getGenerator(tree);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-4
@@ -1,9 +1,6 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import binnie.extratrees.worldgen.BlockType;
|
||||
import binnie.extratrees.worldgen.BlockTypeLeaf;
|
||||
import binnie.extratrees.worldgen.BlockTypeLog;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenDefault extends WorldGenTree {
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import binnie.extratrees.worldgen.BlockTypeLog;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import binnie.extratrees.worldgen.BlockType;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gen;
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
@@ -4,17 +4,86 @@ import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.core.genetics.alleles.EnumAllele;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class AlleleHelper {
|
||||
public static IAllele getAllele(EnumTemperature temperature) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(temperature));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumHumidity humidity) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(humidity));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumTolerance tolerance) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(tolerance));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Fertility fertility) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(fertility));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Territory territory) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(territory));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Lifespan lifespan) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(lifespan));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Sappiness sappiness) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(sappiness));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Speed speed) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(speed));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Flowering flowering) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(flowering));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Height height) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(height));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Maturation maturation) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(maturation));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Yield yield) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(yield));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumAllele.Saplings saplings) {
|
||||
return AlleleManager.alleleRegistry.getAllele(getUid(saplings));
|
||||
}
|
||||
|
||||
public static IAllele getAllele(EnumFlowerColor color) {
|
||||
return color.getAllele();
|
||||
}
|
||||
|
||||
public static IAllele getAllele(int number) {
|
||||
return AlleleManager.alleleRegistry.getAllele("forestry.i" + number + "d");
|
||||
}
|
||||
|
||||
public static IAllele getAllele(boolean bool) {
|
||||
if (bool) {
|
||||
return AlleleManager.alleleRegistry.getAllele("forestry.boolTrue");
|
||||
}
|
||||
return AlleleManager.alleleRegistry.getAllele("forestry.boolFalse");
|
||||
}
|
||||
|
||||
public static String toDisplay(EnumTemperature temperature) {
|
||||
return AlleleManager.climateHelper.toDisplay(temperature);
|
||||
}
|
||||
@@ -34,7 +103,7 @@ public class AlleleHelper {
|
||||
public static String toDisplay(EnumSoilType soilType) {
|
||||
return I18N.localise(Botany.instance, "soil." + soilType.getID());
|
||||
}
|
||||
|
||||
|
||||
public static String toDisplay(EnumTolerance tolerance) {
|
||||
return toAlleleDisplay("tolerance", tolerance.name());
|
||||
}
|
||||
@@ -51,6 +120,14 @@ public class AlleleHelper {
|
||||
return getUid("sappiness", sappiness.name());
|
||||
}
|
||||
|
||||
private static String getUid(EnumTemperature temperature) {
|
||||
return getUid("temperature", temperature.name());
|
||||
}
|
||||
|
||||
private static String getUid(EnumHumidity humidity) {
|
||||
return getUid("humidity", humidity.name());
|
||||
}
|
||||
|
||||
public static String getUid(EnumAllele.Saplings saplings) {
|
||||
if (saplings == EnumAllele.Saplings.AVERAGE) {
|
||||
return getUid("saplings", "Default");
|
||||
@@ -106,15 +183,15 @@ public class AlleleHelper {
|
||||
return getUid(key, valueName, true);
|
||||
}
|
||||
|
||||
protected static String getUid(String key, String valueName, boolean needCapitalize) {
|
||||
private static String getUid(String key, String valueName, boolean needCapitalize) {
|
||||
if (needCapitalize) {
|
||||
valueName = WordUtils.capitalize(valueName.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
valueName = valueName.replace("_", "");
|
||||
return "forestry." + key + valueName;
|
||||
}
|
||||
|
||||
protected static String toAlleleDisplay(String key, String valueName) {
|
||||
|
||||
private static String toAlleleDisplay(String key, String valueName) {
|
||||
String name = valueName.toLowerCase().replace("_", "");
|
||||
return I18N.localise("forestry.allele." + key + "." + name);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user