--- a/net/minecraft/world/level/block/DaylightDetectorBlock.java
+++ b/net/minecraft/world/level/block/DaylightDetectorBlock.java
@@ -4,6 +4,7 @@
 import javax.annotation.Nullable;
 import net.minecraft.core.BlockPos;
 import net.minecraft.core.Direction;
+import net.minecraft.core.Holder;
 import net.minecraft.util.Mth;
 import net.minecraft.world.InteractionResult;
 import net.minecraft.world.entity.player.Player;
@@ -26,24 +27,25 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 
 public class DaylightDetectorBlock extends BaseEntityBlock {
+
     public static final MapCodec<DaylightDetectorBlock> CODEC = simpleCodec(DaylightDetectorBlock::new);
     public static final IntegerProperty POWER = BlockStateProperties.POWER;
     public static final BooleanProperty INVERTED = BlockStateProperties.INVERTED;
-    protected static final VoxelShape SHAPE = Block.box(0.0, 0.0, 0.0, 16.0, 6.0, 16.0);
+    protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D);
 
     @Override
     public MapCodec<DaylightDetectorBlock> codec() {
-        return CODEC;
+        return DaylightDetectorBlock.CODEC;
     }
 
     public DaylightDetectorBlock(BlockBehaviour.Properties settings) {
         super(settings);
-        this.registerDefaultState(this.stateDefinition.any().setValue(POWER, Integer.valueOf(0)).setValue(INVERTED, Boolean.valueOf(false)));
+        this.registerDefaultState((BlockState) ((BlockState) ((BlockState) this.stateDefinition.any()).setValue(DaylightDetectorBlock.POWER, 0)).setValue(DaylightDetectorBlock.INVERTED, false));
     }
 
     @Override
     protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE;
+        return DaylightDetectorBlock.SHAPE;
     }
 
     @Override
@@ -53,25 +55,29 @@
 
     @Override
     protected int getSignal(BlockState state, BlockGetter world, BlockPos pos, Direction direction) {
-        return state.getValue(POWER);
+        return (Integer) state.getValue(DaylightDetectorBlock.POWER);
     }
 
     private static void updateSignalStrength(BlockState state, Level world, BlockPos pos) {
         int i = world.getBrightness(LightLayer.SKY, pos) - world.getSkyDarken();
         float f = world.getSunAngle(1.0F);
-        boolean bl = state.getValue(INVERTED);
-        if (bl) {
+        boolean flag = (Boolean) state.getValue(DaylightDetectorBlock.INVERTED);
+
+        if (flag) {
             i = 15 - i;
         } else if (i > 0) {
-            float g = f < (float) Math.PI ? 0.0F : (float) (Math.PI * 2);
-            f += (g - f) * 0.2F;
-            i = Math.round((float)i * Mth.cos(f));
+            float f1 = f < 3.1415927F ? 0.0F : 6.2831855F;
+
+            f += (f1 - f) * 0.2F;
+            i = Math.round((float) i * Mth.cos(f));
         }
 
         i = Mth.clamp(i, 0, 15);
-        if (state.getValue(POWER) != i) {
-            world.setBlock(pos, state.setValue(POWER, Integer.valueOf(i)), 3);
+        if ((Integer) state.getValue(DaylightDetectorBlock.POWER) != i) {
+            i = org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, pos, ((Integer) state.getValue(DaylightDetectorBlock.POWER)), i).getNewCurrent(); // CraftBukkit - Call BlockRedstoneEvent
+            world.setBlock(pos, (BlockState) state.setValue(DaylightDetectorBlock.POWER, i), 3);
         }
+
     }
 
     @Override
@@ -80,10 +86,11 @@
             if (world.isClientSide) {
                 return InteractionResult.SUCCESS;
             } else {
-                BlockState blockState = state.cycle(INVERTED);
-                world.setBlock(pos, blockState, 2);
-                world.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(player, blockState));
-                updateSignalStrength(blockState, world, pos);
+                BlockState iblockdata1 = (BlockState) state.cycle(DaylightDetectorBlock.INVERTED);
+
+                world.setBlock(pos, iblockdata1, 2);
+                world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(player, iblockdata1));
+                DaylightDetectorBlock.updateSignalStrength(iblockdata1, world, pos);
                 return InteractionResult.CONSUME;
             }
         } else {
@@ -109,19 +116,18 @@
     @Nullable
     @Override
     public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
-        return !world.isClientSide && world.dimensionType().hasSkyLight()
-            ? createTickerHelper(type, BlockEntityType.DAYLIGHT_DETECTOR, DaylightDetectorBlock::tickEntity)
-            : null;
+        return !world.isClientSide && world.dimensionType().hasSkyLight() ? createTickerHelper(type, BlockEntityType.DAYLIGHT_DETECTOR, DaylightDetectorBlock::tickEntity) : null;
     }
 
     private static void tickEntity(Level world, BlockPos pos, BlockState state, DaylightDetectorBlockEntity blockEntity) {
         if (world.getGameTime() % 20L == 0L) {
-            updateSignalStrength(state, world, pos);
+            DaylightDetectorBlock.updateSignalStrength(state, world, pos);
         }
+
     }
 
     @Override
     protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
-        builder.add(POWER, INVERTED);
+        builder.add(DaylightDetectorBlock.POWER, DaylightDetectorBlock.INVERTED);
     }
 }
