1.3.0
Fix item pagination and unassigned item placement - Keep unassigned items off earlier assigned pages - Start unassigned items after the last assigned slot - Continue unassigned items on subsequent pages - Prevent unassigned item duplication - Correct pagination for categories with no assigned items - Update maximum page calculation to match pagination behavior
This commit is contained in:
1 parent
b6d376a2f9
commit
a992f044cd
10 files changed
+326
-96
No files matched your search
@@ -0,0 +1,138 @@
|
|||||||
|
# Depositing Items
|
||||||
|
|
||||||
|
RS-Warehouse provides several ways to deposit items into the Warehouse.
|
||||||
|
|
||||||
|
Items can be deposited using:
|
||||||
|
|
||||||
|
1. **Transaction Menu**
|
||||||
|
2. **Auto-Deposit**
|
||||||
|
3. **Warehouse Chest — Automatic Processing**
|
||||||
|
4. **Warehouse Chest — On Chest Close**
|
||||||
|
5. **Command — `/shop deposit`**
|
||||||
|
|
||||||
|
Each method ultimately adds the deposited items to the shared Warehouse inventory.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Deposit Through the Transaction Menu
|
||||||
|
|
||||||
|
Items can be deposited directly through the item's **Transaction Menu**.
|
||||||
|
|
||||||
|
Open the Warehouse and select the category containing the item you want to deposit.
|
||||||
|
|
||||||
|
Select the item to open its Transaction Menu.
|
||||||
|
|
||||||
|
From the Transaction Menu, click the wool to set the amount you want to deposit. Deposit amount will be displayed in the
|
||||||
|
title. Green wool adds to the deposit amount, Red wool will subtract from it.
|
||||||
|
|
||||||
|
Once you have the desired amount set, click the item in the center of the wool.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
> **NOTE:** Variant items such as damaged, enchanted, and partially filled items have their own transaction menus and are handled separately from the primary item.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Auto-Deposit
|
||||||
|
|
||||||
|
**Auto-Deposit** allows you to automatically deposit items when you pick them up.
|
||||||
|
|
||||||
|
Each player has their own Auto-Deposit filter.
|
||||||
|
|
||||||
|
When Auto-Deposit is enabled and you pick up an item that matches one of the items in your filter, RS-Warehouse sends the item directly to the Warehouse instead of placing it into your inventory.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
### Adding Items to the Auto-Deposit Filter
|
||||||
|
|
||||||
|
Open the **Auto-Deposit** menu from the Warehouse.
|
||||||
|
|
||||||
|
Place an item into the Auto-Deposit menu to add it to your personal filter.
|
||||||
|
|
||||||
|
The item placed into the filter is used as a copy of the item you want to automatically deposit.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
> **NOTE:** Adding an item to the Auto-Deposit filter does not remove that item from your inventory.
|
||||||
|
|
||||||
|
For more information, see **[Auto-Deposit](...)**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Warehouse Chest — Automatic Processing
|
||||||
|
|
||||||
|
A **Warehouse Chest** can automatically process its contents at regular intervals.
|
||||||
|
|
||||||
|
The processing interval is controlled by the server's `config.yml`.
|
||||||
|
|
||||||
|
The configured interval determines how often RS-Warehouse checks the Warehouse Chest for items to deposit.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
> **NOTE:** The automatic processing interval is controlled by the server configuration and may be different on your server.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Warehouse Chest — On Chest Close
|
||||||
|
|
||||||
|
A **Warehouse Chest** can also process its contents when the chest is closed.
|
||||||
|
|
||||||
|
When this option is enabled, RS-Warehouse processes the items in the Warehouse Chest when the player closes the chest.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
This allows items to be deposited without waiting for the next automatic processing interval.
|
||||||
|
|
||||||
|
> **NOTE:** Chest-close processing and automatic timed processing are separate options controlled by the server configuration.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Command — `/shop deposit`
|
||||||
|
|
||||||
|
Items can also be deposited using the **`/shop deposit`** command.
|
||||||
|
|
||||||
|
This command opens the **Warehouse Deposit** inventory.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
Place the items you want to deposit into the inventory.
|
||||||
|
|
||||||
|
When the inventory is closed, RS-Warehouse processes the items and adds them to the Warehouse.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
> **NOTE:** The `/shop deposit` command provides a convenient way to access the Warehouse Deposit inventory without navigating through the Warehouse menus.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## New Items
|
||||||
|
|
||||||
|
Items that have not yet been assigned to a category can still be deposited.
|
||||||
|
|
||||||
|
Depending on the server configuration, newly discovered items may be placed into the **Unassigned** category.
|
||||||
|
|
||||||
|
For more information, see **[The Unassigned Category](...)**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Which Method Should I Use?
|
||||||
|
|
||||||
|
Each deposit method is useful in different situations.
|
||||||
|
|
||||||
|
| Method | Best Used For |
|
||||||
|
|---|---|
|
||||||
|
| **Transaction Menu** | Depositing a specific item directly |
|
||||||
|
| **Auto-Deposit** | Automatically depositing items when picked up |
|
||||||
|
| **Warehouse Chest — Automatic Processing** | Farms and storage systems that continuously feed a Warehouse Chest |
|
||||||
|
| **Warehouse Chest — On Chest Close** | Manually placing items into a Warehouse Chest |
|
||||||
|
| **`/shop deposit`** | Quickly depositing items through a dedicated inventory |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Finished
|
||||||
|
|
||||||
|
RS-Warehouse provides several ways to get items into the Warehouse.
|
||||||
|
|
||||||
|
Choose the method that best fits how you collect and store items on your server.
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
# Withdrawing Items
|
||||||
|
|
||||||
|
Items stored in the Warehouse can be withdrawn directly into your inventory.
|
||||||
|
|
||||||
|
The normal withdrawal process is:
|
||||||
|
|
||||||
|
1. Open the Warehouse.
|
||||||
|
2. Select a category.
|
||||||
|
3. Select the item you want.
|
||||||
|
4. Open the item's Transaction Menu.
|
||||||
|
5. Select **Withdraw**.
|
||||||
|
6. Choose the amount.
|
||||||
|
7. Confirm the withdrawal by picking up the item in the center.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Selecting an Item
|
||||||
|
|
||||||
|
Open the Warehouse and select the category containing the item you want to withdraw.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
Select the item to open its **Transaction Menu**.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
The Transaction Menu displays the item currently selected along with its available Warehouse quantity.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Choosing the Withdrawal Amount
|
||||||
|
|
||||||
|
Select **Withdraw** to choose how many items you want to remove from the Warehouse.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
The amount selection menu allows you to adjust the amount before completing the withdrawal.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
> **NOTE:** The amount available for withdrawal is limited by the quantity stored in the Warehouse and the amount that can be placed into your inventory.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Completing the Withdrawal
|
||||||
|
|
||||||
|
Confirm the withdrawal to receive the selected items.
|
||||||
|
|
||||||
|
The items are removed from the Warehouse and added to your inventory.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
The Warehouse quantity is updated after a successful withdrawal.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Withdrawing Variants
|
||||||
|
|
||||||
|
Some items may have variants stored separately from the primary item.
|
||||||
|
|
||||||
|
RS-Warehouse supports transaction menus for:
|
||||||
|
|
||||||
|
- **Damaged Variants**
|
||||||
|
- **Enchanted Variants**
|
||||||
|
- **Partially Filled Variants**
|
||||||
|
|
||||||
|
These variants can be selected and withdrawn independently.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
> **NOTE:** A variant represents a specific version of an item and is handled separately from the primary item.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Inventory Space
|
||||||
|
|
||||||
|
Your available inventory space affects how many items can be withdrawn at one time.
|
||||||
|
|
||||||
|
If your inventory cannot hold the requested amount, the available withdrawal amount is limited accordingly.
|
||||||
|
|
||||||
|
> **IMPORTANT:** Make sure you have enough inventory space before withdrawing large quantities.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Auto-Deposit and Withdrawals
|
||||||
|
|
||||||
|
If an item is configured for **Auto-Deposit**, RS-Warehouse may prevent it from being withdrawn while that Auto-Deposit filter is active.
|
||||||
|
|
||||||
|
If this occurs, remove the item from your Auto-Deposit filter before attempting to withdraw it.
|
||||||
|
|
||||||
|
📷 Screenshot
|
||||||
|
|
||||||
|
For more information, see **[Auto-Deposit](...)**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Finished
|
||||||
|
|
||||||
|
You can withdraw Warehouse items whenever you need them.
|
||||||
|
|
||||||
|
Use the category and item menus to locate the item, select the desired amount, and complete the withdrawal.
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# Depositing Items
|
|
||||||
|
|
||||||
Players can deposit items directly into the warehouse.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Open the Warehouse
|
|
||||||
|
|
||||||
Open the Warehouse Chest.
|
|
||||||
|
|
||||||
📷 Screenshot
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Select Deposit
|
|
||||||
|
|
||||||
Choose Deposit.
|
|
||||||
|
|
||||||
📷 Screenshot
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Select Items
|
|
||||||
|
|
||||||
Choose the items to deposit.
|
|
||||||
|
|
||||||
📷 Screenshot
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Confirmation
|
|
||||||
|
|
||||||
Items are transferred into warehouse storage.
|
|
||||||
|
|
||||||
📷 Screenshot
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Finished
|
|
||||||
|
|
||||||
Your items are now available to all authorized players.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
⬅️ Previous: [Subcategories](Subcategories.md)
|
|
||||||
|
|
||||||
➡️ Next: [Withdrawing Items](Withdrawing-Items.md)
|
|
||||||
@@ -8,6 +8,6 @@ This page documents every permission node used by RS-Warehouse.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
⬅️ Previous: [Withdrawing Items](Withdrawing-Items.md)
|
⬅️ Previous: [Withdrawing Items](../02)%20Depositing%20And%20Withdrawing/Withdrawing-Items.md)
|
||||||
|
|
||||||
➡️ Next: [Commands](Commands.md)
|
➡️ Next: [Commands](Commands.md)
|
||||||
@@ -73,4 +73,4 @@ The subcategory is now available.
|
|||||||
|
|
||||||
⬅️ Previous: [Categories](Categories.md)
|
⬅️ Previous: [Categories](Categories.md)
|
||||||
|
|
||||||
➡️ Next: [Depositing Items](Depositing-Items.md)
|
➡️ Next: [Depositing Items](../02)%20Depositing%20And%20Withdrawing/Depositing-Items.md)
|
||||||
Whitespace-only changes.
+2
-2
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
- [Auto-Deposit](50%29%20Side%20Pages/Auto-Deposit.md)
|
- [Auto-Deposit](50%29%20Side%20Pages/Auto-Deposit.md)
|
||||||
- [UnCategorized Category](50%29%20Side%20Pages/UnCategorized%20Category.md)
|
- [UnCategorized Category](50%29%20Side%20Pages/UnCategorized%20Category.md)
|
||||||
- [Depositing Items]
|
- [Depositing Items](02%29%20Depositing%20And%20Withdrawing/B%29%20Depositing%20items.md)
|
||||||
- [Withdrawing Items]
|
- [Withdrawing Items](02%29%20Depositing%20And%20Withdrawing/B%29%20Withdrawing%20items.md)
|
||||||
|
|
||||||
### Organization
|
### Organization
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<groupId>com.rsscripting</groupId>
|
<groupId>com.rsscripting</groupId>
|
||||||
<artifactId>RS-Warehouse</artifactId>
|
<artifactId>RS-Warehouse</artifactId>
|
||||||
<name>RS-Warehouse</name>
|
<name>RS-Warehouse</name>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
|
|||||||
@@ -84,12 +84,6 @@ public class ItemsMenu {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
List<WarehouseItem> items =
|
|
||||||
ItemsPagination.getItemsForDisplay(
|
|
||||||
categoryId,
|
|
||||||
page
|
|
||||||
);
|
|
||||||
|
|
||||||
int maxPage =
|
int maxPage =
|
||||||
ItemsPagination.getMaximumPage(
|
ItemsPagination.getMaximumPage(
|
||||||
categoryId
|
categoryId
|
||||||
@@ -108,6 +102,12 @@ public class ItemsMenu {
|
|||||||
page
|
page
|
||||||
);
|
);
|
||||||
|
|
||||||
|
List<WarehouseItem> items =
|
||||||
|
ItemsPagination.getItemsForDisplay(
|
||||||
|
categoryId,
|
||||||
|
page
|
||||||
|
);
|
||||||
|
|
||||||
boolean hasPrevious =
|
boolean hasPrevious =
|
||||||
page > 0;
|
page > 0;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class ItemsPagination {
|
|||||||
|
|
||||||
int highestAssignedPage = -1;
|
int highestAssignedPage = -1;
|
||||||
int unassigned = 0;
|
int unassigned = 0;
|
||||||
int lastPageHighestSlot = 8;
|
int finalAssignedHighestSlot = 8;
|
||||||
|
|
||||||
for (WarehouseItem item : items) {
|
for (WarehouseItem item : items) {
|
||||||
|
|
||||||
@@ -47,18 +47,25 @@ public class ItemsPagination {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highestAssignedPage < 0) {
|
/*
|
||||||
|
* No assigned items means this is a normal unassigned-only list.
|
||||||
|
*/
|
||||||
|
if (highestAssignedPage == -1) {
|
||||||
|
|
||||||
int pages =
|
if (unassigned == 0) {
|
||||||
(unassigned + 44) / 45;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return Math.max(
|
return (unassigned - 1) / 45;
|
||||||
0,
|
|
||||||
pages - 1
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Only the final assigned page can contain unassigned items.
|
||||||
|
*/
|
||||||
|
int finalAssignedPage =
|
||||||
|
highestAssignedPage + 1;
|
||||||
|
|
||||||
for (WarehouseItem item : items) {
|
for (WarehouseItem item : items) {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -66,12 +73,12 @@ public class ItemsPagination {
|
|||||||
&&
|
&&
|
||||||
item.slot() != null
|
item.slot() != null
|
||||||
&&
|
&&
|
||||||
item.page() == highestAssignedPage + 1
|
item.page() == finalAssignedPage
|
||||||
) {
|
) {
|
||||||
|
|
||||||
lastPageHighestSlot =
|
finalAssignedHighestSlot =
|
||||||
Math.max(
|
Math.max(
|
||||||
lastPageHighestSlot,
|
finalAssignedHighestSlot,
|
||||||
item.slot()
|
item.slot()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -79,25 +86,22 @@ public class ItemsPagination {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int availableOnLastAssignedPage =
|
int availableOnFinalAssignedPage =
|
||||||
Math.max(
|
Math.max(
|
||||||
0,
|
0,
|
||||||
53 - lastPageHighestSlot
|
53 - finalAssignedHighestSlot
|
||||||
);
|
);
|
||||||
|
|
||||||
int remainingUnassigned =
|
int remainingUnassigned =
|
||||||
Math.max(
|
Math.max(
|
||||||
0,
|
0,
|
||||||
unassigned - availableOnLastAssignedPage
|
unassigned - availableOnFinalAssignedPage
|
||||||
);
|
);
|
||||||
|
|
||||||
int overflowPages =
|
int overflowPages =
|
||||||
(remainingUnassigned + 44) / 45;
|
(remainingUnassigned + 44) / 45;
|
||||||
|
|
||||||
return Math.max(
|
return highestAssignedPage + overflowPages;
|
||||||
0,
|
|
||||||
highestAssignedPage + overflowPages
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +154,37 @@ public class ItemsPagination {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Assigned pages
|
* Categories with no assigned items are a simple unassigned-only
|
||||||
|
* list. They begin on page 1 and use all 45 item slots.
|
||||||
|
*/
|
||||||
|
if (highestAssignedPage == -1) {
|
||||||
|
|
||||||
|
int start =
|
||||||
|
page * 45;
|
||||||
|
|
||||||
|
if (start >= unassigned.size()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
int end =
|
||||||
|
Math.min(
|
||||||
|
start + 45,
|
||||||
|
unassigned.size()
|
||||||
|
);
|
||||||
|
|
||||||
|
return new ArrayList<>(
|
||||||
|
unassigned.subList(
|
||||||
|
start,
|
||||||
|
end
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Assigned pages. Only the final assigned page receives
|
||||||
|
* unassigned items, and they begin immediately after the
|
||||||
|
* highest assigned slot on that page.
|
||||||
*/
|
*/
|
||||||
if (page <= highestAssignedPage) {
|
if (page <= highestAssignedPage) {
|
||||||
|
|
||||||
@@ -175,9 +209,6 @@ public class ItemsPagination {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Unassigned items begin only on the last assigned page.
|
|
||||||
*/
|
|
||||||
if (page == highestAssignedPage) {
|
if (page == highestAssignedPage) {
|
||||||
|
|
||||||
int remainingSlots =
|
int remainingSlots =
|
||||||
@@ -186,17 +217,18 @@ public class ItemsPagination {
|
|||||||
53 - highestSlot
|
53 - highestSlot
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int i = 0;
|
int end =
|
||||||
i < remainingSlots && i < unassigned.size();
|
Math.min(
|
||||||
i++) {
|
remainingSlots,
|
||||||
|
unassigned.size()
|
||||||
|
);
|
||||||
|
|
||||||
results.add(
|
results.addAll(
|
||||||
unassigned.get(
|
unassigned.subList(
|
||||||
i
|
0,
|
||||||
)
|
end
|
||||||
);
|
)
|
||||||
|
);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,17 +237,21 @@ public class ItemsPagination {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Overflow pages contain only unassigned items.
|
* Pages after the final assigned page contain only unassigned
|
||||||
|
* items. The first overflow page starts after the unassigned
|
||||||
|
* items that fit on the final assigned page.
|
||||||
*/
|
*/
|
||||||
int lastPageHighestSlot = 8;
|
int finalAssignedHighestSlot = 8;
|
||||||
|
int finalAssignedPage =
|
||||||
|
highestAssignedPage + 1;
|
||||||
|
|
||||||
for (WarehouseItem item : assigned) {
|
for (WarehouseItem item : assigned) {
|
||||||
|
|
||||||
if (item.page() == highestAssignedPage + 1) {
|
if (item.page() == finalAssignedPage) {
|
||||||
|
|
||||||
lastPageHighestSlot =
|
finalAssignedHighestSlot =
|
||||||
Math.max(
|
Math.max(
|
||||||
lastPageHighestSlot,
|
finalAssignedHighestSlot,
|
||||||
item.slot()
|
item.slot()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -226,7 +262,7 @@ public class ItemsPagination {
|
|||||||
int consumed =
|
int consumed =
|
||||||
Math.max(
|
Math.max(
|
||||||
0,
|
0,
|
||||||
53 - lastPageHighestSlot
|
53 - finalAssignedHighestSlot
|
||||||
);
|
);
|
||||||
|
|
||||||
consumed =
|
consumed =
|
||||||
|
|||||||
Reference in new issue
Block a user