syncing still dont work

This commit is contained in:
gamma-delta 2022-04-02 12:21:15 -05:00
parent 21a82b0069
commit a7cedacda9
2 changed files with 7 additions and 4 deletions

View file

@ -38,11 +38,10 @@ public class BlockEntityAkashicBookshelf extends PaucalBlockEntity {
this.recordPos = recordPos;
this.pattern = pattern;
this.setChanged();
var oldBs = this.getBlockState();
var newBs = oldBs.setValue(BlockAkashicBookshelf.DATUM_TYPE, type);
this.level.setBlockAndUpdate(this.getBlockPos(), newBs);
this.level.sendBlockUpdated(this.getBlockPos(), oldBs, newBs, 3);
this.level.setBlock(this.getBlockPos(), newBs, 3);
this.sync();
}
@Override
@ -60,9 +59,13 @@ public class BlockEntityAkashicBookshelf extends PaucalBlockEntity {
protected void loadModData(CompoundTag compoundTag) {
if (compoundTag.contains(TAG_RECORD_POS)) {
this.recordPos = NbtUtils.readBlockPos(compoundTag.getCompound(TAG_RECORD_POS));
} else {
this.recordPos = null;
}
if (compoundTag.contains(TAG_PATTERN)) {
this.pattern = HexPattern.DeserializeFromNBT(compoundTag.getCompound(TAG_PATTERN));
} else {
this.pattern = null;
}
}

View file

@ -145,8 +145,8 @@ public class BlockEntityAkashicRecord extends PaucalBlockEntity {
@Override
protected void loadModData(CompoundTag compoundTag) {
var lookupTag = compoundTag.getCompound(TAG_LOOKUP);
var sigs = lookupTag.getAllKeys();
this.entries.clear();
for (var sig : sigs) {
var entryTag = lookupTag.getCompound(sig);
var pos = NbtUtils.readBlockPos(entryTag.getCompound(TAG_POS));