-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8be1ec2
commit 8019141
Showing
3 changed files
with
116 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: violetc <[email protected]> | ||
Date: Wed, 14 Aug 2024 01:48:14 +0800 | ||
Subject: [PATCH] Old BlockEntity behaviour | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/level/block/ChiseledBookShelfBlock.java b/src/main/java/net/minecraft/world/level/block/ChiseledBookShelfBlock.java | ||
index ca3a8ead09cf0d3c1352ac266b749bc0bca2ff9a..b705ee10371e77d027b88afc790f346f20c0087f 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/ChiseledBookShelfBlock.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/ChiseledBookShelfBlock.java | ||
@@ -197,6 +197,13 @@ public class ChiseledBookShelfBlock extends BaseEntityBlock { | ||
} | ||
|
||
chiseledBookShelfBlockEntity.clearContent(); | ||
+ // Leaves start - behaviour 1.21.1- | ||
+ if (org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour) { | ||
+ bl = false; | ||
+ world.updateNeighbourForOutputSignal(pos, this); | ||
+ break label32; | ||
+ } | ||
+ // Leaves end - behaviour 1.21.1- | ||
bl = true; | ||
break label32; | ||
} | ||
diff --git a/src/main/java/net/minecraft/world/level/block/LecternBlock.java b/src/main/java/net/minecraft/world/level/block/LecternBlock.java | ||
index 0c52e1f8bc233bb66e53f4c69e1d8757382bbe81..142009c9eeca22e42ed3ff04cf8f1ba623d6254b 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/LecternBlock.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/LecternBlock.java | ||
@@ -209,10 +209,11 @@ public class LecternBlock extends BaseEntityBlock { | ||
this.popBook(state, world, pos); | ||
} | ||
|
||
- super.onRemove(state, world, pos, newState, moved); | ||
+ if (!org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour) super.onRemove(state, world, pos, newState, moved); // Leaves - behaviour 1.21.1- | ||
if ((Boolean) state.getValue(LecternBlock.POWERED)) { | ||
world.updateNeighborsAt(pos.below(), this); | ||
} | ||
+ if (org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour) super.onRemove(state, world, pos, newState, moved); // Leaves - behaviour 1.21.1- | ||
|
||
} | ||
} | ||
diff --git a/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java b/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java | ||
index 8d57c68d2f20f7c0d5c1be5d5b12e6926aad8c58..f1341d0f6545dfb13d14a37a68fda5b3403604b5 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java | ||
@@ -150,10 +150,11 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg | ||
@Override | ||
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) { | ||
if (!state.is(newState.getBlock())) { | ||
- super.onRemove(state, world, pos, newState, moved); | ||
+ if (!org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour) super.onRemove(state, world, pos, newState, moved); // Leaves - behaviour 1.21.1- | ||
if (SculkSensorBlock.getPhase(state) == SculkSensorPhase.ACTIVE) { | ||
SculkSensorBlock.updateNeighbours(world, pos, state); | ||
} | ||
+ if (org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour) super.onRemove(state, world, pos, newState, moved); // Leaves - behaviour 1.21.1- | ||
|
||
} | ||
} | ||
diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java | ||
index e70bf963cd960098709262b0a0b34e62562313d8..14286ebb28c467e1948601407466a31320cfd6e9 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java | ||
@@ -173,10 +173,11 @@ public class ShulkerBoxBlock extends BaseEntityBlock { | ||
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) { | ||
if (!state.is(newState.getBlock())) { | ||
BlockEntity blockEntity = world.getBlockEntity(pos); | ||
- super.onRemove(state, world, pos, newState, moved); | ||
+ if (!org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour) super.onRemove(state, world, pos, newState, moved); // Leaves - behaviour 1.21.1- | ||
if (blockEntity instanceof ShulkerBoxBlockEntity) { | ||
world.updateNeighbourForOutputSignal(pos, state.getBlock()); | ||
} | ||
+ if (org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour) super.onRemove(state, world, pos, newState, moved); // Leaves - behaviour 1.21.1- | ||
} | ||
} | ||
|
||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java | ||
index f2ef63d69bfc6fb3b3dc4b3b2938733d1c371746..e6c67426c9ea76eae2c677d796d0db579acaed6e 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java | ||
@@ -67,7 +67,7 @@ public abstract class BlockEntity { | ||
} | ||
|
||
public boolean isValidBlockState(BlockState state) { | ||
- return this.type.isValid(state); | ||
+ return org.leavesmc.leaves.LeavesConfig.oldBlockEntityBehaviour || this.type.isValid(state); // Leaves - behaviour 1.21.1- | ||
} | ||
|
||
public static BlockPos getPosFromTag(CompoundTag nbt) { |