fix issue where turning on the back of the screen would break both sides of the screen
This commit is contained in:
parent
78160917eb
commit
5ce9e4574d
|
|
@ -103,6 +103,8 @@ public class BlockScreen extends BaseEntityBlock {
|
|||
@Override
|
||||
public void onRemove(BlockState p_60515_, Level p_60516_, BlockPos p_60517_, BlockState p_60518_, boolean p_60519_) {
|
||||
// TODO: make this also get called on client?
|
||||
if (p_60518_.getBlock() == p_60515_.getBlock()) return;
|
||||
|
||||
for (BlockSide value : BlockSide.values()) {
|
||||
Vector3i vec = new Vector3i(p_60517_.getX(), p_60517_.getY(), p_60517_.getZ());
|
||||
Multiblock.findOrigin(p_60516_, vec, value, null);
|
||||
|
|
|
|||
|
|
@ -285,6 +285,23 @@ public class TileEntityScreen extends BlockEntity {
|
|||
screens.add(Screen.deserialize(list.getCompound(i)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag getUpdateTag() {
|
||||
CompoundTag tag = new CompoundTag();
|
||||
saveAdditional(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUpdateTag(CompoundTag tag) {
|
||||
load(tag);
|
||||
for (Screen screen : screens) {
|
||||
if (screen.browser == null) screen.createBrowser(false);
|
||||
if (screen.browser != null) screen.browser.loadURL(screen.url);
|
||||
}
|
||||
updateAABB();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveAdditional(CompoundTag tag) {
|
||||
super.saveAdditional(tag);
|
||||
|
|
@ -653,23 +670,6 @@ public class TileEntityScreen extends BlockEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag getUpdateTag() {
|
||||
CompoundTag tag = new CompoundTag();
|
||||
saveAdditional(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUpdateTag(CompoundTag tag) {
|
||||
load(tag);
|
||||
for (Screen screen : screens) {
|
||||
if (screen.browser == null) screen.createBrowser(false);
|
||||
if (screen.browser != null) screen.browser.loadURL(screen.url);
|
||||
}
|
||||
updateAABB();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnloaded() {
|
||||
if (level.isClientSide) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user