Comments (5)
This is due to the ProtocolLib version you're using not being complete.
Not really something LilyPad can fix.
from bukkit-compatbungee.
This is an issue with LilyPad. The payload byte array was replaced with the PacketDataSerializer in the payload classes:
private String a;
private PacketDataSerializer b; // Replaced byte array
from bukkit-compatbungee.
Looking into this further I do not seem to be able to get a PacketDataSerializer (or any of ProtocolLib's wrappers for it) from PacketContainer. Correct me if I'm wrong?
from bukkit-compatbungee.
There isn't a wrapper for PacketDataSerializer, but something like this would work:
PacketContainer packet = event.getPacket();
// Obtain the data serializer
Class<?> dataSerializerClass = MinecraftReflection.getPacketDataSerializerClass();
StructureModifier<?> dataSerializers = packet.getSpecificModifier(dataSerializerClass);
Object dataSerializer = dataSerializers.read(0);
// Obtain the methods we will need
// You can probably make these static
FuzzyReflection fuzzy = FuzzyReflection.fromClass(dataSerializerClass);
MethodAccessor readableBytes = Accessors.getMethodAccessor(fuzzy.getMethodByParameters("readableBytes", int.class, new Class<?>[0]));
MethodAccessor readBytes = Accessors.getMethodAccessor(fuzzy.getMethodByParameters("readBytes", byte[].class, new Class<?>[] { int.class }));
int i = (int) readableBytes.invoke(dataSerializer);
byte[] bytes = (byte[]) readBytes.invoke(dataSerializer, i);
// Do stuff
from bukkit-compatbungee.
Resolved by PR #2
from bukkit-compatbungee.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bukkit-compatbungee.