2015-02-19 07:08:15 +01:00
|
|
|
package com.intellectualcrafters.plot;
|
|
|
|
|
2015-07-30 16:25:16 +02:00
|
|
|
import java.io.File;
|
|
|
|
|
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-30 16:25:16 +02:00
|
|
|
import com.intellectualcrafters.plot.util.AbstractTitle;
|
|
|
|
import com.intellectualcrafters.plot.util.BlockManager;
|
2015-08-24 18:28:32 +02:00
|
|
|
import com.intellectualcrafters.plot.util.ChatManager;
|
2015-07-30 16:25:16 +02:00
|
|
|
import com.intellectualcrafters.plot.util.ChunkManager;
|
|
|
|
import com.intellectualcrafters.plot.util.EconHandler;
|
|
|
|
import com.intellectualcrafters.plot.util.EventUtil;
|
|
|
|
import com.intellectualcrafters.plot.util.InventoryUtil;
|
|
|
|
import com.intellectualcrafters.plot.util.SchematicHandler;
|
|
|
|
import com.intellectualcrafters.plot.util.SetupUtils;
|
|
|
|
import com.intellectualcrafters.plot.util.TaskManager;
|
|
|
|
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
|
2015-02-19 07:08:15 +01:00
|
|
|
|
2015-09-11 12:09:22 +02:00
|
|
|
public interface IPlotMain
|
|
|
|
{
|
|
|
|
|
2015-07-28 08:06:19 +02:00
|
|
|
/**
|
|
|
|
* Log a message to console
|
|
|
|
* @param message
|
|
|
|
*/
|
2015-09-11 12:09:22 +02:00
|
|
|
void log(final 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-09-11 12:09:22 +02:00
|
|
|
|
2015-09-10 07:34:41 +02:00
|
|
|
/**
|
|
|
|
* Get the directory containing all the worlds
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
File getWorldContainer();
|
2015-07-06 11:38:37 +02:00
|
|
|
|
2015-07-30 19:24:01 +02:00
|
|
|
/**
|
|
|
|
* Wrap a player into a PlotPlayer object
|
|
|
|
* @param obj
|
|
|
|
* @return
|
|
|
|
*/
|
2015-09-11 12:09:22 +02:00
|
|
|
PlotPlayer wrapPlayer(final Object obj);
|
|
|
|
|
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-09-11 12:09:22 +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-09-11 12:09:22 +02:00
|
|
|
|
2015-08-03 20:20:04 +02:00
|
|
|
/**
|
|
|
|
* Get the nms package prefix
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
String getNMSPackage();
|
2015-09-11 12:09:22 +02:00
|
|
|
|
2015-07-30 16:25:16 +02:00
|
|
|
/**
|
|
|
|
* Get the schematic handler
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
SchematicHandler initSchematicHandler();
|
2015-09-11 12:09:22 +02:00
|
|
|
|
2015-08-24 18:28:32 +02:00
|
|
|
/**
|
|
|
|
* Get the schematic handler
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
ChatManager initChatManager();
|
2015-09-11 12:09:22 +02: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-09-07 14:17:48 +02:00
|
|
|
boolean initWorldEdit();
|
2015-09-11 12:09:22 +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-09-11 12:09:22 +02: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-09-11 12:09:22 +02:00
|
|
|
|
2015-07-28 08:06:19 +02:00
|
|
|
/**
|
|
|
|
* Start the metrics task
|
|
|
|
*/
|
|
|
|
void startMetrics();
|
2015-09-11 12:09:22 +02:00
|
|
|
|
2015-07-28 08:06:19 +02:00
|
|
|
/**
|
|
|
|
* If a world is already loaded, set the generator (use NMS if required)
|
|
|
|
* @param world
|
|
|
|
*/
|
2015-09-11 12:09:22 +02:00
|
|
|
void setGenerator(final String world);
|
2015-07-28 08:06:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the UUIDHandlerImplementation which will cache and provide UUIDs
|
|
|
|
* @return
|
|
|
|
*/
|
2015-07-27 19:50:04 +02:00
|
|
|
UUIDHandlerImplementation initUUIDHandler();
|
2015-09-11 12:09:22 +02:00
|
|
|
|
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-09-11 12:09:22 +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-09-11 12:09:22 +02:00
|
|
|
void unregister(final 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-09-11 12:09:22 +02:00
|
|
|
PlotGenerator<?> getGenerator(final String world, final String name);
|
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
|
|
|
/**
|
2015-07-30 16:25:16 +02:00
|
|
|
* Get the name of the server
|
2015-07-28 08:06:19 +02:00
|
|
|
* @return
|
|
|
|
*/
|
2015-07-30 16:25:16 +02:00
|
|
|
String getServerName();
|
2015-09-11 12:09:22 +02:00
|
|
|
|
2015-07-28 08:06:19 +02:00
|
|
|
/**
|
2015-07-30 16:25:16 +02:00
|
|
|
* Get the class that will manage player titles
|
2015-07-28 08:06:19 +02:00
|
|
|
* @return
|
|
|
|
*/
|
2015-07-30 16:25:16 +02:00
|
|
|
AbstractTitle initTitleManager();
|
2015-02-20 07:34:19 +01:00
|
|
|
}
|