This commit is contained in:
Bruno Rybársky 2024-08-21 21:18:49 +02:00
parent 51ce3a9774
commit 9956589189
2 changed files with 9 additions and 5 deletions

@ -11,7 +11,7 @@ loader_version=0.16.0
fabric_version=0.102.1+1.21.1 fabric_version=0.102.1+1.21.1
# Mod Properties # Mod Properties
mod_version=3.2.1 mod_version=3.2.4
maven_group=systems.brn maven_group=systems.brn
archives_base_name=Serverstorage archives_base_name=Serverstorage

@ -243,18 +243,22 @@ public class StorageScreen extends PagedGui {
} }
} }
} else if (!cursorStack.isEmpty()) { } else if (!cursorStack.isEmpty()) {
insertItem(cursorStack); insertItem(cursorStack, true);
} }
return false; return false;
} }
public void insertItem(ItemStack stack) { public void insertItem(ItemStack stack, boolean isCursor) {
if (!checkDistance()) { if (!checkDistance()) {
return; return;
} }
int canPutIn = stack.getCount() - getNetwork().putItemStackRemainder(stack); int canPutIn = stack.getCount() - getNetwork().putItemStackRemainder(stack);
if (canPutIn > 0) { if (canPutIn > 0) {
removeFromInventory(player.getInventory(), stack, canPutIn); if (isCursor) {
stack.decrement(canPutIn);
} else {
removeFromInventory(player.getInventory(), stack, canPutIn);
}
refreshTerminals(); refreshTerminals();
} }
} }
@ -265,7 +269,7 @@ public class StorageScreen extends PagedGui {
return false; return false;
} }
refreshTerminals(); refreshTerminals();
insertItem(stack); insertItem(stack, true);
return super.insertItem(stack, startIndex, endIndex, fromLast); return super.insertItem(stack, startIndex, endIndex, fromLast);
} }