Skip to content

Commit 893d776

Browse files
committed
fix crashes and default modded echantnemtns cost
1 parent 27d43bd commit 893d776

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

Diff for: src/main/kotlin/dev/sterner/api/VoidBoundApi.kt

+13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package dev.sterner.api
33
import com.sammy.malum.client.VoidRevelationHandler
44
import com.sammy.malum.common.container.WeaversWorkbenchContainer.component
55
import com.sammy.malum.core.systems.recipe.SpiritWithCount
6+
import com.sammy.malum.core.systems.spirit.MalumSpiritType
7+
import com.sammy.malum.registry.common.SpiritTypeRegistry
68
import dev.sterner.api.item.ItemAbility
79
import dev.sterner.listener.EnchantSpiritDataReloadListener
810
import dev.sterner.registry.VoidBoundComponentRegistry
@@ -63,6 +65,17 @@ object VoidBoundApi {
6365
}
6466
}
6567

68+
if (out.isEmpty()) {
69+
out.add(SpiritWithCount(SpiritTypeRegistry.AQUEOUS_SPIRIT, 4 * level))
70+
out.add(SpiritWithCount(SpiritTypeRegistry.INFERNAL_SPIRIT, 4 * level))
71+
out.add(SpiritWithCount(SpiritTypeRegistry.EARTHEN_SPIRIT, 4 * level))
72+
out.add(SpiritWithCount(SpiritTypeRegistry.AERIAL_SPIRIT, 4 * level))
73+
74+
out.add(SpiritWithCount(SpiritTypeRegistry.ARCANE_SPIRIT, 4 * level))
75+
out.add(SpiritWithCount(SpiritTypeRegistry.ELDRITCH_SPIRIT, 4 * level))
76+
out.add(SpiritWithCount(SpiritTypeRegistry.SACRED_SPIRIT, 4 * level))
77+
out.add(SpiritWithCount(SpiritTypeRegistry.WICKED_SPIRIT, 4 * level))
78+
}
6679
return out
6780
}
6881

Diff for: src/main/kotlin/dev/sterner/client/event/SpiritAltarHudRenderEvent.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ object SpiritAltarHudRenderEvent {
4949
val recipe: SpiritInfusionRecipe? = se.possibleRecipes.entries.stream()
5050
.filter { it: Map.Entry<SpiritInfusionRecipe?, Ranking?> -> it.value != null }
5151
.max(java.util.Map.Entry.comparingByValue())
52-
.map({ it.key })
53-
.orElse(null) as SpiritInfusionRecipe
52+
.map { it.key }
53+
.orElse(null)
5454
val extras = recipe?.extraItems
5555
val inventory = se.extrasInventory
5656

Diff for: src/main/kotlin/dev/sterner/common/menu/OsmoticEnchanterMenu.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class OsmoticEnchanterMenu(
1717
i: Int, inventory: Inventory, val pos: BlockPos,
1818
) : AbstractContainerMenu(VoidBoundMenuTypeRegistry.OSMOTIC_ENCHANTER.get(), i) {
1919

20-
var inventory: LodestoneBlockEntityInventory? = null
2120
var osmoticEnchanter: OsmoticEnchanterBlockEntity? = null
2221
var shouldRefresh = true
2322

@@ -78,15 +77,15 @@ class OsmoticEnchanterMenu(
7877
if (slot.hasItem()) {
7978
val itemStack1 = slot.item
8079
itemStack = itemStack1.copy()
81-
if (index < this.inventory!!.stacks.size) {
80+
if (index < osmoticEnchanter?.inventory!!.stacks.size) {
8281
if (!this.moveItemStackTo(
83-
itemStack1, this.inventory!!.stacks.size,
82+
itemStack1, osmoticEnchanter?.inventory!!.stacks.size,
8483
slots.size, true
8584
)
8685
) {
8786
return ItemStack.EMPTY
8887
}
89-
} else if (!this.moveItemStackTo(itemStack1, 0, this.inventory!!.stacks.size, false)) {
88+
} else if (!this.moveItemStackTo(itemStack1, 0, osmoticEnchanter?.inventory!!.stacks.size, false)) {
9089
return ItemStack.EMPTY
9190
}
9291

0 commit comments

Comments
 (0)