From 306a5cc05f85547260d0552a88a471cd7842b899 Mon Sep 17 00:00:00 2001 From: SD Date: Fri, 14 Jan 2022 14:06:00 +0530 Subject: [PATCH] goodbye, manual syncing --- .../dimdoors/block/entity/RiftBlockEntity.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java b/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java index 8a63f4bd..24c0e470 100644 --- a/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java +++ b/src/main/java/org/dimdev/dimdoors/block/entity/RiftBlockEntity.java @@ -3,6 +3,9 @@ package org.dimdev.dimdoors.block.entity; import java.util.Objects; import net.minecraft.block.Block; +import net.minecraft.network.Packet; +import net.minecraft.network.listener.ClientPlayPacketListener; +import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.math.EulerAngle; import net.minecraft.util.math.Vec3d; @@ -24,6 +27,7 @@ import org.dimdev.dimdoors.api.util.math.TransformationMatrix3d; import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry; import org.dimdev.dimdoors.world.pocket.VirtualLocation; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; @@ -35,10 +39,9 @@ import net.minecraft.text.LiteralText; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable; import net.fabricmc.fabric.api.networking.v1.PlayerLookup; -public abstract class RiftBlockEntity extends BlockEntity implements BlockEntityClientSerializable, Target, EntityTarget { +public abstract class RiftBlockEntity extends BlockEntity implements Target, EntityTarget { private static final Logger LOGGER = LogManager.getLogger(); public static long showRiftCoreUntil = 0; @@ -72,14 +75,10 @@ public abstract class RiftBlockEntity extends BlockEntity implements BlockEntity return nbt; } + @Nullable @Override - public void fromClientTag(NbtCompound nbt) { - this.deserialize(nbt); - } - - @Override - public NbtCompound toClientTag(NbtCompound nbt) { - return this.serialize(nbt); + public Packet toUpdatePacket() { + return BlockEntityUpdateS2CPacket.create(this); } public void setDestination(VirtualTarget destination) {