Toggle for block break will not be saved. (MySQL will need updating).

This commit is contained in:
Brianna 2019-05-15 20:17:55 -04:00
parent c7cc59ef79
commit 633d0293b6
3 changed files with 7 additions and 0 deletions

View File

@ -261,6 +261,8 @@ public class EpicHoppersPlugin extends JavaPlugin implements EpicHoppers {
String blackLoc = row.get("black").asString();
Location black = blackLoc == null ? null : Methods.unserializeLocation(blackLoc);
boolean autoBreak = row.get("autobreak").asBoolean();
EFilter filter = new EFilter();
filter.setWhiteList(whiteList);
@ -270,6 +272,8 @@ public class EpicHoppersPlugin extends JavaPlugin implements EpicHoppers {
EHopper hopper = new EHopper(location, levelManager.getLevel(level), lastPlayer, placedBy, blocks, filter, teleportTrigger, autoCrafting);
if (autoBreak) hopper.toggleAutoBreaking();
hopperManager.addHopper(location, hopper);
}
}

View File

@ -3,6 +3,7 @@ package com.songoda.epichoppers.storage;
import com.songoda.epichoppers.EpicHoppersPlugin;
import com.songoda.epichoppers.api.hopper.Hopper;
import com.songoda.epichoppers.boost.BoostData;
import com.songoda.epichoppers.hopper.EHopper;
import com.songoda.epichoppers.utils.ConfigWrapper;
import com.songoda.epichoppers.utils.Methods;
import org.bukkit.Material;
@ -50,6 +51,7 @@ public abstract class Storage {
new StorageItem("whitelist", hopper.getFilter().getWhiteList()),
new StorageItem("blacklist", hopper.getFilter().getBlackList()),
new StorageItem("void", hopper.getFilter().getVoidList()),
new StorageItem("autobreak", ((EHopper)hopper).isAutoBreaking()),
new StorageItem("black", hopper.getFilter().getEndPoint() == null ? null : Methods.serializeLocation(hopper.getFilter().getEndPoint())));
}

View File

@ -34,6 +34,7 @@ public class MySQLDatabase {
"\t`blacklist` TEXT NULL,\n" +
"\t`void` TEXT NULL,\n" +
"\t`black` TEXT NULL\n" +
"\t`autobreak` TEXT NULL\n" +
")");
connection.createStatement().execute("CREATE TABLE IF NOT EXISTS `" + instance.getConfig().getString("Database.Prefix") + "boosts` (\n" +