mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-02-02 13:01:26 +01:00
Fixed auto selling to work in all slots.
This commit is contained in:
parent
7c1da22fef
commit
b068395a51
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicHoppers"
|
||||
path: "/builds/Songoda/$name"
|
||||
version: "3.5.8"
|
||||
version: "3.5.9"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -41,7 +41,7 @@ public class ModuleAutoSell implements Module {
|
||||
RegisteredServiceProvider<Economy> rsp = instance.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
|
||||
net.milkbowl.vault.economy.Economy econ = rsp.getProvider();
|
||||
|
||||
List<String> list = (List<String>) EpicHoppersPlugin.getInstance().getConfig().getList("Main.AutoSell Prices");
|
||||
List<String> list = instance.getConfig().getStringList("Main.AutoSell Prices");
|
||||
|
||||
for (String line : list) {
|
||||
try {
|
||||
@ -51,10 +51,10 @@ public class ModuleAutoSell implements Module {
|
||||
double price = Double.valueOf(split[1]);
|
||||
|
||||
for (ItemStack itemStack : hopperBlock.getInventory().getContents()) {
|
||||
if (itemStack.getType() == material) {
|
||||
econ.depositPlayer(Bukkit.getOfflinePlayer(hopper.getPlacedBy()), price * itemStack.getAmount());
|
||||
hopperBlock.getInventory().removeItem(itemStack);
|
||||
}
|
||||
if (itemStack == null || itemStack.getType() != material) continue;
|
||||
|
||||
econ.depositPlayer(Bukkit.getOfflinePlayer(hopper.getPlacedBy()), price * itemStack.getAmount());
|
||||
hopperBlock.getInventory().removeItem(itemStack);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user