Skip to content

Commit c6a4fe7

Browse files
Actually fix NPE source.
Wont ask the cover if it has such capability if the entity itself doesnt have it on that side. null check in cover capability code wont trigger anymore
1 parent bf1286d commit c6a4fe7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/gregtech/api/metatileentity/MetaTileEntity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,10 @@ public final <T> T getCoverCapability(Capability<T> capability, EnumFacing side)
771771
boolean isCoverable = capability == GregtechTileCapabilities.CAPABILITY_COVERABLE;
772772
CoverBehavior coverBehavior = side == null ? null : getCoverAtSide(side);
773773
T originalCapability = getCapability(capability, side);
774+
// If we have no such capability on this side, then the cover on this side cant have it either
775+
if (originalCapability == null) {
776+
return null;
777+
}
774778
if (coverBehavior != null && !isCoverable) {
775779
return coverBehavior.getCapability(capability, originalCapability);
776780
}

0 commit comments

Comments
 (0)