From 7c3abcdb6002ebb442efce2ba49ffc65dba64179 Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Mon, 14 Sep 2026 02:58:49 -0400 Subject: [PATCH 1/7] Use integer blockstate for shelf variant --- .../blockstates/akashic_bookshelf.json | 168 +++++++++--------- .../client/RegisterClientStuff.java | 2 +- .../blocks/akashic/BlockAkashicBookshelf.java | 8 +- .../akashic/BlockEntityAkashicBookshelf.java | 8 +- .../hexcasting/common/lib/HexBlocks.java | 2 +- .../blockstates/akashic_bookshelf.json | 168 +++++++++--------- .../xplat/HexBlockStatesAndModels.java | 35 ++-- 7 files changed, 185 insertions(+), 206 deletions(-) diff --git a/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json b/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json index 2f79ec12a3..18ab01e4c2 100644 --- a/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json +++ b/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json @@ -1,107 +1,99 @@ { "variants": { - "facing=east,has_books=false": { + "facing=east,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 90 }, - "facing=east,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true, - "y": 90 - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true, - "y": 90 - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true, - "y": 90 - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true, - "y": 90 - } - ], - "facing=north,has_books=false": { + "facing=east,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 90 + }, + "facing=north,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true }, - "facing=north,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true - } - ], - "facing=south,has_books=false": { + "facing=north,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true + }, + "facing=north,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true + }, + "facing=north,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true + }, + "facing=north,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true + }, + "facing=south,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 180 }, - "facing=south,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true, - "y": 180 - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true, - "y": 180 - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true, - "y": 180 - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true, - "y": 180 - } - ], - "facing=west,has_books=false": { + "facing=south,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 180 + }, + "facing=west,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 270 }, - "facing=west,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true, - "y": 270 - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true, - "y": 270 - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true, - "y": 270 - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true, - "y": 270 - } - ] + "facing=west,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 270 + } } } \ No newline at end of file diff --git a/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java b/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java index 0fcaac0f46..fe75a950b3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java @@ -158,7 +158,7 @@ public static void registerColorProviders(BiConsumer itemColorR itemColorRegistry.accept(makeIotaStorageColorizer(HexItems.THOUGHT_KNOT.get()::getColor), HexItems.THOUGHT_KNOT.get()); blockColorRegistry.accept((bs, level, pos, idx) -> { - if (!bs.getValue(BlockAkashicBookshelf.HAS_BOOKS) || level == null || pos == null) { + if (bs.getValue(BlockAkashicBookshelf.HAS_BOOKS) == 0 || level == null || pos == null) { return 0xff_ffffff; } var tile = level.getBlockEntity(pos); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java index d4f1b1749b..5b0feed2f3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java @@ -24,20 +24,20 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; -import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.phys.BlockHitResult; import org.jetbrains.annotations.Nullable; public class BlockAkashicBookshelf extends Block implements AkashicFloodfiller, EntityBlock, IForgeLikeBlock { public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; - public static final BooleanProperty HAS_BOOKS = BooleanProperty.create("has_books"); + public static final IntegerProperty HAS_BOOKS = IntegerProperty.create("has_books", 0, 4); public BlockAkashicBookshelf(Properties p_49795_) { super(p_49795_); this.registerDefaultState(this.getStateDefinition().any() .setValue(FACING, Direction.NORTH) - .setValue(HAS_BOOKS, false)); + .setValue(HAS_BOOKS, 0)); } @Override @@ -101,7 +101,7 @@ public boolean hasAnalogOutputSignal(BlockState pState) { @Override public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) { - return pState.getValue(HAS_BOOKS) ? 15 : 0; // TODO have an iota -> comparator value mapping? + return (pState.getValue(HAS_BOOKS) > 0) ? 15 : 0; // TODO have an iota -> comparator value mapping? } @Nullable diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java index 3059dad377..32e3cc70d4 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java @@ -13,10 +13,13 @@ import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.Nullable; +import java.util.Random; + public class BlockEntityAkashicBookshelf extends HexBlockEntity { public static final String TAG_PATTERN = "pattern"; public static final String TAG_IOTA = "iota"; public static final String TAG_DUMMY = "dummy"; + private static final Random RANDOM = new Random(); // This is only not null if this stores any data. private HexPattern pattern = null; @@ -55,7 +58,8 @@ public void setNewMapping(HexPattern pattern, Iota iota) { if (previouslyEmpty) { var oldBs = this.getBlockState(); - var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, true); + int variant = RANDOM.nextInt(1,5); + var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, variant); this.level.setBlock(this.getBlockPos(), newBs, 3); this.level.sendBlockUpdated(this.getBlockPos(), oldBs, newBs, 3); } else { @@ -71,7 +75,7 @@ public void clearIota() { if (!previouslyEmpty) { var oldBs = this.getBlockState(); - var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, false); + var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, 0); this.level.setBlock(this.getBlockPos(), newBs, 3); this.level.sendBlockUpdated(this.getBlockPos(), oldBs, newBs, 3); } else { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java index 4f9fd2f54e..cc26e28498 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java @@ -188,7 +188,7 @@ private static BlockBehaviour.Properties quenched() { ); public static final Supplier AKASHIC_BOOKSHELF = blockItem("akashic_bookshelf", () -> new BlockAkashicBookshelf(akashicWoodyHard() - .lightLevel(bs -> (bs.getValue(BlockAkashicBookshelf.HAS_BOOKS)) ? 4 : 0))); + .lightLevel(bs -> (bs.getValue(BlockAkashicBookshelf.HAS_BOOKS) > 0) ? 4 : 0))); public static final Supplier AKASHIC_LIGATURE = blockItem("akashic_ligature", () -> new BlockAkashicLigature(akashicWoodyHard().lightLevel(bs -> 4))); diff --git a/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json b/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json index 2f79ec12a3..18ab01e4c2 100644 --- a/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json +++ b/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json @@ -1,107 +1,99 @@ { "variants": { - "facing=east,has_books=false": { + "facing=east,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 90 }, - "facing=east,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true, - "y": 90 - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true, - "y": 90 - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true, - "y": 90 - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true, - "y": 90 - } - ], - "facing=north,has_books=false": { + "facing=east,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 90 + }, + "facing=north,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true }, - "facing=north,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true - } - ], - "facing=south,has_books=false": { + "facing=north,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true + }, + "facing=north,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true + }, + "facing=north,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true + }, + "facing=north,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true + }, + "facing=south,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 180 }, - "facing=south,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true, - "y": 180 - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true, - "y": 180 - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true, - "y": 180 - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true, - "y": 180 - } - ], - "facing=west,has_books=false": { + "facing=south,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 180 + }, + "facing=west,has_books=0": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 270 }, - "facing=west,has_books=true": [ - { - "model": "hexcasting:block/akashic_bookshelf_1", - "uvlock": true, - "y": 270 - }, - { - "model": "hexcasting:block/akashic_bookshelf_2", - "uvlock": true, - "y": 270 - }, - { - "model": "hexcasting:block/akashic_bookshelf_3", - "uvlock": true, - "y": 270 - }, - { - "model": "hexcasting:block/akashic_bookshelf_4", - "uvlock": true, - "y": 270 - } - ] + "facing=west,has_books=1": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=2": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=3": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=4": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 270 + } } } \ No newline at end of file diff --git a/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexBlockStatesAndModels.java b/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexBlockStatesAndModels.java index d1f11fd7aa..626d7e306e 100644 --- a/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexBlockStatesAndModels.java +++ b/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexBlockStatesAndModels.java @@ -98,33 +98,24 @@ protected void registerStatesAndModels() { var builder = ConfiguredModel.builder(); - if (bs.getValue(BlockAkashicBookshelf.HAS_BOOKS)) { - for (int i = 1; i <= 4; i++) { - var model = models().withExistingParent("akashic_bookshelf_" + i, - modLoc("block/akashic_bookshelf")) - .texture("overlay", modLoc("block/akashic_bookshelf_overlay_" + i)); - - builder.modelFile(model) - .rotationY(dir.getOpposite().get2DDataValue() * 90) - .uvLock(true); - if (i < 4) { - builder = builder.nextModel(); - } - } + int bookVariant = bs.getValue(BlockAkashicBookshelf.HAS_BOOKS); + BlockModelBuilder model; + if (bookVariant > 0) { + model = models().withExistingParent("akashic_bookshelf_" + bookVariant, + modLoc("block/akashic_bookshelf")) + .texture("overlay", modLoc("block/akashic_bookshelf_overlay_" + bookVariant)); } else { - var model = models().orientable("akashic_bookshelf_empty", - modLoc("block/akashic_bookshelf_horiz"), - modLoc("block/akashic_bookshelf"), - modLoc("block/akashic_bookshelf_vert")); - + model = models().orientable("akashic_bookshelf_empty", + modLoc("block/akashic_bookshelf_horiz"), + modLoc("block/akashic_bookshelf"), + modLoc("block/akashic_bookshelf_vert")); if (dir == Direction.NORTH) { simpleBlockItem(HexBlocks.AKASHIC_BOOKSHELF.get(), model); } - - builder.modelFile(model) - .rotationY(dir.getOpposite().get2DDataValue() * 90) - .uvLock(true); } + builder.modelFile(model) + .rotationY(dir.getOpposite().get2DDataValue() * 90) + .uvLock(true); return builder.build(); }); From 3df28f2bc489aa8bb6754a8a0659a9c8256894e9 Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Mon, 14 Sep 2026 12:31:04 -0400 Subject: [PATCH 2/7] Allow overwriting shelves --- .../blocks/akashic/BlockAkashicRecord.java | 27 +++++++++---------- .../akashic/BlockEntityAkashicBookshelf.java | 18 ++++++------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java index 7d00f44eea..255e78e745 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java @@ -17,28 +17,27 @@ public BlockAkashicRecord(Properties p_49795_) { /** * @return the block position of the place it gets stored, or null if there was no room. *

- * Will never clobber anything. + * Will clobber an existing shelf if the pattern matches. */ public @Nullable BlockPos addNewDatum(BlockPos herePos, Level level, HexPattern key, Iota datum) { - var clobbereePos = AkashicFloodfiller.floodFillFor(herePos, level, + // look for an existing shelf with the provided keypattern + var targetPos = AkashicFloodfiller.floodFillFor(herePos, level, (pos, bs, world) -> world.getBlockEntity(pos) instanceof BlockEntityAkashicBookshelf tile && tile.getPattern() != null && tile.getPattern().getSignature().equals(key.getSignature())); - - if (clobbereePos != null) { - return null; + // if there's no existing shelf that matches, look for an empty shelf + if (targetPos == null) { + targetPos = AkashicFloodfiller.floodFillFor(herePos, level, 0.9f, + (pos, bs, world) -> + world.getBlockEntity(pos) instanceof BlockEntityAkashicBookshelf tile + && tile.getPattern() == null, 128); } - - var openPos = AkashicFloodfiller.floodFillFor(herePos, level, 0.9f, - (pos, bs, world) -> - world.getBlockEntity(pos) instanceof BlockEntityAkashicBookshelf tile - && tile.getPattern() == null, 128); - if (openPos != null) { - var tile = (BlockEntityAkashicBookshelf) level.getBlockEntity(openPos); + // overwrite whatever shelf was found (may clobber existing data!) + if (targetPos != null) { + var tile = (BlockEntityAkashicBookshelf) level.getBlockEntity(targetPos); tile.setNewMapping(key, datum); - - return openPos; + return targetPos; } else { return null; } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java index 32e3cc70d4..c069f1aa4b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java @@ -51,20 +51,18 @@ public Tag getIotaTag() { }*/ public void setNewMapping(HexPattern pattern, Iota iota) { - var previouslyEmpty = this.pattern == null; this.pattern = pattern; this.iota = iota; //this.iotaTag = IotaType.TYPED_CODEC.encodeStart(NbtOps.INSTANCE, iota).getOrThrow(); - if (previouslyEmpty) { - var oldBs = this.getBlockState(); - int variant = RANDOM.nextInt(1,5); - var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, variant); - this.level.setBlock(this.getBlockPos(), newBs, 3); - this.level.sendBlockUpdated(this.getBlockPos(), oldBs, newBs, 3); - } else { - this.setChanged(); - } + var oldBs = this.getBlockState(); + int variant = RANDOM.nextInt(1,5); + // must always change variant when updating to make the tint update properly + while (variant == oldBs.getValue(BlockAkashicBookshelf.HAS_BOOKS)) + variant = RANDOM.nextInt(1,5); + var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, variant); + this.level.setBlock(this.getBlockPos(), newBs, 3); + this.level.sendBlockUpdated(this.getBlockPos(), oldBs, newBs, 3); } public void clearIota() { From 1c58284dfee0b70aad0d9e91757d1945abf83208 Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Mon, 14 Sep 2026 12:31:33 -0400 Subject: [PATCH 3/7] Fix manual erasing --- .../common/blocks/akashic/BlockAkashicBookshelf.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java index 5b0feed2f3..eeb43e967a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java @@ -52,9 +52,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev } } - return stack.isEmpty() && hand == InteractionHand.MAIN_HAND - ? ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION - : ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; } @Override From 548fca347c40e223c015c402a6f4f832523f1425 Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Mon, 14 Sep 2026 14:00:26 -0400 Subject: [PATCH 4/7] Implement shelf sealing --- .../client/render/ScryingLensOverlays.java | 5 +++ .../blocks/akashic/BlockAkashicBookshelf.java | 16 +++++++-- .../blocks/akashic/BlockAkashicRecord.java | 33 +++++++++++-------- .../akashic/BlockEntityAkashicBookshelf.java | 5 ++- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/client/render/ScryingLensOverlays.java b/Common/src/main/java/at/petrak/hexcasting/client/render/ScryingLensOverlays.java index 7a9de750cb..422dc65214 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/render/ScryingLensOverlays.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/render/ScryingLensOverlays.java @@ -3,6 +3,7 @@ import at.petrak.hexcasting.api.block.circle.BlockAbstractImpetus; import at.petrak.hexcasting.api.casting.circles.BlockEntityAbstractImpetus; import at.petrak.hexcasting.api.client.ScryingLensOverlayRegistry; +import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicBookshelf; import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicBookshelf; import at.petrak.hexcasting.common.lib.HexBlocks; import com.mojang.datafixers.util.Pair; @@ -65,6 +66,10 @@ public static void addScryingLensStuff() { var display = iota.display(); lines.add(new Pair<>(new ItemStack(Items.BOOK), display)); } + if (state.getValue(BlockAkashicBookshelf.SEALED)) { + var sealed = Component.translatable("hexcasting.tooltip.spellbook.sealed").withStyle(ChatFormatting.GOLD); + lines.add(new Pair<>(new ItemStack(Items.HONEYCOMB), sealed)); + } } }); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java index eeb43e967a..bb8374983f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java @@ -2,6 +2,7 @@ import at.petrak.hexcasting.annotations.SoftImplement; import at.petrak.hexcasting.api.casting.iota.PatternIota; +import at.petrak.hexcasting.api.mod.HexTags; import at.petrak.hexcasting.common.items.storage.ItemScroll; import at.petrak.hexcasting.common.lib.HexSounds; import at.petrak.hexcasting.xplat.IForgeLikeBlock; @@ -24,6 +25,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.phys.BlockHitResult; @@ -32,12 +34,14 @@ public class BlockAkashicBookshelf extends Block implements AkashicFloodfiller, EntityBlock, IForgeLikeBlock { public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final IntegerProperty HAS_BOOKS = IntegerProperty.create("has_books", 0, 4); + public static final BooleanProperty SEALED = BooleanProperty.create("sealed"); public BlockAkashicBookshelf(Properties p_49795_) { super(p_49795_); this.registerDefaultState(this.getStateDefinition().any() .setValue(FACING, Direction.NORTH) - .setValue(HAS_BOOKS, 0)); + .setValue(HAS_BOOKS, 0) + .setValue(SEALED, false)); } @Override @@ -49,6 +53,14 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev } level.playSound(player, pos, HexSounds.SCROLL_SCRIBBLE.value(), SoundSource.BLOCKS, 1f, 1f); return ItemInteractionResult.sidedSuccess(level.isClientSide); + } else if (stack.is(HexTags.Items.SEAL_MATERIALS) && shelf.getIota() != null && !state.getValue(SEALED)) { + var newState = state.setValue(SEALED, true); + level.setBlock(pos, newState, 3); + level.sendBlockUpdated(pos, state, newState, 3); + level.levelEvent(player, 3003, pos, 0); + if (!player.isCreative()) + stack.shrink(1); + return ItemInteractionResult.sidedSuccess(level.isClientSide); } } @@ -74,7 +86,7 @@ protected InteractionResult useWithoutItem(BlockState state, Level level, BlockP @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { - builder.add(FACING, HAS_BOOKS); + builder.add(FACING, HAS_BOOKS, SEALED); } @Override diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java index 255e78e745..379265471f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicRecord.java @@ -13,27 +13,32 @@ public BlockAkashicRecord(Properties p_49795_) { super(p_49795_); } - - /** - * @return the block position of the place it gets stored, or null if there was no room. - *

- * Will clobber an existing shelf if the pattern matches. - */ public @Nullable - BlockPos addNewDatum(BlockPos herePos, Level level, HexPattern key, Iota datum) { - // look for an existing shelf with the provided keypattern - var targetPos = AkashicFloodfiller.floodFillFor(herePos, level, + BlockPos findValidShelf(BlockPos herePos, Level level, HexPattern key) { + // look for an existing unsealed shelf with the provided keypattern + var shelfPos = AkashicFloodfiller.floodFillFor(herePos, level, (pos, bs, world) -> world.getBlockEntity(pos) instanceof BlockEntityAkashicBookshelf tile - && tile.getPattern() != null && tile.getPattern().getSignature().equals(key.getSignature())); - // if there's no existing shelf that matches, look for an empty shelf - if (targetPos == null) { - targetPos = AkashicFloodfiller.floodFillFor(herePos, level, 0.9f, + && tile.getPattern() != null && tile.getPattern().getSignature().equals(key.getSignature()) + && !bs.getValue(BlockAkashicBookshelf.SEALED)); + // if there's no valid existing shelf, look for an empty shelf + if (shelfPos == null) { + shelfPos = AkashicFloodfiller.floodFillFor(herePos, level, 0.9f, (pos, bs, world) -> world.getBlockEntity(pos) instanceof BlockEntityAkashicBookshelf tile && tile.getPattern() == null, 128); } - // overwrite whatever shelf was found (may clobber existing data!) + return shelfPos; + } + + /** + * @return the block position of the place it gets stored, or null if there was no room. + *

+ * Will clobber an existing shelf if it's unsealed and the pattern matches. + */ + public @Nullable + BlockPos addNewDatum(BlockPos herePos, Level level, HexPattern key, Iota datum) { + var targetPos = findValidShelf(herePos, level, key); if (targetPos != null) { var tile = (BlockEntityAkashicBookshelf) level.getBlockEntity(targetPos); tile.setNewMapping(key, datum); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java index c069f1aa4b..16291c4184 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockEntityAkashicBookshelf.java @@ -73,9 +73,12 @@ public void clearIota() { if (!previouslyEmpty) { var oldBs = this.getBlockState(); - var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, 0); + var newBs = oldBs.setValue(BlockAkashicBookshelf.HAS_BOOKS, 0) + .setValue(BlockAkashicBookshelf.SEALED, false); this.level.setBlock(this.getBlockPos(), newBs, 3); this.level.sendBlockUpdated(this.getBlockPos(), oldBs, newBs, 3); + if (oldBs.getValue(BlockAkashicBookshelf.SEALED)) + level.levelEvent(3004, this.getBlockPos(), 0); } else { this.setChanged(); } From 226c63fc80b67a45e1b7fa23c76fccbad53684ef Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Mon, 14 Sep 2026 15:09:34 -0400 Subject: [PATCH 5/7] Mishap for lack-of-shelf-space --- .../api/casting/mishaps/MishapNoShelfSpace.kt | 21 +++++++++++++++++++ .../casting/actions/akashic/OpAkashicWrite.kt | 3 +++ .../hexcasting/lang/en_us.flatten.json5 | 6 +++++- .../en_us/entries/casting/mishaps2.json | 5 +++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapNoShelfSpace.kt diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapNoShelfSpace.kt b/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapNoShelfSpace.kt new file mode 100644 index 0000000000..9f61d41f83 --- /dev/null +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapNoShelfSpace.kt @@ -0,0 +1,21 @@ +package at.petrak.hexcasting.api.casting.mishaps + +import at.petrak.hexcasting.api.casting.eval.CastingEnvironment +import at.petrak.hexcasting.api.casting.iota.Iota +import at.petrak.hexcasting.api.pigment.FrozenPigment +import at.petrak.hexcasting.api.utils.TreeList +import net.minecraft.core.BlockPos +import net.minecraft.world.item.DyeColor + +class MishapNoShelfSpace(val pos: BlockPos) : Mishap() { + override fun accentColor(env: CastingEnvironment, errorCtx: Context): FrozenPigment = + dyeColor(DyeColor.PURPLE) + + override fun execute(env: CastingEnvironment, errorCtx: Context, stack: TreeList): TreeList { + env.mishapEnvironment.removeXp(20) + return stack + } + + override fun errorMessage(env: CastingEnvironment, errorCtx: Context) = + error("no_shelf_space", pos.toShortString()) +} \ No newline at end of file diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/akashic/OpAkashicWrite.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/akashic/OpAkashicWrite.kt index 254e2edb1a..7cce4a1619 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/akashic/OpAkashicWrite.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/akashic/OpAkashicWrite.kt @@ -8,6 +8,7 @@ import at.petrak.hexcasting.api.casting.getPattern import at.petrak.hexcasting.api.casting.iota.Iota import at.petrak.hexcasting.api.casting.math.HexPattern import at.petrak.hexcasting.api.casting.mishaps.MishapNoAkashicRecord +import at.petrak.hexcasting.api.casting.mishaps.MishapNoShelfSpace import at.petrak.hexcasting.api.casting.mishaps.MishapOthersName import at.petrak.hexcasting.api.misc.MediaConstants import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicRecord @@ -38,6 +39,8 @@ object OpAkashicWrite : SpellAction { if (trueNameMishap != null) throw trueNameMishap + record.findValidShelf(pos, env.world, key) ?: throw MishapNoShelfSpace(pos) + return SpellAction.Result( Spell(record, pos, key, datum), MediaConstants.DUST_UNIT, diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 index 4cbf32ca26..86babcc159 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 @@ -1100,6 +1100,7 @@ }, no_akashic_record: "No Akashic Record at %s", + no_shelf_space: "The Akashic Record at %s has no available shelves", disallowed: "%s has been disallowed by the server admins", disallowed_generic: "That pattern has been disallowed by the server admins", disallowed_circle: "%s has been disallowed in spell circles by the server admins", @@ -1590,6 +1591,9 @@ "no_record.title": "Lack Akashic Record", no_record: "Tried to access an $(l:greatwork/akashiclib)$(item)Akashic Record/$ at a location where there isn't one.$(br2)Causes purple sparks, and steals away some of my experience.", + "no_shelf_space.title": "Saturated Library", + no_shelf_space: "Tried to write an iota into an $(l:greatwork/akashiclib)$(item)Akashic Library/$ that has no $(l:greatwork/akashiclib)$(item)Akashic Bookshelves/$ capable of holding it.$(br2)Causes purple sparks, and steals away some of my experience.", + "bad_shepherd.title": "Improper Shepherding", bad_shepherd: "Tried to activate a $(l:greatwork/directrix)$(item)Shepherd Directrix/$ without a boolean on the top of the stack.$(br2)Causes red and white sparks, and forcibly ejects the Shepherd Directrix from the circle. This doesn't destroy it, thankfully, but I should make sure to go pick it up and replace it where it belongs.", }, @@ -1766,7 +1770,7 @@ "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.", "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 128 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.", 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.", - "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.", + "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/$. Using $(item)Honeycomb/$ seals the shelf, just like a $(l:items/focus)$(item)Focus/$ or $(l:items/spellbook)$(item)Spellbook/$.$(br2)Sneaking and using an empty hand clears the datum in the shelf, removing the seal if present.", }, quenching_allays: { diff --git a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/casting/mishaps2.json b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/casting/mishaps2.json index 61eb9e399c..7206e9e3af 100644 --- a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/casting/mishaps2.json +++ b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/casting/mishaps2.json @@ -25,6 +25,11 @@ "title": "hexcasting.page.mishaps2.no_record.title", "text": "hexcasting.page.mishaps2.no_record" }, + { + "type": "patchouli:text", + "title": "hexcasting.page.mishaps2.no_shelf_space.title", + "text": "hexcasting.page.mishaps2.no_shelf_space" + }, { "type": "patchouli:text", "title": "hexcasting.page.mishaps2.bad_shepherd.title", From b54569ff0edf06460a264fbfe653050b7660eada Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Mon, 14 Sep 2026 15:14:22 -0400 Subject: [PATCH 6/7] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3379b6631..f6a5ba1973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - The pattern itself is now a special handler with a variable tail length - The tail length determines how many extra iotas from the original stack are included in each iteration's stack - Iotas included via the above process are now popped from the original stack +- Using Akasha's Gambit with a pattern that already exists in a library will now overwrite the associated shelf ([#1301](https://github.com/FallingColors/HexMod/pull/1301)) @Robotgiggle +- Akashic Bookshelves can now be sealed with honeycomb to prevent overwriting ([#1301](https://github.com/FallingColors/HexMod/pull/1301)) @Robotgiggle ### Changed From d91fd0c60e8135569eaff24872c7f6cb28c2eacf Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Mon, 14 Sep 2026 15:39:49 -0400 Subject: [PATCH 7/7] Update blockstate jsons --- .../blockstates/akashic_bookshelf.json | 135 +++++++++++++++--- .../blockstates/akashic_bookshelf.json | 135 +++++++++++++++--- 2 files changed, 230 insertions(+), 40 deletions(-) diff --git a/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json b/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json index 18ab01e4c2..673b4f00fc 100644 --- a/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json +++ b/Common/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json @@ -1,96 +1,191 @@ { "variants": { - "facing=east,has_books=0": { + "facing=east,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 90 }, - "facing=east,has_books=1": { + "facing=east,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=1,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=1,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true, "y": 90 }, - "facing=east,has_books=2": { + "facing=east,has_books=2,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true, "y": 90 }, - "facing=east,has_books=3": { + "facing=east,has_books=2,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=3,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true, "y": 90 }, - "facing=east,has_books=4": { + "facing=east,has_books=3,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=4,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=4,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true, "y": 90 }, - "facing=north,has_books=0": { + "facing=north,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true }, - "facing=north,has_books=1": { + "facing=north,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true + }, + "facing=north,has_books=1,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true + }, + "facing=north,has_books=1,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true }, - "facing=north,has_books=2": { + "facing=north,has_books=2,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true + }, + "facing=north,has_books=2,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true }, - "facing=north,has_books=3": { + "facing=north,has_books=3,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true }, - "facing=north,has_books=4": { + "facing=north,has_books=3,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true + }, + "facing=north,has_books=4,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true }, - "facing=south,has_books=0": { + "facing=north,has_books=4,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true + }, + "facing=south,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 180 }, - "facing=south,has_books=1": { + "facing=south,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=1,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=1,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true, "y": 180 }, - "facing=south,has_books=2": { + "facing=south,has_books=2,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true, "y": 180 }, - "facing=south,has_books=3": { + "facing=south,has_books=2,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=3,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true, "y": 180 }, - "facing=south,has_books=4": { + "facing=south,has_books=3,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=4,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true, "y": 180 }, - "facing=west,has_books=0": { + "facing=south,has_books=4,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 180 + }, + "facing=west,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 270 }, - "facing=west,has_books=1": { + "facing=west,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=1,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true, "y": 270 }, - "facing=west,has_books=2": { + "facing=west,has_books=1,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=2,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=2,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true, "y": 270 }, - "facing=west,has_books=3": { + "facing=west,has_books=3,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=3,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true, "y": 270 }, - "facing=west,has_books=4": { + "facing=west,has_books=4,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=4,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true, "y": 270 diff --git a/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json b/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json index 18ab01e4c2..673b4f00fc 100644 --- a/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json +++ b/Neoforge/src/generated/resources/assets/hexcasting/blockstates/akashic_bookshelf.json @@ -1,96 +1,191 @@ { "variants": { - "facing=east,has_books=0": { + "facing=east,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 90 }, - "facing=east,has_books=1": { + "facing=east,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=1,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=1,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true, "y": 90 }, - "facing=east,has_books=2": { + "facing=east,has_books=2,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true, "y": 90 }, - "facing=east,has_books=3": { + "facing=east,has_books=2,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=3,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true, "y": 90 }, - "facing=east,has_books=4": { + "facing=east,has_books=3,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=4,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 90 + }, + "facing=east,has_books=4,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true, "y": 90 }, - "facing=north,has_books=0": { + "facing=north,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true }, - "facing=north,has_books=1": { + "facing=north,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true + }, + "facing=north,has_books=1,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true + }, + "facing=north,has_books=1,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true }, - "facing=north,has_books=2": { + "facing=north,has_books=2,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true + }, + "facing=north,has_books=2,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true }, - "facing=north,has_books=3": { + "facing=north,has_books=3,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true }, - "facing=north,has_books=4": { + "facing=north,has_books=3,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true + }, + "facing=north,has_books=4,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true }, - "facing=south,has_books=0": { + "facing=north,has_books=4,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true + }, + "facing=south,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 180 }, - "facing=south,has_books=1": { + "facing=south,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=1,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=1,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true, "y": 180 }, - "facing=south,has_books=2": { + "facing=south,has_books=2,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true, "y": 180 }, - "facing=south,has_books=3": { + "facing=south,has_books=2,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=3,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true, "y": 180 }, - "facing=south,has_books=4": { + "facing=south,has_books=3,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 180 + }, + "facing=south,has_books=4,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true, "y": 180 }, - "facing=west,has_books=0": { + "facing=south,has_books=4,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 180 + }, + "facing=west,has_books=0,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_empty", "uvlock": true, "y": 270 }, - "facing=west,has_books=1": { + "facing=west,has_books=0,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_empty", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=1,sealed=false": { "model": "hexcasting:block/akashic_bookshelf_1", "uvlock": true, "y": 270 }, - "facing=west,has_books=2": { + "facing=west,has_books=1,sealed=true": { + "model": "hexcasting:block/akashic_bookshelf_1", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=2,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_2", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=2,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_2", "uvlock": true, "y": 270 }, - "facing=west,has_books=3": { + "facing=west,has_books=3,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_3", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=3,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_3", "uvlock": true, "y": 270 }, - "facing=west,has_books=4": { + "facing=west,has_books=4,sealed=false": { + "model": "hexcasting:block/akashic_bookshelf_4", + "uvlock": true, + "y": 270 + }, + "facing=west,has_books=4,sealed=true": { "model": "hexcasting:block/akashic_bookshelf_4", "uvlock": true, "y": 270