Commit
Thanks libraryaddict. :)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,6 +167,10 @@ public PacketContainer getPacket() { | |
public void setPacket(PacketContainer packet) { | ||
if (readOnly) | ||
throw new IllegalStateException("The packet event is read-only."); | ||
if (packet == null) | ||
throw new IllegalArgumentException("Cannot set packet to NULL. Use setCancelled() instead."); | ||
if (this.packet != null && this.packet.getType() != packet.getType()) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aadnk
Author
Owner
|
||
throw new IllegalArgumentException("Cannot change packet type from " + this.packet.getType() + " to " + packet.getType()); | ||
this.packet = packet; | ||
} | ||
|
||
|
Why is replacing the packet with a different one not allowed?