Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues with lidded not closing patch #11370

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions patches/server/1056-Fixed-issues-with-lidded-not-closing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jakush <[email protected]>
Date: Sat, 7 Sep 2024 15:24:46 +0200
Subject: [PATCH] Fixed issues with lidded not closing


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index fcccf989c25f0a259b160c4ff7873f7009e64d14..2751d7391386a50824c05f6323ce395251e7afe3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -178,10 +178,14 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CommandBlock;
+import net.minecraft.world.level.block.entity.BarrelBlockEntity;
import net.minecraft.world.level.block.entity.BlockEntity;
+import net.minecraft.world.level.block.entity.ChestBlockEntity;
import net.minecraft.world.level.block.entity.CommandBlockEntity;
import net.minecraft.world.level.block.entity.CrafterBlockEntity;
+import net.minecraft.world.level.block.entity.EnderChestBlockEntity;
import net.minecraft.world.level.block.entity.JigsawBlockEntity;
+import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;
import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.block.entity.StructureBlockEntity;
import net.minecraft.world.level.block.state.BlockBehaviour;
@@ -1943,6 +1947,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

if (enuminteractionresult.consumesAction()) {
CriteriaTriggers.ANY_BLOCK_USE.trigger(this.player, movingobjectpositionblock.getBlockPos(), itemstack.copy());
+
+ // Paper start - Fixed issues with lidded not closing
+ BlockEntity entity = worldserver.getBlockEntity(blockposition);
+ if (entity != null) {
+ switch (entity) {
+ case BarrelBlockEntity barrelBlock -> barrelBlock.openersCounter.opened = true;
+ case ChestBlockEntity chestBlock -> chestBlock.openersCounter.opened = true;
+ case EnderChestBlockEntity enderChestBlock -> enderChestBlock.openersCounter.opened = true;
+ case ShulkerBoxBlockEntity shulkerBoxBlock -> shulkerBoxBlock.opened = true;
+ default -> {
+ }
+ }
+ }
+ // Paper end - Fixed issues with lidded not closing
}

if (enumdirection == Direction.UP && !enuminteractionresult.consumesAction() && blockposition.getY() >= i - 1 && ServerGamePacketListenerImpl.wasBlockPlacementAttempt(this.player, itemstack)) {
Loading