mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
fixes
This commit is contained in:
parent
a5731d94be
commit
22700aa88b
@ -29,6 +29,7 @@ import com.intellectualcrafters.plot.config.C;
|
|||||||
import com.intellectualcrafters.plot.config.Settings;
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
import com.intellectualcrafters.plot.database.PlotMeConverter;
|
import com.intellectualcrafters.plot.database.PlotMeConverter;
|
||||||
import com.intellectualcrafters.plot.events.PlotDeleteEvent;
|
import com.intellectualcrafters.plot.events.PlotDeleteEvent;
|
||||||
|
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||||
import com.intellectualcrafters.plot.generator.BukkitHybridUtils;
|
import com.intellectualcrafters.plot.generator.BukkitHybridUtils;
|
||||||
import com.intellectualcrafters.plot.generator.HybridGen;
|
import com.intellectualcrafters.plot.generator.HybridGen;
|
||||||
import com.intellectualcrafters.plot.generator.HybridUtils;
|
import com.intellectualcrafters.plot.generator.HybridUtils;
|
||||||
@ -39,6 +40,8 @@ import com.intellectualcrafters.plot.listeners.PlayerEvents_1_8;
|
|||||||
import com.intellectualcrafters.plot.listeners.PlotPlusListener;
|
import com.intellectualcrafters.plot.listeners.PlotPlusListener;
|
||||||
import com.intellectualcrafters.plot.listeners.WorldEditListener;
|
import com.intellectualcrafters.plot.listeners.WorldEditListener;
|
||||||
import com.intellectualcrafters.plot.object.PlotId;
|
import com.intellectualcrafters.plot.object.PlotId;
|
||||||
|
import com.intellectualcrafters.plot.titles.AbstractTitle;
|
||||||
|
import com.intellectualcrafters.plot.titles.DefaultTitle;
|
||||||
import com.intellectualcrafters.plot.util.BlockManager;
|
import com.intellectualcrafters.plot.util.BlockManager;
|
||||||
import com.intellectualcrafters.plot.util.ConsoleColors;
|
import com.intellectualcrafters.plot.util.ConsoleColors;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
@ -54,6 +57,9 @@ import com.intellectualcrafters.plot.util.bukkit.SetBlockFast_1_8;
|
|||||||
import com.intellectualcrafters.plot.util.bukkit.SetBlockManager;
|
import com.intellectualcrafters.plot.util.bukkit.SetBlockManager;
|
||||||
import com.intellectualcrafters.plot.util.bukkit.SetBlockSlow;
|
import com.intellectualcrafters.plot.util.bukkit.SetBlockSlow;
|
||||||
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
||||||
|
import com.intellectualcrafters.plot.uuid.DefaultUUIDWrapper;
|
||||||
|
import com.intellectualcrafters.plot.uuid.OfflineUUIDWrapper;
|
||||||
|
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
|
|
||||||
public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
||||||
@ -102,8 +108,8 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
MAIN = new PlotSquared(this);
|
|
||||||
THIS = this;
|
THIS = this;
|
||||||
|
MAIN = new PlotSquared(this);
|
||||||
if (Settings.METRICS) {
|
if (Settings.METRICS) {
|
||||||
try {
|
try {
|
||||||
final Metrics metrics = new Metrics(this);
|
final Metrics metrics = new Metrics(this);
|
||||||
@ -127,6 +133,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void log(String message) {
|
public void log(String message) {
|
||||||
|
message = message.replaceAll("\u00B2", "2");
|
||||||
if ((THIS == null) || (Bukkit.getServer().getConsoleSender() == null)) {
|
if ((THIS == null) || (Bukkit.getServer().getConsoleSender() == null)) {
|
||||||
System.out.println(ChatColor.stripColor(ConsoleColors.fromString(message)));
|
System.out.println(ChatColor.stripColor(ConsoleColors.fromString(message)));
|
||||||
} else {
|
} else {
|
||||||
@ -337,4 +344,36 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
public SetupUtils initSetupUtils() {
|
public SetupUtils initSetupUtils() {
|
||||||
return new BukkitSetupUtils();
|
return new BukkitSetupUtils();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UUIDWrapper initUUIDHandler() {
|
||||||
|
boolean checkVersion = checkVersion(1, 7, 6);
|
||||||
|
if (!checkVersion) {
|
||||||
|
log(C.PREFIX.s()+" &c[WARN] Titles are disabled - please update your version of Bukkit to support this feature.");
|
||||||
|
Settings.TITLES = false;
|
||||||
|
FlagManager.removeFlag(FlagManager.getFlag("titles"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
AbstractTitle.TITLE_CLASS = new DefaultTitle();
|
||||||
|
}
|
||||||
|
if (Settings.OFFLINE_MODE) {
|
||||||
|
UUIDHandler.uuidWrapper = new OfflineUUIDWrapper();
|
||||||
|
Settings.OFFLINE_MODE = true;
|
||||||
|
}
|
||||||
|
else if (checkVersion) {
|
||||||
|
UUIDHandler.uuidWrapper = new DefaultUUIDWrapper();
|
||||||
|
Settings.OFFLINE_MODE = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
UUIDHandler.uuidWrapper = new OfflineUUIDWrapper();
|
||||||
|
Settings.OFFLINE_MODE = true;
|
||||||
|
}
|
||||||
|
if (Settings.OFFLINE_MODE) {
|
||||||
|
log(C.PREFIX.s()+" &6PlotSquared is using Offline Mode UUIDs either because of user preference, or because you are using an old version of Bukkit");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log(C.PREFIX.s()+" &6PlotSquared is using online UUIDs");
|
||||||
|
}
|
||||||
|
return UUIDHandler.uuidWrapper;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import com.intellectualcrafters.plot.object.PlotId;
|
|||||||
import com.intellectualcrafters.plot.util.BlockManager;
|
import com.intellectualcrafters.plot.util.BlockManager;
|
||||||
import com.intellectualcrafters.plot.util.SetupUtils;
|
import com.intellectualcrafters.plot.util.SetupUtils;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
|
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
|
||||||
|
|
||||||
public interface IPlotMain {
|
public interface IPlotMain {
|
||||||
public void log(String message);
|
public void log(String message);
|
||||||
@ -43,6 +44,8 @@ public interface IPlotMain {
|
|||||||
|
|
||||||
public HybridUtils initHybridUtils();
|
public HybridUtils initHybridUtils();
|
||||||
|
|
||||||
|
public UUIDWrapper initUUIDHandler();
|
||||||
|
|
||||||
public boolean initPlotMeConverter();
|
public boolean initPlotMeConverter();
|
||||||
|
|
||||||
public void getGenerator(String world, String name);
|
public void getGenerator(String world, String name);
|
||||||
|
@ -437,6 +437,8 @@ public class PlotSquared {
|
|||||||
IMP.registerPlotPlusEvents();
|
IMP.registerPlotPlusEvents();
|
||||||
IMP.registerForceFieldEvents();
|
IMP.registerForceFieldEvents();
|
||||||
IMP.registerWorldEditEvents();
|
IMP.registerWorldEditEvents();
|
||||||
|
// create UUIDWrapper
|
||||||
|
UUIDHandler.uuidWrapper = IMP.initUUIDHandler();
|
||||||
// create Hybrid utility class
|
// create Hybrid utility class
|
||||||
HybridUtils.manager = IMP.initHybridUtils();
|
HybridUtils.manager = IMP.initHybridUtils();
|
||||||
// create setup util class
|
// create setup util class
|
||||||
@ -771,9 +773,6 @@ public class PlotSquared {
|
|||||||
storage.set(node.getKey(), node.getValue());
|
storage.set(node.getKey(), node.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void showDebug() {
|
|
||||||
Settings.DB.USE_MYSQL = storage.getBoolean("mysql.use");
|
Settings.DB.USE_MYSQL = storage.getBoolean("mysql.use");
|
||||||
Settings.DB.USER = storage.getString("mysql.user");
|
Settings.DB.USER = storage.getString("mysql.user");
|
||||||
Settings.DB.PASSWORD = storage.getString("mysql.password");
|
Settings.DB.PASSWORD = storage.getString("mysql.password");
|
||||||
@ -790,10 +789,13 @@ public class PlotSquared {
|
|||||||
Settings.API_URL = config.getString("uuid.api.location");
|
Settings.API_URL = config.getString("uuid.api.location");
|
||||||
Settings.CUSTOM_API = config.getBoolean("uuid.api.custom");
|
Settings.CUSTOM_API = config.getBoolean("uuid.api.custom");
|
||||||
Settings.UUID_FECTHING = config.getBoolean("uuid.fetching");
|
Settings.UUID_FECTHING = config.getBoolean("uuid.fetching");
|
||||||
C.COLOR_1 = "\u00A7" + (style.getString("color.1"));
|
}
|
||||||
C.COLOR_2 = "\u00A7" + (style.getString("color.2"));
|
|
||||||
C.COLOR_3 = "\u00A7" + (style.getString("color.3"));
|
public static void showDebug() {
|
||||||
C.COLOR_4 = "\u00A7" + (style.getString("color.4"));
|
C.COLOR_1 = "&" + (style.getString("color.1"));
|
||||||
|
C.COLOR_2 = "&" + (style.getString("color.2"));
|
||||||
|
C.COLOR_3 = "&" + (style.getString("color.3"));
|
||||||
|
C.COLOR_4 = "&" + (style.getString("color.4"));
|
||||||
if (Settings.DEBUG) {
|
if (Settings.DEBUG) {
|
||||||
final Map<String, String> settings = new HashMap<>();
|
final Map<String, String> settings = new HashMap<>();
|
||||||
settings.put("Kill Road Mobs", "" + Settings.KILL_ROAD_MOBS);
|
settings.put("Kill Road Mobs", "" + Settings.KILL_ROAD_MOBS);
|
||||||
|
@ -53,7 +53,7 @@ public class Claim extends SubCommand {
|
|||||||
// final PlayerClaimPlotEvent event = new PlayerClaimPlotEvent(player, plot, auto);
|
// final PlayerClaimPlotEvent event = new PlayerClaimPlotEvent(player, plot, auto);
|
||||||
// Bukkit.getPluginManager().callEvent(event);
|
// Bukkit.getPluginManager().callEvent(event);
|
||||||
// boolean result = event.isCancelled();
|
// boolean result = event.isCancelled();
|
||||||
boolean result = true;
|
boolean result = false;
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
MainUtil.createPlot(player.getUUID(), plot);
|
MainUtil.createPlot(player.getUUID(), plot);
|
||||||
|
@ -84,6 +84,7 @@ public class MainCommand {
|
|||||||
}
|
}
|
||||||
final List<String> help = new ArrayList<>();
|
final List<String> help = new ArrayList<>();
|
||||||
help.add(C.HELP_HEADER.s());
|
help.add(C.HELP_HEADER.s());
|
||||||
|
System.out.print(C.HELP_HEADER.s());
|
||||||
// HELP_CATEGORY("&cCategory: &6%category%&c, Page: %current%&c/&6%max%&c, Displaying: &6%dis%&c/&6%total%"),
|
// HELP_CATEGORY("&cCategory: &6%category%&c, Page: %current%&c/&6%max%&c, Displaying: &6%dis%&c/&6%total%"),
|
||||||
help.add(C.HELP_CATEGORY.s().replace("%category%", category == null ? "All" : category.toString()).replace("%current%", "" + (page + 1)).replace("%max%", "" + (totalPages + 1)).replace("%dis%", "" + (commands.size() % perPage)).replace("%total%", "" + commands.size()));
|
help.add(C.HELP_CATEGORY.s().replace("%category%", category == null ? "All" : category.toString()).replace("%current%", "" + (page + 1)).replace("%max%", "" + (totalPages + 1)).replace("%dis%", "" + (commands.size() % perPage)).replace("%total%", "" + commands.size()));
|
||||||
SubCommand cmd;
|
SubCommand cmd;
|
||||||
@ -158,7 +159,7 @@ public class MainCommand {
|
|||||||
for (final String string : helpMenu(player, cato, page)) {
|
for (final String string : helpMenu(player, cato, page)) {
|
||||||
help.append(string).append("\n");
|
help.append(string).append("\n");
|
||||||
}
|
}
|
||||||
player.sendMessage(MainUtil.colorise('&', help.toString()));
|
MainUtil.sendMessage(player, help.toString());
|
||||||
// return PlayerFunctions.sendMessage(player, help.toString());
|
// return PlayerFunctions.sendMessage(player, help.toString());
|
||||||
} else {
|
} else {
|
||||||
for (final SubCommand command : subCommands) {
|
for (final SubCommand command : subCommands) {
|
||||||
|
@ -444,7 +444,7 @@ public enum C {
|
|||||||
* @see com.intellectualsites.translation.TranslationLanguage
|
* @see com.intellectualsites.translation.TranslationLanguage
|
||||||
*/
|
*/
|
||||||
protected final static TranslationLanguage lang = new TranslationLanguage("PlotSquared", "this", "use");
|
protected final static TranslationLanguage lang = new TranslationLanguage("PlotSquared", "this", "use");
|
||||||
public static String COLOR_1 = "\u00A76", COLOR_2 = "\u00A77", COLOR_3 = "\u00A78", COLOR_4 = "\u00A73";
|
public static String COLOR_1 = "&6", COLOR_2 = "&7", COLOR_3 = "&8", COLOR_4 = "&3";
|
||||||
/**
|
/**
|
||||||
* The TranslationManager
|
* The TranslationManager
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: ${project.name}
|
name: ${project.name}
|
||||||
main: com.intellectualcrafters.plot.PlotSquared
|
main: com.intellectualcrafters.plot.BukkitMain
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
load: STARTUP
|
load: STARTUP
|
||||||
description: >
|
description: >
|
||||||
|
Loading…
Reference in New Issue
Block a user