public final class Network
extends java.lang.Object
Aside from providing basic message sending capabilities this also has facilities for throttling package throughput to avoid overloading the network when a large number of casings are active and nearby players. Throttling is applied to particle effect emission and module packets where possible.
| Modifier and Type | Field and Description |
|---|---|
static Network |
INSTANCE |
static int |
RANGE_HIGH |
static int |
RANGE_LOW |
static int |
RANGE_MEDIUM |
| Modifier and Type | Method and Description |
|---|---|
void |
clientTick() |
void |
initClient() |
void |
initServer() |
void |
sendModuleData(Casing casing,
Face face,
io.netty.buffer.ByteBuf data,
byte type) |
void |
sendModuleData(Casing casing,
Face face,
net.minecraft.nbt.NbtCompound data,
byte type) |
void |
sendRedstoneEffect(net.minecraft.world.World world,
double x,
double y,
double z) |
void |
sendToClient(AbstractMessage message,
net.minecraft.entity.player.PlayerEntity player) |
int |
sendToClientsInDimension(AbstractMessage message,
net.minecraft.world.World world) |
int |
sendToClientsNearLocation(AbstractMessage message,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int range) |
void |
sendToServer(AbstractMessage message) |
void |
serverTick() |
public static final Network INSTANCE
public static final int RANGE_HIGH
public static final int RANGE_MEDIUM
public static final int RANGE_LOW
@Environment(value=CLIENT) public void initClient()
public void initServer()
public void sendModuleData(Casing casing, Face face, net.minecraft.nbt.NbtCompound data, byte type)
public void sendModuleData(Casing casing, Face face, io.netty.buffer.ByteBuf data, byte type)
public void sendRedstoneEffect(net.minecraft.world.World world,
double x,
double y,
double z)
public int sendToClientsInDimension(AbstractMessage message, net.minecraft.world.World world)
public int sendToClientsNearLocation(AbstractMessage message, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, int range)
public void sendToClient(AbstractMessage message, net.minecraft.entity.player.PlayerEntity player)
@Environment(value=CLIENT) public void sendToServer(AbstractMessage message)
public void serverTick()
public void clientTick()