mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
fix lots of levels
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Option to make doors require redstone
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java b/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
||||
index 42ae4d293a420f0b8eb476df6389b2e7a693895f..fa1a2483c24d95ca03c269cde68c335e248810c9 100644
|
||||
index 42ae4d293a420f0b8eb476df6389b2e7a693895f..97c20c5b89e6d7e4ed844eff39ee55dfa8988d37 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
||||
@@ -57,7 +57,7 @@ public class InteractWithDoor {
|
||||
@@ -13,7 +13,7 @@ index 42ae4d293a420f0b8eb476df6389b2e7a693895f..fa1a2483c24d95ca03c269cde68c335e
|
||||
if (iblockdata.is(BlockTags.WOODEN_DOORS, (blockbase_blockdata) -> {
|
||||
return blockbase_blockdata.getBlock() instanceof DoorBlock;
|
||||
- })) {
|
||||
+ }) && !DoorBlock.requiresRedstone(entityliving.level, iblockdata, blockposition)) { // Purpur
|
||||
+ }) && !DoorBlock.requiresRedstone(entityliving.level(), iblockdata, blockposition)) { // Purpur
|
||||
DoorBlock blockdoor = (DoorBlock) iblockdata.getBlock();
|
||||
|
||||
if (!blockdoor.isOpen(iblockdata)) {
|
||||
@@ -22,7 +22,7 @@ index 42ae4d293a420f0b8eb476df6389b2e7a693895f..fa1a2483c24d95ca03c269cde68c335e
|
||||
if (iblockdata1.is(BlockTags.WOODEN_DOORS, (blockbase_blockdata) -> {
|
||||
return blockbase_blockdata.getBlock() instanceof DoorBlock;
|
||||
- })) {
|
||||
+ }) && !DoorBlock.requiresRedstone(entityliving.level, iblockdata, blockposition1)) { // Purpur
|
||||
+ }) && !DoorBlock.requiresRedstone(entityliving.level(), iblockdata, blockposition1)) { // Purpur
|
||||
DoorBlock blockdoor1 = (DoorBlock) iblockdata1.getBlock();
|
||||
|
||||
if (!blockdoor1.isOpen(iblockdata1)) {
|
||||
@@ -31,12 +31,12 @@ index 42ae4d293a420f0b8eb476df6389b2e7a693895f..fa1a2483c24d95ca03c269cde68c335e
|
||||
if (!iblockdata.is(BlockTags.WOODEN_DOORS, (blockbase_blockdata) -> {
|
||||
return blockbase_blockdata.getBlock() instanceof DoorBlock;
|
||||
- })) {
|
||||
+ }) || DoorBlock.requiresRedstone(entity.level, iblockdata, blockposition)) { // Purpur
|
||||
+ }) || DoorBlock.requiresRedstone(entity.level(), iblockdata, blockposition)) { // Purpur
|
||||
iterator.remove();
|
||||
} else {
|
||||
DoorBlock blockdoor = (DoorBlock) iblockdata.getBlock();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DoorBlock.java b/src/main/java/net/minecraft/world/level/block/DoorBlock.java
|
||||
index c028a7158e41a0754abb8e24dcd647633fbf3fe8..bfd90aa35dce7f8843f7331907a446332db5fade 100644
|
||||
index c028a7158e41a0754abb8e24dcd647633fbf3fe8..cd65d32f4af016d4937e598c71386a3072f4c490 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DoorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DoorBlock.java
|
||||
@@ -167,6 +167,7 @@ public class DoorBlock extends Block {
|
||||
@@ -54,7 +54,7 @@ index c028a7158e41a0754abb8e24dcd647633fbf3fe8..bfd90aa35dce7f8843f7331907a44633
|
||||
+
|
||||
+ // Purpur start
|
||||
+ public static boolean requiresRedstone(Level level, BlockState state, BlockPos pos) {
|
||||
+ if (level().purpurConfig.doorRequiresRedstone.contains(state.getBlock())) {
|
||||
+ if (level.purpurConfig.doorRequiresRedstone.contains(state.getBlock())) {
|
||||
+ // force update client
|
||||
+ BlockPos otherPos = pos.relative(state.getValue(DoorBlock.HALF) == DoubleBlockHalf.LOWER ? Direction.UP : Direction.DOWN);
|
||||
+ BlockState otherState = level.getBlockState(otherPos);
|
||||
@@ -67,7 +67,7 @@ index c028a7158e41a0754abb8e24dcd647633fbf3fe8..bfd90aa35dce7f8843f7331907a44633
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index e3ee434dcca8edafcca3c8f9a28349dccad23617..c0485f0fc5ec96ff709d95c0b5981e6d7e8d6c6f 100644
|
||||
index 76a7627d45da058437aa397161a3a6d2276bb631..e6a80597801bd0633c880b4470cda6bbec788646 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -510,6 +510,16 @@ public class PurpurWorldConfig {
|
||||
|
||||
Reference in New Issue
Block a user