mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-23 02:35:18 +01:00
Added saving for autoselling.
This commit is contained in:
parent
baf2b605d5
commit
4349299321
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicHoppers"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "4.0.3"
|
||||
version: "4.0.4"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -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);
|
||||
|
@ -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())));
|
||||
}
|
||||
|
||||
|
@ -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" +
|
||||
|
Loading…
Reference in New Issue
Block a user