use of org.dragonet.protocol.packets.RequestChunkRadiusPacket 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;
}
Aggregations