-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make PacketProcessor interface, make code more generic
- Loading branch information
Showing
4 changed files
with
55 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...itsmyconfig/processor/UnpackedPacket.java → .../itsmyconfig/processor/PacketContent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/to/itsme/itsmyconfig/processor/PacketProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package to.itsme.itsmyconfig.processor; | ||
|
||
import net.kyori.adventure.text.Component; | ||
|
||
/** | ||
* Represents a packet that has been unpacked. | ||
* | ||
* @param <C> The packet container type. | ||
*/ | ||
public interface PacketProcessor<C> { | ||
|
||
/** | ||
* Edits the packet container with the given component. | ||
* | ||
* @param container The packet container. | ||
* @param component The component to edit with. | ||
*/ | ||
void edit(final C container, final Component component); | ||
|
||
/** | ||
* Unpacks the packet container into a {@link PacketContent}. | ||
* | ||
* @param container The packet container. | ||
* @return The unpacked packet. | ||
*/ | ||
PacketContent<C> unpack(final C container); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters