From 061cd3da5391706dfe27b0c68d6598648872271f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20K=C3=A4mpf?= <48529807+PlatinPython@users.noreply.github.com> Date: Sat, 9 Jul 2022 18:44:33 +0200 Subject: [PATCH] [1.19.x] Fix shulker boxes allowing input of items, that return false for Item#canFitInsideContainerItems, through hoppers. (#8823) * Make ShulkerBoxBlockEntity#canPlaceItemThroughFace delegate to Item#canFitInsideContainerItems. * Switch to using Or and add comment. * Switch Or to And. --- .../entity/ShulkerBoxBlockEntity.java.patch | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java.patch index 141e2d7825..f277ad3adf 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java.patch @@ -1,14 +1,23 @@ --- a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java +++ b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java -@@ -235,6 +_,11 @@ - return this.f_59647_ == ShulkerBoxBlockEntity.AnimationStatus.CLOSED; +@@ -211,7 +_,7 @@ } + public boolean m_7155_(int p_59663_, ItemStack p_59664_, @Nullable Direction p_59665_) { +- return !(Block.m_49814_(p_59664_.m_41720_()) instanceof ShulkerBoxBlock); ++ return !(Block.m_49814_(p_59664_.m_41720_()) instanceof ShulkerBoxBlock) && p_59664_.m_41720_().m_142095_(); // FORGE: Make shulker boxes respect Item#canFitInsideContainerItems + } + + public boolean m_7157_(int p_59682_, ItemStack p_59683_, Direction p_59684_) { +@@ -233,6 +_,11 @@ + + public boolean m_59702_() { + return this.f_59647_ == ShulkerBoxBlockEntity.AnimationStatus.CLOSED; ++ } ++ + @Override + protected net.minecraftforge.items.IItemHandler createUnSidedHandler() { + return new net.minecraftforge.items.wrapper.SidedInvWrapper(this, Direction.UP); -+ } -+ + } + public static enum AnimationStatus { - CLOSED, - OPENING,