--- a/net/minecraft/world/level/block/ButtonBlock.java
+++ b/net/minecraft/world/level/block/ButtonBlock.java
@@ -26,8 +26,13 @@
 import net.minecraft.world.phys.BlockHitResult;
 import net.minecraft.world.phys.shapes.CollisionContext;
 import net.minecraft.world.phys.shapes.VoxelShape;
+// CraftBukkit start
+import org.bukkit.event.block.BlockRedstoneEvent;
+import org.bukkit.event.entity.EntityInteractEvent;
+// CraftBukkit end
 
 public class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock {
+
     public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
     private static final int PRESSED_DEPTH = 1;
     private static final int UNPRESSED_DEPTH = 2;
@@ -56,70 +61,81 @@
     protected ButtonBlock(BlockBehaviour.Properties settings, BlockSetType blockSetType, int pressTicks, boolean wooden) {
         super(settings.sound(blockSetType.soundType()));
         this.type = blockSetType;
-        this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(POWERED, Boolean.valueOf(false)).setValue(FACE, AttachFace.WALL));
+        this.registerDefaultState((BlockState) ((BlockState) ((BlockState) ((BlockState) this.stateDefinition.any()).setValue(ButtonBlock.FACING, Direction.NORTH)).setValue(ButtonBlock.POWERED, false)).setValue(ButtonBlock.FACE, AttachFace.WALL));
         this.ticksToStayPressed = pressTicks;
         this.arrowsCanPress = wooden;
     }
 
     @Override
     public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        Direction direction = state.getValue(FACING);
-        boolean bl = state.getValue(POWERED);
-        switch ((AttachFace)state.getValue(FACE)) {
+        Direction enumdirection = (Direction) state.getValue(ButtonBlock.FACING);
+        boolean flag = (Boolean) state.getValue(ButtonBlock.POWERED);
+
+        switch ((AttachFace) state.getValue(ButtonBlock.FACE)) {
             case FLOOR:
-                if (direction.getAxis() == Direction.Axis.X) {
-                    return bl ? PRESSED_FLOOR_AABB_X : FLOOR_AABB_X;
+                if (enumdirection.getAxis() == Direction.Axis.X) {
+                    return flag ? ButtonBlock.PRESSED_FLOOR_AABB_X : ButtonBlock.FLOOR_AABB_X;
                 }
 
-                return bl ? PRESSED_FLOOR_AABB_Z : FLOOR_AABB_Z;
+                return flag ? ButtonBlock.PRESSED_FLOOR_AABB_Z : ButtonBlock.FLOOR_AABB_Z;
             case WALL:
-                VoxelShape var10000;
-                switch (direction) {
+                VoxelShape voxelshape;
+
+                switch (enumdirection) {
                     case EAST:
-                        var10000 = bl ? PRESSED_EAST_AABB : EAST_AABB;
+                        voxelshape = flag ? ButtonBlock.PRESSED_EAST_AABB : ButtonBlock.EAST_AABB;
                         break;
                     case WEST:
-                        var10000 = bl ? PRESSED_WEST_AABB : WEST_AABB;
+                        voxelshape = flag ? ButtonBlock.PRESSED_WEST_AABB : ButtonBlock.WEST_AABB;
                         break;
                     case SOUTH:
-                        var10000 = bl ? PRESSED_SOUTH_AABB : SOUTH_AABB;
+                        voxelshape = flag ? ButtonBlock.PRESSED_SOUTH_AABB : ButtonBlock.SOUTH_AABB;
                         break;
                     case NORTH:
                     case UP:
                     case DOWN:
-                        var10000 = bl ? PRESSED_NORTH_AABB : NORTH_AABB;
+                        voxelshape = flag ? ButtonBlock.PRESSED_NORTH_AABB : ButtonBlock.NORTH_AABB;
                         break;
                     default:
                         throw new IncompatibleClassChangeError();
                 }
 
-                return var10000;
+                return voxelshape;
             case CEILING:
             default:
-                if (direction.getAxis() == Direction.Axis.X) {
-                    return bl ? PRESSED_CEILING_AABB_X : CEILING_AABB_X;
-                } else {
-                    return bl ? PRESSED_CEILING_AABB_Z : CEILING_AABB_Z;
-                }
+                return enumdirection.getAxis() == Direction.Axis.X ? (flag ? ButtonBlock.PRESSED_CEILING_AABB_X : ButtonBlock.CEILING_AABB_X) : (flag ? ButtonBlock.PRESSED_CEILING_AABB_Z : ButtonBlock.CEILING_AABB_Z);
         }
     }
 
     @Override
     public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
-        if (state.getValue(POWERED)) {
+        if ((Boolean) state.getValue(ButtonBlock.POWERED)) {
             return InteractionResult.CONSUME;
         } else {
+            // CraftBukkit start
+            boolean powered = ((Boolean) state.getValue(POWERED));
+            org.bukkit.block.Block block = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
+            int old = (powered) ? 15 : 0;
+            int current = (!powered) ? 15 : 0;
+
+            BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current);
+            world.getCraftServer().getPluginManager().callEvent(eventRedstone);
+
+            if ((eventRedstone.getNewCurrent() > 0) != (!powered)) {
+                return InteractionResult.SUCCESS;
+            }
+            // CraftBukkit end
             this.press(state, world, pos);
             this.playSound(player, world, pos, true);
-            world.gameEvent(player, GameEvent.BLOCK_ACTIVATE, pos);
+            world.gameEvent((Entity) player, GameEvent.BLOCK_ACTIVATE, pos);
             return InteractionResult.sidedSuccess(world.isClientSide);
         }
     }
 
     public void press(BlockState state, Level world, BlockPos pos) {
-        world.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(true)), 3);
+        world.setBlock(pos, (BlockState) state.setValue(ButtonBlock.POWERED, true), 3);
         this.updateNeighbours(state, world, pos);
