PacketWrapper
PacketWrapper copied to clipboard
Clean up AbstractPacket
The "recievePacket" method has been deprecated for almost a year now and the replacement method is directly below the misspelled one. All plugins should have updated by now.
Instead of throwing the exceptions manually the Preconditions class is helping out.
Please note that I throw a NullPointerException if the packet handle is null and no longer an IllegalArgumentException. If this is not desired the line can be changed to
Preconditions.checkArgument(handle != null,"Packet handle cannot be NULL.");
Also, @dmulloy2 should I make another pr for removing the other deprecated methods? I don’t know how long you want to keep deprecated code before removal.
The thing about PacketWrapper is that it's meant to be be directly copied into plugins, so we're good to remove deprecated methods after the next Minecraft release. So anything that's currently deprecated is fine to be removed assuming people didn't just ignore the warning
@dmulloy2 Anything that I am supposed to change here (intendation?) so that you can merge this pr? I will make another pr for the other classes with deprecated code.