1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-16 18:31:53 +01:00

Add ASM dep to API and fix issues from title packet changes with bungee api

This commit is contained in:
Jason Penilla 2021-06-11 19:23:18 -07:00
parent 51d9594fe8
commit 25eea26621
2 changed files with 19 additions and 4 deletions

View file

@ -5,6 +5,19 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ dependencies {
api("net.kyori:adventure-text-serializer-gson")
api("net.kyori:adventure-text-serializer-legacy")
api("net.kyori:adventure-text-serializer-plain")
+ api("org.ow2.asm:asm:9.0")
+ api("org.ow2.asm:asm-commons:9.0")
compileOnly("org.apache.maven:maven-resolver-provider:3.8.1")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0")
diff --git a/pom.xml b/pom.xml
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/pom.xml

View file

@ -76,12 +76,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public void setTitleTimes(int fadeInTicks, int stayTicks, int fadeOutTicks) {
+ getHandle().connection.send(new ClientboundSetTitlesPacket(ClientboundSetTitlesPacket.Type.TIMES, (BaseComponent[]) null, fadeInTicks, stayTicks, fadeOutTicks));
+ getHandle().connection.send(new ClientboundSetTitlesAnimationPacket(fadeInTicks, stayTicks, fadeOutTicks));
+ }
+
+ @Override
+ public void setSubtitle(BaseComponent[] subtitle) {
+ getHandle().connection.send(new ClientboundSetTitlesPacket(ClientboundSetTitlesPacket.Type.SUBTITLE, subtitle, 0, 0, 0));
+ final String json = net.md_5.bungee.chat.ComponentSerializer.toString(subtitle);
+ getHandle().connection.send(new ClientboundSetSubtitleTextPacket(Component.Serializer.fromJson(json)));
+ }
+
+ @Override
@ -91,7 +92,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public void showTitle(BaseComponent[] title) {
+ getHandle().connection.send(new ClientboundSetTitlesPacket(ClientboundSetTitlesPacket.Type.TITLE, title, 0, 0, 0));
+ final String json = net.md_5.bungee.chat.ComponentSerializer.toString(title);
+ getHandle().connection.send(new ClientboundSetTitleTextPacket(Component.Serializer.fromJson(json)));
+ }
+
+ @Override
@ -133,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public void hideTitle() {
+ getHandle().connection.send(new ClientboundSetTitlesPacket(ClientboundSetTitlesPacket.Type.CLEAR, (BaseComponent[]) null, 0, 0, 0));
+ getHandle().connection.send(new ClientboundClearTitlesPacket(false));
+ }
+ // Paper end
+