-        world.scheduleTick(pos, this, this.ticksToStayPressed);
+        world.scheduleTick(pos, (Block) this, this.ticksToStayPressed);
     }
 
     protected void playSound(@Nullable Player player, LevelAccessor world, BlockPos pos, boolean powered) {
@@ -133,7 +149,7 @@
     @Override
     public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
         if (!moved && !state.is(newState.getBlock())) {
-            if (state.getValue(POWERED)) {
+            if ((Boolean) state.getValue(ButtonBlock.POWERED)) {
                 this.updateNeighbours(state, world, pos);
             }
 
@@ -143,12 +159,12 @@
 
     @Override
     public int getSignal(BlockState state, BlockGetter world, BlockPos pos, Direction direction) {
-        return state.getValue(POWERED) ? 15 : 0;
+        return (Boolean) state.getValue(ButtonBlock.POWERED) ? 15 : 0;
     }
 
     @Override
     public int getDirectSignal(BlockState state, BlockGetter world, BlockPos pos, Direction direction) {
-        return state.getValue(POWERED) && getConnectedDirection(state) == direction ? 15 : 0;
+        return (Boolean) state.getValue(ButtonBlock.POWERED) && getConnectedDirection(state) == direction ? 15 : 0;
     }
 
     @Override
@@ -158,31 +174,58 @@
 
     @Override
     public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
-        if (state.getValue(POWERED)) {
+        if ((Boolean) state.getValue(ButtonBlock.POWERED)) {
             this.checkPressed(state, world, pos);
         }
     }
 
     @Override
     public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
-        if (!world.isClientSide && this.arrowsCanPress && !state.getValue(POWERED)) {
+        if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.v1_20_R2.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
+        if (!world.isClientSide && this.arrowsCanPress && !(Boolean) state.getValue(ButtonBlock.POWERED)) {
             this.checkPressed(state, world, pos);
         }
     }
 
     protected void checkPressed(BlockState state, Level world, BlockPos pos) {
-        AbstractArrow abstractArrow = this.arrowsCanPress ? world.getEntitiesOfClass(AbstractArrow.class, state.getShape(world, pos).bounds().move(pos)).stream().findFirst().orElse((AbstractArrow)null) : null;
-        boolean bl = abstractArrow != null;
-        boolean bl2 = state.getValue(POWERED);
-        if (bl != bl2) {
-            world.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(bl)), 3);
+        AbstractArrow entityarrow = this.arrowsCanPress ? (AbstractArrow) world.getEntitiesOfClass(AbstractArrow.class, state.getShape(world, pos).bounds().move(pos)).stream().findFirst().orElse(null) : null; // CraftBukkit - decompile error
+        boolean flag = entityarrow != null;
+        boolean flag1 = (Boolean) state.getValue(ButtonBlock.POWERED);
+
+        // CraftBukkit start - Call interact event when arrows turn on wooden buttons
+        if (flag1 != flag && flag) {
+            org.bukkit.block.Block block = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
+            EntityInteractEvent event = new EntityInteractEvent(entityarrow.getBukkitEntity(), block);
+            world.getCraftServer().getPluginManager().callEvent(event);
+
+            if (event.isCancelled()) {
+                return;
+            }
+        }
+        // CraftBukkit end
+
+        if (flag != flag1) {
+            // CraftBukkit start
+            boolean powered = flag1;
+            org.bukkit.block.Block block = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
+            int old = (powered) ? 15 : 0;
+            int current = (!powered) ? 15 : 0;
+
+            BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current);
+            world.getCraftServer().getPluginManager().callEvent(eventRedstone);
+
+            if ((flag && eventRedstone.getNewCurrent() <= 0) || (!flag && eventRedstone.getNewCurrent() > 0)) {
+                return;
+            }
+            // CraftBukkit end
+            world.setBlock(pos, (BlockState) state.setValue(ButtonBlock.POWERED, flag), 3);
             this.updateNeighbours(state, world, pos);
-            this.playSound((Player)null, world, pos, bl);
-            world.gameEvent(abstractArrow, bl ? GameEvent.BLOCK_ACTIVATE : GameEvent.BLOCK_DEACTIVATE, pos);
+            this.playSound((Player) null, world, pos, flag);
+            world.gameEvent((Entity) entityarrow, flag ? GameEvent.BLOCK_ACTIVATE : GameEvent.BLOCK_DEACTIVATE, pos);
         }
 
-        if (bl) {
-            world.scheduleTick(new BlockPos(pos), this, this.ticksToStayPressed);
+        if (flag) {
+            world.scheduleTick(new BlockPos(pos), (Block) this, this.ticksToStayPressed);
         }
 
     }
@@ -194,6 +237,6 @@
 
     @Override
     protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
-        builder.add(FACING, POWERED, FACE);
+        builder.add(ButtonBlock.FACING, ButtonBlock.POWERED, ButtonBlock.FACE);
     }
 }
