mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 17:44:55 +00:00
* Fixed Secondary Species Primary Production Calling Math.round on probabilities is a logical error * gradle spotlessApply * Fixed computation of BeeModifiers to be consistent with additive modifiers Needs work in other mods (Binnie and MagicBees) * Fixed doubled base production modifier, fixed tooltips for frames with negative modifiers * Fixed floating point bug if productionModifier is negative * Fixed floating point bug if productionModifier + tier is negative * Float constant suffix * Actually fix base production modifier * Improve tooltip coloring, correct production modifier self capping, add float suffixes * More tooltip improvments * Nerf base production (apiaries in shambles) * Halve forestry frame production boost Co-authored-by: Jakub <[email protected]> * Added flowering modifier to tooltips I believe one of the blood magic frames has a non-default flowering modifier * Fixed flowering modifier in tooltip and made default values visible --------- Co-authored-by: Jakub <[email protected]>
128 lines
4.4 KiB
Java
128 lines
4.4 KiB
Java
/*******************************************************************************
|
|
* Copyright (c) 2011-2014 SirSengir. All rights reserved. This program and the accompanying materials are made
|
|
* available under the terms of the GNU Lesser Public License v3 which accompanies this distribution, and is available
|
|
* at http://www.gnu.org/licenses/lgpl-3.0.txt
|
|
*
|
|
* Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie,
|
|
* MysteriousAges
|
|
******************************************************************************/
|
|
package forestry.apiculture;
|
|
|
|
import forestry.api.apiculture.IBeeGenome;
|
|
import forestry.api.apiculture.IBeeHousing;
|
|
import forestry.api.apiculture.IBeeModifier;
|
|
|
|
public class BeeHousingModifier implements IBeeModifier {
|
|
|
|
private final IBeeHousing beeHousing;
|
|
|
|
public BeeHousingModifier(IBeeHousing beeHousing) {
|
|
this.beeHousing = beeHousing;
|
|
}
|
|
|
|
@Override
|
|
public float getTerritoryModifier(IBeeGenome genome, final float currentModifier) {
|
|
float modifierValue = 1.0f;
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
modifierValue *= modifier.getTerritoryModifier(genome, modifierValue * currentModifier);
|
|
}
|
|
return modifierValue;
|
|
}
|
|
|
|
@Override
|
|
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, final float currentModifier) {
|
|
float modifierValue = 1.0f;
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
modifierValue *= modifier.getMutationModifier(genome, mate, modifierValue * currentModifier);
|
|
}
|
|
return modifierValue;
|
|
}
|
|
|
|
@Override
|
|
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, final float currentModifier) {
|
|
float modifierValue = 1.0f;
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
modifierValue *= modifier.getLifespanModifier(genome, mate, modifierValue * currentModifier);
|
|
}
|
|
return modifierValue;
|
|
}
|
|
|
|
@Override
|
|
public float getProductionModifier(IBeeGenome genome, final float currentModifier) {
|
|
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);
|
|
}
|
|
return modifierValue;
|
|
}
|
|
|
|
@Override
|
|
public float getFloweringModifier(IBeeGenome genome, final float currentModifier) {
|
|
float modifierValue = 1.0f;
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
modifierValue *= modifier.getFloweringModifier(genome, modifierValue * currentModifier);
|
|
}
|
|
return modifierValue;
|
|
}
|
|
|
|
@Override
|
|
public float getGeneticDecay(IBeeGenome genome, final float currentModifier) {
|
|
float modifierValue = 1.0f;
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
modifierValue *= modifier.getGeneticDecay(genome, modifierValue * currentModifier);
|
|
}
|
|
return modifierValue;
|
|
}
|
|
|
|
@Override
|
|
public boolean isSealed() {
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
if (modifier.isSealed()) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean isSelfLighted() {
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
if (modifier.isSelfLighted()) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean isSelfUnlighted() {
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
if (modifier.isSelfUnlighted()) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean isSunlightSimulated() {
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
if (modifier.isSunlightSimulated()) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean isHellish() {
|
|
for (IBeeModifier modifier : beeHousing.getBeeModifiers()) {
|
|
if (modifier.isHellish()) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|