Skip to content

Incompatibilities with other ProtocolLib plugin #320

Description

@fensoft

When using bungee + premium LibsDisguises in 1.13 + a very simple ProtocolLib plugin, it makes minecraft vanilla crashing in bungee (and only if bungee is used).

I don't know if it's a bug in bungee but clearly LibsDisguises is modifying my packets and makes bungee crashing with this error:
DecoderException : java.lang.IndexOutOfBoundsException: readerIndex(0) + length(1) exceeds writerIndex(0): UnpooledSlicedByteBuf(ridx: 0, widx: 0, cap: 0/0, unwrapped: PooledUnsafeDirectByteBuf(ridx: 2, widx: 2, cap: 65536)) @ io.netty.handler.codec.MessageToMessageDecoder:98

I've made a very simple sample of my plugin to show you this. Just open the inventory and click on any item or even an empty (AIR) slot:

package com.fensoftheberge.FenProtocolLib;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

import com.comphenix.packetwrapper.WrapperPlayServerSetSlot;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;

public class FenProtocolLib extends JavaPlugin {
	class WindowClickPacketListener extends PacketAdapter {
	        public WindowClickPacketListener(Plugin plugin) {
	            super(plugin, PacketType.Play.Client.WINDOW_CLICK);
	        }
	        
	        @Override
	        public void onPacketReceiving(PacketEvent event) {
	        	WrapperPlayServerSetSlot packet_setcursor = new WrapperPlayServerSetSlot();
	        	packet_setcursor.setSlot(-1);
	        	packet_setcursor.setWindowId(-1);
	        	packet_setcursor.setSlotData(new ItemStack(Material.AIR));
	        	packet_setcursor.sendPacket(event.getPlayer());
	        }
	}

	public void onEnable() {
    	ProtocolLibrary.getProtocolManager().addPacketListener(new WindowClickPacketListener(this));
    }
}

Here's the versions i'm using:

Paper version git-Paper-435 (MC: 1.13.2)
ProtocolLib v4.4.0*
LibsDisguises v9.6.0-SNAPSHOT + premium LibsDisguises-9.5.2.jar
BungeeCord version git:BungeeCord-Bootstrap:1.13-SNAPSHOT:c26705e:1368

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions