-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up AbstractPacket #57
base: master
Are you sure you want to change the base?
Conversation
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. |
PacketWrapper/src/main/java/com/comphenix/packetwrapper/AbstractPacket.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the two spaces indentation instead of the 4 are desired by the repository owner?
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the uneeded formating changes see single line comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uneeded formatting changes. Use 4 spaces instead of 2.
|
||
this.handle = handle; | ||
} | ||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes from here ->
ProtocolLibrary.getProtocolManager().broadcastServerPacket(getHandle()); | ||
} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to here.
} | ||
} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from here
} catch (Exception e) { | ||
throw new RuntimeException("Cannot receive packet.", e); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to here
@@ -2,24 +2,25 @@ | |||
* PacketWrapper - ProtocolLib wrappers for Minecraft packets | |||
* Copyright (C) dmulloy2 <http://dmulloy2.net> | |||
* Copyright (C) Kristian S. Strangeland | |||
* | |||
* <p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is not treated as a Javadoc so instead of adding <p>
tags I would suggest removing the second *
from the comment start
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.");