mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-08-06 04:23:26 +00:00
Weekly code cleanup
This commit is contained in:
parent
ffc7a5c7b7
commit
59be72aefe
168 changed files with 5733 additions and 3829 deletions
|
@ -21,18 +21,19 @@
|
|||
|
||||
package com.intellectualcrafters.plot.database;
|
||||
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotComment;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotComment;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
|
||||
/**
|
||||
* @author Citymonstret
|
||||
* @author Empire92
|
||||
|
@ -49,61 +50,73 @@ public interface AbstractDB {
|
|||
/**
|
||||
* Set Plot owner
|
||||
*
|
||||
* @param plot Plot in which the owner should be set
|
||||
* @param uuid The uuid of the new owner
|
||||
* @param plot
|
||||
* Plot in which the owner should be set
|
||||
* @param uuid
|
||||
* The uuid of the new owner
|
||||
*/
|
||||
public void setOwner(final Plot plot, final UUID uuid);
|
||||
|
||||
/**
|
||||
* Create all settings, and create default helpers, trusted + denied lists
|
||||
*
|
||||
* @param plots Plots for which the default table entries should be created
|
||||
* @param plots
|
||||
* Plots for which the default table entries should be created
|
||||
*/
|
||||
public void createAllSettingsAndHelpers(final ArrayList<Plot> plots);
|
||||
|
||||
/**
|
||||
* Create a plot
|
||||
*
|
||||
* @param plots Plots that should be created
|
||||
* @param plots
|
||||
* Plots that should be created
|
||||
*/
|
||||
public void createPlots(final ArrayList<Plot> plots);
|
||||
|
||||
/**
|
||||
* Create a plot
|
||||
*
|
||||
* @param plot That should be created
|
||||
* @param plot
|
||||
* That should be created
|
||||
*/
|
||||
public void createPlot(final Plot plot);
|
||||
|
||||
/**
|
||||
* Create tables
|
||||
*
|
||||
* @param database Database in which the tables will be created
|
||||
* @param database
|
||||
* Database in which the tables will be created
|
||||
*
|
||||
* @throws SQLException If the database manager is unable to create the tables
|
||||
* @throws SQLException
|
||||
* If the database manager is unable to create the tables
|
||||
*/
|
||||
public void createTables(final String database, final boolean add_constraint) throws Exception;
|
||||
|
||||
/**
|
||||
* Delete a plot
|
||||
*
|
||||
* @param plot Plot that should be deleted
|
||||
* @param plot
|
||||
* Plot that should be deleted
|
||||
*/
|
||||
public void delete(final String world, final Plot plot);
|
||||
|
||||
/**
|
||||
* Create plot settings
|
||||
*
|
||||
* @param id Plot Entry ID
|
||||
* @param plot Plot Object
|
||||
* @param id
|
||||
* Plot Entry ID
|
||||
* @param plot
|
||||
* Plot Object
|
||||
*/
|
||||
public void createPlotSettings(final int id, final Plot plot);
|
||||
|
||||
/**
|
||||
* Get the table entry ID
|
||||
*
|
||||
* @param world Which the plot is located in
|
||||
* @param id2 Plot ID
|
||||
* @param world
|
||||
* Which the plot is located in
|
||||
* @param id2
|
||||
* Plot ID
|
||||
* @return Integer = Plot Entry Id
|
||||
*/
|
||||
public int getId(final String world, final PlotId id2);
|
||||
|
@ -116,97 +129,125 @@ public interface AbstractDB {
|
|||
/**
|
||||
* Set the merged status for a plot
|
||||
*
|
||||
* @param world World in which the plot is located
|
||||
* @param plot Plot Object
|
||||
* @param merged boolean[]
|
||||
* @param world
|
||||
* World in which the plot is located
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param merged
|
||||
* boolean[]
|
||||
*/
|
||||
public void setMerged(final String world, final Plot plot, final boolean[] merged);
|
||||
|
||||
/**
|
||||
* Set plot flags
|
||||
*
|
||||
* @param world World in which the plot is located
|
||||
* @param plot Plot Object
|
||||
* @param flags flags to set (flag[])
|
||||
* @param world
|
||||
* World in which the plot is located
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param flags
|
||||
* flags to set (flag[])
|
||||
*/
|
||||
public void setFlags(final String world, final Plot plot, final Flag[] flags);
|
||||
|
||||
/**
|
||||
* Set the plot alias
|
||||
*
|
||||
* @param plot Plot for which the alias should be set
|
||||
* @param alias Plot Alias
|
||||
* @param plot
|
||||
* Plot for which the alias should be set
|
||||
* @param alias
|
||||
* Plot Alias
|
||||
*/
|
||||
public void setAlias(final String world, final Plot plot, final String alias);
|
||||
|
||||
/**
|
||||
* Purgle a plot
|
||||
*
|
||||
* @param world World in which the plot is located
|
||||
* @param id Plot ID
|
||||
* @param world
|
||||
* World in which the plot is located
|
||||
* @param id
|
||||
* Plot ID
|
||||
*/
|
||||
public void purge(final String world, final PlotId id);
|
||||
|
||||
/**
|
||||
* Purge a whole world
|
||||
*
|
||||
* @param world World in which the plots should be purged
|
||||
* @param world
|
||||
* World in which the plots should be purged
|
||||
*/
|
||||
public void purge(final String world);
|
||||
|
||||
/**
|
||||
* Set Plot Home Position
|
||||
* @param plot Plot Object
|
||||
* @param position Plot Home Position
|
||||
*
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param position
|
||||
* Plot Home Position
|
||||
*/
|
||||
public void setPosition(final String world, final Plot plot, final String position);
|
||||
|
||||
/**
|
||||
* @param id Plot Entry ID
|
||||
* @param id
|
||||
* Plot Entry ID
|
||||
* @return Plot Settings
|
||||
*/
|
||||
public HashMap<String, Object> getSettings(final int id);
|
||||
|
||||
/**
|
||||
* @param plot Plot Object
|
||||
* @param player Player that should be removed
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param player
|
||||
* Player that should be removed
|
||||
*/
|
||||
public void removeHelper(final String world, final Plot plot, final OfflinePlayer player);
|
||||
|
||||
/**
|
||||
* @param plot Plot Object
|
||||
* @param player Player that should be removed
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param player
|
||||
* Player that should be removed
|
||||
*/
|
||||
public void removeTrusted(final String world, final Plot plot, final OfflinePlayer player);
|
||||
|
||||
/**
|
||||
* @param plot Plot Object
|
||||
* @param player Player that should be removed
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param player
|
||||
* Player that should be removed
|
||||
*/
|
||||
public void setHelper(final String world, final Plot plot, final OfflinePlayer player);
|
||||
|
||||
/**
|
||||
* @param plot Plot Object
|
||||
* @param player Player that should be added
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param player
|
||||
* Player that should be added
|
||||
*/
|
||||
public void setTrusted(final String world, final Plot plot, final OfflinePlayer player);
|
||||
|
||||
/**
|
||||
* @param plot Plot Object
|
||||
* @param player Player that should be added
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param player
|
||||
* Player that should be added
|
||||
*/
|
||||
public void removeDenied(final String world, final Plot plot, final OfflinePlayer player);
|
||||
|
||||
/**
|
||||
* @param plot Plot Object
|
||||
* @param player Player that should be added
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param player
|
||||
* Player that should be added
|
||||
*/
|
||||
public void setDenied(final String world, final Plot plot, final OfflinePlayer player);
|
||||
|
||||
/**
|
||||
* Get Plots ratings
|
||||
*
|
||||
* @param plot Plot Object
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @return Plot Ratings (pre-calculated)
|
||||
*/
|
||||
public double getRatings(final Plot plot);
|
||||
|
@ -214,27 +255,36 @@ public interface AbstractDB {
|
|||
/**
|
||||
* Remove a plot comment
|
||||
*
|
||||
* @param world World in which the plot is located
|
||||
* @param plot Plot Object
|
||||
* @param comment Comment to remove
|
||||
* @param world
|
||||
* World in which the plot is located
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param comment
|
||||
* Comment to remove
|
||||
*/
|
||||
public void removeComment(final String world, final Plot plot, final PlotComment comment);
|
||||
|
||||
/**
|
||||
* Set a plot comment
|
||||
*
|
||||
* @param world World in which the plot is located
|
||||
* @param plot Plot Object
|
||||
* @param comment Comment to add
|
||||
* @param world
|
||||
* World in which the plot is located
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param comment
|
||||
* Comment to add
|
||||
*/
|
||||
public void setComment(final String world, final Plot plot, final PlotComment comment);
|
||||
|
||||
/**
|
||||
* Get Plot Comments
|
||||
*
|
||||
* @param world World in which the plot is located
|
||||
* @param plot Plot Object
|
||||
* @param tier Comment Tier
|
||||
* @param world
|
||||
* World in which the plot is located
|
||||
* @param plot
|
||||
* Plot Object
|
||||
* @param tier
|
||||
* Comment Tier
|
||||
* @return Plot Comments within the specified tier
|
||||
*/
|
||||
public ArrayList<PlotComment> getComments(final String world, final Plot plot, final int tier);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue