Javadocs, cleanup, extension's client rules, built-in BundledModules generators, etc (#544)
* Add javadocs to many methods * Added built-in ways to generate BundledModules and documented them * Add Eclipse launch files to .gitignore and fix 11 warnings * Remove many unused imports * Remove some dead and unused code around app loading * Allow extensions to have client-side rules in their SettingsManager Also change tabs to spaces when those changed * Remove unnecessary classloader param in BundledModule * Change max tickwarp duration to Integer.MAX_VALUE * Move RulePrinter into the source so it can be managed by the IDE * Properly reset hopperCounters when changing worlds Also change tabs to spaces again and minor tweaks to javadocs * Run mergedocs even if Full.md was modified * Update src/main/java/carpet/commands/TickCommand.java Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
This commit is contained in:
1 parent
f444fab183
commit
ba1071a8d1
35 files changed
+315
-91
No files matched your search
@@ -20,50 +20,104 @@ public interface CarpetExtension
|
||||
* Runs once per loaded world once the server / gamerules etc are fully loaded
|
||||
* but before worlds are loaded
|
||||
* Can be loaded multiple times in SinglePlayer
|
||||
*
|
||||
* @param server The {@link MinecraftServer} instance that loaded
|
||||
*/
|
||||
default void onServerLoaded(MinecraftServer server) {}
|
||||
|
||||
/**
|
||||
* Runs once per loaded world once the World files are fully loaded
|
||||
* Can be loaded multiple times in SinglePlayer
|
||||
*
|
||||
* @param server The current {@link MinecraftServer} instance
|
||||
*
|
||||
*/
|
||||
default void onServerLoadedWorlds(MinecraftServer server) {}
|
||||
|
||||
/**
|
||||
* Runs once per game tick, as a first thing in the tick
|
||||
*
|
||||
* @param server The current {@link MinecraftServer} instance
|
||||
*
|
||||
*/
|
||||
default void onTick(MinecraftServer server) {}
|
||||
|
||||
/**
|
||||
* Register your own commands right after vanilla commands are added
|
||||
* If that matters for you
|
||||
*
|
||||
* @param dispatcher The current {@link CommandSource<ServerCommandSource>} dispatcher
|
||||
* where you should register your commands
|
||||
*
|
||||
*/
|
||||
default void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher) {}
|
||||
|
||||
/**
|
||||
* Provide your own custom settings manager managed in the same way as base /carpet
|
||||
* command, but separated to its own command as defined in SettingsManager.
|
||||
*
|
||||
* @return Your custom {@link SettingsManager} instance to be managed by Carpet
|
||||
*
|
||||
*/
|
||||
default SettingsManager customSettingsManager() {return null;}
|
||||
|
||||
/**
|
||||
* todiddalidoo
|
||||
* Event that gets called when a player logs in
|
||||
*
|
||||
* @param player The {@link ServerPlayerEntity} that logged in
|
||||
*
|
||||
*/
|
||||
default void onPlayerLoggedIn(ServerPlayerEntity player) {}
|
||||
|
||||
/**
|
||||
* todiddalidoo
|
||||
* Event that gets called when a player logs out
|
||||
*
|
||||
* @param player The {@link ServerPlayerEntity} that logged out
|
||||
*
|
||||
*/
|
||||
default void onPlayerLoggedOut(ServerPlayerEntity player) {}
|
||||
|
||||
/**
|
||||
* Event that gets called when the server closes.
|
||||
* Can be called multiple times in singleplayer
|
||||
*
|
||||
* @param server The {@link MinecraftServer} that is closing
|
||||
*
|
||||
*/
|
||||
default void onServerClosed(MinecraftServer server) {}
|
||||
|
||||
/**
|
||||
* Event that gets called when the server reloads (usually
|
||||
* when running the /reload command)
|
||||
*
|
||||
* @param server The {@link MinecraftServer} that is reloading
|
||||
*
|
||||
*/
|
||||
default void onReload(MinecraftServer server) {}
|
||||
|
||||
/**
|
||||
* Event that gets called when a player logs in
|
||||
*
|
||||
* @return A {@link String} usually being the extension's id
|
||||
*
|
||||
*/
|
||||
default String version() {return null;}
|
||||
|
||||
/**
|
||||
* Called when registering custom loggers
|
||||
*
|
||||
*/
|
||||
default void registerLoggers() {}
|
||||
|
||||
/**
|
||||
* Method for Carpet to get the translations for extension's
|
||||
* rules.
|
||||
*
|
||||
* @param lang A {@link String} being the language id selected by the user
|
||||
* @return A {@link Map<String, String>} containing the string key with it's
|
||||
* respective translation {@link String} or {@link null} if not available
|
||||
*
|
||||
*/
|
||||
default Map<String, String> canHasTranslations(String lang) { return null;}
|
||||
|
||||
/**
|
||||
@@ -79,7 +133,7 @@ public interface CarpetExtension
|
||||
*
|
||||
* EntityEventsGroup.Event class: to handle `entity_event('foo', ...)` type of events
|
||||
*
|
||||
* @param expression: Passed CarpetExpression to add built-in functions to
|
||||
* @param expression Passed {@link CarpetExpression} to add built-in functions to
|
||||
*/
|
||||
default void scarpetApi(CarpetExpression expression) {}
|
||||
|
||||
|
||||
Reference in new issue
Block a user