Allow setting qc range with quasiConnectivity setting (#1617)
* add quasiConnectivityRange setting * make sure qc range respects different world heights * check if source == null in qc range validator * merge the two qc settings * Set minimum range down to zero (no qc)
This commit is contained in:
1 parent
f2c658bf03
commit
0e2f6df4d3
4 files changed
+86
-34
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package carpet.helpers;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
public class QuasiConnectivity {
|
||||
|
||||
public static boolean hasQuasiSignal(Level level, BlockPos pos) {
|
||||
for (int i = 1; i <= CarpetSettings.quasiConnectivity; i++) {
|
||||
BlockPos above = pos.above(i);
|
||||
|
||||
if (level.isOutsideBuildHeight(above)) {
|
||||
break;
|
||||
}
|
||||
if (level.hasNeighborSignal(above)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user