All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.PacketDecrypter Maven / Gradle / Ivy

package net.minecraft.server;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;

import javax.crypto.Cipher;
import java.util.List;

public class PacketDecrypter extends MessageToMessageDecoder {
	
	private final PacketEncryptionHandler a;
	
	public PacketDecrypter(Cipher cipher) {
		this.a = new PacketEncryptionHandler(cipher);
	}
	
	protected void a(ChannelHandlerContext channelhandlercontext, ByteBuf bytebuf, List list) throws Exception {
		list.add(this.a.a(channelhandlercontext, bytebuf));
	}
	
	protected void decode(ChannelHandlerContext channelhandlercontext, ByteBuf object, List list) throws Exception {
		this.a(channelhandlercontext, object, list);
	}
}