Skip to content

Commit fd457fc

Browse files
committed
Implement suggested naming changes
1 parent 10953c1 commit fd457fc

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ public class UncheckedSignChangeEvent extends PlayerEvent implements Cancellable
2424

2525
private static final HandlerList HANDLER_LIST = new HandlerList();
2626
private boolean cancel = false;
27-
private final BlockPosition block;
27+
private final BlockPosition editedBlockPosition;
2828
private final Side side;
2929
private final List<Component> lines;
3030

3131
@ApiStatus.Internal
32-
public UncheckedSignChangeEvent(final Player editor, final BlockPosition block, final Side side, final List<Component> lines) {
32+
public UncheckedSignChangeEvent(final Player editor, final BlockPosition editedBlockPosition, final Side side, final List<Component> lines) {
3333
super(editor);
34-
this.block = block;
34+
this.editedBlockPosition = editedBlockPosition;
3535
this.side = side;
3636
this.lines = lines;
3737
}
@@ -41,8 +41,8 @@ public UncheckedSignChangeEvent(final Player editor, final BlockPosition block,
4141
*
4242
* @return location where the change happened
4343
*/
44-
public BlockPosition getBlock() {
45-
return block;
44+
public BlockPosition getEditedBlockPosition() {
45+
return editedBlockPosition;
4646
}
4747

4848
/**
@@ -59,7 +59,7 @@ public Side getSide() {
5959
*
6060
* @return the lines
6161
*/
62-
public @Unmodifiable List<Component> getLines() {
62+
public @Unmodifiable List<Component> lines() {
6363
return lines;
6464
}
6565

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.UUID;
1111
import java.util.concurrent.CompletableFuture;
1212
import io.papermc.paper.entity.LookAnchor;
13-
import io.papermc.paper.math.BlockPosition;
13+
import io.papermc.paper.math.Position;
1414
import org.bukkit.BanEntry;
1515
import org.bukkit.DyeColor;
1616
import org.bukkit.Effect;
@@ -51,7 +51,6 @@
5151
import org.bukkit.plugin.messaging.PluginMessageRecipient;
5252
import org.bukkit.potion.PotionEffect;
5353
import org.bukkit.potion.PotionEffectType;
54-
import org.bukkit.profile.PlayerProfile;
5554
import org.bukkit.scoreboard.Scoreboard;
5655
import org.jetbrains.annotations.ApiStatus;
5756
import org.jetbrains.annotations.NotNull;
@@ -3487,8 +3486,9 @@ default void setNoTickViewDistance(int viewDistance) {
34873486
*
34883487
* @param block The block where the client has a sign placed
34893488
* @param side The side to edit
3489+
* @see io.papermc.paper.event.packet.UncheckedSignChangeEvent
34903490
*/
3491-
void openLocalSign(@NotNull BlockPosition block, @NotNull Side side);
3491+
void openVirtualSign(@NotNull Position block, @NotNull Side side);
34923492

34933493
/**
34943494
* Shows the demo screen to the player, this screen is normally only seen in

paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import io.netty.buffer.Unpooled;
99
import io.papermc.paper.FeatureHooks;
1010
import io.papermc.paper.entity.LookAnchor;
11-
import io.papermc.paper.math.BlockPosition;
11+
import io.papermc.paper.math.Position;
1212
import io.papermc.paper.util.MCUtil;
1313
import it.unimi.dsi.fastutil.shorts.ShortArraySet;
1414
import it.unimi.dsi.fastutil.shorts.ShortSet;
@@ -3065,8 +3065,10 @@ public void openSign(@NotNull Sign sign, @NotNull Side side) {
30653065
}
30663066

30673067
@Override
3068-
public void openLocalSign(@NotNull BlockPosition block, @NotNull Side side) {
3069-
getHandle().connection.send(new ClientboundOpenSignEditorPacket(MCUtil.toBlockPos(block), side == Side.FRONT));
3068+
public void openVirtualSign(@NotNull Position block, @NotNull Side side) {
3069+
if (this.getHandle().connection == null) return;
3070+
3071+
this.getHandle().connection.send(new ClientboundOpenSignEditorPacket(MCUtil.toBlockPos(block), side == Side.FRONT));
30703072
}
30713073

30723074
@Override

0 commit comments

Comments
 (0)