Skip to content

Commit fd8c0c1

Browse files
committed
fix harvest golem
1 parent 58be070 commit fd8c0c1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ItemAbilityHandler {
2323
return
2424
}
2525
val player = mc.player
26-
val stack = player!!.mainHandItem
26+
val stack = player?.mainHandItem
2727
if (stack == null) {
2828
active = false
2929
return

Diff for: src/main/kotlin/dev/sterner/common/entity/ai/sensor/GolemStorageSensor.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ class GolemStorageSensor : PredicateSensor<BlockEntity, SoulSteelGolemEntity>(
5454
}
5555

5656
if (blocks.isEmpty()) {
57-
BrainUtils.clearMemory(entity, VoidBoundMemoryTypeRegistry.NEARBY_CROPS.get())
57+
if (entity.getGolemCore() == GolemCore.FILL) {
58+
BrainUtils.clearMemory(entity, VoidBoundMemoryTypeRegistry.OUTPUT_STORAGE_LOCATIONS.get())
59+
} else if (entity.getGolemCore() == GolemCore.EMPTY) {
60+
BrainUtils.clearMemory(entity, VoidBoundMemoryTypeRegistry.INPUT_STORAGE_LOCATIONS.get())
61+
}
5862
} else {
5963
if (entity.getGolemCore() == GolemCore.FILL) {
6064
BrainUtils.setMemory(entity, VoidBoundMemoryTypeRegistry.OUTPUT_STORAGE_LOCATIONS.get(), blocks)

0 commit comments

Comments
 (0)