Class DoorContraptionStatePacket

java.lang.Object
com.hbm_m.network.DoorContraptionStatePacket
All Implemented Interfaces:
S2CPacket

public class DoorContraptionStatePacket extends Object implements S2CPacket
S2C-пакет: открыть/закрыть HBM-дверь на Create-контрапшене.

Замена blockstate-flip'у (который триггерил resetClientContraption и сносил клиент-BE/звук). Серверный HbmDoorMovementBehaviour.doToggle обновляет серверный кэш + шлёт этот пакет; клиентский хендлер populate кэш (ContraptionWorld + VirtualRenderWorld) + invalidateColliders.

Поля: entityId контрапшен-сущности, controllerLocalPos, doorDeclId, facing, open. Никаких blockstate-изменений → ноль resetClientContraption.

  • Constructor Summary

    Constructors
    Constructor
    Description
    DoorContraptionStatePacket(int entityId, net.minecraft.core.BlockPos controllerLocalPos, String doorDeclId, net.minecraft.core.Direction facing, boolean open)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    decode(net.minecraft.network.FriendlyByteBuf buf)
     
    static void
    handle(DoorContraptionStatePacket msg, dev.architectury.networking.NetworkManager.PacketContext context)
     
    static void
    sendToNear(net.minecraft.server.level.ServerLevel level, net.minecraft.world.phys.Vec3 pos, int entityId, net.minecraft.core.BlockPos controllerLocalPos, String doorDeclId, net.minecraft.core.Direction facing, boolean open)
     
    void
    write(net.minecraft.network.FriendlyByteBuf buf)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DoorContraptionStatePacket

      public DoorContraptionStatePacket(int entityId, net.minecraft.core.BlockPos controllerLocalPos, String doorDeclId, net.minecraft.core.Direction facing, boolean open)
  • Method Details

    • decode

      public static DoorContraptionStatePacket decode(net.minecraft.network.FriendlyByteBuf buf)
    • write

      public void write(net.minecraft.network.FriendlyByteBuf buf)
      Specified by:
      write in interface S2CPacket
    • handle

      public static void handle(DoorContraptionStatePacket msg, dev.architectury.networking.NetworkManager.PacketContext context)
    • sendToNear

      public static void sendToNear(net.minecraft.server.level.ServerLevel level, net.minecraft.world.phys.Vec3 pos, int entityId, net.minecraft.core.BlockPos controllerLocalPos, String doorDeclId, net.minecraft.core.Direction facing, boolean open)