From 33799eebd4c331440bce2064d1caa8ffb24b8dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sat, 25 May 2024 10:14:43 +0200 Subject: [PATCH] Fix a bug that destroyed items with a full inventory --- gradle.properties | 2 +- .../systems/brn/server_storage/screens/StorageScreen.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 48b303f..d1d39a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ yarn_mappings=1.20.6+build.3 loader_version=0.15.11 # Mod Properties -mod_version=1.4 +mod_version=1.5 maven_group=systems.brn archives_base_name=Server_storage diff --git a/src/main/java/systems/brn/server_storage/screens/StorageScreen.java b/src/main/java/systems/brn/server_storage/screens/StorageScreen.java index 8d0a4d9..83164a5 100644 --- a/src/main/java/systems/brn/server_storage/screens/StorageScreen.java +++ b/src/main/java/systems/brn/server_storage/screens/StorageScreen.java @@ -66,8 +66,8 @@ public class StorageScreen extends PagedGui { if (clickedElement != null) { ItemStack clickedItem = clickedElement.getItemStack(); ItemStack noLoreStack = removeCountFromLore(clickedItem); - if (tryRemoveItemStackFromChests(world, pos, noLoreStack)) { - this.player.getInventory().insertStack(noLoreStack); + if(this.player.getInventory().insertStack(noLoreStack)){ + tryRemoveItemStackFromChests(world, pos, noLoreStack); } } this.updateDisplay();