mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Should work better :D
This commit is contained in:
parent
56cb409a43
commit
0a66fad271
@ -381,6 +381,7 @@ public enum C {
|
|||||||
* Custom
|
* Custom
|
||||||
*/
|
*/
|
||||||
CUSTOM_STRING("-");
|
CUSTOM_STRING("-");
|
||||||
|
static TranslationLanguage lang = new TranslationLanguage("PlotSquared", "this", "use");
|
||||||
private static TranslationManager manager;
|
private static TranslationManager manager;
|
||||||
private static TranslationFile defaultFile;
|
private static TranslationFile defaultFile;
|
||||||
/**
|
/**
|
||||||
@ -422,9 +423,8 @@ public enum C {
|
|||||||
// FIXME: generating a blank file
|
// FIXME: generating a blank file
|
||||||
// FIXME: translations aren't customizable
|
// FIXME: translations aren't customizable
|
||||||
// FIXME: Some messages still have the %arg stuff in them
|
// FIXME: Some messages still have the %arg stuff in them
|
||||||
|
|
||||||
if (defaultFile == null) {
|
if (defaultFile == null) {
|
||||||
defaultFile = new YamlTranslationFile(BukkitTranslation.getParent(PlotMain.getPlugin(PlotMain.class)), TranslationLanguage.englishAmerican, "PlotSquared", manager)
|
defaultFile = new YamlTranslationFile(BukkitTranslation.getParent(PlotMain.getPlugin(PlotMain.class)), lang, "PlotSquared", manager)
|
||||||
.read();
|
.read();
|
||||||
}
|
}
|
||||||
// register everything in this class
|
// register everything in this class
|
||||||
@ -455,7 +455,7 @@ public enum C {
|
|||||||
* @return translated if exists else default
|
* @return translated if exists else default
|
||||||
*/
|
*/
|
||||||
public String s() {
|
public String s() {
|
||||||
return manager.getTranslated(toString(), TranslationLanguage.englishAmerican).getTranslated().replaceAll("&-", "\n").replaceAll("\\n", "\n");
|
return manager.getTranslated(toString(), lang).getTranslated().replaceAll("&-", "\n").replaceAll("\\n", "\n");
|
||||||
/*
|
/*
|
||||||
if (PlotMain.translations != null) {
|
if (PlotMain.translations != null) {
|
||||||
final String t = PlotMain.translations.getString(this.toString());
|
final String t = PlotMain.translations.getString(this.toString());
|
||||||
|
@ -36,31 +36,47 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public class SQLManager extends AbstractDB {
|
public class SQLManager extends AbstractDB {
|
||||||
|
|
||||||
private Connection connection;
|
// Public final
|
||||||
private String prefix;
|
public final String SET_OWNER;
|
||||||
public final String SET_OWNER =
|
public final String GET_ALL_PLOTS;
|
||||||
"UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?";
|
public final String CREATE_PLOTS;
|
||||||
// TODO MongoDB @Brandon
|
public final String CREATE_SETTINGS;
|
||||||
public String GET_ALL_PLOTS =
|
public final String CREATE_HELPERS;
|
||||||
"SELECT `id`, `plot_id_x`, `plot_id_z`, `world` FROM `" + prefix + "plot`";
|
public final String CREATE_PLOT;
|
||||||
public String CREATE_PLOTS =
|
// Private Final
|
||||||
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) values ";
|
private final Connection connection;
|
||||||
public String CREATE_SETTINGS =
|
private final String prefix;
|
||||||
"INSERT INTO `" + prefix + "plot_settings` (`plot_plot_id`) values ";
|
|
||||||
public String CREATE_HELPERS =
|
/**
|
||||||
"INSERT INTO `" + prefix + "plot_helpers` (`plot_plot_id`, `user_uuid`) values ";
|
* Constructor
|
||||||
public String CREATE_PLOT =
|
*
|
||||||
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)";
|
* @param c connection
|
||||||
|
* @param p prefix
|
||||||
|
*/
|
||||||
public SQLManager(Connection c, String p) {
|
public SQLManager(Connection c, String p) {
|
||||||
|
// Private final
|
||||||
connection = c;
|
connection = c;
|
||||||
prefix = p;
|
prefix = p;
|
||||||
|
// Public final
|
||||||
|
SET_OWNER =
|
||||||
|
"UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?";
|
||||||
|
GET_ALL_PLOTS =
|
||||||
|
"SELECT `id`, `plot_id_x`, `plot_id_z`, `world` FROM `" + prefix + "plot`";
|
||||||
|
CREATE_PLOTS =
|
||||||
|
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) values ";
|
||||||
|
CREATE_SETTINGS =
|
||||||
|
"INSERT INTO `" + prefix + "plot_settings` (`plot_plot_id`) values ";
|
||||||
|
CREATE_HELPERS =
|
||||||
|
"INSERT INTO `" + prefix + "plot_helpers` (`plot_plot_id`, `user_uuid`) values ";
|
||||||
|
CREATE_PLOT =
|
||||||
|
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Plot owner
|
* Set Plot owner
|
||||||
*
|
*
|
||||||
* @param plot
|
* @param plot Plot Object
|
||||||
* @param uuid
|
* @param uuid Owner UUID
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setOwner(final Plot plot, final UUID uuid) {
|
public void setOwner(final Plot plot, final UUID uuid) {
|
||||||
@ -123,7 +139,7 @@ public class SQLManager extends AbstractDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add plot settings
|
// add plot settings
|
||||||
final Integer[] ids = helpers.keySet().toArray(new Integer[0]);
|
final Integer[] ids = helpers.keySet().toArray(new Integer[helpers.keySet().size()]);
|
||||||
StringBuilder statement = new StringBuilder(CREATE_SETTINGS);
|
StringBuilder statement = new StringBuilder(CREATE_SETTINGS);
|
||||||
for (int i = 0; i < (ids.length - 1); i++) {
|
for (int i = 0; i < (ids.length - 1); i++) {
|
||||||
statement.append("(?),");
|
statement.append("(?),");
|
||||||
|
Loading…
Reference in New Issue
Block a user