Search in sources :

Example 1 with ChunkRadiusUpdatedPacket

use of org.dragonet.protocol.packets.ChunkRadiusUpdatedPacket in project DragonProxy by DragonetMC.

the class PERequestChunkRadiusPacketTranslator method translate.

@Override
public Packet[] translate(UpstreamSession session, RequestChunkRadiusPacket packet) {
    session.getDataCache().put(CacheKey.PLAYER_REQUESTED_CHUNK_RADIUS, packet.radius);
    // System.out.println("Requested chunk radius : " + packet.radius);
    session.sendPacket(new ChunkRadiusUpdatedPacket(((RequestChunkRadiusPacket) packet).radius));
    session.getChunkCache().sendOrderedChunks();
    ClientSettingsPacket clientSettingsPacket = new ClientSettingsPacket((String) session.getDataCache().getOrDefault(CacheKey.PLAYER_LANGUAGE, "enUS"), (int) session.getDataCache().getOrDefault(CacheKey.PLAYER_REQUESTED_CHUNK_RADIUS, 5), ChatVisibility.FULL, false, new SkinPart[] {}, Hand.OFF_HAND);
    ((PCDownstreamSession) session.getDownstream()).send(clientSettingsPacket);
    return null;
}
Also used : ChunkRadiusUpdatedPacket(org.dragonet.protocol.packets.ChunkRadiusUpdatedPacket) RequestChunkRadiusPacket(org.dragonet.protocol.packets.RequestChunkRadiusPacket) ClientSettingsPacket(com.github.steveice10.mc.protocol.packet.ingame.client.ClientSettingsPacket) PCDownstreamSession(org.dragonet.proxy.network.PCDownstreamSession)

Aggregations

ClientSettingsPacket (com.github.steveice10.mc.protocol.packet.ingame.client.ClientSettingsPacket)1 ChunkRadiusUpdatedPacket (org.dragonet.protocol.packets.ChunkRadiusUpdatedPacket)1 RequestChunkRadiusPacket (org.dragonet.protocol.packets.RequestChunkRadiusPacket)1 PCDownstreamSession (org.dragonet.proxy.network.PCDownstreamSession)1