Skip to content

Commit 3e064ce

Browse files
committed
Experimental and jd
1 parent 29db04f commit 3e064ce

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

paper-api/src/main/java/io/papermc/paper/event/packet/UncheckedSignChangeEvent.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.papermc.paper.event.packet;
22

33
import io.papermc.paper.math.BlockPosition;
4+
import io.papermc.paper.math.Position;
45
import net.kyori.adventure.text.Component;
56
import org.bukkit.block.sign.Side;
67
import org.bukkit.entity.Player;
@@ -13,13 +14,16 @@
1314
import java.util.List;
1415

1516
/**
16-
* Called when a sign edit packet has been received, but the location at which the sign should be edited
17+
* Called when a client attempts to modify a sign, but the location at which the sign should be edited
1718
* has not yet been checked for the existence of a real sign.
1819
* <p>
1920
* Cancelling this event will prevent further processing of the sign change, but needs further handling
20-
* by the plugin because the local world might be in an inconsistent state.
21+
* by the plugin as the client's local world might be in an inconsistent state.
22+
*
23+
* @see Player#openVirtualSign(Position, Side)
2124
*/
2225
@NullMarked
26+
@ApiStatus.Experimental
2327
public class UncheckedSignChangeEvent extends PlayerEvent implements Cancellable {
2428

2529
private static final HandlerList HANDLER_LIST = new HandlerList();

paper-api/src/main/java/org/bukkit/entity/Player.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -3481,13 +3481,14 @@ default void setNoTickViewDistance(int viewDistance) {
34813481
* Open a sign for editing by the player.
34823482
* <p>
34833483
* The sign must only be placed locally for the player, which can be done with {@link #sendBlockChange(Location, BlockData)} and {@link #sendBlockUpdate(Location, TileState)}.
3484-
* A side-effect of this is that no events will be called for this action.
3484+
* A side-effect of this is that normal events, like {@link org.bukkit.event.block.SignChangeEvent} will not be called (unless there is an actual sign in the world).
34853485
* </p>
34863486
*
34873487
* @param block The block where the client has a sign placed
34883488
* @param side The side to edit
34893489
* @see io.papermc.paper.event.packet.UncheckedSignChangeEvent
34903490
*/
3491+
@ApiStatus.Experimental
34913492
void openVirtualSign(@NotNull Position block, @NotNull Side side);
34923493

34933494
/**

paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -2504,7 +2504,7 @@
25042504
+ if (!new io.papermc.paper.event.packet.UncheckedSignChangeEvent(this.player.getBukkitEntity(),
25052505
+ io.papermc.paper.util.MCUtil.toPosition(pos),
25062506
+ packet.isFrontText() ? org.bukkit.block.sign.Side.FRONT : org.bukkit.block.sign.Side.BACK,
2507-
+ filteredText.stream().map(line -> (net.kyori.adventure.text.Component) net.kyori.adventure.text.Component.text(line.raw())).toList())
2507+
+ filteredText.stream().<net.kyori.adventure.text.Component>map(line -> net.kyori.adventure.text.Component.text(line.raw())).toList())
25082508
+ .callEvent()) {
25092509
+ return;
25102510
+ }

0 commit comments

Comments
 (0)