Akashic libraries now have a range limit
This commit is contained in:
parent
0ba1c36ad9
commit
6418e9b95e
2 changed files with 11 additions and 8 deletions
|
@ -37,10 +37,9 @@ public class BlockAkashicFloodfiller extends Block {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
public static @Nullable
|
public static BlockPos floodFillFor(BlockPos start, Level world,
|
||||||
BlockPos floodFillFor(BlockPos start, Level world,
|
TriPredicate<BlockPos, BlockState, Level> isValid, TriPredicate<BlockPos, BlockState, Level> isTarget, int maxRange) {
|
||||||
TriPredicate<BlockPos, BlockState, Level> isValid, TriPredicate<BlockPos, BlockState, Level> isTarget) {
|
|
||||||
var seenBlocks = new HashSet<BlockPos>();
|
var seenBlocks = new HashSet<BlockPos>();
|
||||||
var todo = new ArrayDeque<BlockPos>();
|
var todo = new ArrayDeque<BlockPos>();
|
||||||
todo.add(start);
|
todo.add(start);
|
||||||
|
@ -50,6 +49,10 @@ public class BlockAkashicFloodfiller extends Block {
|
||||||
|
|
||||||
for (var dir : Direction.values()) {
|
for (var dir : Direction.values()) {
|
||||||
var neighbor = here.relative(dir);
|
var neighbor = here.relative(dir);
|
||||||
|
|
||||||
|
if (neighbor.distSqr(start) > maxRange * maxRange)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (seenBlocks.add(neighbor)) {
|
if (seenBlocks.add(neighbor)) {
|
||||||
var bs = world.getBlockState(neighbor);
|
var bs = world.getBlockState(neighbor);
|
||||||
if (isTarget.test(neighbor, bs, world)) {
|
if (isTarget.test(neighbor, bs, world)) {
|
||||||
|
@ -64,10 +67,10 @@ public class BlockAkashicFloodfiller extends Block {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static @Nullable
|
@Nullable
|
||||||
BlockPos floodFillFor(BlockPos start, Level world,
|
public static BlockPos floodFillFor(BlockPos start, Level world,
|
||||||
TriPredicate<BlockPos, BlockState, Level> isTarget) {
|
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) {
|
public static boolean canItBeFloodedThrough(BlockPos pos, BlockState state, Level world) {
|
||||||
|
|
|
@ -705,7 +705,7 @@
|
||||||
|
|
||||||
"hexcasting.entry.akashiclib": "Akashic Libraries",
|
"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.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.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.",
|
"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.",
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue