remove setCancelled / isCancelled from PacketInjector (#1553)

closes #1552
This commit is contained in:
Pasqual Koschmieder 2022-03-26 18:00:12 +01:00 committed by GitHub
parent b4eff32213
commit 4096952c16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 34 deletions

View File

@ -222,11 +222,6 @@ public class PacketFilterManager implements ListenerInvoker, InternalManager {
}
Object nmsPacket = packet.getHandle();
// make sure packets which are force received through this method are never cancelled
boolean oldCancelState = this.packetInjector.isCancelled(nmsPacket);
this.packetInjector.setCancelled(nmsPacket, false);
// check to which listeners we need to post the packet
if (filters) {
// post to all listeners
@ -244,7 +239,6 @@ public class PacketFilterManager implements ListenerInvoker, InternalManager {
// post to the player inject, reset our cancel state change
this.playerInjectionHandler.receiveClientPacket(sender, nmsPacket);
this.packetInjector.setCancelled(nmsPacket, oldCancelState);
}
}

View File

@ -3,7 +3,6 @@ package com.comphenix.protocol.injector.packet;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.concurrency.PacketTypeSet;
import com.comphenix.protocol.events.ListenerOptions;
import com.comphenix.protocol.injector.packet.PacketInjector;
import java.util.Set;
public abstract class AbstractPacketInjector implements PacketInjector {
@ -14,17 +13,6 @@ public abstract class AbstractPacketInjector implements PacketInjector {
this.inboundFilters = inboundFilters;
}
@Override
public boolean isCancelled(Object packet) {
// No, it's never cancelled
return false;
}
@Override
public void setCancelled(Object packet, boolean cancelled) {
throw new UnsupportedOperationException();
}
@Override
public boolean addPacketHandler(PacketType type, Set<ListenerOptions> options) {
this.inboundFilters.addType(type);

View File

@ -14,22 +14,6 @@ import org.bukkit.entity.Player;
*/
public interface PacketInjector {
/**
* Determine if a packet is cancelled or not.
*
* @param packet - the packet to check.
* @return TRUE if it is, FALSE otherwise.
*/
boolean isCancelled(Object packet);
/**
* Set whether or not a packet is cancelled.
*
* @param packet - the packet to set.
* @param cancelled - TRUE to cancel the packet, FALSE otherwise.
*/
void setCancelled(Object packet, boolean cancelled);
/**
* Start intercepting packets with the given packet type.
*