Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e0598aa2 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter

CraftBukkit Changes:
2cdc6b1e4 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter
This commit is contained in:
Mariell Hoversholm
2021-08-05 21:53:50 +02:00
parent ecbd399610
commit 7df3240f80
9 changed files with 100 additions and 35 deletions

View File

@@ -2261,11 +2261,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ @Override
+ public void sendSignChange(Location loc, List<net.kyori.adventure.text.Component> lines) {
+ this.sendSignChange(loc, lines, org.bukkit.DyeColor.BLACK);
+ }
+ @Override
+ public void sendSignChange(Location loc, List<net.kyori.adventure.text.Component> lines, DyeColor dyeColor) {
+ public void sendSignChange(Location loc, @Nullable List<net.kyori.adventure.text.Component> lines, DyeColor dyeColor, boolean hasGlowingText) {
+ if (getHandle().connection == null) {
+ return;
+ }
@@ -2278,12 +2274,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ throw new IllegalArgumentException("Must have at least 4 lines");
+ }
+ Component[] components = CraftSign.sanitizeLines(lines);
+ this.sendSignChange0(components, loc, dyeColor);
+ this.sendSignChange0(components, loc, dyeColor, hasGlowingText);
+ }
+
+ private void sendSignChange0(Component[] components, Location loc, DyeColor dyeColor) {
+ private void sendSignChange0(Component[] components, Location loc, DyeColor dyeColor, boolean hasGlowingText) {
+ SignBlockEntity sign = new SignBlockEntity(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), Blocks.OAK_SIGN.defaultBlockState());
+ sign.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData()));
+ sign.setHasGlowingText(hasGlowingText);
+ System.arraycopy(components, 0, sign.messages, 0, sign.messages.length);
+
+ getHandle().connection.send(sign.getUpdatePacket());
@@ -2291,23 +2288,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
@Override
public void sendSignChange(Location loc, String[] lines) {
this.sendSignChange(loc, lines, DyeColor.BLACK);
this.sendSignChange(loc, lines, DyeColor.BLACK);
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
Component[] components = CraftSign.sanitizeLines(lines);
- SignBlockEntity sign = new SignBlockEntity(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), Blocks.OAK_SIGN.defaultBlockState());
- sign.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData()));
- for (int i = 0; i < components.length; i++) {
- sign.setMessage(i, components[i]);
- }
+ /*SignBlockEntity sign = new SignBlockEntity(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), Blocks.OAK_SIGN.defaultBlockState());
+ sign.setColor(EnumColor.fromColorIndex(dyeColor.getWoolData()));
+ System.arraycopy(components, 0, sign.lines, 0, sign.lines.length);
sign.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData()));
sign.setHasGlowingText(hasGlowingText);
for (int i = 0; i < components.length; i++) {
sign.setMessage(i, components[i]);
}
- this.getHandle().connection.send(sign.getUpdatePacket());
+ this.getHandle().connection.send(sign.getUpdatePacket());*/ // Paper
+ this.sendSignChange0(components, loc, dyeColor); // Paper
+ this.sendSignChange0(components, loc, dyeColor, hasGlowingText); // Paper
}
@Override