diff options
author | Shane Freeder <[email protected]> | 2022-03-13 21:22:14 +0000 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2022-03-13 21:23:59 +0000 |
commit | 9e013d6928899c76c227c4adb6ae5aec506f491b (patch) | |
tree | 4c8f0b224bcc09b6ba23d3992433d924dd5474d1 /patches | |
parent | 6ff60b33a647e9a35ddf37f3ab33901211ac5f64 (diff) | |
download | Paper-9e013d6928899c76c227c4adb6ae5aec506f491b.tar.gz Paper-9e013d6928899c76c227c4adb6ae5aec506f491b.zip |
trivial refactors, rebasefeature/SignSendEvent
Diffstat (limited to 'patches')
-rw-r--r-- | patches/api/0374-SendSignEvent.patch (renamed from patches/api/0356-SendSignEvent.patch) | 6 | ||||
-rw-r--r-- | patches/server/0878-SendSignEvent.patch (renamed from patches/server/0850-SendSignEvent.patch) | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/patches/api/0356-SendSignEvent.patch b/patches/api/0374-SendSignEvent.patch index d61f8aedea..c1d2dfcd6b 100644 --- a/patches/api/0356-SendSignEvent.patch +++ b/patches/api/0374-SendSignEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] SendSignEvent diff --git a/src/main/java/io/papermc/paper/event/block/SendSignEvent.java b/src/main/java/io/papermc/paper/event/block/SendSignEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..8cc0e1eb7a1a851b3c5ea3e002149b0d96bc5972 +index 0000000000000000000000000000000000000000..fa188e8bf3965234b2634b01ab1078c2fa76e7be --- /dev/null +++ b/src/main/java/io/papermc/paper/event/block/SendSignEvent.java @@ -0,0 +1,69 @@ @@ -59,13 +59,13 @@ index 0000000000000000000000000000000000000000..8cc0e1eb7a1a851b3c5ea3e002149b0d + * @return the lines of the sign + **/ + @NotNull -+ public abstract List<Component> getLines(); ++ public abstract List<@NotNull Component> lines(); + + /** + * @param line the line in which to modify + * @param component the component in which to set + */ -+ public abstract void setLine(int line, @Nullable net.kyori.adventure.text.Component component); ++ public abstract void line(int line, @Nullable net.kyori.adventure.text.Component component); + + private static final HandlerList handlers = new HandlerList(); + diff --git a/patches/server/0850-SendSignEvent.patch b/patches/server/0878-SendSignEvent.patch index 1145be7bcf..5822edfeb7 100644 --- a/patches/server/0850-SendSignEvent.patch +++ b/patches/server/0878-SendSignEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] SendSignEvent diff --git a/src/main/java/io/papermc/paper/block/SendSignEventImpl.java b/src/main/java/io/papermc/paper/block/SendSignEventImpl.java new file mode 100644 -index 0000000000000000000000000000000000000000..d4fc17586ff4eb07708636ad9ad8c56ea7a882a6 +index 0000000000000000000000000000000000000000..9c0ac5fe927728279842d92cc85a0979534f2107 --- /dev/null +++ b/src/main/java/io/papermc/paper/block/SendSignEventImpl.java -@@ -0,0 +1,54 @@ +@@ -0,0 +1,55 @@ +package io.papermc.paper.block; + +import io.papermc.paper.event.block.SendSignEvent; @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..d4fc17586ff4eb07708636ad9ad8c56e + + @Override + @NotNull -+ public List<net.kyori.adventure.text.Component> getLines() { ++ public List<net.kyori.adventure.text.Component> lines() { + return lines; + } + @@ -59,13 +59,14 @@ index 0000000000000000000000000000000000000000..d4fc17586ff4eb07708636ad9ad8c56e + return filteredMessages; + } + -+ public void setLine(int line, net.kyori.adventure.text.Component component) { ++ @Override ++ public void line(int line, net.kyori.adventure.text.Component component) { + lines.set(line, component != null ? component : net.kyori.adventure.text.Component.empty()); + filteredMessages[line] = TextComponent.EMPTY; + } +} diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -index 6371176fba41218a209ea59b4cafe5b2d4a685fd..fba8368c89dc7edeaa5aceb47d59c30b9e1d23fc 100644 +index 6371176fba41218a209ea59b4cafe5b2d4a685fd..3a7d1186a86860cab3fc00f98359d263353d2a3d 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java @@ -27,6 +27,7 @@ import net.minecraft.world.phys.Vec3; @@ -80,11 +81,11 @@ index 6371176fba41218a209ea59b4cafe5b2d4a685fd..fba8368c89dc7edeaa5aceb47d59c30b protected void saveAdditional(CompoundTag nbt) { super.saveAdditional(nbt); -+ // Paper ++ // Paper start + if (isSending && this.level != null) { + var signSendEvent = new io.papermc.paper.block.SendSignEventImpl(this.level, this.worldPosition, this.messages, this.filteredMessages); + signSendEvent.callEvent(); -+ final java.util.List<net.kyori.adventure.text.Component> lines = signSendEvent.getLines(); ++ final java.util.List<net.kyori.adventure.text.Component> lines = signSendEvent.lines(); + final java.util.List<Component> lineComponents = io.papermc.paper.adventure.PaperAdventure.asVanilla(lines); + final Component[] filteredMessages = signSendEvent.getFilteredMessages(); + for (int i = 0; i < 4; ++i) { |