Fix a bug that destroyed items with a full inventory

This commit is contained in:
Bruno Rybársky 2024-05-25 10:14:43 +02:00
parent 7aba187f07
commit 33799eebd4
2 changed files with 3 additions and 3 deletions

@ -8,7 +8,7 @@ yarn_mappings=1.20.6+build.3
loader_version=0.15.11 loader_version=0.15.11
# Mod Properties # Mod Properties
mod_version=1.4 mod_version=1.5
maven_group=systems.brn maven_group=systems.brn
archives_base_name=Server_storage archives_base_name=Server_storage

@ -66,8 +66,8 @@ public class StorageScreen extends PagedGui {
if (clickedElement != null) { if (clickedElement != null) {
ItemStack clickedItem = clickedElement.getItemStack(); ItemStack clickedItem = clickedElement.getItemStack();
ItemStack noLoreStack = removeCountFromLore(clickedItem); ItemStack noLoreStack = removeCountFromLore(clickedItem);
if (tryRemoveItemStackFromChests(world, pos, noLoreStack)) { if(this.player.getInventory().insertStack(noLoreStack)){
this.player.getInventory().insertStack(noLoreStack); tryRemoveItemStackFromChests(world, pos, noLoreStack);
} }
} }
this.updateDisplay(); this.updateDisplay();