aadnk / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
288 stars 92 forks source link

optionIntercept() replace for what? #207

Open GabrielAtlas opened 1 year ago

GabrielAtlas commented 1 year ago

Make sure you're doing the following

Describe the question I want to know how can achive the same functionallity of the method that was removed (optionIntercept)

Code `public class PremiumListeners extends PacketAdapter {

private final Terminal plugin;

private final SecureRandom random = new SecureRandom();
private final KeyPair keyPair = EncryptionUtil.generateKeyPair();
private final RateLimiter rateLimiter;

public PremiumListeners(Terminal plugin, RateLimiter rateLimiter) {
    super(params()
            .plugin(plugin)
            .optionIntercept() // removed (compilation error at ProtocolLib API 5.0.0)
            .types(START, ENCRYPTION_BEGIN)
            .optionAsync());

    this.plugin = plugin;
    this.rateLimiter = rateLimiter;
}`