mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-08-06 12:33:08 +00:00
158 lines
4 KiB
Java
158 lines
4 KiB
Java
/*
|
|
* Copyright (c) IntellectualCrafters - 2014. You are not allowed to distribute
|
|
* and/or monetize any of our intellectual property. IntellectualCrafters is not
|
|
* affiliated with Mojang AB. Minecraft is a trademark of Mojang AB.
|
|
*
|
|
* >> File = DBFunc.java >> Generated by: Citymonstret at 2014-08-09 01:43
|
|
*/
|
|
|
|
package com.intellectualcrafters.plot.database;
|
|
|
|
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;
|
|
import com.intellectualcrafters.plot.Plot;
|
|
import com.intellectualcrafters.plot.PlotComment;
|
|
import com.intellectualcrafters.plot.PlotId;
|
|
|
|
/**
|
|
* @author Citymonstret
|
|
*/
|
|
public abstract class AbstractDB {
|
|
|
|
// TODO MongoDB @Brandon
|
|
|
|
/**
|
|
* Set Plot owner
|
|
*
|
|
* @param plot
|
|
* @param uuid
|
|
*/
|
|
public abstract void setOwner(final Plot plot, final UUID uuid);
|
|
|
|
public abstract void createAllSettingsAndHelpers(final ArrayList<Plot> plots);
|
|
|
|
/**
|
|
* Create a plot
|
|
*
|
|
* @param plots
|
|
*/
|
|
public abstract void createPlots(final ArrayList<Plot> plots);
|
|
|
|
/**
|
|
* Create a plot
|
|
*
|
|
* @param plot
|
|
*/
|
|
public abstract void createPlot(final Plot plot);
|
|
|
|
/**
|
|
* Create tables
|
|
*
|
|
* @throws SQLException
|
|
*/
|
|
public abstract void createTables(final String database, final boolean add_constraint) throws Exception;
|
|
|
|
/**
|
|
* Delete a plot
|
|
*
|
|
* @param plot
|
|
*/
|
|
public abstract void delete(final String world, final Plot plot);
|
|
|
|
/**
|
|
* Create plot settings
|
|
*
|
|
* @param id
|
|
* @param plot
|
|
*/
|
|
public abstract void createPlotSettings(final int id, final Plot plot);
|
|
|
|
public abstract int getId(final String world, final PlotId id2);
|
|
|
|
/**
|
|
* @return
|
|
*/
|
|
public abstract LinkedHashMap<String, HashMap<PlotId, Plot>> getPlots();
|
|
|
|
public abstract void setMerged(final String world, final Plot plot, final boolean[] merged);
|
|
|
|
public abstract void setFlags(final String world, final Plot plot, final Flag[] flags);
|
|
|
|
/**
|
|
* @param plot
|
|
* @param alias
|
|
*/
|
|
public abstract void setAlias(final String world, final Plot plot, final String alias);
|
|
|
|
public abstract void purge(final String world, final PlotId id);
|
|
|
|
public abstract void purge(final String world);
|
|
|
|
/**
|
|
* @param plot
|
|
* @param position
|
|
*/
|
|
public abstract void setPosition(final String world, final Plot plot, final String position);
|
|
|
|
/**
|
|
* @param id
|
|
* @return
|
|
*/
|
|
public abstract HashMap<String, Object> getSettings(final int id);
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public UUID everyone = UUID.fromString("1-1-3-3-7");
|
|
|
|
/**
|
|
* @param plot
|
|
* @param player
|
|
*/
|
|
public abstract void removeHelper(final String world, final Plot plot, final OfflinePlayer player);
|
|
|
|
/**
|
|
* @param plot
|
|
* @param player
|
|
*/
|
|
public abstract void removeTrusted(final String world, final Plot plot, final OfflinePlayer player);
|
|
|
|
/**
|
|
* @param plot
|
|
* @param player
|
|
*/
|
|
public abstract void setHelper(final String world, final Plot plot, final OfflinePlayer player);
|
|
|
|
/**
|
|
* @param plot
|
|
* @param player
|
|
*/
|
|
public abstract void setTrusted(final String world, final Plot plot, final OfflinePlayer player);
|
|
|
|
/**
|
|
* @param plot
|
|
* @param player
|
|
*/
|
|
public abstract void removeDenied(final String world, final Plot plot, final OfflinePlayer player);
|
|
|
|
/**
|
|
* @param plot
|
|
* @param player
|
|
*/
|
|
public abstract void setDenied(final String world, final Plot plot, final OfflinePlayer player);
|
|
|
|
public abstract double getRatings(final Plot plot);
|
|
|
|
public abstract void removeComment(final String world, final Plot plot, final PlotComment comment);
|
|
|
|
public abstract void setComment(final String world, final Plot plot, final PlotComment comment);
|
|
|
|
public abstract ArrayList<PlotComment> getComments(final String world, final Plot plot, final int tier);
|
|
}
|