diff --git a/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java b/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java index c9a2834b7..19c1e2d55 100644 --- a/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java +++ b/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java @@ -24,7 +24,7 @@ public class DefaultBeeModifier implements IBeeModifier { } public float getProductionModifier(IBeeGenome genome, float currentModifier) { - return 1.0f; + return 0.0f; } public float getFloweringModifier(IBeeGenome genome, float currentModifier) { diff --git a/src/main/java/forestry/apiculture/ApiaryBeeModifier.java b/src/main/java/forestry/apiculture/ApiaryBeeModifier.java index 4b516bb17..1b6887e6f 100644 --- a/src/main/java/forestry/apiculture/ApiaryBeeModifier.java +++ b/src/main/java/forestry/apiculture/ApiaryBeeModifier.java @@ -15,6 +15,6 @@ public class ApiaryBeeModifier extends DefaultBeeModifier { @Override public float getProductionModifier(IBeeGenome genome, float currentModifier) { - return 0.1f; + return -0.9f; // results in 0.1 with no frames, see BeeHousingModifier,java } } diff --git a/src/main/java/forestry/apiculture/BeeHousingModifier.java b/src/main/java/forestry/apiculture/BeeHousingModifier.java index 2156d5423..7c0c08386 100644 --- a/src/main/java/forestry/apiculture/BeeHousingModifier.java +++ b/src/main/java/forestry/apiculture/BeeHousingModifier.java @@ -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; // part of the additive production nerf, but don't worry at least you effectively + // get +1 from `t` in `Bee.java:produceStacks` for (IBeeModifier modifier : beeHousing.getBeeModifiers()) { modifierValue += modifier.getProductionModifier(genome, modifierValue + currentModifier); } diff --git a/src/main/java/forestry/apiculture/BeehouseBeeModifier.java b/src/main/java/forestry/apiculture/BeehouseBeeModifier.java index f4db9bd7a..bf5feb949 100644 --- a/src/main/java/forestry/apiculture/BeehouseBeeModifier.java +++ b/src/main/java/forestry/apiculture/BeehouseBeeModifier.java @@ -20,7 +20,7 @@ public class BeehouseBeeModifier extends DefaultBeeModifier { @Override public float getProductionModifier(IBeeGenome genome, float currentModifier) { - return 0.25f; + return -0.75f;// results in 0.25 with no frames, see BeeHousingModifier,java } @Override diff --git a/src/main/java/forestry/apiculture/EventHandlerApiculture.java b/src/main/java/forestry/apiculture/EventHandlerApiculture.java index 60696863d..79ecd76a3 100644 --- a/src/main/java/forestry/apiculture/EventHandlerApiculture.java +++ b/src/main/java/forestry/apiculture/EventHandlerApiculture.java @@ -34,19 +34,31 @@ public class EventHandlerApiculture { tooltip.add(StringUtil.localize("frame.tooltip.durability") + getDurabilityFormatted(durability)); float territory = modifier.getTerritoryModifier(null, 1.0F); - tooltip.add(StringUtil.localize("frame.tooltip.territory") + getColorFormatted(territory)); - + tooltip.add( + StringUtil.localize("frame.tooltip.territory") + + getModifierFormatted(territory, false, false)); float mutation = modifier.getMutationModifier(null, null, 1.0F); - tooltip.add(StringUtil.localize("frame.tooltip.mutationRate") + getColorFormatted(mutation)); - + tooltip.add( + StringUtil.localize("frame.tooltip.mutationRate") + + getModifierFormatted(mutation, false, false)); float lifespan = modifier.getLifespanModifier(null, null, 1.0F); - tooltip.add(StringUtil.localize("frame.tooltip.lifespan") + getColorFormatted(lifespan)); - - float production = modifier.getProductionModifier(null, 1.0F); - tooltip.add(StringUtil.localize("frame.tooltip.production") + getColorFormatted(production, true)); - + // lower lifespan is better + tooltip.add( + StringUtil.localize("frame.tooltip.lifespan") + + getModifierFormatted(lifespan, false, true)); + float production = modifier.getProductionModifier(null, 0.0F); + tooltip.add( + StringUtil.localize("frame.tooltip.production") + + getModifierFormatted(production, true, false)); + float flowering = modifier.getFloweringModifier(null, 1.0F); + tooltip.add( + StringUtil.localize("frame.tooltip.flowering") + + getModifierFormatted(flowering, false, false)); float decay = modifier.getGeneticDecay(null, 1.0F); - tooltip.add(StringUtil.localize("frame.tooltip.geneticDecay") + getColorFormatted(decay)); + // lower genetic decay is better + tooltip.add( + StringUtil.localize("frame.tooltip.geneticDecay") + + getModifierFormatted(decay, false, true)); } } } @@ -68,15 +80,27 @@ public class EventHandlerApiculture { return color + " " + durability; } - private static String getColorFormatted(float value, boolean additive) { + private static String getModifierFormatted(float value, boolean additive, boolean undesireable) { EnumChatFormatting color; - if (value <= 0.5F) { + float lo_threshold = 0.5F, mid_threshold = 1.0F, hi_threshold = 2.0F; + float discriminant = value; + if (additive) { + lo_threshold = -1.0F; + mid_threshold = 0.0F; + hi_threshold = 2.0F; // this one is the same + if (undesireable) { + discriminant = -value; + } + } else if (undesireable) { + discriminant = 1.0F / value; + } + if (discriminant <= lo_threshold) { color = EnumChatFormatting.DARK_RED; // "bad" stat - } else if (value < 1.0F) { + } else if (discriminant < mid_threshold) { color = EnumChatFormatting.RED; // "below average" stat - } else if (value == 1.0F) { + } else if (discriminant == mid_threshold) { color = EnumChatFormatting.GOLD; // "average" stat - } else if (value <= 2.0F) { + } else if (discriminant <= hi_threshold) { color = EnumChatFormatting.GREEN; // "above average" stat } else { color = EnumChatFormatting.AQUA; // "great" stat @@ -84,10 +108,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 @@ -96,8 +122,4 @@ public class EventHandlerApiculture { } return formatted + value; } - - private static String getColorFormatted(float value) { - return getColorFormatted(value, false); - } } diff --git a/src/main/java/forestry/apiculture/genetics/Bee.java b/src/main/java/forestry/apiculture/genetics/Bee.java index aa5e4f660..ca5f533f7 100644 --- a/src/main/java/forestry/apiculture/genetics/Bee.java +++ b/src/main/java/forestry/apiculture/genetics/Bee.java @@ -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, 0f); + prodModifier += beeModeModifier.getProductionModifier(genome, prodModifier); // / Primary Products for (Map.Entry entry : primary.getProductChances().entrySet()) { @@ -551,10 +551,13 @@ public class Bee extends IndividualLiving implements IBee { } public static float getFinalChance(float chance, float beeSpeed, float productionModifier, float t) { + if (productionModifier + t <= 0f) { + return 0f; + } chance *= 100f; return (float) (2.8 * Math.pow(chance, 0.52) * Math.pow((productionModifier + t), 0.52) - * Math.pow(beeSpeed, 0.37)) / 100.f; + * Math.pow(beeSpeed, 0.37)) / 100f; } /* REPRODUCTION */ diff --git a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java index ca2954901..eeb2f9cc9 100755 --- a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java +++ b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java @@ -24,11 +24,19 @@ import forestry.api.apiculture.IBeekeepingMode; public class BeekeepingMode implements IBeekeepingMode { - public static final IBeekeepingMode easy = new BeekeepingMode("EASY", 2.0f, 1.0f, 1.0f, false, false); - public static final IBeekeepingMode normal = new BeekeepingMode("NORMAL", 1.0f, 1.0f, 1.0f, false, true); - public static final IBeekeepingMode hard = new BeekeepingMode("HARD", 0.75f, 1.5f, 1.0f, false, true); - public static final IBeekeepingMode hardcore = new BeekeepingMode("HARDCORE", 0.5f, 5.0f, 0.8f, true, true); - public static final IBeekeepingMode insane = new BeekeepingMode("INSANE", 0.2f, 10.0f, 0.6f, true, true); + public static final IBeekeepingMode easy = new BeekeepingMode("EASY", 2.0f, 1.0f, 0.0f, false, false);// original + // multiplicative + // modifier is + // 1x + public static final IBeekeepingMode normal = new BeekeepingMode("NORMAL", 1.0f, 1.0f, 0.0f, false, true);// orig 1x + public static final IBeekeepingMode hard = new BeekeepingMode("HARD", 0.75f, 1.5f, 0.0f, false, true);// orig 1x; + // this is the + // default in + // gtnh + public static final IBeekeepingMode hardcore = new BeekeepingMode("HARDCORE", 0.5f, 5.0f, -0.2f, true, true);// orig + // 0.8x + public static final IBeekeepingMode insane = new BeekeepingMode("INSANE", 0.2f, 10.0f, -0.4f, true, true);// orig + // 0.6x private final Random rand; private final String name; @@ -93,7 +101,7 @@ public class BeekeepingMode implements IBeekeepingMode { public boolean isOverworked(IBee queen, IBeeHousing housing) { IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - float productionModifier = beeModifier.getProductionModifier(queen.getGenome(), 1f); + float productionModifier = beeModifier.getProductionModifier(queen.getGenome(), 0f); if (productionModifier > 16) { if (housing.getWorld().rand.nextFloat() * 100 < 0.01 * ((productionModifier * productionModifier) - 100)) { return true; diff --git a/src/main/java/forestry/apiculture/items/ItemHiveFrame.java b/src/main/java/forestry/apiculture/items/ItemHiveFrame.java index 25bdb4943..df21d8d4a 100755 --- a/src/main/java/forestry/apiculture/items/ItemHiveFrame.java +++ b/src/main/java/forestry/apiculture/items/ItemHiveFrame.java @@ -56,7 +56,7 @@ public class ItemHiveFrame extends ItemForestry implements IHiveFrame { @Override public float getProductionModifier(IBeeGenome genome, float currentModifier) { - return (currentModifier < 10f) ? 2f : 1f; + return (currentModifier < 10.0f) ? 1.0f : 0.0f; } @Override diff --git a/src/main/resources/assets/forestry/lang/en_US.lang b/src/main/resources/assets/forestry/lang/en_US.lang index a7b9d299e..8647a7fe8 100644 --- a/src/main/resources/assets/forestry/lang/en_US.lang +++ b/src/main/resources/assets/forestry/lang/en_US.lang @@ -573,6 +573,7 @@ for.frame.tooltip.territory=Territory: for.frame.tooltip.mutationRate=Mutation Rate: for.frame.tooltip.lifespan=Lifespan: for.frame.tooltip.production=Production: +for.frame.tooltip.flowering=Flowering: for.frame.tooltip.geneticDecay=Genetic Decay: item.for.fruits.cherry.name=Cherry