mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
my bad
This commit is contained in:
parent
e4cd1bdc56
commit
2edec161a8
@ -40,4 +40,13 @@ public class AbstractFlag {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other){
|
||||
if (other == null) return false;
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof AbstractFlag)) return false;
|
||||
AbstractFlag otherObj = (AbstractFlag)other;
|
||||
return (otherObj.key.equals(this.key));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,11 +11,17 @@ import java.util.List;
|
||||
|
||||
import static org.bukkit.Material.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jesse Boyd
|
||||
*
|
||||
*/
|
||||
public abstract class PlotWorld {
|
||||
|
||||
// TODO make this configurable
|
||||
// make non static and static_default_valu + add config option
|
||||
public static ArrayList<Material> BLOCKS = new ArrayList<Material>(Arrays.asList(new Material[] { ACACIA_STAIRS,
|
||||
@SuppressWarnings("deprecation")
|
||||
public static ArrayList<Material> BLOCKS = new ArrayList<Material>(Arrays.asList(new Material[] { ACACIA_STAIRS,
|
||||
BEACON, BEDROCK, BIRCH_WOOD_STAIRS, BOOKSHELF, BREWING_STAND, BRICK, BRICK_STAIRS, BURNING_FURNACE,
|
||||
CAKE_BLOCK, CAULDRON, CLAY_BRICK, CLAY, COAL_BLOCK, COAL_ORE, COBBLE_WALL, COBBLESTONE, COBBLESTONE_STAIRS,
|
||||
COMMAND, DARK_OAK_STAIRS, DAYLIGHT_DETECTOR, DIAMOND_ORE, DIAMOND_BLOCK, DIRT, DISPENSER, DROPPER,
|
||||
@ -91,7 +97,8 @@ public abstract class PlotWorld {
|
||||
*
|
||||
@param config
|
||||
*/
|
||||
public void loadDefaultConfiguration(ConfigurationSection config) {
|
||||
public void loadDefaultConfiguration(ConfigurationSection config)
|
||||
{
|
||||
this.MOB_SPAWNING = config.getBoolean("natural_mob_spawning");
|
||||
this.AUTO_MERGE = config.getBoolean("plot.auto_merge");
|
||||
this.PLOT_BIOME = (Biome) Configuration.BIOME.parseString(config.getString("plot.biome"));
|
||||
@ -115,12 +122,12 @@ public abstract class PlotWorld {
|
||||
|
||||
public abstract void loadConfiguration(ConfigurationSection config);
|
||||
|
||||
public void saveConfiguration(ConfigurationSection config) {
|
||||
|
||||
/*
|
||||
* Saving core plotworld settings
|
||||
*/
|
||||
|
||||
/**
|
||||
* Saving core plotworld settings
|
||||
* @param config
|
||||
*/
|
||||
public void saveConfiguration(ConfigurationSection config)
|
||||
{
|
||||
HashMap<String, Object> options = new HashMap<String, Object>();
|
||||
|
||||
options.put("natural_mob_spawning", PlotWorld.MOB_SPAWNING_DEFAULT);
|
||||
@ -146,11 +153,13 @@ public abstract class PlotWorld {
|
||||
/*
|
||||
* Saving generator specific settings
|
||||
*/
|
||||
for (ConfigurationNode setting : settings) {
|
||||
for (ConfigurationNode setting : settings)
|
||||
{
|
||||
options.put(setting.getConstant(), setting.getType().parseObject(setting.getValue()));
|
||||
}
|
||||
|
||||
for (String option : options.keySet()) {
|
||||
for (String option : options.keySet())
|
||||
{
|
||||
if (!config.contains(option)) {
|
||||
config.set(option, options.get(option));
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import org.bukkit.WeatherType;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.AbstractFlag;
|
||||
import com.intellectualcrafters.plot.C;
|
||||
import com.intellectualcrafters.plot.Flag;
|
||||
import com.intellectualcrafters.plot.FlagManager;
|
||||
@ -96,8 +97,17 @@ public class Set extends SubCommand {
|
||||
PlayerFunctions.sendMessage(plr, C.NEED_KEY.s().replaceAll("%values%", message));
|
||||
return false;
|
||||
}
|
||||
if (!FlagManager.getFlags().contains(args[1].toLowerCase()) && (PlotMain.worldGuardListener != null)
|
||||
&& !PlotMain.worldGuardListener.str_flags.contains(args[1].toLowerCase())) {
|
||||
|
||||
AbstractFlag af = new AbstractFlag("");
|
||||
|
||||
try {
|
||||
af = new AbstractFlag(args[1].toLowerCase());
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
if (!FlagManager.getFlags().contains(af) && ((PlotMain.worldGuardListener == null) || !PlotMain.worldGuardListener.str_flags.contains(args[1].toLowerCase()))) {
|
||||
PlayerFunctions.sendMessage(plr, C.NOT_VALID_FLAG);
|
||||
return false;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class DefaultPlotWorld extends PlotWorld {
|
||||
super(worldname);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* CONFIG NODE | DEFAULT VALUE | DESCRIPTION | CONFIGURATION TYPE | REQUIRED
|
||||
* FOR INITIAL SETUP
|
||||
*
|
||||
@ -152,7 +152,7 @@ public class DefaultPlotWorld extends PlotWorld {
|
||||
new ConfigurationNode("wall.height", DefaultPlotWorld.WALL_HEIGHT_DEFAULT, "Wall height", Configuration.INTEGER, true), };
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* This method is called when a world loads. Make sure you set all your
|
||||
* constants here. You are provided with the configuration section for that
|
||||
* specific world.
|
||||
|
Loading…
Reference in New Issue
Block a user