Skip to content

Commit

Permalink
fix: in some cases players cannot open storage controller despite no …
Browse files Browse the repository at this point in the history
…one else being in it
  • Loading branch information
klikli-dev committed Aug 12, 2023
1 parent f85c4fa commit ccb74b1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ protected StorageControllerContainerBase(@Nullable MenuType<?> type, int id, Inv
}

public static boolean canOpen(Player player, BlockPos pos) {
if (!openContainers.containsKey(pos)) {
if (!openContainers.containsKey(pos) || openContainers.get(pos).equals(player.getUUID())) {
return true;
}


player.sendSystemMessage(Component.translatable(TranslationKeys.MESSAGE_CONTAINER_ALREADY_OPEN).withStyle(ChatFormatting.RED));
return false;
}
Expand Down

0 comments on commit ccb74b1

Please sign in to comment.