13
0
geforkt von Mirrors/Paper

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

Dieser Commit ist enthalten in:
Jason Penilla 2021-06-11 19:23:18 -07:00
Ursprung 51d9594fe8
Commit 25eea26621
2 geänderte Dateien mit 19 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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
+