--- a/net/minecraft/world/level/block/SignBlock.java
+++ b/net/minecraft/world/level/block/SignBlock.java
@@ -30,6 +30,7 @@
 import net.minecraft.world.level.block.state.properties.BooleanProperty;
 import net.minecraft.world.level.block.state.properties.WoodType;
 import net.minecraft.world.level.gameevent.GameEvent;
+import net.minecraft.world.level.material.Fluid;
 import net.minecraft.world.level.material.FluidState;
 import net.minecraft.world.level.material.Fluids;
 import net.minecraft.world.phys.BlockHitResult;
@@ -38,6 +39,7 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 
 public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterloggedBlock {
+
     public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
     protected static final float AABB_OFFSET = 4.0F;
     protected static final VoxelShape SHAPE = Block.box(4.0D, 0.0D, 4.0D, 12.0D, 16.0D, 12.0D);
@@ -50,8 +52,8 @@
 
     @Override
     public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
-        if (state.getValue(WATERLOGGED)) {
-            world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
+        if ((Boolean) state.getValue(SignBlock.WATERLOGGED)) {
+            world.scheduleTick(pos, (Fluid) Fluids.WATER, Fluids.WATER.getTickDelay(world));
         }
 
         return super.updateShape(state, direction, neighborState, world, pos, neighborPos);
@@ -59,7 +61,7 @@
 
     @Override
     public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE;
+        return SignBlock.SHAPE;
     }
 
     @Override
@@ -74,45 +76,52 @@
 
     @Override
     public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
-        ItemStack itemStack = player.getItemInHand(hand);
-        Item item = itemStack.getItem();
-        Item signBlockEntity = itemStack.getItem();
-        SignApplicator var10000;
-        if (signBlockEntity instanceof SignApplicator signApplicator) {
-            var10000 = signApplicator;
+        ItemStack itemstack = player.getItemInHand(hand);
+        Item item = itemstack.getItem();
+        Item item1 = itemstack.getItem();
+        SignApplicator signapplicator;
+
+        if (item1 instanceof SignApplicator) {
+            SignApplicator signapplicator1 = (SignApplicator) item1;
+
+            signapplicator = signapplicator1;
         } else {
-            var10000 = null;
+            signapplicator = null;
         }
 
-        SignApplicator signApplicator2 = var10000;
-        boolean bl = signApplicator2 != null && player.mayBuild();
-        BlockEntity bl2 = world.getBlockEntity(pos);
-        if (bl2 instanceof SignBlockEntity signBlockEntity) {
+        SignApplicator signapplicator2 = signapplicator;
+        boolean flag = signapplicator2 != null && player.mayBuild();
+        BlockEntity tileentity = world.getBlockEntity(pos);
+
+        if (tileentity instanceof SignBlockEntity) {
+            SignBlockEntity tileentitysign = (SignBlockEntity) tileentity;
+
             if (!world.isClientSide) {
-                boolean bl2 = signBlockEntity.isFacingFrontText(player);
-                SignText signText = signBlockEntity.getText(bl2);
-                boolean bl3 = signBlockEntity.executeClickCommandsIfPresent(player, world, pos, bl2);
-                if (signBlockEntity.isWaxed()) {
-                    world.playSound((Player)null, signBlockEntity.getBlockPos(), SoundEvents.WAXED_SIGN_INTERACT_FAIL, SoundSource.BLOCKS);
-                    return this.getInteractionResult(bl);
-                } else if (bl && !this.otherPlayerIsEditingSign(player, signBlockEntity) && signApplicator2.canApplyToSign(signText, player) && signApplicator2.tryApplyToSign(world, signBlockEntity, bl2, player)) {
+                boolean flag1 = tileentitysign.isFacingFrontText(player);
+                SignText signtext = tileentitysign.getText(flag1);
+                boolean flag2 = tileentitysign.executeClickCommandsIfPresent(player, world, pos, flag1);
+
+                if (tileentitysign.isWaxed()) {
+                    world.playSound((Player) null, tileentitysign.getBlockPos(), SoundEvents.WAXED_SIGN_INTERACT_FAIL, SoundSource.BLOCKS);
+                    return this.getInteractionResult(flag);
+                } else if (flag && !this.otherPlayerIsEditingSign(player, tileentitysign) && signapplicator2.canApplyToSign(signtext, player) && signapplicator2.tryApplyToSign(world, tileentitysign, flag1, player)) {
                     if (!player.isCreative()) {
-                        itemStack.shrink(1);
+                        itemstack.shrink(1);
                     }
 
-                    world.gameEvent(GameEvent.BLOCK_CHANGE, signBlockEntity.getBlockPos(), GameEvent.Context.of(player, signBlockEntity.getBlockState()));
+                    world.gameEvent(GameEvent.BLOCK_CHANGE, tileentitysign.getBlockPos(), GameEvent.Context.of(player, tileentitysign.getBlockState()));
                     player.awardStat(Stats.ITEM_USED.get(item));
                     return InteractionResult.SUCCESS;
-                } else if (bl3) {
+                } else if (flag2) {
                     return InteractionResult.SUCCESS;
-                } else if (!this.otherPlayerIsEditingSign(player, signBlockEntity) && player.mayBuild() && this.hasEditableText(player, signBlockEntity, bl2)) {
-                    this.openTextEdit(player, signBlockEntity, bl2);
-                    return this.getInteractionResult(bl);
+                } else if (!this.otherPlayerIsEditingSign(player, tileentitysign) && player.mayBuild() && this.hasEditableText(player, tileentitysign, flag1)) {
+                    this.openTextEdit(player, tileentitysign, flag1, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper
+                    return this.getInteractionResult(flag);
                 } else {
                     return InteractionResult.PASS;
                 }
             } else {
-                return !bl && !signBlockEntity.isWaxed() ? InteractionResult.CONSUME : InteractionResult.SUCCESS;
+                return !flag && !tileentitysign.isWaxed() ? InteractionResult.CONSUME : InteractionResult.SUCCESS;
             }
         } else {
             return InteractionResult.PASS;
@@ -124,9 +133,10 @@
     }
 
     private boolean hasEditableText(Player player, SignBlockEntity blockEntity, boolean front) {
-        SignText signText = blockEntity.getText(front);
-        return Arrays.stream(signText.getMessages(player.isTextFilteringEnabled())).allMatch((message) -> {
-            return message.equals(CommonComponents.EMPTY) || message.getContents() instanceof LiteralContents;
+        SignText signtext = blockEntity.getText(front);
+
+        return Arrays.stream(signtext.getMessages(player.isTextFilteringEnabled())).allMatch((ichatbasecomponent) -> {
+            return ichatbasecomponent.equals(CommonComponents.EMPTY) || ichatbasecomponent.getContents() instanceof LiteralContents;
         });
     }
 
@@ -138,7 +148,7 @@
 
     @Override
     public FluidState getFluidState(BlockState state) {
-        return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state);
+        return (Boolean) state.getValue(SignBlock.WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state);
     }
 
     public WoodType type() {
@@ -146,29 +156,57 @@
     }
 
     public static WoodType getWoodType(Block block) {
-        WoodType woodType;
+        WoodType blockpropertywood;
+
         if (block instanceof SignBlock) {
-            woodType = ((SignBlock)block).type();
+            blockpropertywood = ((SignBlock) block).type();
         } else {
-            woodType = WoodType.OAK;
+            blockpropertywood = WoodType.OAK;
         }
 
-        return woodType;
+        return blockpropertywood;
     }
 
+    @io.papermc.paper.annotation.DoNotUse @Deprecated // Paper
     public void openTextEdit(Player player, SignBlockEntity blockEntity, boolean front) {
-        blockEntity.setAllowedPlayerEditor(player.getUUID());
-        player.openTextEdit(blockEntity, front);
+        // Paper start - PlayerOpenSignEvent
+        this.openTextEdit(player, blockEntity, front, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.UNKNOWN);
+    }
+    public void openTextEdit(Player entityhuman, SignBlockEntity tileentitysign, boolean flag, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause cause) {
+        org.bukkit.entity.Player bukkitPlayer = (org.bukkit.entity.Player) entityhuman.getBukkitEntity();
+        org.bukkit.block.Block bukkitBlock = org.bukkit.craftbukkit.v1_20_R2.block.CraftBlock.at(tileentitysign.getLevel(), tileentitysign.getBlockPos());
+        org.bukkit.craftbukkit.v1_20_R2.block.CraftSign<?> bukkitSign = (org.bukkit.craftbukkit.v1_20_R2.block.CraftSign<?>) org.bukkit.craftbukkit.v1_20_R2.block.CraftBlockStates.getBlockState(bukkitBlock);
+        io.papermc.paper.event.player.PlayerOpenSignEvent event = new io.papermc.paper.event.player.PlayerOpenSignEvent(
+            bukkitPlayer,
+            bukkitSign,
+            flag ? org.bukkit.block.sign.Side.FRONT : org.bukkit.block.sign.Side.BACK,
+            cause);
+        if (!event.callEvent()) return;
+        if (org.bukkit.event.player.PlayerSignOpenEvent.getHandlerList().getRegisteredListeners().length > 0) {
+            final org.bukkit.event.player.PlayerSignOpenEvent.Cause legacyCause = switch (cause) {
+                case PLACE -> org.bukkit.event.player.PlayerSignOpenEvent.Cause.PLACE;
+                case PLUGIN -> org.bukkit.event.player.PlayerSignOpenEvent.Cause.PLUGIN;
+                case INTERACT -> org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT;
+                case UNKNOWN -> org.bukkit.event.player.PlayerSignOpenEvent.Cause.UNKNOWN;
+            };
+        // Paper end - PlayerOpenSignEvent
+        if (!org.bukkit.craftbukkit.v1_20_R2.event.CraftEventFactory.callPlayerSignOpenEvent(entityhuman, tileentitysign, flag, legacyCause)) { // Paper
+            return;
+        }
+        } // Paper
+        tileentitysign.setAllowedPlayerEditor(entityhuman.getUUID());
+        entityhuman.openTextEdit(tileentitysign, flag);
     }
 
     private boolean otherPlayerIsEditingSign(Player player, SignBlockEntity blockEntity) {
-        UUID uUID = blockEntity.getPlayerWhoMayEdit();
-        return uUID != null && !uUID.equals(player.getUUID());
+        UUID uuid = blockEntity.getPlayerWhoMayEdit();
+
+        return uuid != null && !uuid.equals(player.getUUID());
     }
 
     @Nullable
     @Override
     public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
-        return createTickerHelper(type, BlockEntityType.SIGN, SignBlockEntity::tick);
+        return null; // Paper
     }
 }
