diff --git a/libraries/networking-common/build.gradle b/libraries/networking-common/build.gradle new file mode 100644 index 00000000..e98ba2c6 --- /dev/null +++ b/libraries/networking-common/build.gradle @@ -0,0 +1 @@ +setUpLibrary(project) diff --git a/libraries/networking-common/gradle.properties b/libraries/networking-common/gradle.properties new file mode 100644 index 00000000..cff73107 --- /dev/null +++ b/libraries/networking-common/gradle.properties @@ -0,0 +1,2 @@ +version = 0.1.0 +archives_base_name = networking-common diff --git a/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/build.gradle b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/build.gradle new file mode 100644 index 00000000..1b6e3f6d --- /dev/null +++ b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/build.gradle @@ -0,0 +1,4 @@ +setUpModule(project, + 'entrypoints-mc13w16a-04192037-mc1.14.4', + 'lifecycle-events-mc19w04a-mc1.14.4' +) diff --git a/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/gradle.properties b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/gradle.properties new file mode 100644 index 00000000..58630c9a --- /dev/null +++ b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/gradle.properties @@ -0,0 +1,7 @@ +environment = * +min_mc_version = 1.13-pre4 +max_mc_version = 1.14.4 +mc_version_range = >=1.13-rc.4 <=1.14.4 + +minecraft_version = 1.14.4 +feather_build = 1 diff --git a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java similarity index 100% rename from libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java rename to libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java diff --git a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/PacketBuffers.java similarity index 82% rename from libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java rename to libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/PacketBuffers.java index e1944e62..356630c9 100644 --- a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java +++ b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/PacketBuffers.java @@ -9,7 +9,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; -public final class PacketByteBufs { +public final class PacketBuffers { public static PacketByteBuf make() { return make(Unpooled.buffer()); @@ -19,8 +19,8 @@ public static PacketByteBuf make(byte[] bytes) { return make(Unpooled.wrappedBuffer(bytes)); } - public static PacketByteBuf make(ByteBuf buf) { - return new PacketByteBuf(buf); + public static PacketByteBuf make(ByteBuf buffer) { + return new PacketByteBuf(buffer); } public static PacketByteBuf make(IOConsumer writer) throws IOException { diff --git a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java rename to libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java diff --git a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java rename to libraries/networking-common/networking-common-mc1.13-pre4-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java diff --git a/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/build.gradle b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/build.gradle new file mode 100644 index 00000000..2f186572 --- /dev/null +++ b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/build.gradle @@ -0,0 +1,4 @@ +setUpModule(project, + 'entrypoints-mc13w16a-04192037-mc1.14.4', + 'lifecycle-events-mc13w36a-09051446-mc1.13' +) diff --git a/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/gradle.properties b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/gradle.properties new file mode 100644 index 00000000..69c97dca --- /dev/null +++ b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/gradle.properties @@ -0,0 +1,7 @@ +environment = * +min_mc_version = 13w41a +max_mc_version = 1.13-pre2 +mc_version_range = >=1.7-alpha.13.41.a <=1.13-rc.2 + +minecraft_version = 1.13-pre2 +feather_build = 1 diff --git a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java similarity index 100% rename from libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java rename to libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java diff --git a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/PacketBuffers.java similarity index 94% rename from libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java rename to libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/PacketBuffers.java index e1944e62..7cf48082 100644 --- a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java +++ b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/PacketBuffers.java @@ -9,7 +9,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; -public final class PacketByteBufs { +public final class PacketBuffers { public static PacketByteBuf make() { return make(Unpooled.buffer()); diff --git a/libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java rename to libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java rename to libraries/networking-common/networking-common-mc13w41a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java diff --git a/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/build.gradle b/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/build.gradle new file mode 100644 index 00000000..f7548915 --- /dev/null +++ b/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/build.gradle @@ -0,0 +1,4 @@ +setUpModule(project, + 'entrypoints-mcin-20091223-1459-mc1.5.2', + 'lifecycle-events-mcb1.4-1507-mcb1.7.3' +) diff --git a/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/gradle.properties b/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/gradle.properties new file mode 100644 index 00000000..94398336 --- /dev/null +++ b/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/gradle.properties @@ -0,0 +1,10 @@ +environment = client +min_mc_version = a1.0.16 +max_mc_version = a1.2.6 +mc_version_range = >=1.0.0-alpha.0.16 <=1.0.0-alpha.2.6 + +minecraft_version = a1.2.6 +feather_build = 1 +raven_build = 2 +sparrow_build = 2 +nests_build = 6 diff --git a/libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java similarity index 100% rename from libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java rename to libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java diff --git a/libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java similarity index 100% rename from libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java rename to libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java diff --git a/libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java rename to libraries/networking-common/networking-common-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java diff --git a/libraries/networking-common/networking-common-mcb1.0-mc13w39b/build.gradle b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/build.gradle new file mode 100644 index 00000000..b1769cfa --- /dev/null +++ b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/build.gradle @@ -0,0 +1,4 @@ +setUpModule(project, + 'entrypoints-mcin-20091223-1459-mc1.5.2', + 'lifecycle-events-mc12w21a-mc1.6.4' +) diff --git a/libraries/networking-common/networking-common-mcb1.0-mc13w39b/gradle.properties b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/gradle.properties new file mode 100644 index 00000000..41bc8da8 --- /dev/null +++ b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/gradle.properties @@ -0,0 +1,8 @@ +environment = * +min_mc_version = b1.0 +max_mc_version = 13w39b +mc_version_range = >=1.0.0-beta.0 <=1.7-alpha.13.39.b + +minecraft_version = 1.5.2 +feather_build = 1 +nests_build = 5 diff --git a/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java similarity index 100% rename from libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java rename to libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java diff --git a/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java similarity index 100% rename from libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java rename to libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java rename to libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java diff --git a/libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java rename to libraries/networking-common/networking-common-mcb1.0-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java diff --git a/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/build.gradle b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/build.gradle new file mode 100644 index 00000000..28981ba3 --- /dev/null +++ b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/build.gradle @@ -0,0 +1,4 @@ +setUpModule(project, + 'entrypoints-mcin-20091223-1459-mc1.5.2', + 'lifecycle-events-mcserver-a0.2.0-mcserver-a0.2.8' +) diff --git a/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/gradle.properties b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/gradle.properties new file mode 100644 index 00000000..f77f4b9e --- /dev/null +++ b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/gradle.properties @@ -0,0 +1,10 @@ +environment = server +min_mc_version = server-a0.1.0 +max_mc_version = server-a0.2.8 +mc_version_range = >=1.0.0-alpha.1.0 <=1.0.0-alpha.2.8 + +minecraft_version = server-a0.2.8 +feather_build = 1 +raven_build = 1 +sparrow_build = 1 +nests_build = 3 diff --git a/libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java similarity index 100% rename from libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java rename to libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java diff --git a/libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java similarity index 100% rename from libraries/networking/networking-mc12w18a-mc12w19a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java rename to libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java diff --git a/libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java similarity index 100% rename from libraries/networking/networking-mc11w49a-mc12w16a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java rename to libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java diff --git a/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/resources/osl.networking.mixins.json b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/resources/osl.networking.mixins.json new file mode 100644 index 00000000..2cfc21d4 --- /dev/null +++ b/libraries/networking-common/networking-common-mcserver-a0.1.0-mcserver-a0.2.8/src/main/resources/osl.networking.mixins.json @@ -0,0 +1,18 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "net.ornithemc.osl.networking.impl.mixin", + "compatibilityLevel": "JAVA_8", + "mixins": [ + "common.PacketAccessor" + ], + "client": [ + ], + "server": [ + "server.ServerLoginNetworkHandlerMixin", + "server.ServerPlayNetworkHandlerMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/libraries/networking/src/main/java/net/ornithemc/osl/networking/api/Channels.java b/libraries/networking-common/src/main/java/net/ornithemc/osl/networking/api/Channels.java similarity index 100% rename from libraries/networking/src/main/java/net/ornithemc/osl/networking/api/Channels.java rename to libraries/networking-common/src/main/java/net/ornithemc/osl/networking/api/Channels.java diff --git a/libraries/networking-common/src/main/java/net/ornithemc/osl/networking/impl/Constants.java b/libraries/networking-common/src/main/java/net/ornithemc/osl/networking/impl/Constants.java new file mode 100644 index 00000000..19393b9b --- /dev/null +++ b/libraries/networking-common/src/main/java/net/ornithemc/osl/networking/impl/Constants.java @@ -0,0 +1,18 @@ +package net.ornithemc.osl.networking.impl; + +public class Constants { + + /** + * The packet id for custom payloads, matches that + * of Vanilla custom payloads in 11w49a and above. + */ + public static final int CUSTOM_PAYLOAD_PACKET_ID = 250; + /** + * The string used to modify the Vanilla handshake. + * It needs to be an invalid Minecraft username. + */ + public static final String OSL_HANDSHAKE_KEY = "\0OrnitheMC"; + + public static final int DEFAULT_MAX_STRING_LENGTH = 32767; + +} diff --git a/libraries/networking-common/src/main/resources/assets/ornithe-standard-libraries/networking-common/icon.png b/libraries/networking-common/src/main/resources/assets/ornithe-standard-libraries/networking-common/icon.png new file mode 100644 index 00000000..ef588531 Binary files /dev/null and b/libraries/networking-common/src/main/resources/assets/ornithe-standard-libraries/networking-common/icon.png differ diff --git a/libraries/networking-common/src/main/resources/fabric.mod.json b/libraries/networking-common/src/main/resources/fabric.mod.json new file mode 100644 index 00000000..37f958e6 --- /dev/null +++ b/libraries/networking-common/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "osl-networking-common", + "version": "${version}", + "name": "Networking Common", + "description": "Common elements of the OSL Networking API.", + "authors": [ + "OrnitheMC", + "Space Walker" + ], + "contact": { + "homepage": "https://ornithemc.net/", + "issues": "https://github.com/OrnitheMC/ornithe-standard-libraries/issues", + "sources": "https://github.com/OrnitheMC/ornithe-standard-libraries" + }, + "license": "Apache-2.0", + "icon": "assets/ornithe-standard-libraries/networking-common/icon.png", + "environment": "${environment}", + "entrypoints": { + }, + "mixins": [ + ], + "depends": { + "fabricloader": ">=0.16.0", + "minecraft": "${mc_version_range}", + "osl-core": ">=0.4.0", + "osl-entrypoints": ">=0.2.0", + "osl-lifecycle-events": ">=0.4.0" + } +} diff --git a/libraries/networking/src/main/java/net/ornithemc/osl/networking/impl/Constants.java b/libraries/networking/java/net/ornithemc/osl/networking/impl/Constants.java similarity index 100% rename from libraries/networking/src/main/java/net/ornithemc/osl/networking/impl/Constants.java rename to libraries/networking/java/net/ornithemc/osl/networking/impl/Constants.java diff --git a/libraries/networking/networking-mc1.13-pre4-mc18w30b/build.gradle b/libraries/networking/networking-mc1.13-pre4-mc18w30b/build.gradle index cadd1023..9c3d3b9f 100644 --- a/libraries/networking/networking-mc1.13-pre4-mc18w30b/build.gradle +++ b/libraries/networking/networking-mc1.13-pre4-mc18w30b/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mc13w16a-04192037-mc1.14.4', - 'lifecycle-events-mc18w30a-mc18w50a' + 'lifecycle-events-mc18w30a-mc18w50a', + 'networking-common-mc1.13-pre4-mc1.14.4' ) diff --git a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java b/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java index 5faf509d..2962ff0a 100644 --- a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java @@ -19,7 +19,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.PayloadListener; import net.ornithemc.osl.networking.impl.NetworkListener; @@ -158,7 +158,7 @@ private static Packet makePacket(Identifier channel, CustomPayload payload) { private static Packet makePacket(Identifier channel, IOConsumer writer) { try { - return new CustomPayloadC2SPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadC2SPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java b/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java index d0448b0c..90ef1226 100644 --- a/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc1.13-pre4-mc18w30b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java @@ -23,7 +23,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.PayloadListener; import net.ornithemc.osl.networking.impl.NetworkListener; @@ -253,7 +253,7 @@ private static Packet makePacket(Identifier channel, CustomPayload payload) { private static Packet makePacket(Identifier channel, IOConsumer writer) { try { - return new CustomPayloadS2CPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadS2CPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc11w49a-mc12w16a/build.gradle b/libraries/networking/networking-mc11w49a-mc12w16a/build.gradle index 48639a05..0d602d1f 100644 --- a/libraries/networking/networking-mc11w49a-mc12w16a/build.gradle +++ b/libraries/networking/networking-mc11w49a-mc12w16a/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mc12w01a-mc12w17a' + 'lifecycle-events-mc12w01a-mc12w17a', + 'networking-common-mcb1.0-mc13w39b' ) diff --git a/libraries/networking/networking-mc12w17a-mc12w17a/build.gradle b/libraries/networking/networking-mc12w17a-mc12w17a/build.gradle index 48639a05..0d602d1f 100644 --- a/libraries/networking/networking-mc12w17a-mc12w17a/build.gradle +++ b/libraries/networking/networking-mc12w17a-mc12w17a/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mc12w01a-mc12w17a' + 'lifecycle-events-mc12w01a-mc12w17a', + 'networking-common-mcb1.0-mc13w39b' ) diff --git a/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index f0963ed6..00000000 --- a/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,70 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index dbe85275..00000000 --- a/libraries/networking/networking-mc12w17a-mc12w17a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,71 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.mob.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mc12w18a-mc12w19a/build.gradle b/libraries/networking/networking-mc12w18a-mc12w19a/build.gradle index a722cfca..c8372dbf 100644 --- a/libraries/networking/networking-mc12w18a-mc12w19a/build.gradle +++ b/libraries/networking/networking-mc12w18a-mc12w19a/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mc12w18a-mc12w19a' + 'lifecycle-events-mc12w18a-mc12w19a', + 'networking-common-mcb1.0-mc13w39b' ) diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/build.gradle b/libraries/networking/networking-mc12w21a-mc13w39b/build.gradle index b1769cfa..ebb22514 100644 --- a/libraries/networking/networking-mc12w21a-mc13w39b/build.gradle +++ b/libraries/networking/networking-mc12w21a-mc13w39b/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mc12w21a-mc1.6.4' + 'lifecycle-events-mc12w21a-mc1.6.4', + 'networking-common-mcb1.0-mc13w39b' ) diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/gradle.properties b/libraries/networking/networking-mc12w21a-mc13w39b/gradle.properties index f77fabb6..19360a2c 100644 --- a/libraries/networking/networking-mc12w21a-mc13w39b/gradle.properties +++ b/libraries/networking/networking-mc12w21a-mc13w39b/gradle.properties @@ -3,6 +3,6 @@ min_mc_version = 12w21a max_mc_version = 13w39b mc_version_range = >=1.3.1-alpha.12.21.a <=1.7-alpha.13.39.b -minecraft_version = 13w39b +minecraft_version = 1.5.2 feather_build = 1 -nests_build = 2 +nests_build = 5 diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index 237d7e67..00000000 --- a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public interface CustomPayload { - - void read(DataInputStream input) throws IOException; - - void write(DataOutputStream output) throws IOException; - -} diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java deleted file mode 100644 index f68e894c..00000000 --- a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class DataStreams { - - public static DataInputStream input(byte[] bytes) { - return new DataInputStream(new ByteArrayInputStream(bytes == null ? new byte[0] : bytes)); - } - - public static ByteArrayOutputStream output(IOConsumer writer) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(bos); - writer.accept(os); - return bos; - } -} diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerPlayNetworking.java b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerPlayNetworking.java index 83d990f4..7eda8cca 100644 --- a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerPlayNetworking.java +++ b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/api/server/ServerPlayNetworking.java @@ -6,7 +6,7 @@ import java.util.function.Supplier; import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; +import net.minecraft.server.entity.mob.player.ServerPlayerEntity; import net.minecraft.server.network.handler.ServerPlayNetworkHandler; import net.ornithemc.osl.core.api.util.function.IOConsumer; diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/PlayerManagerMixin.java b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/PlayerManagerMixin.java index eaca81eb..524a0e78 100644 --- a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/PlayerManagerMixin.java +++ b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/PlayerManagerMixin.java @@ -10,7 +10,7 @@ import net.minecraft.network.Connection; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerManager; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; +import net.minecraft.server.entity.mob.player.ServerPlayerEntity; import net.ornithemc.osl.networking.api.server.ServerConnectionEvents; diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/ServerPlayNetworkHandlerMixin.java b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/ServerPlayNetworkHandlerMixin.java index b1f392b1..cc8e6a20 100644 --- a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/ServerPlayNetworkHandlerMixin.java +++ b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/mixin/common/ServerPlayNetworkHandlerMixin.java @@ -13,7 +13,7 @@ import net.minecraft.network.packet.CustomPayloadPacket; import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; +import net.minecraft.server.entity.mob.player.ServerPlayerEntity; import net.minecraft.server.network.handler.ServerPlayNetworkHandler; import net.ornithemc.osl.networking.api.server.ServerConnectionEvents; diff --git a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java index de25d533..fa8c0cb8 100644 --- a/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc12w21a-mc13w39b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java @@ -15,7 +15,7 @@ import net.minecraft.network.packet.CustomPayloadPacket; import net.minecraft.network.packet.Packet; import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; +import net.minecraft.server.entity.mob.player.ServerPlayerEntity; import net.minecraft.server.network.handler.ServerPlayNetworkHandler; import net.ornithemc.osl.core.api.util.function.IOConsumer; diff --git a/libraries/networking/networking-mc13w41a-mc14w20b/build.gradle b/libraries/networking/networking-mc13w41a-mc14w20b/build.gradle index 2f186572..019322bf 100644 --- a/libraries/networking/networking-mc13w41a-mc14w20b/build.gradle +++ b/libraries/networking/networking-mc13w41a-mc14w20b/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mc13w16a-04192037-mc1.14.4', - 'lifecycle-events-mc13w36a-09051446-mc1.13' + 'lifecycle-events-mc13w36a-09051446-mc1.13', + 'networking-common-mc13w41a-mc1.13-pre2' ) diff --git a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java b/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java deleted file mode 100644 index 93b76c29..00000000 --- a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - -import net.minecraft.network.PacketByteBuf; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class PacketByteBufs { - - public static PacketByteBuf make() { - return make(Unpooled.buffer()); - } - - public static PacketByteBuf make(byte[] bytes) { - return bytes == null ? make() : make(Unpooled.wrappedBuffer(bytes)); - } - - public static PacketByteBuf make(ByteBuf buf) { - return buf == null ? make() : new PacketByteBuf(buf); - } - - public static PacketByteBuf make(IOConsumer writer) throws IOException { - PacketByteBuf buffer = make(); - writer.accept(buffer); - return buffer; - } -} diff --git a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index d5adcfb8..00000000 --- a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,82 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index e248c524..00000000 --- a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,83 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java b/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java index 3174f5ee..83ed3924 100644 --- a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java @@ -18,7 +18,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.Channels; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteArrayListener; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.PayloadListener; @@ -51,7 +51,7 @@ public static void destroy(Minecraft minecraft) { public static void registerListener(String channel, Supplier initializer, PayloadListener listener) { registerListenerImpl(channel, (minecraft, handler, data) -> { T payload = initializer.get(); - payload.read(PacketByteBufs.make(data)); + payload.read(PacketBuffers.make(data)); return listener.handle(minecraft, handler, payload); }); @@ -59,7 +59,7 @@ public static void registerListener(String channel, Su public static void registerListener(String channel, ByteBufListener listener) { registerListenerImpl(channel, (minecraft, handler, data) -> { - return listener.handle(minecraft, handler, PacketByteBufs.make(data)); + return listener.handle(minecraft, handler, PacketBuffers.make(data)); }); } @@ -155,7 +155,7 @@ private static Packet makePacket(String channel, CustomPayload payload) { private static Packet makePacket(String channel, IOConsumer writer) { try { - return new CustomPayloadC2SPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadC2SPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java b/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java index 150bf476..94753273 100644 --- a/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc13w41a-mc14w20b/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java @@ -22,7 +22,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.Channels; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteArrayListener; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.PayloadListener; @@ -55,7 +55,7 @@ public static void destroy(MinecraftServer server) { public static void registerListener(String channel, Supplier initializer, PayloadListener listener) { registerListenerImpl(channel, (server, handler, player, data) -> { T payload = initializer.get(); - payload.read(PacketByteBufs.make(data)); + payload.read(PacketBuffers.make(data)); return listener.handle(server, handler, player, payload); }); @@ -63,7 +63,7 @@ public static void registerListener(String channel, Su public static void registerListener(String channel, ByteBufListener listener) { registerListenerImpl(channel, (server, handler, player, data) -> { - return listener.handle(server, handler, player, PacketByteBufs.make(data)); + return listener.handle(server, handler, player, PacketBuffers.make(data)); }); } @@ -272,7 +272,7 @@ private static Packet makePacket(String channel, CustomPayload payload) { private static Packet makePacket(String channel, IOConsumer writer) { try { - return new CustomPayloadS2CPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadS2CPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc14w21a-mc14w30c/build.gradle b/libraries/networking/networking-mc14w21a-mc14w30c/build.gradle index 2f186572..019322bf 100644 --- a/libraries/networking/networking-mc14w21a-mc14w30c/build.gradle +++ b/libraries/networking/networking-mc14w21a-mc14w30c/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mc13w16a-04192037-mc1.14.4', - 'lifecycle-events-mc13w36a-09051446-mc1.13' + 'lifecycle-events-mc13w36a-09051446-mc1.13', + 'networking-common-mc13w41a-mc1.13-pre2' ) diff --git a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index aee6a1cd..00000000 --- a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.IOException; - -import net.minecraft.network.PacketByteBuf; - -public interface CustomPayload { - - void read(PacketByteBuf buffer) throws IOException; - - void write(PacketByteBuf buffer) throws IOException; - -} diff --git a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java deleted file mode 100644 index e1944e62..00000000 --- a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - -import net.minecraft.network.PacketByteBuf; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class PacketByteBufs { - - public static PacketByteBuf make() { - return make(Unpooled.buffer()); - } - - public static PacketByteBuf make(byte[] bytes) { - return make(Unpooled.wrappedBuffer(bytes)); - } - - public static PacketByteBuf make(ByteBuf buf) { - return new PacketByteBuf(buf); - } - - public static PacketByteBuf make(IOConsumer writer) throws IOException { - PacketByteBuf buffer = make(); - writer.accept(buffer); - return buffer; - } -} diff --git a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index d5adcfb8..00000000 --- a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,82 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index e248c524..00000000 --- a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,83 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java index 830dc28d..5c727c58 100644 --- a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java @@ -19,7 +19,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.Channels; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteArrayListener; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.PayloadListener; @@ -61,7 +61,7 @@ public static void registerListenerAsync(String channe private static void registerListener(String channel, Supplier initializer, PayloadListener listener, boolean async) { registerListenerImpl(channel, (minecraft, handler, data) -> { T payload = initializer.get(); - payload.read(PacketByteBufs.make(data)); + payload.read(PacketBuffers.make(data)); return listener.handle(minecraft, handler, payload); }, async); @@ -77,7 +77,7 @@ public static void registerListenerAsync(String channel, ByteBufListener listene private static void registerListener(String channel, ByteBufListener listener, boolean async) { registerListenerImpl(channel, (minecraft, handler, data) -> { - return listener.handle(minecraft, handler, PacketByteBufs.make(data)); + return listener.handle(minecraft, handler, PacketBuffers.make(data)); }, async); } @@ -185,7 +185,7 @@ private static Packet makePacket(String channel, CustomPayload payload) { private static Packet makePacket(String channel, IOConsumer writer) { try { - return new CustomPayloadC2SPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadC2SPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java index 0c5372fa..92f8843d 100644 --- a/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc14w21a-mc14w30c/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java @@ -23,7 +23,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.Channels; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteArrayListener; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.PayloadListener; @@ -66,7 +66,7 @@ public static void registerListenerAsync(String channe private static void registerListener(String channel, Supplier initializer, PayloadListener listener, boolean async) { registerListenerImpl(channel, (server, handler, player, data) -> { T payload = initializer.get(); - payload.read(PacketByteBufs.make(data)); + payload.read(PacketBuffers.make(data)); return listener.handle(server, handler, player, payload); }, async); @@ -82,7 +82,7 @@ public static void registerListenerAsync(String channel, ByteBufListener listene private static void registerListener(String channel, ByteBufListener listener, boolean async) { registerListenerImpl(channel, (server, handler, player, data) -> { - return listener.handle(server, handler, player, PacketByteBufs.make(data)); + return listener.handle(server, handler, player, PacketBuffers.make(data)); }, async); } @@ -302,7 +302,7 @@ private static Packet makePacket(String channel, CustomPayload payload) { private static Packet makePacket(String channel, IOConsumer writer) { try { - return new CustomPayloadS2CPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadS2CPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc14w31a-mc1.13-pre2/build.gradle b/libraries/networking/networking-mc14w31a-mc1.13-pre2/build.gradle index 2f186572..019322bf 100644 --- a/libraries/networking/networking-mc14w31a-mc1.13-pre2/build.gradle +++ b/libraries/networking/networking-mc14w31a-mc1.13-pre2/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mc13w16a-04192037-mc1.14.4', - 'lifecycle-events-mc13w36a-09051446-mc1.13' + 'lifecycle-events-mc13w36a-09051446-mc1.13', + 'networking-common-mc13w41a-mc1.13-pre2' ) diff --git a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index aee6a1cd..00000000 --- a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.IOException; - -import net.minecraft.network.PacketByteBuf; - -public interface CustomPayload { - - void read(PacketByteBuf buffer) throws IOException; - - void write(PacketByteBuf buffer) throws IOException; - -} diff --git a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index d5adcfb8..00000000 --- a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,82 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index e248c524..00000000 --- a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,83 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java b/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java index f9078808..17b0d98a 100644 --- a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java @@ -19,7 +19,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.Channels; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.PayloadListener; import net.ornithemc.osl.networking.impl.NetworkListener; @@ -160,7 +160,7 @@ private static Packet makePacket(String channel, CustomPayload payload) { private static Packet makePacket(String channel, IOConsumer writer) { try { - return new CustomPayloadC2SPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadC2SPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java b/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java index 4921990c..fa854380 100644 --- a/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc14w31a-mc1.13-pre2/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java @@ -23,7 +23,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.Channels; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.PayloadListener; import net.ornithemc.osl.networking.impl.NetworkListener; @@ -253,7 +253,7 @@ private static Packet makePacket(String channel, CustomPayload payload) { private static Packet makePacket(String channel, IOConsumer writer) { try { - return new CustomPayloadS2CPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadS2CPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc18w31a-mc1.14.4/build.gradle b/libraries/networking/networking-mc18w31a-mc1.14.4/build.gradle index 1b6e3f6d..ae8efccc 100644 --- a/libraries/networking/networking-mc18w31a-mc1.14.4/build.gradle +++ b/libraries/networking/networking-mc18w31a-mc1.14.4/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mc13w16a-04192037-mc1.14.4', - 'lifecycle-events-mc19w04a-mc1.14.4' + 'lifecycle-events-mc19w04a-mc1.14.4', + 'networking-common-mc1.13-pre4-mc1.14.4' ) diff --git a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index aee6a1cd..00000000 --- a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.IOException; - -import net.minecraft.network.PacketByteBuf; - -public interface CustomPayload { - - void read(PacketByteBuf buffer) throws IOException; - - void write(PacketByteBuf buffer) throws IOException; - -} diff --git a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java deleted file mode 100644 index e1944e62..00000000 --- a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/PacketByteBufs.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - -import net.minecraft.network.PacketByteBuf; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class PacketByteBufs { - - public static PacketByteBuf make() { - return make(Unpooled.buffer()); - } - - public static PacketByteBuf make(byte[] bytes) { - return make(Unpooled.wrappedBuffer(bytes)); - } - - public static PacketByteBuf make(ByteBuf buf) { - return new PacketByteBuf(buf); - } - - public static PacketByteBuf make(IOConsumer writer) throws IOException { - PacketByteBuf buffer = make(); - writer.accept(buffer); - return buffer; - } -} diff --git a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index d5adcfb8..00000000 --- a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,82 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index e248c524..00000000 --- a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,83 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.living.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * This applies to connections to dedicated servers as - * well as connections to integrated servers. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java index 5faf509d..2962ff0a 100644 --- a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/client/ClientPlayNetworkingImpl.java @@ -19,7 +19,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.PayloadListener; import net.ornithemc.osl.networking.impl.NetworkListener; @@ -158,7 +158,7 @@ private static Packet makePacket(Identifier channel, CustomPayload payload) { private static Packet makePacket(Identifier channel, IOConsumer writer) { try { - return new CustomPayloadC2SPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadC2SPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java index d7ff0a5c..ddf93266 100644 --- a/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java +++ b/libraries/networking/networking-mc18w31a-mc1.14.4/src/main/java/net/ornithemc/osl/networking/impl/server/ServerPlayNetworkingImpl.java @@ -24,7 +24,7 @@ import net.ornithemc.osl.core.api.util.function.IOConsumer; import net.ornithemc.osl.networking.api.CustomPayload; -import net.ornithemc.osl.networking.api.PacketByteBufs; +import net.ornithemc.osl.networking.api.PacketBuffers; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteBufListener; import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.PayloadListener; import net.ornithemc.osl.networking.impl.NetworkListener; @@ -254,7 +254,7 @@ private static Packet makePacket(Identifier channel, CustomPayload payload) { private static Packet makePacket(Identifier channel, IOConsumer writer) { try { - return new CustomPayloadS2CPacket(channel, PacketByteBufs.make(writer)); + return new CustomPayloadS2CPacket(channel, PacketBuffers.make(writer)); } catch (IOException e) { LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e); return null; diff --git a/libraries/networking/networking-mca1.0.16-mca1.2.6/build.gradle b/libraries/networking/networking-mca1.0.16-mca1.2.6/build.gradle index f7548915..ec8ddff2 100644 --- a/libraries/networking/networking-mca1.0.16-mca1.2.6/build.gradle +++ b/libraries/networking/networking-mca1.0.16-mca1.2.6/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mcb1.4-1507-mcb1.7.3' + 'lifecycle-events-mcb1.4-1507-mcb1.7.3', + 'networking-common-mca1.0.16-mca1.2.6' ) diff --git a/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index 237d7e67..00000000 --- a/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public interface CustomPayload { - - void read(DataInputStream input) throws IOException; - - void write(DataOutputStream output) throws IOException; - -} diff --git a/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java deleted file mode 100644 index f68e894c..00000000 --- a/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class DataStreams { - - public static DataInputStream input(byte[] bytes) { - return new DataInputStream(new ByteArrayInputStream(bytes == null ? new byte[0] : bytes)); - } - - public static ByteArrayOutputStream output(IOConsumer writer) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(bos); - writer.accept(os); - return bos; - } -} diff --git a/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index f0963ed6..00000000 --- a/libraries/networking/networking-mca1.0.16-mca1.2.6/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,70 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mcb1.0-mcb1.4_01/build.gradle b/libraries/networking/networking-mcb1.0-mcb1.4_01/build.gradle index f7548915..f34446ab 100644 --- a/libraries/networking/networking-mcb1.0-mcb1.4_01/build.gradle +++ b/libraries/networking/networking-mcb1.0-mcb1.4_01/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mcb1.4-1507-mcb1.7.3' + 'lifecycle-events-mcb1.4-1507-mcb1.7.3', + 'networking-common-mcb1.0-mc13w39b' ) diff --git a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index 237d7e67..00000000 --- a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public interface CustomPayload { - - void read(DataInputStream input) throws IOException; - - void write(DataOutputStream output) throws IOException; - -} diff --git a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java deleted file mode 100644 index f68e894c..00000000 --- a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class DataStreams { - - public static DataInputStream input(byte[] bytes) { - return new DataInputStream(new ByteArrayInputStream(bytes == null ? new byte[0] : bytes)); - } - - public static ByteArrayOutputStream output(IOConsumer writer) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(bos); - writer.accept(os); - return bos; - } -} diff --git a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index f0963ed6..00000000 --- a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,70 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index dbe85275..00000000 --- a/libraries/networking/networking-mcb1.0-mcb1.4_01/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,71 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.mob.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mcb1.5-mc11w48a/build.gradle b/libraries/networking/networking-mcb1.5-mc11w48a/build.gradle index 4f17952b..8e54b83d 100644 --- a/libraries/networking/networking-mcb1.5-mc11w48a/build.gradle +++ b/libraries/networking/networking-mcb1.5-mc11w48a/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mcb1.8-pre1-201109081459-mc11w50a' + 'lifecycle-events-mcb1.8-pre1-201109081459-mc11w50a', + 'networking-common-mcb1.0-mc13w39b' ) diff --git a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index 237d7e67..00000000 --- a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public interface CustomPayload { - - void read(DataInputStream input) throws IOException; - - void write(DataOutputStream output) throws IOException; - -} diff --git a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java deleted file mode 100644 index f68e894c..00000000 --- a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class DataStreams { - - public static DataInputStream input(byte[] bytes) { - return new DataInputStream(new ByteArrayInputStream(bytes == null ? new byte[0] : bytes)); - } - - public static ByteArrayOutputStream output(IOConsumer writer) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(bos); - writer.accept(os); - return bos; - } -} diff --git a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java b/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java deleted file mode 100644 index f0963ed6..00000000 --- a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/client/ClientConnectionEvents.java +++ /dev/null @@ -1,70 +0,0 @@ -package net.ornithemc.osl.networking.api.client; - -import java.util.function.Consumer; - -import net.minecraft.client.Minecraft; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the client side of a client-server connection. - */ -public class ClientConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.LOGIN.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.consumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.PLAY_READY.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.consumer(); - /** - * This event is fired when the client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ClientConnectionEvents.DISCONNECT.register(minecraft -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.consumer(); - -} diff --git a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index dbe85275..00000000 --- a/libraries/networking/networking-mcb1.5-mc11w48a/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,71 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.mob.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/build.gradle b/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/build.gradle index 28981ba3..f2a18659 100644 --- a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/build.gradle +++ b/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mcserver-a0.2.0-mcserver-a0.2.8' + 'lifecycle-events-mcserver-a0.2.0-mcserver-a0.2.8', + 'networking-common-mcserver-a0.1.0-mcserver-a0.2.8' ) diff --git a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index 237d7e67..00000000 --- a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public interface CustomPayload { - - void read(DataInputStream input) throws IOException; - - void write(DataOutputStream output) throws IOException; - -} diff --git a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java deleted file mode 100644 index f68e894c..00000000 --- a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class DataStreams { - - public static DataInputStream input(byte[] bytes) { - return new DataInputStream(new ByteArrayInputStream(bytes == null ? new byte[0] : bytes)); - } - - public static ByteArrayOutputStream output(IOConsumer writer) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(bos); - writer.accept(os); - return bos; - } -} diff --git a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index dbe85275..00000000 --- a/libraries/networking/networking-mcserver-a0.1.2_01-mcserver-a0.2.1/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,71 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.mob.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/build.gradle b/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/build.gradle index 28981ba3..f2a18659 100644 --- a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/build.gradle +++ b/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/build.gradle @@ -1,4 +1,5 @@ setUpModule(project, 'entrypoints-mcin-20091223-1459-mc1.5.2', - 'lifecycle-events-mcserver-a0.2.0-mcserver-a0.2.8' + 'lifecycle-events-mcserver-a0.2.0-mcserver-a0.2.8', + 'networking-common-mcserver-a0.1.0-mcserver-a0.2.8' ) diff --git a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java b/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java deleted file mode 100644 index 237d7e67..00000000 --- a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/CustomPayload.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public interface CustomPayload { - - void read(DataInputStream input) throws IOException; - - void write(DataOutputStream output) throws IOException; - -} diff --git a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java b/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java deleted file mode 100644 index f68e894c..00000000 --- a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/DataStreams.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.ornithemc.osl.networking.api; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.ornithemc.osl.core.api.util.function.IOConsumer; - -public final class DataStreams { - - public static DataInputStream input(byte[] bytes) { - return new DataInputStream(new ByteArrayInputStream(bytes == null ? new byte[0] : bytes)); - } - - public static ByteArrayOutputStream output(IOConsumer writer) throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(bos); - writer.accept(os); - return bos; - } -} diff --git a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java b/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java deleted file mode 100644 index dbe85275..00000000 --- a/libraries/networking/networking-mcserver-a0.2.2-mcserver-a0.2.8/src/main/java/net/ornithemc/osl/networking/api/server/ServerConnectionEvents.java +++ /dev/null @@ -1,71 +0,0 @@ -package net.ornithemc.osl.networking.api.server; - -import java.util.function.BiConsumer; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.entity.mob.player.ServerPlayerEntity; - -import net.ornithemc.osl.core.api.events.Event; - -/** - * Events related to the server side of a client-server connection. - */ -public class ServerConnectionEvents { - - /** - * This event is fired after a successful login occurs. - * - *

- * Note that channel registration happens after login, - * and until then data cannot safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.LOGIN.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> LOGIN = Event.biConsumer(); - /** - * This event is fired after login, once channel registration is complete. - * - *

- * This marks the moment data can safely be sent to the client. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.PLAY_READY.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> PLAY_READY = Event.biConsumer(); - /** - * This event is fired when a client disconnects from the server. - * - *

- * Callbacks to this event should be registered in your mod's entrypoint, - * and can be done as follows: - * - *

-	 * {@code
-	 * ServerConnectionEvents.DISCONNECT.register((server, player) -> {
-	 * 	...
-	 * });
-	 * }
-	 * 
- */ - public static final Event> DISCONNECT = Event.biConsumer(); - -} diff --git a/libraries/networking/src/main/resources/fabric.mod.json b/libraries/networking/src/main/resources/fabric.mod.json index 16417e6f..3be6e20f 100644 --- a/libraries/networking/src/main/resources/fabric.mod.json +++ b/libraries/networking/src/main/resources/fabric.mod.json @@ -35,6 +35,7 @@ "minecraft": "${mc_version_range}", "osl-core": ">=0.4.0", "osl-entrypoints": ">=0.2.0", - "osl-lifecycle-events": ">=0.4.0" + "osl-lifecycle-events": ">=0.4.0", + "osl-networking-common": ">=0.1.0" } } diff --git a/settings.gradle b/settings.gradle index cb6f2ac3..e9b351c2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -77,6 +77,13 @@ include ':libraries:networking:networking-mc14w31a-mc1.13-pre2' include ':libraries:networking:networking-mc1.13-pre4-mc18w30b' include ':libraries:networking:networking-mc18w31a-mc1.14.4' +include ':libraries:networking-common' +include ':libraries:networking-common:networking-common-mca1.0.16-mca1.2.6' +include ':libraries:networking-common:networking-common-mcserver-a0.1.0-mcserver-a0.2.8' +include ':libraries:networking-common:networking-common-mcb1.0-mc13w39b' +include ':libraries:networking-common:networking-common-mc13w41a-mc1.13-pre2' +include ':libraries:networking-common:networking-common-mc1.13-pre4-mc1.14.4' + include ':libraries:resource-loader' include ':libraries:resource-loader:resource-loader-mca1.2.2-1624-mc11w48a' include ':libraries:resource-loader:resource-loader-mc11w49a-mc1.2.5'