syncing still dont work
This commit is contained in:
parent
21a82b0069
commit
a7cedacda9
2 changed files with 7 additions and 4 deletions
|
@ -38,11 +38,10 @@ public class BlockEntityAkashicBookshelf extends PaucalBlockEntity {
|
||||||
this.recordPos = recordPos;
|
this.recordPos = recordPos;
|
||||||
this.pattern = pattern;
|
this.pattern = pattern;
|
||||||
|
|
||||||
this.setChanged();
|
|
||||||
var oldBs = this.getBlockState();
|
var oldBs = this.getBlockState();
|
||||||
var newBs = oldBs.setValue(BlockAkashicBookshelf.DATUM_TYPE, type);
|
var newBs = oldBs.setValue(BlockAkashicBookshelf.DATUM_TYPE, type);
|
||||||
this.level.setBlockAndUpdate(this.getBlockPos(), newBs);
|
this.level.setBlock(this.getBlockPos(), newBs, 3);
|
||||||
this.level.sendBlockUpdated(this.getBlockPos(), oldBs, newBs, 3);
|
this.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,9 +59,13 @@ public class BlockEntityAkashicBookshelf extends PaucalBlockEntity {
|
||||||
protected void loadModData(CompoundTag compoundTag) {
|
protected void loadModData(CompoundTag compoundTag) {
|
||||||
if (compoundTag.contains(TAG_RECORD_POS)) {
|
if (compoundTag.contains(TAG_RECORD_POS)) {
|
||||||
this.recordPos = NbtUtils.readBlockPos(compoundTag.getCompound(TAG_RECORD_POS));
|
this.recordPos = NbtUtils.readBlockPos(compoundTag.getCompound(TAG_RECORD_POS));
|
||||||
|
} else {
|
||||||
|
this.recordPos = null;
|
||||||
}
|
}
|
||||||
if (compoundTag.contains(TAG_PATTERN)) {
|
if (compoundTag.contains(TAG_PATTERN)) {
|
||||||
this.pattern = HexPattern.DeserializeFromNBT(compoundTag.getCompound(TAG_PATTERN));
|
this.pattern = HexPattern.DeserializeFromNBT(compoundTag.getCompound(TAG_PATTERN));
|
||||||
|
} else {
|
||||||
|
this.pattern = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,8 +145,8 @@ public class BlockEntityAkashicRecord extends PaucalBlockEntity {
|
||||||
@Override
|
@Override
|
||||||
protected void loadModData(CompoundTag compoundTag) {
|
protected void loadModData(CompoundTag compoundTag) {
|
||||||
var lookupTag = compoundTag.getCompound(TAG_LOOKUP);
|
var lookupTag = compoundTag.getCompound(TAG_LOOKUP);
|
||||||
|
|
||||||
var sigs = lookupTag.getAllKeys();
|
var sigs = lookupTag.getAllKeys();
|
||||||
|
this.entries.clear();
|
||||||
for (var sig : sigs) {
|
for (var sig : sigs) {
|
||||||
var entryTag = lookupTag.getCompound(sig);
|
var entryTag = lookupTag.getCompound(sig);
|
||||||
var pos = NbtUtils.readBlockPos(entryTag.getCompound(TAG_POS));
|
var pos = NbtUtils.readBlockPos(entryTag.getCompound(TAG_POS));
|
||||||
|
|
Loading…
Reference in a new issue