mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
commit
085f621f0f
@ -155,9 +155,9 @@ public interface ConfigurationSection {
|
|||||||
* replaced, regardless of what the new value is.
|
* replaced, regardless of what the new value is.
|
||||||
* <p>
|
* <p>
|
||||||
* Some implementations may have limitations on what you may store. See
|
* Some implementations may have limitations on what you may store. See
|
||||||
* their individual javadocs for details. No implementations should allow
|
* their individual javadoc for details. No implementations should allow
|
||||||
* you to store {@link Configuration}s or {@link ConfigurationSection}s,
|
* you to store {@link Configuration}s or {@link ConfigurationSection}s,
|
||||||
* please use {@link #createSection(java.lang.String)} for that.
|
* please use {@link #createSection(String)} for that.
|
||||||
*
|
*
|
||||||
* @param path Path of the object to set.
|
* @param path Path of the object to set.
|
||||||
* @param value New value to set the path to.
|
* @param value New value to set the path to.
|
||||||
|
@ -193,7 +193,7 @@ public class YamlConfiguration extends FileConfiguration {
|
|||||||
}
|
}
|
||||||
Files.copy(file.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(file.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
PS.debug("&dCould not read: &7" + file);
|
PS.debug("&dCould not read: &7" + file);
|
||||||
PS.debug("&drenamed to: &7" + dest.getName());
|
PS.debug("&dRenamed to: &7" + dest.getName());
|
||||||
PS.debug("&c============ Full stacktrace ============");
|
PS.debug("&c============ Full stacktrace ============");
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
PS.debug("&c=========================================");
|
PS.debug("&c=========================================");
|
||||||
|
@ -28,7 +28,7 @@ public class YamlRepresenter extends Representer {
|
|||||||
@Override
|
@Override
|
||||||
public Node representData(final Object data) {
|
public Node representData(final Object data) {
|
||||||
final ConfigurationSerializable serializable = (ConfigurationSerializable) data;
|
final ConfigurationSerializable serializable = (ConfigurationSerializable) data;
|
||||||
final Map<String, Object> values = new LinkedHashMap<String, Object>();
|
final Map<String, Object> values = new LinkedHashMap<>();
|
||||||
values.put(ConfigurationSerialization.SERIALIZED_TYPE_KEY, ConfigurationSerialization.getAlias(serializable.getClass()));
|
values.put(ConfigurationSerialization.SERIALIZED_TYPE_KEY, ConfigurationSerialization.getAlias(serializable.getClass()));
|
||||||
values.putAll(serializable.serialize());
|
values.putAll(serializable.serialize());
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public interface ConfigurationSerializable {
|
|||||||
* Creates a Map representation of this class.
|
* Creates a Map representation of this class.
|
||||||
* <p>
|
* <p>
|
||||||
* This class must provide a method to restore this class, as defined in
|
* This class must provide a method to restore this class, as defined in
|
||||||
* the {@link ConfigurationSerializable} interface javadocs.
|
* the {@link ConfigurationSerializable} interface javadoc.
|
||||||
*
|
*
|
||||||
* @return Map containing the current state of this class
|
* @return Map containing the current state of this class
|
||||||
*/
|
*/
|
||||||
|
@ -44,7 +44,7 @@ public final class NBTUtils {
|
|||||||
} else if (clazz.equals(IntArrayTag.class)) {
|
} else if (clazz.equals(IntArrayTag.class)) {
|
||||||
return "TAG_Int_Array";
|
return "TAG_Int_Array";
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Invalid tag classs (" + clazz.getName() + ").");
|
throw new IllegalArgumentException("Invalid tag class (" + clazz.getName() + ").");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ public final class NBTUtils {
|
|||||||
} else if (clazz.equals(IntArrayTag.class)) {
|
} else if (clazz.equals(IntArrayTag.class)) {
|
||||||
return NBTConstants.TYPE_INT_ARRAY;
|
return NBTConstants.TYPE_INT_ARRAY;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Invalid tag classs (" + clazz.getName() + ").");
|
throw new IllegalArgumentException("Invalid tag class (" + clazz.getName() + ").");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import com.plotsquared.general.commands.CommandDeclaration;
|
|||||||
command = "debugpaste",
|
command = "debugpaste",
|
||||||
aliases = { "dp" },
|
aliases = { "dp" },
|
||||||
usage = "/plot debugpaste",
|
usage = "/plot debugpaste",
|
||||||
description = "Upload settings.yml & latest.log to hastebin",
|
description = "Upload settings.yml & latest.log to HasteBin",
|
||||||
permission = "plots.debugpaste",
|
permission = "plots.debugpaste",
|
||||||
category = CommandCategory.DEBUG)
|
category = CommandCategory.DEBUG)
|
||||||
public class DebugPaste extends SubCommand {
|
public class DebugPaste extends SubCommand {
|
||||||
|
@ -164,7 +164,7 @@ public class Setup extends SubCommand {
|
|||||||
MainUtil.sendMessage(plr, "&6What terrain would you like in plots?"
|
MainUtil.sendMessage(plr, "&6What terrain would you like in plots?"
|
||||||
+ "\n&8 - &2NONE&8 - &7No terrain at all"
|
+ "\n&8 - &2NONE&8 - &7No terrain at all"
|
||||||
+ "\n&8 - &7ORE&8 - &7Just some ore veins and trees"
|
+ "\n&8 - &7ORE&8 - &7Just some ore veins and trees"
|
||||||
+ "\n&8 - &7ROAD&8 - &7Terrain seperated by roads"
|
+ "\n&8 - &7ROAD&8 - &7Terrain separated by roads"
|
||||||
+ "\n&8 - &7ALL&8 - &7Entirely vanilla generation");
|
+ "\n&8 - &7ALL&8 - &7Entirely vanilla generation");
|
||||||
}
|
}
|
||||||
object.current++;
|
object.current++;
|
||||||
@ -176,7 +176,7 @@ public class Setup extends SubCommand {
|
|||||||
MainUtil.sendMessage(plr, "&cYou must choose the terrain!"
|
MainUtil.sendMessage(plr, "&cYou must choose the terrain!"
|
||||||
+ "\n&8 - &2NONE&8 - &7No terrain at all"
|
+ "\n&8 - &2NONE&8 - &7No terrain at all"
|
||||||
+ "\n&8 - &7ORE&8 - &7Just some ore veins and trees"
|
+ "\n&8 - &7ORE&8 - &7Just some ore veins and trees"
|
||||||
+ "\n&8 - &7ROAD&8 - &7Terrain seperated by roads"
|
+ "\n&8 - &7ROAD&8 - &7Terrain separated by roads"
|
||||||
+ "\n&8 - &7ALL&8 - &7Entirely vanilla generation");
|
+ "\n&8 - &7ALL&8 - &7Entirely vanilla generation");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ public class Setup extends SubCommand {
|
|||||||
try {
|
try {
|
||||||
plr.teleport(BlockManager.manager.getSpawn(world));
|
plr.teleport(BlockManager.manager.getSpawn(world));
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
plr.sendMessage("&cAn error occured. See console for more information");
|
plr.sendMessage("&cAn error occurred. See console for more information");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
sendMessage(plr, C.SETUP_FINISHED, object.world);
|
sendMessage(plr, C.SETUP_FINISHED, object.world);
|
||||||
|
@ -22,10 +22,12 @@ package com.intellectualcrafters.plot.commands;
|
|||||||
|
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SubCommand class
|
* SubCommand class
|
||||||
*
|
*
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "deprecation" })
|
@SuppressWarnings({ "deprecation" })
|
||||||
public abstract class SubCommand extends com.plotsquared.general.commands.Command<PlotPlayer> {
|
public abstract class SubCommand extends com.plotsquared.general.commands.Command<PlotPlayer> {
|
||||||
@ -38,11 +40,11 @@ public abstract class SubCommand extends com.plotsquared.general.commands.Comman
|
|||||||
/**
|
/**
|
||||||
* Send a message
|
* Send a message
|
||||||
*
|
*
|
||||||
* @param plr Player who will receive the mssage
|
* @param plr Player who will receive the message
|
||||||
* @param c Caption
|
* @param c Caption
|
||||||
* @param args Arguments (%s's)
|
* @param args Arguments (%s's)
|
||||||
*
|
*
|
||||||
* @see com.intellectualcrafters.plot.util.MainUtil#sendMessage(PlotPlayer, C, String...)
|
* @see MainUtil#sendMessage(PlotPlayer, C, String...)
|
||||||
*/
|
*/
|
||||||
public boolean sendMessage(final PlotPlayer plr, final C c, final String... args) {
|
public boolean sendMessage(final PlotPlayer plr, final C c, final String... args) {
|
||||||
c.send(plr, args);
|
c.send(plr, args);
|
||||||
|
@ -129,7 +129,7 @@ public class Template extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot template <import|explort> <world> [template]");
|
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot template <import|export> <world> [template]");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
final String world = args[1];
|
final String world = args[1];
|
||||||
|
@ -486,7 +486,7 @@ public class DBFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace all occurances of a uuid in the database with another one
|
* Replace all occurrences of a uuid in the database with another one
|
||||||
* @param old
|
* @param old
|
||||||
* @param now
|
* @param now
|
||||||
*/
|
*/
|
||||||
|
@ -372,7 +372,7 @@ public class FlagManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of registerd AbstragFlag objects based on player permissions
|
* Get a list of registered AbstractFlag objects based on player permissions
|
||||||
*
|
*
|
||||||
* @param player with permissions
|
* @param player with permissions
|
||||||
*
|
*
|
||||||
|
@ -13,7 +13,7 @@ import com.intellectualcrafters.plot.util.SetBlockQueue;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A plot manager with square plots which tesselate on a square grid with the following sections: ROAD, WALL, BORDER (wall), PLOT, FLOOR (plot)
|
* A plot manager with square plots which tessellate on a square grid with the following sections: ROAD, WALL, BORDER (wall), PLOT, FLOOR (plot)
|
||||||
*/
|
*/
|
||||||
public class ClassicPlotManager extends SquarePlotManager {
|
public class ClassicPlotManager extends SquarePlotManager {
|
||||||
@Override
|
@Override
|
||||||
|
@ -2306,7 +2306,7 @@ public class MainUtil {
|
|||||||
/**
|
/**
|
||||||
* Send a message to the player
|
* Send a message to the player
|
||||||
*
|
*
|
||||||
* @param plr Player to recieve message
|
* @param plr Player to receive message
|
||||||
* @param msg Message to send
|
* @param msg Message to send
|
||||||
*
|
*
|
||||||
* @return true Can be used in things such as commands (return PlayerFunctions.sendMessage(...))
|
* @return true Can be used in things such as commands (return PlayerFunctions.sendMessage(...))
|
||||||
@ -2345,7 +2345,7 @@ public class MainUtil {
|
|||||||
/**
|
/**
|
||||||
* Send a message to the player
|
* Send a message to the player
|
||||||
*
|
*
|
||||||
* @param plr Player to recieve message
|
* @param plr Player to receive message
|
||||||
* @param c Caption to send
|
* @param c Caption to send
|
||||||
*
|
*
|
||||||
* @return boolean success
|
* @return boolean success
|
||||||
@ -2357,7 +2357,7 @@ public class MainUtil {
|
|||||||
/**
|
/**
|
||||||
* Send a message to the player
|
* Send a message to the player
|
||||||
*
|
*
|
||||||
* @param plr Player to recieve message
|
* @param plr Player to receive message
|
||||||
* @param c Caption to send
|
* @param c Caption to send
|
||||||
*
|
*
|
||||||
* @return boolean success
|
* @return boolean success
|
||||||
|
@ -10,21 +10,21 @@ import com.intellectualcrafters.plot.util.MainUtil;
|
|||||||
|
|
||||||
public class HelpPage {
|
public class HelpPage {
|
||||||
|
|
||||||
private final List<HelpObject> _helpObjecs;
|
private final List<HelpObject> helpObjects;
|
||||||
private final String _header;
|
private final String _header;
|
||||||
|
|
||||||
public HelpPage(final CommandCategory category, final int currentPage, final int maxPages) {
|
public HelpPage(final CommandCategory category, final int currentPage, final int maxPages) {
|
||||||
_helpObjecs = new ArrayList<>();
|
helpObjects = new ArrayList<>();
|
||||||
_header = C.HELP_PAGE_HEADER.s().replace("%category%", category == null ? "ALL" : category.toString()).replace("%current%", (currentPage + 1) + "").replace("%max%", (maxPages + 1) + "");
|
_header = C.HELP_PAGE_HEADER.s().replace("%category%", category == null ? "ALL" : category.toString()).replace("%current%", (currentPage + 1) + "").replace("%max%", (maxPages + 1) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(final PlotPlayer player) {
|
public void render(final PlotPlayer player) {
|
||||||
if (_helpObjecs.size() < 1) {
|
if (helpObjects.size() < 1) {
|
||||||
MainUtil.sendMessage(player, C.NOT_VALID_NUMBER, "(0)");
|
MainUtil.sendMessage(player, C.NOT_VALID_NUMBER, "(0)");
|
||||||
} else {
|
} else {
|
||||||
MainUtil.sendMessage(player, C.HELP_HEADER.s(), false);
|
MainUtil.sendMessage(player, C.HELP_HEADER.s(), false);
|
||||||
MainUtil.sendMessage(player, _header, false);
|
MainUtil.sendMessage(player, _header, false);
|
||||||
for (final HelpObject object : _helpObjecs) {
|
for (final HelpObject object : helpObjects) {
|
||||||
MainUtil.sendMessage(player, object.toString(), false);
|
MainUtil.sendMessage(player, object.toString(), false);
|
||||||
}
|
}
|
||||||
MainUtil.sendMessage(player, C.HELP_FOOTER.s(), false);
|
MainUtil.sendMessage(player, C.HELP_FOOTER.s(), false);
|
||||||
@ -32,6 +32,6 @@ public class HelpPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addHelpItem(final HelpObject object) {
|
public void addHelpItem(final HelpObject object) {
|
||||||
_helpObjecs.add(object);
|
helpObjects.add(object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ public class FancyMessage implements JsonRepresentedObject, Cloneable, Iterable<
|
|||||||
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
||||||
return this;
|
return this;
|
||||||
} catch (final InvocationTargetException e) {
|
} catch (final InvocationTargetException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "A error has occured durring invoking of method.", e);
|
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,7 +265,7 @@ public class FancyMessage implements JsonRepresentedObject, Cloneable, Iterable<
|
|||||||
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
||||||
return this;
|
return this;
|
||||||
} catch (final InvocationTargetException e) {
|
} catch (final InvocationTargetException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "A error has occured durring invoking of method.", e);
|
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -296,7 +296,7 @@ public class FancyMessage implements JsonRepresentedObject, Cloneable, Iterable<
|
|||||||
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
||||||
return this;
|
return this;
|
||||||
} catch (final InvocationTargetException e) {
|
} catch (final InvocationTargetException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "A error has occured durring invoking of method.", e);
|
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ public class FancyMessage implements JsonRepresentedObject, Cloneable, Iterable<
|
|||||||
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
|
||||||
return this;
|
return this;
|
||||||
} catch (final InvocationTargetException e) {
|
} catch (final InvocationTargetException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "A error has occured durring invoking of method.", e);
|
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -618,7 +618,7 @@ public class FancyMessage implements JsonRepresentedObject, Cloneable, Iterable<
|
|||||||
} catch (final InstantiationException e) {
|
} catch (final InstantiationException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "Underlying class is abstract.", e);
|
Bukkit.getLogger().log(Level.WARNING, "Underlying class is abstract.", e);
|
||||||
} catch (final InvocationTargetException e) {
|
} catch (final InvocationTargetException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "A error has occured durring invoking of method.", e);
|
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
|
||||||
} catch (final NoSuchMethodException e) {
|
} catch (final NoSuchMethodException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "Could not find method.", e);
|
Bukkit.getLogger().log(Level.WARNING, "Could not find method.", e);
|
||||||
} catch (final ClassNotFoundException e) {
|
} catch (final ClassNotFoundException e) {
|
||||||
|
@ -111,7 +111,7 @@ final class MessagePart implements JsonRepresentedObject, ConfigurationSerializa
|
|||||||
}
|
}
|
||||||
json.endObject();
|
json.endObject();
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
Bukkit.getLogger().log(Level.WARNING, "A problem occured during writing of JSON string", e);
|
Bukkit.getLogger().log(Level.WARNING, "A problem occurred during writing of JSON string", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,7 +548,7 @@ public class EntityWrapper {
|
|||||||
restoreLiving((LivingEntity) entity);
|
restoreLiving((LivingEntity) entity);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
// END AMEABLE //
|
// END AGEABLE //
|
||||||
case SHEEP: {
|
case SHEEP: {
|
||||||
final Sheep sheep = (Sheep) entity;
|
final Sheep sheep = (Sheep) entity;
|
||||||
if (dataByte == 1) {
|
if (dataByte == 1) {
|
||||||
|
@ -28,13 +28,13 @@ public class BukkitHybridUtils extends HybridUtils {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void analyzeRegion(final String world, final RegionWrapper region, final RunnableVal<PlotAnalysis> whenDone) {
|
public void analyzeRegion(final String world, final RegionWrapper region, final RunnableVal<PlotAnalysis> whenDone) {
|
||||||
// int diff, int variety, int verticies, int rotation, int height_sd
|
// int diff, int variety, int vertices, int rotation, int height_sd
|
||||||
/*
|
/*
|
||||||
* diff: compare to base by looping through all blocks
|
* diff: compare to base by looping through all blocks
|
||||||
* variety: add to hashset for each plotblock
|
* variety: add to HashSet for each PlotBlock
|
||||||
* height_sd: loop over all blocks and get top block
|
* height_sd: loop over all blocks and get top block
|
||||||
*
|
*
|
||||||
* verticies: store air map and compare with neighbours
|
* vertices: store air map and compare with neighbours
|
||||||
* for each block check the adjacent
|
* for each block check the adjacent
|
||||||
* - Store all blocks then go through in second loop
|
* - Store all blocks then go through in second loop
|
||||||
* - recheck each block
|
* - recheck each block
|
||||||
@ -150,7 +150,7 @@ public class BukkitHybridUtils extends HybridUtils {
|
|||||||
if (now == 0) {
|
if (now == 0) {
|
||||||
air[i]++;
|
air[i]++;
|
||||||
} else {
|
} else {
|
||||||
// check verticies
|
// check vertices
|
||||||
// modifications_adjacent
|
// modifications_adjacent
|
||||||
if ((x > 0) && (z > 0) && (y > 0) && (x < (width - 1)) && (z < (length - 1)) && (y < 255)) {
|
if ((x > 0) && (z > 0) && (y > 0) && (x < (width - 1)) && (z < (length - 1)) && (y < 255)) {
|
||||||
if (newblocks[y - 1][x][z] == 0) {
|
if (newblocks[y - 1][x][z] == 0) {
|
||||||
|
@ -93,7 +93,7 @@ public class StateWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: Move this into the spongee module!
|
* TODO: Move this into the sponge module!
|
||||||
*
|
*
|
||||||
public Map<String, Tag> serializeItem(final org.spongepowered.api.item.inventory.ItemStack item) {
|
public Map<String, Tag> serializeItem(final org.spongepowered.api.item.inventory.ItemStack item) {
|
||||||
final Map<String, Tag> data = new HashMap<String, Tag>();
|
final Map<String, Tag> data = new HashMap<String, Tag>();
|
||||||
|
Loading…
Reference in New Issue
Block a user