Skip to content

Commit

Permalink
Actually fix NPE source.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
PrototypeTrousers committed Nov 12, 2020
1 parent bf1286d commit c6a4fe7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/gregtech/api/metatileentity/MetaTileEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,10 @@ public final <T> T getCoverCapability(Capability<T> capability, EnumFacing side)
boolean isCoverable = capability == GregtechTileCapabilities.CAPABILITY_COVERABLE;
CoverBehavior coverBehavior = side == null ? null : getCoverAtSide(side);
T originalCapability = getCapability(capability, side);
// If we have no such capability on this side, then the cover on this side cant have it either
if (originalCapability == null) {
return null;
}
if (coverBehavior != null && !isCoverable) {
return coverBehavior.getCapability(capability, originalCapability);
}
Expand Down

0 comments on commit c6a4fe7

Please sign in to comment.