Skip to content

Commit ec0f289

Browse files
committed
Fix broken pipenets causing DuctPipeBlockEntity to return illegal LazyOptionals
1 parent e93d421 commit ec0f289

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/com/gregtechceu/gtceu/common/blockentity/DuctPipeBlockEntity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public static void onBlockEntityRegister(BlockEntityType<DuctPipeBlockEntity> du
5252
initHandlers();
5353
}
5454
checkNetwork();
55+
56+
if (defaultHandler == null) {
57+
// if the default handler is null, return LazyOptional.empty because that means the pipenet is invalid
58+
return LazyOptional.empty();
59+
}
5560
return GTCapability.CAPABILITY_HAZARD_CONTAINER.orEmpty(cap,
5661
LazyOptional.of(() -> handlers.getOrDefault(side, defaultHandler)));
5762
} else if (cap == GTCapability.CAPABILITY_COVERABLE) {

0 commit comments

Comments
 (0)