mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 15:22:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19ef8fe309 |
No files matched your search
@@ -51,7 +51,7 @@ public class BeeHousingModifier implements IBeeModifier {
|
|||||||
public float getProductionModifier(IBeeGenome genome, final float currentModifier) {
|
public float getProductionModifier(IBeeGenome genome, final float currentModifier) {
|
||||||
float modifierValue = 1.0f;
|
float modifierValue = 1.0f;
|
||||||
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
||||||
modifierValue *= modifier.getProductionModifier(genome, modifierValue * currentModifier);
|
modifierValue += modifier.getProductionModifier(genome, modifierValue + currentModifier);
|
||||||
}
|
}
|
||||||
return modifierValue;
|
return modifierValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -455,12 +455,11 @@ public class Bee extends IndividualLiving implements IBee {
|
|||||||
// / PRODUCTION
|
// / PRODUCTION
|
||||||
@Override
|
@Override
|
||||||
public ItemStack[] getProduceList() {
|
public ItemStack[] getProduceList() {
|
||||||
ArrayList<ItemStack> products = new ArrayList<>();
|
|
||||||
|
|
||||||
IAlleleBeeSpecies primary = genome.getPrimary();
|
IAlleleBeeSpecies primary = genome.getPrimary();
|
||||||
IAlleleBeeSpecies secondary = genome.getSecondary();
|
IAlleleBeeSpecies secondary = genome.getSecondary();
|
||||||
|
|
||||||
products.addAll(primary.getProductChances().keySet());
|
ArrayList<ItemStack> products = new ArrayList<>(primary.getProductChances().keySet());
|
||||||
|
|
||||||
Set<ItemStack> secondaryProducts = secondary.getProductChances().keySet();
|
Set<ItemStack> secondaryProducts = secondary.getProductChances().keySet();
|
||||||
// Remove duplicates
|
// Remove duplicates
|
||||||
@@ -479,13 +478,13 @@ public class Bee extends IndividualLiving implements IBee {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return products.toArray(new ItemStack[products.size()]);
|
return products.toArray(new ItemStack[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack[] getSpecialtyList() {
|
public ItemStack[] getSpecialtyList() {
|
||||||
Set<ItemStack> specialties = genome.getPrimary().getSpecialtyChances().keySet();
|
Set<ItemStack> specialties = genome.getPrimary().getSpecialtyChances().keySet();
|
||||||
return specialties.toArray(new ItemStack[specialties.size()]);
|
return specialties.toArray(new ItemStack[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -517,7 +516,6 @@ public class Bee extends IndividualLiving implements IBee {
|
|||||||
float speed = genome.getSpeed();
|
float speed = genome.getSpeed();
|
||||||
float prodModifier = beeHousingModifier.getProductionModifier(genome, 1f)
|
float prodModifier = beeHousingModifier.getProductionModifier(genome, 1f)
|
||||||
* beeModeModifier.getProductionModifier(genome, 1f);
|
* beeModeModifier.getProductionModifier(genome, 1f);
|
||||||
prodModifier /= 4f;
|
|
||||||
|
|
||||||
// / Primary Products
|
// / Primary Products
|
||||||
for (Map.Entry<ItemStack, Float> entry : primary.getProductChances().entrySet()) {
|
for (Map.Entry<ItemStack, Float> entry : primary.getProductChances().entrySet()) {
|
||||||
@@ -541,7 +539,7 @@ public class Bee extends IndividualLiving implements IBee {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack[] productsArray = products.toArray(new ItemStack[products.size()]);
|
ItemStack[] productsArray = products.toArray(new ItemStack[0]);
|
||||||
ChunkCoordinates housingCoordinates = housing.getCoordinates();
|
ChunkCoordinates housingCoordinates = housing.getCoordinates();
|
||||||
return genome.getFlowerProvider().affectProducts(
|
return genome.getFlowerProvider().affectProducts(
|
||||||
housing.getWorld(),
|
housing.getWorld(),
|
||||||
@@ -554,9 +552,9 @@ public class Bee extends IndividualLiving implements IBee {
|
|||||||
|
|
||||||
public static float getFinalChance(float chance, float beeSpeed, float productionModifier, float t) {
|
public static float getFinalChance(float chance, float beeSpeed, float productionModifier, float t) {
|
||||||
chance *= 100f;
|
chance *= 100f;
|
||||||
return (float) (((1f + t / 6f) * Math.sqrt(chance) * 2f * (1f + beeSpeed)
|
return (float) (2.8 * Math.pow(chance, 0.52)
|
||||||
+ Math.pow(productionModifier, Math.cbrt(chance))
|
* Math.pow((productionModifier + t), 0.52)
|
||||||
- 3f) / 100f);
|
* Math.pow(beeSpeed, 0.37)) / 100.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* REPRODUCTION */
|
/* REPRODUCTION */
|
||||||
|
|||||||
Reference in new issue
Block a user