This commit is contained in:
Tracker-Friendly 2025-03-06 18:46:55 +00:00
parent 4823d6d78c
commit 895b20bcd5

View file

@ -10,12 +10,12 @@ import java.util.Set;
public class SearchForNeighbours {
public static Set<EnergyBlock> searchForNeighbours(World world, BlockPos pos) {
var neighbours = new HashSet<EnergyBlock>();
Direction.stream().forEach(direction -> {
for (var direction : Direction.values()) {
var entity = world.getBlockEntity(pos.offset(direction));
if (entity instanceof EnergyBlock) {
neighbours.add((EnergyBlock) entity);
}
});
}
return neighbours;
}
}