blob: c6088252bbc18c30e5f146f40a70b85f1d77c0ca [file] [log] [blame] [raw]
package us.myles.ViaVersion.api.remapper;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.exception.InformativeException;
public abstract class PacketHandler implements ValueWriter {
/**
* Handle a packet
*
* @param wrapper The associated wrapper
* @throws Exception Throws exception if it failed to handle the packet
*/
public abstract void handle(PacketWrapper wrapper) throws Exception;
@Override
public void write(PacketWrapper writer, Object inputValue) throws Exception {
try {
handle(writer);
} catch (InformativeException e) {
e.addSource(this.getClass());
throw e;
}
}
}