4df4d07ae9
* do not release & push repo before finished * langs update * updateSuppression config moved up * redirect tick command option to carpet config system * optimizedDragonRespawn * diff in files * counter rules transformed * oops! * some fakeplayer options moved up * simplify * creative no clip moved * pre remove core module * pre update luminol to further fix a bug that config not saved to real file * fix up transform * fix up transform * fix up * fix up some problem in PR * redirect forgotten moved config * fix bugs in PR * refix * switch for final merge
65 lines
4.0 KiB
Diff
65 lines
4.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Bacteriawa <A3167717663@hotmail.com>
|
|
Date: Wed, 14 Jun 2023 12:07:07 +0800
|
|
Subject: [PATCH] Leaves: Redstone ignore upwards update
|
|
|
|
(Carpet: dustTrapdoorReintroduced)
|
|
|
|
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
|
|
diff --git a/net/minecraft/world/level/block/ComparatorBlock.java b/net/minecraft/world/level/block/ComparatorBlock.java
|
|
index 45e11737bc2558a4ebfffe133d43111f45dd7d16..d3bcef3fa3228c3869041754b2c18dfc987aac35 100644
|
|
--- a/net/minecraft/world/level/block/ComparatorBlock.java
|
|
+++ b/net/minecraft/world/level/block/ComparatorBlock.java
|
|
@@ -59,6 +59,9 @@ public class ComparatorBlock extends DiodeBlock implements EntityBlock {
|
|
final BlockState neighbourState,
|
|
final RandomSource random
|
|
) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.dustTrapdoorReintroduced && directionToNeighbour == Direction.DOWN) {
|
|
+ return state;
|
|
+ }
|
|
return directionToNeighbour == Direction.DOWN && !this.canSurviveOn(level, neighbourPos, neighbourState)
|
|
? Blocks.AIR.defaultBlockState()
|
|
: super.updateShape(state, level, ticks, pos, directionToNeighbour, neighbourPos, neighbourState, random);
|
|
diff --git a/net/minecraft/world/level/block/RedStoneWireBlock.java b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
index 759eb347299813c20226cc2fc5dc7718d12b7f56..619f5e37919693fc5976aedefed3bb5428395439 100644
|
|
--- a/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
+++ b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
@@ -179,7 +179,9 @@ public class RedStoneWireBlock extends Block {
|
|
final RandomSource random
|
|
) {
|
|
if (directionToNeighbour == Direction.DOWN) {
|
|
- return !this.canSurviveOn(level, neighbourPos, neighbourState) ? Blocks.AIR.defaultBlockState() : state;
|
|
+ return fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.dustTrapdoorReintroduced
|
|
+ ? state
|
|
+ : !this.canSurviveOn(level, neighbourPos, neighbourState) ? Blocks.AIR.defaultBlockState() : state;
|
|
} else if (directionToNeighbour == Direction.UP) {
|
|
return this.getConnectionState(level, state, pos);
|
|
} else {
|
|
@@ -243,7 +245,8 @@ public class RedStoneWireBlock extends Block {
|
|
BlockPos relativePos = pos.relative(direction);
|
|
BlockState relativeState = level.getBlockState(relativePos);
|
|
if (canConnectUp) {
|
|
- boolean isPlaceableAbove = relativeState.getBlock() instanceof TrapDoorBlock || this.canSurviveOn(level, relativePos, relativeState);
|
|
+ boolean isPlaceableAbove = (!fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.dustTrapdoorReintroduced && relativeState.getBlock() instanceof TrapDoorBlock)
|
|
+ || this.canSurviveOn(level, relativePos, relativeState);
|
|
if (isPlaceableAbove && shouldConnectTo(level.getBlockState(relativePos.above()))) {
|
|
if (relativeState.isFaceSturdy(level, relativePos, direction.getOpposite())) {
|
|
return RedstoneSide.UP;
|
|
diff --git a/net/minecraft/world/level/block/RepeaterBlock.java b/net/minecraft/world/level/block/RepeaterBlock.java
|
|
index d301ca4c91e75d715998aa7ed155fd44ccd64785..cc2694d0fc3c9bbe5e91771b3aef8ffb749515b4 100644
|
|
--- a/net/minecraft/world/level/block/RepeaterBlock.java
|
|
+++ b/net/minecraft/world/level/block/RepeaterBlock.java
|
|
@@ -70,6 +70,9 @@ public class RepeaterBlock extends DiodeBlock {
|
|
final BlockState neighbourState,
|
|
final RandomSource random
|
|
) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.dustTrapdoorReintroduced && directionToNeighbour == Direction.DOWN) {
|
|
+ return state;
|
|
+ }
|
|
if (directionToNeighbour == Direction.DOWN && !this.canSurviveOn(level, neighbourPos, neighbourState)) {
|
|
return Blocks.AIR.defaultBlockState();
|
|
} else {
|