From 6bdacc88fa54b40e15b9dd55451c5c589e959de3 Mon Sep 17 00:00:00 2001 From: bruno Date: Wed, 10 Jul 2024 00:11:03 +0200 Subject: [PATCH] Test fix --- gradle.properties | 6 +++--- .../blockentities/InventoryInterfaceBlockEntity.java | 4 ++-- .../java/systems/brn/serverstorage/items/HardDrive.java | 1 - .../systems/brn/serverstorage/lib/StorageOperations.java | 4 +++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index ae9793b..f4e9f66 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,14 +4,14 @@ org.gradle.jvmargs=-Xmx1G # check these on https://modmuss50.me/fabric.html minecraft_version=1.21 -yarn_mappings=1.21+build.7 +yarn_mappings=1.21+build.8 loader_version=0.15.11 # Fabric API -fabric_version=0.100.4+1.21 +fabric_version=0.100.6+1.21 # Mod Properties -mod_version=3.0.9 +mod_version=3.1.0 maven_group=systems.brn archives_base_name=Serverstorage diff --git a/src/main/java/systems/brn/serverstorage/blockentities/InventoryInterfaceBlockEntity.java b/src/main/java/systems/brn/serverstorage/blockentities/InventoryInterfaceBlockEntity.java index f0f92e3..248306f 100644 --- a/src/main/java/systems/brn/serverstorage/blockentities/InventoryInterfaceBlockEntity.java +++ b/src/main/java/systems/brn/serverstorage/blockentities/InventoryInterfaceBlockEntity.java @@ -124,7 +124,7 @@ public class InventoryInterfaceBlockEntity extends BlockEntity { } public static void tick(World world, BlockPos blockPos, BlockState ignoredState, T ignoredt) { - if (!world.getGameRules().getBoolean(ServerStorage_Interface_Enable)){ + if (!world.getGameRules().getBoolean(ServerStorage_Interface_Enable)) { return; } InventoryInterfaceBlockEntity blockEntity = (InventoryInterfaceBlockEntity) world.getBlockEntity(blockPos); @@ -157,12 +157,12 @@ public class InventoryInterfaceBlockEntity extends BlockEntity { insertingStack.setCount(count); if (count > 0) { int canPutInside = count - blockEntity.network.putItemStackRemainder(insertingStack.copy()); - blockEntity.network.updateDisplays(); if (canPutInside > 0) { removeFromInventory(targetedBlockEntityInventory, insertingStack.copy(), canPutInside); } } } + blockEntity.network.updateDisplays(); } } } diff --git a/src/main/java/systems/brn/serverstorage/items/HardDrive.java b/src/main/java/systems/brn/serverstorage/items/HardDrive.java index f766f24..39199a0 100644 --- a/src/main/java/systems/brn/serverstorage/items/HardDrive.java +++ b/src/main/java/systems/brn/serverstorage/items/HardDrive.java @@ -98,7 +98,6 @@ public class HardDrive { public ItemStack getCommitedStack() { ItemStack tempDriveStack = driveStack.copy(); driveStack = ensureUUID(tempDriveStack); - loadComponents(); updateData(); saveComponents(); return driveStack; diff --git a/src/main/java/systems/brn/serverstorage/lib/StorageOperations.java b/src/main/java/systems/brn/serverstorage/lib/StorageOperations.java index 78b0047..f6b7790 100644 --- a/src/main/java/systems/brn/serverstorage/lib/StorageOperations.java +++ b/src/main/java/systems/brn/serverstorage/lib/StorageOperations.java @@ -21,7 +21,9 @@ public class StorageOperations { Map filteredMap = new HashMap<>(); for (Map.Entry entry : itemStackMap.entrySet()) { if (filterItem(entry.getKey().getItem(), query)){ - filteredMap.put(entry.getKey(), entry.getValue()); + ItemStack stack = entry.getKey(); + stack.setCount(Math.min(entry.getValue(), stack.getMaxCount())); + filteredMap.put(stack, entry.getValue()); } } sortedMap.putAll(filteredMap);