diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-11-17 01:22:57 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-11-17 01:22:57 -0500 |
commit | 5c5e1b3dd0985986a941a65726f8f2d7bff7a188 (patch) | |
tree | 885088839304bfc57329ee38107304ee2422e648 /src | |
parent | cea2f168c50f6c930b2cbdfdd694285f72f28157 (diff) |
Add type variable to signature of send and accept
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/cshift/api/transit/network/Channel.java | 4 | ||||
-rw-r--r-- | src/main/java/net/cshift/api/transit/network/INode.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/net/cshift/api/transit/network/Channel.java b/src/main/java/net/cshift/api/transit/network/Channel.java index 3fdae88..758c7d4 100644 --- a/src/main/java/net/cshift/api/transit/network/Channel.java +++ b/src/main/java/net/cshift/api/transit/network/Channel.java @@ -139,8 +139,8 @@ public final class Channel<D> { * @param packet the packet to send * @return The overflow data if the packet is only partially accepted. {@code null} otherwise. */ - public IStaticPacket send(IStaticPacket packet) + public IStaticPacket<D> send(IStaticPacket<D> packet) { - return to.accept(packet, this); + return to.<D>accept(packet, this); } } diff --git a/src/main/java/net/cshift/api/transit/network/INode.java b/src/main/java/net/cshift/api/transit/network/INode.java index 6653e40..ad9f1d3 100644 --- a/src/main/java/net/cshift/api/transit/network/INode.java +++ b/src/main/java/net/cshift/api/transit/network/INode.java @@ -45,7 +45,7 @@ public interface INode * @param channel The channel which the packet is coming through * @return The overflow data if the packet is only partially accepted. {@code null} otherwise. */ - public IStaticPacket accept(IStaticPacket packet, Channel<?> channel); + public <T> IStaticPacket<T> accept(IStaticPacket<T> packet, Channel<T> channel); /** Pressure * |