Files
Purpur/patches/server/0240-Add-Option-for-disable-observer-clocks.patch
2021-08-06 02:43:19 -05:00

36 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DoctaEnkoda <bierquejason@gmail.com>
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 64f671cb809d22e35f01939b91d5bc1fee09629b..10c660c375ec02ee9306543bf8c838b88a9fb0e8 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -320,6 +320,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;