Fixed doubled base production modifier, fixed tooltips for frames with negative modifiers

This commit is contained in:
Gabriel Eiseman committed 2023-07-14 16:00:06 -04:00
1 parent 6f399f1f96
commit 22ff1f569a
3 files changed
+8 -5

No files matched your search

@@ -49,7 +49,8 @@ public class BeeHousingModifier implements IBeeModifier {
@Override
public float getProductionModifier(IBeeGenome genome, final float currentModifier) {
float modifierValue = 1.0f;
float modifierValue = 0.0f;// the "base" value of 1.0 should come from Bee.java or BeeKeepingMode.jave, that is,
// it should be set at the call site
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
modifierValue += modifier.getProductionModifier(genome, modifierValue + currentModifier);
}
@@ -84,10 +84,12 @@ public class EventHandlerApiculture {
String formatted = color.toString();
// Set symbol for if this value is additive or multiplicative
if (additive) {
if (!additive) {
formatted += " x";
} else if (value >= 0.0F) {
formatted += " +";
} else {
formatted += " x";
formatted += " "; // the "-" will be applied, but we still need a space or minecraft will crash
}
// trim trailing zeroes if no decimal-precision is needed
@@ -514,8 +514,8 @@ public class Bee extends IndividualLiving implements IBee {
// Bee genetic speed * beehousing * beekeeping mode
float speed = genome.getSpeed();
float prodModifier = beeHousingModifier.getProductionModifier(genome, 1f)
* beeModeModifier.getProductionModifier(genome, 1f);
float prodModifier = beeHousingModifier.getProductionModifier(genome, 1f);
prodModifier += beeModeModifier.getProductionModifier(genome, prodModifier);
// / Primary Products
for (Map.Entry<ItemStack, Float> entry : primary.getProductChances().entrySet()) {