mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Trigger an update when a bed's sheets are changed
This commit is contained in:
parent
7e25107f7a
commit
a7ac895fd1
1 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,7 @@ import net.minecraft.block.entity.BlockEntityType;
|
|||
import net.minecraft.block.enums.BedPart;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.util.StringIdentifiable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -114,6 +115,9 @@ public class FancyBedBlock extends BedBlock {
|
|||
public void setPattern(SheetPattern pattern) {
|
||||
this.pattern = pattern;
|
||||
markDirty();
|
||||
if (world instanceof ServerWorld sw) {
|
||||
sw.getChunkManager().markForUpdate(getPos());
|
||||
}
|
||||
}
|
||||
|
||||
public SheetPattern getPattern() {
|
||||
|
|
Loading…
Reference in a new issue