Started work on abstract PlotManager class

This commit is contained in:
boy0001 2014-10-05 13:58:35 +11:00
parent 5f0d914b07
commit 5f787d45fa
5 changed files with 75 additions and 4 deletions

View File

@ -4,10 +4,12 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/BarAPI.jar"/> <classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/BarAPI.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/CameraAPI.jar"/> <classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/CameraAPI.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/PlotMe.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/simple-5.1.6.jar"/> <classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/simple-5.1.6.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/simple-xml.jar"/> <classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/simple-xml.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/WorldEdit.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/bukkit-1.7.9-R0.3.jar"/> <classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/bukkit-1.7.9-R0.3.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/Vault-1.4.1.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/worldguard-6.0.0-beta-02.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/WorldEdit.jar"/>
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/PlotMe.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

4
.gitignore vendored
View File

@ -11,3 +11,7 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
/bin /bin
.classpath
*.classpath
.classpath

View File

@ -0,0 +1,65 @@
package com.intellectualcrafters.plot;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
public abstract class PlotManager {
public final PlotWorld plotworld;
public PlotManager(PlotWorld plotworld) {
this.plotworld = plotworld;
}
/*
* Plot locations (methods with Abs in them will not need to consider mega plots)
*/
public abstract PlotId getPlotIdAbs(World world, Location loc);
public abstract boolean isInPlotAbs(Location loc, Plot plot);
public abstract Location getPlotBottomLocAbs(Plot plot); // If you have a circular plot, just return the corner if it were a square
public abstract Location getPlotTopLocAbs(Plot plot); // the same applies here
/*
* Plot clearing (return false if you do not support some method)
*/
public abstract boolean clearPlotAbs(Player player, Plot plot);
public abstract boolean clearSignAbs(Player player, Plot plot);
public abstract boolean clearEntitiesAbs(Player player, Plot plot);
// The function below will apply to MEGA PLOTS, return false if you don't support clearing of mega plots
// the function getPlotBottomLoc(plot) will return the bottom location of the entire mega plot
public abstract boolean clearMegaPlot(Player player, Plot plot);
/*
* Plot set functions (return false if you do not support the specific set method)
*/
public abstract boolean setWall(Player player, Plot plot, Block block);
public abstract boolean setBiome(Player player, Plot plot, Biome biome);
/*
* PLOT MERGING (return false if your generator does not support plot merging)
*/
public abstract boolean createRoadEast(Plot plot);
public abstract boolean createRoadSouth(Plot plot);
public abstract boolean createRoadSouthEast(Plot plot);
public abstract boolean removeRoadEast(Plot plot);
public abstract boolean removeRoadSouth(Plot plot);
public abstract boolean removeRoadSouthEast(Plot plot);
}

View File

@ -169,7 +169,7 @@ public class Setup extends SubCommand implements Listener {
} }
public Setup() { public Setup() {
super("setup", "plots.admin", "Setup a PlotWorld", "/plot setup {world}", "setup", CommandCategory.ACTIONS); super("setup", "plots.admin", "Setup a PlotWorld", "setup {world}", "setup", CommandCategory.ACTIONS);
} }
@Override @Override

View File

@ -1,6 +1,6 @@
name: PlotSquared name: PlotSquared
main: com.intellectualcrafters.plot.PlotMain main: com.intellectualcrafters.plot.PlotMain
version: 2.0.3 version: 2.0.5
load: STARTUP load: STARTUP
description: > description: >
Easy, yet powerful Plot World generation and management. Easy, yet powerful Plot World generation and management.