Class CommonNetwork

java.lang.Object
org.moddingx.libx.CommonNetwork

public class CommonNetwork extends Object
A wrapper for the network implementation of LibX. Allows for some networking functions that are required very often.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    requestBE(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Requests the block entity at the given position from the server.
    void
    updateBE(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Sends the nbt tag retrieved from BlockEntity.getUpdateTag() from the block entity at the given position to all clients tracking the chunk.

    Methods inherited from class java.lang.Object

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

    • updateBE

      public void updateBE(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Sends the nbt tag retrieved from BlockEntity.getUpdateTag() from the block entity at the given position to all clients tracking the chunk. On the client the tag is passed to IForgeBlockEntity.handleUpdateTag(CompoundTag). Does nothing when called on the client.
    • requestBE

      public void requestBE(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Requests the block entity at the given position from the server. This is automatically done when a BlockEntityBase is loaded. The server will send an update packet as described in updateBE(Level, BlockPos) to the client. Does nothing when called on the server.