From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: DoctaEnkoda Date: Mon, 5 Jul 2021 06:00:17 +0200 Subject: [PATCH] Add Option for disable observer clocks Allow to disable observer clocks: https://www.spigotmc.org/attachments/observerclock-gif.365936/ diff --git a/src/main/java/net/minecraft/world/level/block/ObserverBlock.java b/src/main/java/net/minecraft/world/level/block/ObserverBlock.java index 101317912b8299f5be406b75c19cfddb30c1f3f3..21f5632bbc58a1c34b85d9fef240893887e5ae6c 100644 --- a/src/main/java/net/minecraft/world/level/block/ObserverBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ObserverBlock.java @@ -64,6 +64,7 @@ public class ObserverBlock extends DirectionalBlock { @Override public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (state.getValue(ObserverBlock.FACING) == direction && !(Boolean) state.getValue(ObserverBlock.POWERED)) { + if (!world.getMinecraftWorld().purpurConfig.disableObserverClocks || !(neighborState.getBlock() instanceof ObserverBlock) || neighborState.getValue(ObserverBlock.FACING).getOpposite() != direction) // Purpur this.startSignal(world, pos); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index 86d0ff5ca456df5f1d59f26e7bf5201f6ba59cb0..2e44ded2182482894f2320588e66b1aaea0a72d2 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -321,6 +321,11 @@ public class PurpurWorldConfig { villageSiegeSpawning = getBoolean("gameplay-mechanics.mob-spawning.village-sieges", predicate); } + public boolean disableObserverClocks = false; + private void observerSettings() { + disableObserverClocks = getBoolean("blocks.observer.disable-clock", disableObserverClocks); + } + public int playerNetheriteFireResistanceDuration = 0; public int playerNetheriteFireResistanceAmplifier = 0; public boolean playerNetheriteFireResistanceAmbient = false;