Added saving for autoselling.

This commit is contained in:
Brianna 2019-07-10 23:02:44 -04:00
parent baf2b605d5
commit 4349299321
4 changed files with 8 additions and 1 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "EpicHoppers"
path: "/builds/$CI_PROJECT_PATH"
version: "4.0.3"
version: "4.0.4"
build:
stage: build

View File

@ -271,6 +271,8 @@ public class EpicHoppers extends JavaPlugin {
String autoCraftingStr = row.get("autocrafting").asString() == null ? "AIR" : row.get("autocrafting").asString();
boolean autoSell = row.get("autosell").asBoolean();
String[] autoCraftingParts = autoCraftingStr.split(":");
ItemStack autoCrafting = new ItemStack(Material.valueOf(autoCraftingParts[0]), 1, Short.parseShort(autoCraftingParts.length == 2 ? autoCraftingParts[1] : "0"));
@ -291,6 +293,9 @@ public class EpicHoppers extends JavaPlugin {
Hopper hopper = new Hopper(location, level, lastPlayer, placedBy, blocks, filter, teleportTrigger, autoCrafting);
if (!autoSell)
hopper.setAutoSellTimer(-9999);
if (autoBreak) hopper.toggleAutoBreaking();
hopperManager.addHopper(location, hopper);

View File

@ -50,6 +50,7 @@ public abstract class Storage {
new StorageItem("blacklist", hopper.getFilter().getBlackList()),
new StorageItem("void", hopper.getFilter().getVoidList()),
new StorageItem("autobreak", hopper.isAutoBreaking()),
new StorageItem("autosell", hopper.getAutoSellTimer() != -9999),
new StorageItem("black", hopper.getFilter().getEndPoint() == null ? null : Methods.serializeLocation(hopper.getFilter().getEndPoint())));
}

View File

@ -31,6 +31,7 @@ public class MySQLDatabase {
"\t`player` TEXT NULL,\n" +
"\t`teleporttrigger` TEXT NULL,\n" +
"\t`autocrafting` TEXT NULL,\n" +
"\t`autosell` TEXT NULL,\n" +
"\t`whitelist` TEXT NULL,\n" +
"\t`blacklist` TEXT NULL,\n" +
"\t`void` TEXT NULL,\n" +