Skip to content

Commit cbc1232

Browse files
committed
修复EF内部有无效样板时报错的问题
1 parent 77e1e6b commit cbc1232

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/github/kasuminova/novaeng/common/tile/ecotech/efabricator/EFabricatorPatternBus.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ open class EFabricatorPatternBus : EFabricatorPart(), IAEAppEngInventory {
110110
private fun addPattern(stack: ItemStack) {
111111
val item = stack.item
112112
if (item is ItemEncodedPattern) {
113-
val pattern = item.getPatternForItem(stack, this.world)
113+
val pattern = item.getPatternForItem(stack, this.world) ?: return
114114
if (pattern.isCraftable || pattern is FluidPatternDetails) {
115115
aePatterns.add(pattern.condensedOutputs[0])
116116
}
@@ -120,7 +120,7 @@ open class EFabricatorPatternBus : EFabricatorPart(), IAEAppEngInventory {
120120
private fun removePattern(stack: ItemStack) {
121121
val item = stack.item
122122
if (item is ItemEncodedPattern) {
123-
val pattern = item.getPatternForItem(stack, this.world)
123+
val pattern = item.getPatternForItem(stack, this.world) ?: return
124124
if (pattern.isCraftable || pattern is FluidPatternDetails) {
125125
aePatterns.remove(pattern.condensedOutputs[0])
126126
}

0 commit comments

Comments
 (0)