Skip to content

Commit

Permalink
...wait, that's wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Nov 3, 2023
1 parent e534376 commit 0875909
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ private void registerCapabilities(AttachCapabilitiesEvent<BlockEntity> event, Ca
@NotNull
@Override
public <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) {
if (reactorPart.core().isPresent()
|| cap == ForgeCapabilities.ENERGY && reactorPart.isExtractor()) {
var holder = reactorPart.core().get().getCapability(cap, side);
holders.add(holder.cast());
return holder;
if (reactorPart.core().isEmpty() || cap == ForgeCapabilities.ENERGY && !reactorPart.isExtractor()) {
return LazyOptional.empty();
}

return LazyOptional.empty();
var holder = reactorPart.core().get().getCapability(cap, side);
holders.add(holder.cast());
return holder;
}

private void invalidate() {
Expand Down

0 comments on commit 0875909

Please sign in to comment.