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

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