DisposalChest
An optimized Bukkit plugin for disposing items fed in manually or by hoppers.
Requirements
Help command
Notes
Partial config related to dynamic batch thingy. For full config template please check this link .
minChestClearTime: 30
maxChestClearTime: 300
minTPS: 10
maxTPS: 20
minChestClearBatchSize: 10
Dynamic batch processing thingy!
// Do not do anything if TPS falls below the minimum limit.
if(DisposalChest.tps < DisposalChest.minTPS) {
return;
}
// Get number of total trash chests
int chestListSize = trashChestList.size();
// If trash chest count is less than one, do nothing!
if(chestListSize < 1) {
return;
}
// Limit current TPS value to maxTPS (for calculation purpose only)
int limitTPS = Math.min(DisposalChest.maxTPS, Math.round(DisposalChest.tps));
// Calculate the approx time it should take to clear all chests (without considering TPS/realtime thingy)
int timeToClearAllChests = Math.round(DisposalChest.maxChestClearTime - ((DisposalChest.maxChestClearTime - DisposalChest.minChestClearTime) * (DisposalChest.maxTPS - limitTPS) / (DisposalChest.maxTPS - DisposalChest.minTPS) ));
// As we are clearing a batch every 10 seconds multiply the number of chests it should clear per second by 10
int chestBatchSize = chestListSize / timeToClearAllChests * 10 ;
// Make sure the batch size does not fall below minChestClearBatchSize
chestBatchSize = Math.max(DisposalChest.minChestClearBatchSize, chestBatchSize);
An optimized Bukkit plugin for disposing items fed in manually or by hoppers.
Requirements
- MySQL
Help command
Code (Text):
/trashchest
- It doesn't rely on InventoryMoveItemEvent.
- It clears chests at a fixed interval of 200 ticks (10s) but it dynamically adjusts the number of chests it clears in each batch based on the TPS and total number of trash chests in database.
- The time it takes to clear all TrashChests on the server is dynamically adjusted as well.
Partial config related to dynamic batch thingy. For full config template please check this link .
Code (Text):
minChestClearTime: 30
maxChestClearTime: 300
minTPS: 10
maxTPS: 20
minChestClearBatchSize: 10
Code (Text):
// Do not do anything if TPS falls below the minimum limit.
if(DisposalChest.tps < DisposalChest.minTPS) {
return;
}
// Get number of total trash chests
int chestListSize = trashChestList.size();
// If trash chest count is less than one, do nothing!
if(chestListSize < 1) {
return;
}
// Limit current TPS value to maxTPS (for calculation purpose only)
int limitTPS = Math.min(DisposalChest.maxTPS, Math.round(DisposalChest.tps));
// Calculate the approx time it should take to clear all chests (without considering TPS/realtime thingy)
int timeToClearAllChests = Math.round(DisposalChest.maxChestClearTime - ((DisposalChest.maxChestClearTime - DisposalChest.minChestClearTime) * (DisposalChest.maxTPS - limitTPS) / (DisposalChest.maxTPS - DisposalChest.minTPS) ));
// As we are clearing a batch every 10 seconds multiply the number of chests it should clear per second by 10
int chestBatchSize = chestListSize / timeToClearAllChests * 10 ;
// Make sure the batch size does not fall below minChestClearBatchSize
chestBatchSize = Math.max(DisposalChest.minChestClearBatchSize, chestBatchSize);
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.11
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
DisposalChest is a free Minecraft Java mod. Compatible with Minecraft 1.11. Downloaded 229 times (via Spigot). Download it and open it directly in the game.