Add ASM dep to API and fix issues from title packet changes with bungee api
This commit is contained in:
parent
933a189a04
commit
c56800c6fb
|
@ -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 4c197e7d9966f8789e6709461e59fc89355afd9c..9451f8660ec248619383d516df4b95e20e24828a 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -22,6 +22,8 @@ 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 cae43ce5c1287a4cd117fd069d34ebc1b64b7fdb..2c757ffb2253748c6a81f9b373290108209b6ff2 100644
|
||||
--- a/pom.xml
|
||||
|
|
|
@ -33,7 +33,7 @@ index 02d19fa4abdee0c8331734932a83e64694356030..969aea457e76b853e34a67a8fd07e0ea
|
|||
public static MutableComponent fromJson(String json) {
|
||||
return (MutableComponent) GsonHelper.fromJson(Component.Serializer.GSON, json, MutableComponent.class, false);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 1392d4d5027b3d972b2196af7b19fb409977fb8d..6401bdeeaa42ffe1e415553c94f0ec597b85df0c 100644
|
||||
index 1392d4d5027b3d972b2196af7b19fb409977fb8d..145f1ae878a6a6d91f291573f150c66363f151fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -43,7 +43,7 @@ index 1392d4d5027b3d972b2196af7b19fb409977fb8d..6401bdeeaa42ffe1e415553c94f0ec59
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.io.BaseEncoding;
|
||||
@@ -241,6 +242,96 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -241,6 +242,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,12 +76,13 @@ index 1392d4d5027b3d972b2196af7b19fb409977fb8d..6401bdeeaa42ffe1e415553c94f0ec59
|
|||
+
|
||||
+ @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 1392d4d5027b3d972b2196af7b19fb409977fb8d..6401bdeeaa42ffe1e415553c94f0ec59
|
|||
+
|
||||
+ @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 1392d4d5027b3d972b2196af7b19fb409977fb8d..6401bdeeaa42ffe1e415553c94f0ec59
|
|||
+
|
||||
+ @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
|
||||
+
|
||||
|
|
|
@ -30,10 +30,10 @@ index 670efbe53241a0ae32d618c83da601ccc1f26e37..abbbe1786eb68af02f9d39650aad730a
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 6401bdeeaa42ffe1e415553c94f0ec597b85df0c..d7c3bb17faf667ec90c967fe3c5ea6094faf0226 100644
|
||||
index 145f1ae878a6a6d91f291573f150c66363f151fd..34c249bff7f32aa3e58c04a1bc0f65f5f410d714 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -862,7 +862,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -864,7 +864,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
if (fromWorld == toWorld) {
|
||||
entity.connection.teleport(to);
|
||||
} else {
|
||||
|
|
|
@ -23,7 +23,7 @@ index b38ca69d37d7f1af0e34297f45e63a98da754e35..714fb0d766b654ad05134dea9b1e1b62
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index d7c3bb17faf667ec90c967fe3c5ea6094faf0226..074b9e2aa9162aec64007cbf235ccc965db70055 100644
|
||||
index 34c249bff7f32aa3e58c04a1bc0f65f5f410d714..6aabe32512abc974e114e273a41e09804b349cb9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -141,6 +141,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
@ -37,7 +37,7 @@ index d7c3bb17faf667ec90c967fe3c5ea6094faf0226..074b9e2aa9162aec64007cbf235ccc96
|
|||
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
super(server, entity);
|
||||
@@ -1873,6 +1877,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1875,6 +1879,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public boolean getAffectsSpawning() {
|
||||
return this.getHandle().affectsSpawning;
|
||||
}
|
||||
|
|
|
@ -49,10 +49,10 @@ index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c81
|
|||
}
|
||||
+
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 074b9e2aa9162aec64007cbf235ccc965db70055..7d19f877e66ef10c977b8072732bb16bd978e0de 100644
|
||||
index 6aabe32512abc974e114e273a41e09804b349cb9..2f8bcf5290d02cfc41496fd3ae8a63c08d514af8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1679,6 +1679,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1681,6 +1681,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void setRealHealth(double health) {
|
||||
|
|
Loading…
Reference in New Issue