Velocity hopefully working on all versions.
This commit is contained in:
1 parent
7e2c66a82e
commit
a4b326cd44
2 files changed
+2
-2
No files matched your search
@@ -59,7 +59,7 @@ public abstract class ProtocolPacketEvent<T> extends PacketEvent implements Play
|
||||
this.player = player;
|
||||
|
||||
this.serverVersion = PacketEvents.getAPI().getServerManager().getVersion();
|
||||
if (!autoProtocolTranslation && packetSide == PacketSide.CLIENT && user.getClientVersion() != null) {
|
||||
if (!autoProtocolTranslation && user.getClientVersion() != null) {
|
||||
//TODO Optimize
|
||||
this.serverVersion = user.getClientVersion().toServerVersion();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class PacketEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||
public void read(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
|
||||
int firstReaderIndex = buffer.readerIndex();
|
||||
PacketSendEvent packetSendEvent = EventCreationUtil.createSendEvent(ctx.channel(), user, player, buffer,
|
||||
true);
|
||||
false);
|
||||
int readerIndex = buffer.readerIndex();
|
||||
PacketEvents.getAPI().getEventManager().callEvent(packetSendEvent, () -> buffer.readerIndex(readerIndex));
|
||||
if (!packetSendEvent.isCancelled()) {
|
||||
|
||||
Reference in new issue
Block a user