Files
Purpur/patches/server/0191-Add-Option-for-disable-observer-clocks.patch
granny ffeb49da1e ignore item_model component for don't run with scissors feature alongside custom_model_data component
by default, the "don't run with scissors" feature will not activate for shears that have an `item_model` component or `custom_model_data` component.

adds a new world config option at `gameplay-mechanics.item.shears.damage-if-sprinting-item-model` that allows specifying a custom item model ResourceLocation (`purpurmc:scissors` by default) for use with this feature.
2024-12-06 06:05:14 -08: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 93ed9406c34804831b86d006dbd6087db9948f08..26cb9990b91991e0a2eadc2dcbbf229e2e88fb2d 100644
--- a/src/main/java/net/minecraft/world/level/block/ObserverBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ObserverBlock.java
@@ -75,6 +75,7 @@ public class ObserverBlock extends DirectionalBlock {
@Override
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
if (state.getValue(ObserverBlock.FACING) == direction && !(Boolean) state.getValue(ObserverBlock.POWERED)) {
+ if (!world.getWorldBorder().world.purpurConfig.disableObserverClocks || !(neighborState.getBlock() instanceof ObserverBlock) || neighborState.getValue(ObserverBlock.FACING).getOpposite() != direction) // Purpur
this.startSignal(world, tickView, pos);
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index e4abac46f4bf2011a84acb07df424af10214588b..1f7a8f2b5196d5b15b047e6d67491a8335cbdbc3 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -364,6 +364,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;