diff --git a/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/FarmBeaconManager.java b/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/FarmBeaconManager.java index f20e8d716..8435d8bfb 100644 --- a/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/FarmBeaconManager.java +++ b/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/FarmBeaconManager.java @@ -16,18 +16,21 @@ public class FarmBeaconManager { private final NamespacedKey farmBeaconKey; private final int beaconRange; private final double farmBeaconFertility; + private final double farmBeaconGrowthMultiplier; - public FarmBeaconManager(NamespacedKey farmBeaconKey, int beaconRange, double farmBeaconFertility) { + public FarmBeaconManager(NamespacedKey farmBeaconKey, int beaconRange, double farmBeaconFertility, double farmBeaconGrowthMultiplier) { this.farmBeaconKey = farmBeaconKey; this.beaconRange = beaconRange; this.farmBeaconFertility = farmBeaconFertility; + this.farmBeaconGrowthMultiplier = farmBeaconGrowthMultiplier; } public static FarmBeaconManager fromConfiguration(ConfigurationSection section) { return new FarmBeaconManager( NamespacedKey.fromString(section.getString("farm_beacon_key")), section.getInt("farm_beacon_range"), - section.getDouble("farm_beacon_fertility") + section.getDouble("farm_beacon_fertility"), + section.getDouble("farm_beacon_growth_multiplier") ); } @@ -64,6 +67,10 @@ public class FarmBeaconManager { return false; } + public double getFarmBeaconGrowthMultiplier() { + return farmBeaconGrowthMultiplier; + } + public double getFarmBeaconFertility() { return farmBeaconFertility; } diff --git a/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/growthconfig/PlantGrowthConfig.java b/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/growthconfig/PlantGrowthConfig.java index 45671f5fa..59e36333b 100644 --- a/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/growthconfig/PlantGrowthConfig.java +++ b/plugins/realisticbiomes2-paper/src/main/java/com/untamedears/realisticbiomes/growthconfig/PlantGrowthConfig.java @@ -95,7 +95,6 @@ public class PlantGrowthConfig extends AbstractGrowthConfig { public String getInfoString(Block b) { double soilMultiplier = 1.0 + getSoilBonus(b); double lightMultiplier = getLightMultiplier(b); - double beaconMultiplier = getBeaconMultiplier(b); StringBuilder sb = new StringBuilder(); sb.append(ChatColor.GOLD); sb.append(ItemUtils.getItemName(item)); @@ -122,7 +121,7 @@ public class PlantGrowthConfig extends AbstractGrowthConfig { if (lightMultiplier != 1.0) { sb.append("\n" + ChatColor.GOLD + "Light multiplier: " + lightMultiplier); } - if (beaconMultiplier != 1.0) { + if (this.farmBeaconManager.isNearBeacon(b.getLocation())) { sb.append("\n" + ChatColor.LIGHT_PURPLE + "Farm beacon nearby"); } return sb.toString(); @@ -166,7 +165,7 @@ public class PlantGrowthConfig extends AbstractGrowthConfig { // affects growth time private double getBeaconMultiplier(Block block) { - return this.farmBeaconManager.isNearBeacon(block.getLocation()) ? 2.0 : 1.0; + return this.farmBeaconManager.isNearBeacon(block.getLocation()) ? this.farmBeaconManager.getFarmBeaconGrowthMultiplier() : 1.0; } /**