Skip to content

Commit

Permalink
fix: logistics cannot interact with upper parts of double-high machines
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Aug 5, 2024
1 parent 6705f5d commit f840523
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ protected void notifyTargetCapabilityCacheCreated(BlockCapabilityCache<T, C> cap
* @return
*/
public List<BlockCapabilityCache<T, C>> availableTargetCapabilities() {
return this.targetCapabilities.stream().filter(cache -> this.level().isLoaded(cache.pos()) && this.level().getBlockEntity(cache.pos()) != null).toList();
return this.targetCapabilities.stream().filter(cache ->
this.level().isLoaded(cache.pos()) &&
//instead of querying the BE, we query the cap.
//because some caps come without BE, and even our own double-height blocks don't have a BE for the upper part.
this.level().getCapability(this.capabilityType(), cache.pos(), cache.context()) != null
).toList();
}

/**
Expand Down

0 comments on commit f840523

Please sign in to comment.