50 lines
3.2 KiB
Diff
50 lines
3.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
Date: Tue, 18 Nov 2025 00:24:32 +0800
|
|
Subject: [PATCH] Revert TrapDoorBlock changes form Paper
|
|
|
|
|
|
diff --git a/net/minecraft/world/level/block/TrapDoorBlock.java b/net/minecraft/world/level/block/TrapDoorBlock.java
|
|
index b45ae50db32c4156b8f8008335673d20c570c72d..af78831441f362b0129aa864854ce5a64d544640 100644
|
|
--- a/net/minecraft/world/level/block/TrapDoorBlock.java
|
|
+++ b/net/minecraft/world/level/block/TrapDoorBlock.java
|
|
@@ -128,37 +128,7 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
|
if (!level.isClientSide()) {
|
|
boolean hasNeighborSignal = level.hasNeighborSignal(pos);
|
|
if (hasNeighborSignal != state.getValue(POWERED)) {
|
|
- // CraftBukkit start
|
|
- org.bukkit.block.Block bblock = org.bukkit.craftbukkit.block.CraftBlock.at(level, pos);
|
|
- int power = bblock.getBlockPower();
|
|
- int oldPower = state.getValue(TrapDoorBlock.OPEN) ? 15 : 0;
|
|
-
|
|
- if (oldPower == 0 ^ power == 0 || neighborBlock.defaultBlockState().isSignalSource()) {
|
|
- org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(bblock, oldPower, power);
|
|
- level.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
|
- hasNeighborSignal = eventRedstone.getNewCurrent() > 0;
|
|
- }
|
|
- // CraftBukkit end
|
|
- // Paper start - break redstone on trapdoors early
|
|
- boolean open = state.getValue(TrapDoorBlock.OPEN) != hasNeighborSignal;
|
|
- // note: this must run before any state for this block/its neighbours are written to the world
|
|
- // we allow the redstone event to fire so that plugins can block
|
|
- if (hasNeighborSignal && open) { // if we are now powered and it caused the trap door to open
|
|
- // in this case, first check for the redstone on top first
|
|
- BlockPos abovePos = pos.above();
|
|
- BlockState above = level.getBlockState(abovePos);
|
|
- if (above.getBlock() instanceof RedStoneWireBlock) {
|
|
- level.setBlock(abovePos, Blocks.AIR.defaultBlockState(), Block.UPDATE_CLIENTS | Block.UPDATE_NEIGHBORS);
|
|
- Block.popResource(level, abovePos, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.REDSTONE));
|
|
- // now check that this didn't change our state
|
|
- if (level.getBlockState(pos) != state) {
|
|
- // our state was changed, so we cannot propagate this update
|
|
- return;
|
|
- }
|
|
- }
|
|
- }
|
|
- if (open) {
|
|
- // Paper end - break redstone on trapdoors early
|
|
+ if (state.getValue(OPEN) != hasNeighborSignal) {
|
|
state = state.setValue(OPEN, hasNeighborSignal);
|
|
this.playSound(null, level, pos, hasNeighborSignal);
|
|
}
|