PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java

201 lines
4.6 KiB
Java
Raw Normal View History

2015-02-19 07:08:15 +01:00
package com.intellectualcrafters.plot;
2015-06-05 16:08:16 +02:00
import com.intellectualcrafters.plot.config.C;
2015-02-22 14:20:41 +01:00
import com.intellectualcrafters.plot.generator.HybridUtils;
2015-07-26 20:46:24 +02:00
import com.intellectualcrafters.plot.generator.PlotGenerator;
2015-04-09 07:41:14 +02:00
import com.intellectualcrafters.plot.object.PlotPlayer;
2015-07-27 19:50:04 +02:00
import com.intellectualcrafters.plot.util.*;
import com.plotsquared.bukkit.listeners.APlotListener;
2015-07-26 16:51:12 +02:00
import com.plotsquared.bukkit.util.SetupUtils;
2015-07-27 19:50:04 +02:00
import java.io.File;
import java.util.UUID;
2015-02-19 07:08:15 +01:00
public interface IPlotMain {
2015-07-28 08:06:19 +02:00
/**
* Log a message to console
* @param message
*/
2015-07-27 19:50:04 +02:00
void log(String message);
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the `PlotSquared` directory (e.g. /plugins/PlotSquared or /mods/PlotSquared)
* @return
*/
2015-07-27 19:50:04 +02:00
File getDirectory();
2015-07-28 08:06:19 +02:00
/**
* Disable the implementation
* - If a full disable isn't feasibly, just disable what it can
*/
2015-07-27 19:50:04 +02:00
void disable();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the version of the PlotSquared being used
* @return
*/
2015-07-27 19:50:04 +02:00
int[] getPluginVersion();
2015-07-26 17:08:06 +02:00
2015-07-28 08:06:19 +02:00
/**
* Get the version of Minecraft that is running
* (used to check what protocols and such are supported)
* @return
*/
2015-07-27 19:50:04 +02:00
int[] getServerVersion();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* The task manager will run and manage minecraft tasks
* @return
*/
2015-07-27 19:50:04 +02:00
TaskManager getTaskManager();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Run the task that will kill road mobs
*/
2015-07-27 19:50:04 +02:00
void runEntityTask();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Register the implementation specific commands
*/
2015-07-27 19:50:04 +02:00
void registerCommands();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Register the protection system (used to protect blocks and such)
*/
2015-07-27 19:50:04 +02:00
void registerPlayerEvents();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Register inventory related events (used for inventory guis)
*/
2015-07-27 19:50:04 +02:00
void registerInventoryEvents();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Register plot plus related events (whatever these are?)
*/
2015-07-27 19:50:04 +02:00
void registerPlotPlusEvents();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Register force field events (why is this a thing?)
*/
2015-07-27 19:50:04 +02:00
void registerForceFieldEvents();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Register the WorldEdit hook
*/
2015-07-27 19:50:04 +02:00
void registerWorldEditEvents();
2015-04-01 10:25:58 +02:00
2015-07-28 08:06:19 +02:00
/**
* Register TNT related events (if TNT protection is enabled)
*/
2015-07-27 19:50:04 +02:00
void registerTNTListener();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the economy provider
* @return
*/
2015-07-27 19:50:04 +02:00
EconHandler getEconomyHandler();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the block manager
* @return
*/
2015-07-27 19:50:04 +02:00
BlockManager initBlockManager();
2015-02-23 06:29:45 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the EventUtil class
* @return
*/
2015-07-27 19:50:04 +02:00
EventUtil initEventUtil();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the chunk manager
* @return
*/
2015-07-27 19:50:04 +02:00
ChunkManager initChunkManager();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the setuputils class (used for world creation)
* @return
*/
2015-07-27 19:50:04 +02:00
SetupUtils initSetupUtils();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get HybridUtils class (common functions useful for hybrid world generation)
* @return
*/
2015-07-27 19:50:04 +02:00
HybridUtils initHybridUtils();
2015-07-28 08:06:19 +02:00
/**
* Start the metrics task
*/
void startMetrics();
/**
* If a world is already loaded, set the generator (use NMS if required)
* @param world
*/
void setGenerator(String world);
/**
* Get the UUIDHandlerImplementation which will cache and provide UUIDs
* @return
*/
2015-07-27 19:50:04 +02:00
UUIDHandlerImplementation initUUIDHandler();
2015-07-28 08:06:19 +02:00
/**
* Get the InventoryUtil class (used for implementation specific inventory guis)
* @return
*/
2015-07-27 19:50:04 +02:00
InventoryUtil initInventoryUtil();
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Run the converter for the implementation (not necessarily PlotMe, just any plugin that we can convert from)
* @return
*/
2015-07-27 19:50:04 +02:00
boolean initPlotMeConverter();
2015-04-09 07:41:14 +02:00
2015-07-28 08:06:19 +02:00
/**
* Unregister a PlotPlayer from cache e.g. if they have logged off
* @param player
*/
2015-07-27 19:50:04 +02:00
void unregister(PlotPlayer player);
2015-02-23 02:32:27 +01:00
2015-07-28 08:06:19 +02:00
/**
* Get the generator wrapper for a world (world) and generator (name)
* @param world
* @param name
* @return
*/
2015-07-27 19:50:04 +02:00
PlotGenerator<?> getGenerator(String world, String name);
2015-04-26 08:29:58 +02:00
2015-07-28 08:06:19 +02:00
/**
* Get the PlotListener class for this implementation
* (We should try to make this generic so we don't need this)
* @return
*/
2015-07-27 19:50:04 +02:00
APlotListener initPlotListener();
2015-04-26 08:29:58 +02:00
2015-07-28 08:06:19 +02:00
/**
* Register the chunk processor which will clean out chunks that have too many blockstates or entities
*/
2015-07-27 19:50:04 +02:00
void registerChunkProcessor();
2015-04-26 08:29:58 +02:00
2015-07-28 08:06:19 +02:00
/**
* Register the world initialization events (used to keep track of worlds being generated)
*/
2015-07-27 19:50:04 +02:00
void registerWorldEvents();
2015-04-27 11:07:42 +02:00
2015-07-28 08:06:19 +02:00
/**
* This class is currently really empty, but player related stuff can go in here
* @return
*/
2015-07-27 19:50:04 +02:00
PlayerManager initPlayerManager();
2015-07-24 19:37:39 +02:00
2015-07-28 08:06:19 +02:00
/**
* Get the name of the server
* @return
*/
2015-07-27 19:50:04 +02:00
String getServerName();
2015-02-20 07:34:19 +01:00
}