Akashic libraries now have a range limit

This commit is contained in:
yrsegal@gmail.com 2022-08-25 21:08:15 -04:00
parent 0ba1c36ad9
commit 6418e9b95e
2 changed files with 11 additions and 8 deletions

View file

@ -37,10 +37,9 @@ public class BlockAkashicFloodfiller extends Block {
return true;
}
public static @Nullable
BlockPos floodFillFor(BlockPos start, Level world,
TriPredicate<BlockPos, BlockState, Level> isValid, TriPredicate<BlockPos, BlockState, Level> isTarget) {
@Nullable
public static BlockPos floodFillFor(BlockPos start, Level world,
TriPredicate<BlockPos, BlockState, Level> isValid, TriPredicate<BlockPos, BlockState, Level> isTarget, int maxRange) {
var seenBlocks = new HashSet<BlockPos>();
var todo = new ArrayDeque<BlockPos>();
todo.add(start);
@ -50,6 +49,10 @@ public class BlockAkashicFloodfiller extends Block {
for (var dir : Direction.values()) {
var neighbor = here.relative(dir);
if (neighbor.distSqr(start) > maxRange * maxRange)
continue;
if (seenBlocks.add(neighbor)) {
var bs = world.getBlockState(neighbor);
if (isTarget.test(neighbor, bs, world)) {
@ -64,10 +67,10 @@ public class BlockAkashicFloodfiller extends Block {
return null;
}
public static @Nullable
BlockPos floodFillFor(BlockPos start, Level world,
@Nullable
public static BlockPos floodFillFor(BlockPos start, Level world,
TriPredicate<BlockPos, BlockState, Level> isTarget) {
return floodFillFor(start, world, BlockAkashicFloodfiller::canItBeFloodedThrough, isTarget);
return floodFillFor(start, world, BlockAkashicFloodfiller::canItBeFloodedThrough, isTarget, 32);
}
public static boolean canItBeFloodedThrough(BlockPos pos, BlockState state, Level world) {

View file

@ -705,7 +705,7 @@
"hexcasting.entry.akashiclib": "Akashic Libraries",
"hexcasting.page.akashiclib.1": "I KNOW SO MUCH it is ONLY RIGHT to have a place to store it all. Information can be stored in books but it is oh so so so so $(italic)slow/$ to write by hand and read by eye. I demand BETTER. And so I shall MAKE better.$(br2)... I am getting worse ... do not know if I have time to write everything bursting through my head before expiring.",
"hexcasting.page.akashiclib.2": "The library. Here. My plans.$(br2)Like how patterns are associated with actions, I can associate my own patterns with iotas in any way I choose. An $(l:greatwork/akashiclib)$(item)Akashic Record/$ controls the library, and each $(l:greatwork/akashiclib)$(item)Akashic Bookshelf/$ stores one pattern mapped to one iota. These must all be directly connected together, touching. An $(l:greatwork/akashiclib)$(item)Akashic Ligature/$ doesn't do anything but count as a connecting block, to extend the size of my library.",
"hexcasting.page.akashiclib.2": "The library. Here. My plans.$(br2)Like how patterns are associated with actions, I can associate my own patterns with iotas in any way I choose. An $(l:greatwork/akashiclib)$(item)Akashic Record/$ controls the library, and each $(l:greatwork/akashiclib)$(item)Akashic Bookshelf/$ stores one pattern mapped to one iota. These must all be directly connected together, touching, within 32 blocks. An $(l:greatwork/akashiclib)$(item)Akashic Ligature/$ doesn't do anything but count as a connecting block, to extend the size of my library.",
"hexcasting.page.akashiclib.akashic_record": "Allocating and assigning patterns is simple but oh so boring. I have better things to do. I will need a mind well-used to its work for the extraction to stay sound.",
"hexcasting.page.akashiclib.3": "Then to operate the library is simple, the patterns are routed through the librarian and it looks them up and returns the iota to you. Two actions do the work. $(l:patterns/akashic_patterns)Notes here/$.$(br2)Using an empty $(l:items/scroll)$(item)scroll/$ on a bookshelf copies the pattern there onto the $(l:items/scroll)$(item)scroll/$. Sneaking and using an empty hand clears the datum in the shelf.",