Package com.plotsquared.core.database
Interface AbstractDB
- All Known Implementing Classes:
SQLManager
public interface AbstractDB
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPersistentMeta(UUID uuid, String key, byte[] meta, boolean delete) voidclearInbox(Plot plot, String inbox) Clears the specified inbox on the given plot.voidclose()Closes the database.booleanvoidcreateCluster(PlotCluster cluster) voidcreatePlotAndSettings(Plot plot, Runnable whenDone) voidcreatePlotSafe(Plot plot, Runnable success, Runnable failure) Creates a plot.voidcreatePlotsAndData(List<Plot> plots, Runnable whenDone) Creates all settings, and create default helpers, trusted + denied lists.voidcreatePlotSettings(int id, Plot plot) Creates the plot settings.voidCreate tables.voidDeletes a plot.voiddelete(PlotCluster cluster) voiddeleteComments(Plot plot) Deletes all comments from the plot.voiddeleteDenied(Plot plot) Removes all denied players from the plot.voiddeleteHelpers(Plot plot) voiddeleteRatings(Plot plot) voiddeleteSettings(Plot plot) booleanDon't use this method unless you want to ruin someone's server.voiddeleteTrusted(Plot plot) intgetClusterId(PlotCluster cluster) Gets the id of a given plot cluster.voidgetComments(@NonNull Plot plot, String inbox, RunnableVal<List<PlotComment>> whenDone) Gets Plot comments.intGets the table entry ID.voidgetPersistentMeta(UUID uuid, RunnableVal<Map<String, byte[]>> result) getPlots()getRatings(Plot plot) Gets the ratings from the specified plot.voidvoidPurges a whole world.voidPurges a plot.voidremoveComment(Plot plot, PlotComment comment) Removes the specified comment from the given plot.voidremoveDenied(Plot plot, UUID uuid) Removes the specified player from the denied list of the specified plot.voidremoveFlag(Plot plot, PlotFlag<?, ?> flag) Remove a plot flag.voidremoveHelper(PlotCluster cluster, UUID uuid) voidremoveInvited(PlotCluster cluster, UUID uuid) voidremoveMember(Plot plot, UUID uuid) voidremovePersistentMeta(UUID uuid, String key) voidremoveTrusted(Plot plot, UUID uuid) Remove the specified player from the trust list of the specified plot.voidreplaceUUID(UUID old, UUID now) Replaces a old uuid with a new one in the database.voidreplaceWorld(String oldWorld, String newWorld, PlotId min, PlotId max) voidresizeCluster(PlotCluster current, PlotId min, PlotId max) voidSets the plot alias.voidsetClusterName(PlotCluster cluster, String name) Renames a cluster to the given name.voidsetComment(Plot plot, PlotComment comment) Adds the specified comment to the given plot.voidDenies the specified player from the given plot.voidSets plot flag.voidsetHelper(PlotCluster cluster, UUID uuid) voidsetInvited(PlotCluster cluster, UUID uuid) voidvoidSets the merged status for a plot.voidSets Plot owner.voidsetPosition(PlotCluster cluster, String position) voidsetPosition(Plot plot, String position) Sets the plot home position.voidSets a rating for a plot.voidsetTrusted(Plot plot, UUID uuid) Swaps the settings, helpers etc.voidupdateTables(int[] oldVersion) voidvalidateAllPlots(Set<Plot> toValidate)
-
Field Details
-
everyone
The UUID that will count as EVERYONE.
-
-
Method Details
-
setOwner
Sets Plot owner.- Parameters:
plot- the plotuuid- the uuid of the new owner
-
createPlotsAndData
Creates all settings, and create default helpers, trusted + denied lists.- Parameters:
plots- Plots for which the default table entries should be createdwhenDone- the task to run when the method is finished executing
-
createPlotSafe
Creates a plot.- Parameters:
plot- the plot to create
-
createTables
Create tables.- Throws:
Exception- If the database manager is unable to create the tables
-
delete
Deletes a plot.- Parameters:
plot- the plot to delete
-
deleteSettings
-
deleteHelpers
-
deleteTrusted
-
deleteDenied
Removes all denied players from the plot.- Parameters:
plot- the plot
-
deleteComments
Deletes all comments from the plot.- Parameters:
plot- the plot
-
deleteRatings
-
delete
-
addPersistentMeta
-
removePersistentMeta
-
getPersistentMeta
-
createPlotSettings
Creates the plot settings.- Parameters:
id- the plot entry idplot- the plot
-
getId
Gets the table entry ID.- Parameters:
plot- the plot- Returns:
Integer= Plot Entry Id
-
getClusterId
Gets the id of a given plot cluster.- Parameters:
cluster- PlotCluster Object- Returns:
- Integer = Cluster Entry Id
-
convertFlags
boolean convertFlags() -
getPlots
- Returns:
- A linked HashMap containing all plots
-
validateAllPlots
- Parameters:
toValidate-
-
getClusters
- Returns:
- A HashMap containing all plot clusters
-
setMerged
Sets the merged status for a plot.- Parameters:
plot- The plot to set the merged status ofmerged- boolean[]
-
swapPlots
Swaps the settings, helpers etc. of two plots.- Parameters:
plot1- Plot1plot2- Plot2
-
setFlag
Sets plot flag.- Parameters:
plot- Plot Objectflag- Flag to set
-
removeFlag
Remove a plot flag.- Parameters:
plot- Plot Objectflag- Flag to remove
-
setClusterName
Renames a cluster to the given name.- Parameters:
cluster- the cluster to renamename- the new cluster name
-
setAlias
Sets the plot alias.- Parameters:
plot- Plot for which the alias should be setalias- Plot Alias
-
purgeIds
Purges a plot.- Parameters:
uniqueIds- list of plot id (db) to be purged
-
purge
Purges a whole world. -
setPosition
Sets the plot home position.- Parameters:
plot- the plotposition- the position of plot home
-
setPosition
- Parameters:
cluster-position-
-
removeTrusted
Remove the specified player from the trust list of the specified plot.- Parameters:
plot- the plotuuid- the uuid of the player to remove
-
removeHelper
- Parameters:
cluster- PlotCluster Objectuuid- Player that should be removed
-
removeMember
- Parameters:
plot- the plotuuid- Player that should be removed
-
removeInvited
- Parameters:
cluster-uuid-
-
setTrusted
- Parameters:
plot- Plot Objectuuid- Player that should be removed
-
setHelper
- Parameters:
cluster- PlotCluster Objectuuid- Player that should be removed
-
setMember
- Parameters:
plot- Plot Objectuuid- Player that should be added
-
setInvited
- Parameters:
cluster-uuid-
-
removeDenied
Removes the specified player from the denied list of the specified plot.- Parameters:
plot- the plotuuid- the uuid of the player to remove
-
setDenied
Denies the specified player from the given plot.- Parameters:
plot- the plotuuid- the uuid of the player to deny
-
getRatings
Gets the ratings from the specified plot.- Parameters:
plot- the plot- Returns:
- the plot ratings (pre-calculated)
-
setRating
Sets a rating for a plot.- Parameters:
plot-rater-value-
-
removeComment
Removes the specified comment from the given plot.- Parameters:
plot- the plotcomment- the comment to remove
-
clearInbox
Clears the specified inbox on the given plot.- Parameters:
plot- the plotinbox- the inbox to clear
-
setComment
Adds the specified comment to the given plot.- Parameters:
plot- the plotcomment- the comment to add
-
getComments
Gets Plot comments.- Parameters:
plot- The Plot to get comments from
-
createPlotAndSettings
-
createCluster
-
resizeCluster
-
movePlot
-
replaceUUID
Replaces a old uuid with a new one in the database.- Useful for replacing a few uuids (not the entire database).
- or entire conversion, the uuidconvert command scales better.
- Parameters:
old-now-
-
deleteTables
boolean deleteTables()Don't use this method unless you want to ruin someone's server.- Returns:
trueif the tables were deleted,falsewhen an error is encountered
-
close
void close()Closes the database. Generally not recommended to be used by add-ons. -
replaceWorld
-
updateTables
-