Package org.moddingx.libx
Class CommonNetwork
java.lang.Object
org.moddingx.libx.CommonNetwork
A wrapper for the network implementation of LibX. Allows for some networking functions that
are required very often.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 fromBlockEntity.getUpdateTag()
from the block entity at the given position to all clients tracking the chunk.
-
Method Details
-
updateBE
public void updateBE(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Sends the nbt tag retrieved fromBlockEntity.getUpdateTag()
from the block entity at the given position to all clients tracking the chunk. On the client the tag is passed toIForgeBlockEntity.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 aBlockEntityBase
is loaded. The server will send an update packet as described inupdateBE(Level, BlockPos)
to the client. Does nothing when called on the server.
-