Skip to content

Commit

Permalink
Rename PacketSplitter
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Jun 12, 2024
1 parent 1f725dd commit 399a1d4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import fi.dy.masa.servux.Servux;
import fi.dy.masa.servux.dataproviders.StructureDataProvider;
import fi.dy.masa.servux.network.server.IPluginServerPlayHandler;
import fi.dy.masa.servux.network.server.PayloadSplitter;
import fi.dy.masa.servux.network.server.PacketSplitter;

@Environment(EnvType.SERVER)
public abstract class ServuxStructuresHandler<T extends CustomPayload> implements IPluginServerPlayHandler<T>
Expand Down Expand Up @@ -68,7 +68,7 @@ public void decodeStructuresPacket(Identifier channel, ServerPlayerEntity player

switch (packet.getType())
{
// Only NBT type packets are received from MiniHUD, not using PayloadSplitter
// Only NBT type packets are received from MiniHUD, not using PacketSplitter
case PACKET_C2S_STRUCTURES_REGISTER ->
{
//Servux.logger.warn("decodeStructuresPacket(): received Structures Register from player {}", player.getName().getLiteralString());
Expand Down Expand Up @@ -116,7 +116,7 @@ public void receivePlayPayload(T payload, ServerPlayNetworking.Context ctx)
@Override
public void encodeWithSplitter(ServerPlayerEntity player, PacketByteBuf buffer, ServerPlayNetworkHandler networkHandler)
{
// Send each PayloadSplitter buffer slice
// Send each PacketSplitter buffer slice
ServuxStructuresHandler.INSTANCE.encodeStructuresPacket(player, new ServuxStructuresPacket(ServuxStructuresPacket.Type.PACKET_S2C_STRUCTURE_DATA, buffer));
}

Expand All @@ -127,7 +127,7 @@ public void encodeStructuresPacket(ServerPlayerEntity player, ServuxStructuresPa
// Send Structure Data via Packet Splitter
PacketByteBuf buffer = new PacketByteBuf(Unpooled.buffer());
buffer.writeNbt(packet.getCompound());
PayloadSplitter.send(this, buffer, player, player.networkHandler);
PacketSplitter.send(this, buffer, player, player.networkHandler);
}
else if (ServuxStructuresHandler.INSTANCE.sendPlayPayload(player, new ServuxStructuresPacket.Payload(packet)) == false)
{
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Updated by Sakura to work with newer versions by changing the Reading Session keys,
* and using the HANDLER interface to send packets via the Payload system
*/
public class PayloadSplitter
public class PacketSplitter
{
public static final int MAX_TOTAL_PER_PACKET_S2C = 1048576;
public static final int MAX_PAYLOAD_PER_PACKET_S2C = MAX_TOTAL_PER_PACKET_S2C - 5;
Expand Down

0 comments on commit 399a1d4

Please sign in to comment.