diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java index d542d003..97afdf21 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java @@ -33,8 +33,14 @@ public final class PlayerHooks { return IMPL.isFake(player); } + public static void closeContainer(Player player) { + IMPL.closeContainer(player); + } + public interface Impl { boolean isFake(Player player); + + void closeContainer(Player player); } static { diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java index bc0dc07b..c2a8624e 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java @@ -24,4 +24,9 @@ public class PlayerHooksImpl implements PlayerHooks.Impl { public boolean isFake(Player player) { return false; } + + @Override + public void closeContainer(Player player) { + player.closeContainer(); + } } diff --git a/fabric/src/main/resources/architectury.accessWidener b/fabric/src/main/resources/architectury.accessWidener index aa6cbe33..27a3797b 100644 --- a/fabric/src/main/resources/architectury.accessWidener +++ b/fabric/src/main/resources/architectury.accessWidener @@ -50,4 +50,5 @@ mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties dy accessible method net/minecraft/world/entity/Entity getEncodeId ()Ljava/lang/String; accessible field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set; mutable field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set; -accessible field net/minecraft/world/item/DyeColor textureDiffuseColor I \ No newline at end of file +accessible field net/minecraft/world/item/DyeColor textureDiffuseColor I +accessible method net/minecraft/world/entity/player/Player closeContainer ()V \ No newline at end of file diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java index f590abdf..4de2c3d1 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java @@ -25,4 +25,9 @@ public class PlayerHooksImpl implements PlayerHooks.Impl { public boolean isFake(PlayerEntity playerEntity) { return playerEntity instanceof FakePlayer; } + + @Override + public void closeContainer(PlayerEntity playerEntity) { + playerEntity.closeContainer(); + } }