PacketWrapper icon indicating copy to clipboard operation
PacketWrapper copied to clipboard

Clean up AbstractPacket

Open Photon-GitHub opened this issue 7 years ago • 3 comments

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.");

Photon-GitHub avatar Sep 27 '18 00:09 Photon-GitHub

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.

Photon-GitHub avatar Sep 30 '18 16:09 Photon-GitHub

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 avatar Nov 11 '18 19:11 dmulloy2

@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.

Photon-GitHub avatar Nov 12 '18 00:11 Photon-GitHub