Fixed auto selling to work in all slots.

This commit is contained in:
Brianna O'Keefe 2019-03-18 14:43:29 -04:00
parent 7c1da22fef
commit b068395a51
2 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "EpicHoppers"
path: "/builds/Songoda/$name"
version: "3.5.8"
version: "3.5.9"
build:
stage: build

View File

@ -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) {
}