aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-18 17:11:27 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-18 17:11:27 +0200
commit57101a22643c81471f5773f64205bce5270c55eb (patch)
tree06aad972f19c0d2d6563cc90c8bfc11e03ed71b5 /src/main
parent19162e0619051474d60fa8aac1548087277d5b8d (diff)
downloadskyhanni-57101a22643c81471f5773f64205bce5270c55eb.tar.gz
skyhanni-57101a22643c81471f5773f64205bce5270c55eb.tar.bz2
skyhanni-57101a22643c81471f5773f64205bce5270c55eb.zip
Biofuel price in composter is manually maxed at 20k coins
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index fbca4aad9..67fd5c778 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -291,7 +291,7 @@ class ComposterOverlay {
newList.addAsSingletonList(" §7$compostPerTitle: §e${multiplier.round(2)}$compostPerTitlePreview")
- val organicMatterPrice = NEUItems.getPrice(organicMatterItem)
+ val organicMatterPrice = getPrice(organicMatterItem)
val organicMatterFactor = organicMatterFactors[organicMatterItem]!!
val organicMatterRequired = ComposterAPI.organicMatterRequiredPer(null)
@@ -300,7 +300,7 @@ class ComposterOverlay {
val organicMatterPricePer = organicMatterPrice * (organicMatterRequired / organicMatterFactor)
val organicMatterPricePerPreview = organicMatterPrice * (organicMatterRequiredPreview / organicMatterFactor)
- val fuelPrice = NEUItems.getPrice(fuelItem)
+ val fuelPrice = getPrice(fuelItem)
val fuelFactor = fuelFactors[fuelItem]!!
val fuelRequired = ComposterAPI.fuelRequiredPer(null)
@@ -319,7 +319,7 @@ class ComposterOverlay {
newList.addAsSingletonList(materialCostFormat)
- val priceCompost = NEUItems.getPrice("COMPOST")
+ val priceCompost = getPrice("COMPOST")
val profit = (priceCompost - (fuelPricePer + organicMatterPricePer)) * multiplier
val profitPreview = (priceCompost - (fuelPricePerPreview + organicMatterPricePerPreview)) * multiplierPreview
@@ -338,7 +338,7 @@ class ComposterOverlay {
): String {
val map = mutableMapOf<String, Double>()
for ((internalName, factor) in factors) {
- map[internalName] = factor / NEUItems.getPrice(internalName)
+ map[internalName] = factor / getPrice(internalName)
}
var i = 0
@@ -349,7 +349,7 @@ class ComposterOverlay {
val item = NEUItems.getItemStack(internalName)
val itemName = item.name!!
- val price = NEUItems.getPrice(internalName)
+ val price = getPrice(internalName)
val itemsNeeded = ceil(missing / factor)
val totalPrice = itemsNeeded * price
@@ -372,6 +372,13 @@ class ComposterOverlay {
return first!!
}
+ private fun getPrice(internalName: String): Double {
+ val price = NEUItems.getPrice(internalName)
+ if (internalName == "BIOFUEL" && price > 20_000) return 20_000.0
+
+ return price
+ }
+
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
try {