Example #1
0
  @Override
  public boolean add(Packet packet) {
    if (packet.k() == 51) {
      IPacket51 packet51 = InternalAccessor.Instance.newPacket51();
      packet51.setPacket(packet);
      Calculations.Obfuscate(packet51, this.player);
    }

    return super.add(packet);
  }
 @Override
 public void run() {
   while (!Thread.interrupted() && !kill.get()) {
     try {
       ChunkProcessingOrder order = queue.dequeue();
       Calculations.Obfuscate(order.packet, order.player);
       order.packet.compress(localDeflater.get());
       order.output.FinishedProcessing(order.packet);
       Thread.sleep(1);
     } catch (InterruptedException e) {
       // If interrupted then exit
     } catch (Exception e) {
       Orebfuscator.log(e);
     }
   }
 }