mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-28 19:54:43 +02:00
Added schematic save path setting
This commit is contained in:
@ -926,6 +926,7 @@ public class PlotMain extends JavaPlugin {
|
||||
Settings.AUTO_CLEAR = config.getBoolean("clear.auto.enabled");
|
||||
Settings.AUTO_CLEAR_DAYS = config.getInt("clear.auto.days");
|
||||
Settings.DELETE_PLOTS_ON_BAN = config.getBoolean("clear.on.ban");
|
||||
Settings.SCHEMATIC_SAVE_PATH = config.getString("schematic.save_path");
|
||||
}
|
||||
if (Settings.DEBUG) {
|
||||
Map<String, String> settings = new HashMap<>();
|
||||
@ -937,6 +938,7 @@ public class PlotMain extends JavaPlugin {
|
||||
settings.put("DB SQLite Enabled", "" + Settings.DB.USE_SQLITE);
|
||||
settings.put("Auto Clear Enabled", "" + Settings.AUTO_CLEAR);
|
||||
settings.put("Auto Clear Days", "" + Settings.AUTO_CLEAR_DAYS);
|
||||
settings.put("Schematics Save Path", "" + Settings.SCHEMATIC_SAVE_PATH);
|
||||
for (Entry<String, String> setting : settings.entrySet()) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s()
|
||||
+ String.format("&cKey: &6%s&c, Value: &6%s", setting.getKey(), setting.getValue()));
|
||||
@ -1086,6 +1088,7 @@ public class PlotMain extends JavaPlugin {
|
||||
Settings.AUTO_CLEAR_DAYS = config.getInt("clear.auto.days");
|
||||
Settings.AUTO_CLEAR = config.getBoolean("clear.auto.enabled");
|
||||
Settings.MAX_PLOTS = config.getInt("max_plots");
|
||||
Settings.SCHEMATIC_SAVE_PATH = config.getString("schematics.save_path");
|
||||
}
|
||||
|
||||
public static void createConfiguration(PlotWorld plotworld) {
|
||||
|
@ -15,6 +15,7 @@ package com.intellectualcrafters.plot;
|
||||
* @author Empire92
|
||||
*/
|
||||
public class Settings {
|
||||
public static String SCHEMATIC_SAVE_PATH = "/var/www/schematics";
|
||||
public static int MAX_PLOTS = 20;
|
||||
/**
|
||||
* WorldGuard region on claimed plots
|
||||
|
@ -1,26 +1,13 @@
|
||||
package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.intellectualcrafters.jnbt.CompoundTag;
|
||||
import com.intellectualcrafters.plot.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.intellectualcrafters.jnbt.CompoundTag;
|
||||
import com.intellectualcrafters.plot.C;
|
||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.Plot;
|
||||
import com.intellectualcrafters.plot.PlotHelper;
|
||||
import com.intellectualcrafters.plot.PlotId;
|
||||
import com.intellectualcrafters.plot.PlotMain;
|
||||
import com.intellectualcrafters.plot.SchematicHandler;
|
||||
import com.intellectualcrafters.plot.Settings;
|
||||
import com.intellectualcrafters.plot.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.sun.org.apache.xerces.internal.impl.xs.identity.ValueStore;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Schematic extends SubCommand {
|
||||
|
||||
@ -161,7 +148,7 @@ public class Schematic extends SubCommand {
|
||||
public void run() {
|
||||
counter++;
|
||||
PlayerFunctions.sendMessage(plr, "&6ID: "+plot.id);
|
||||
boolean result = SchematicHandler.save(sch, Settings.Web.PATH+"/"+plot.id.x+","+plot.id.y+","+worldname+","+owner+".schematic");
|
||||
boolean result = SchematicHandler.save(sch, Settings.SCHEMATIC_SAVE_PATH+"/"+plot.id.x+","+plot.id.y+","+worldname+","+owner+".schematic");
|
||||
|
||||
if (!result) {
|
||||
PlayerFunctions.sendMessage(plr, "&7 - Failed to save &c"+plot.id);
|
||||
@ -253,7 +240,7 @@ public class Schematic extends SubCommand {
|
||||
public void run() {
|
||||
counter++;
|
||||
PlayerFunctions.sendMessage(plr, "&6ID: "+plot.id);
|
||||
boolean result = SchematicHandler.save(sch, Settings.Web.PATH+"/"+plot.id.x+","+plot.id.y+","+world+","+owner+".schematic");
|
||||
boolean result = SchematicHandler.save(sch, Settings.SCHEMATIC_SAVE_PATH+"/"+plot.id.x+","+plot.id.y+","+world+","+owner+".schematic");
|
||||
|
||||
if (!result) {
|
||||
PlayerFunctions.sendMessage(plr, "&7 - Failed to save &c"+plot.id);
|
||||
|
Reference in New Issue
Block a user