use of mods.railcraft.common.util.misc.AABBFactory in project Railcraft by Railcraft.
the class TokenRing method tick.
public void tick(World world) {
if (!signals.isEmpty()) {
BlockPos origin = signals.stream().findAny().orElse(BlockPos.ORIGIN);
AABBFactory aabbFactory = AABBFactory.start().createBoxForTileAt(origin);
for (BlockPos pos : signals) {
aabbFactory.expandToCoordinate(pos);
}
aabbFactory.grow(16).clampToWorld();
List<EntityMinecart> carts = EntitySearcher.findMinecarts().around(aabbFactory.build()).in(world);
trackedCarts.retainAll(carts.stream().map(Entity::getUniqueID).collect(Collectors.toSet()));
}
}
Aggregations