api-version: 1.13

name: HxMcPluginLoader
version: a0.3
author: JokerZappie
main: nl.imfi_jz.hxmcpluginloader.PluginLoader

commands:
  hxp:
    description: Help command
    usage: /help HxMcPluginLoader
  hxp plugins:
    description: List the loaded Haxe plugins
    usage: /hxp plugins
  hxp commands:
    description: List the registered commands of all Haxe plugins
    usage: /hxp commands
  hxp load:
    description: Loads and enables a specific Haxe plugin
    usage: /hxp load <plugin name>
  hxp unload:
    description: Disables and unloads a specific Haxe plugin
    usage: /hxp unload <plugin name>

#######################################################################################################################
# Changelog
#######################################################################################################################
#
# 07-02-2021: d0.1
# First test
#
# 12-02-2021: d0.2
# List loaded plugins command
# Recursively add class loader as parent per jar file
# Class loader is obtainable by extending classes
#
# 01-05-2021: d0.3
# API is automatically multi-threaded, making Asynchronizable interface redundant
# Changed haxe target from java to jvm
#
# 13-05-2021: d0.4
# Back from jvm to java (because jvm has a few breaking bugs)
# More thread safety
# Added LocalizedEnvironmentAdapter
# Inventory refactor
# Plugin adapter refactor
# Reworked CommandHandler to hopefully work properly with the loader
# Changed command prefix from hmpl to hxp
#
# 02-10-2021: d0.5
# Back to jvm
# Maybe other stuff?
# Actually back to Java :(
# JVM can not support all Haxe languages features through this loader (mainly anonymous structures don't work), since JVM relies on generated support code that is generated depending on the Haxe source code. There can not be a unified codebase.
#
# 06-01-2022: d0.6
# Added player experience level api
# 22-01-2022:
# Fixed adding recipes async
# 23-01-2022:
# Fixed ItemStackAdapter setValue and getValue not working
# Fixes to InventoryAdapter
# 04-02-2022:
# Set applyPhysics to true when changing a block's type
# 05-02-2022:
# Fixed asynchronous setValue (block data) of BlockGameObjectAdapter
#
# 11-06-2022: d0.7
# Added shared plugin memory
# Removed Thread.sleep from disable to see if that fixes disabling from getting stuck
# Updated to Spigot 1.18.2
# Now runtime is checked for available processors to determine thread pool size
# Logger messages of severities other than warning and error now display ChatColors
#
# 03-07-2022: a0.1
# Fixed some implementations in Haxe MC API
# Renamed/moved a few Haxe MC API classes/interfaces/functions
# Documented Haxe MC API
# Added EntitySpawnCategory and EntityCategory to EntityGameObjectAdapter.isA
# Implemented WorldAdapter.getMinBuildableHeight
# Made loader also check regular plugin directory for Haxe plugins (the server will throw an error for those but the loader will still load them)
# Fixed ConsoleLoggerAdapter severity mutes not having effect
# Unified namespaces of my own libraries
# Fixed race condition when multiple plugins try to register events on enable
# Playing a sound now defaults volume and pitch values to 1
# Improved available command listing
#
# 10-11-2022: a0.2
# Now compiling for Java 8 instead of 17, to increase backwards compatibility
# Changed Scale and Inventory API to match 'get' and 'set' naming convention
# Scale now has getCurrent() instead of multiplier() making it easier and more intuitive to use
# Renamed Breakable interface to Damageable and changed semantics of damage()
# damage() now takes an actual damage value instead of a scaled (0 to 1) value
# Added heal() to Damageable
# Added backwards compatibility for API changes
# Added setMax to encounter condition to set max health
# Implemented IniFiction (in Haxe) to support ini files
# Added getIniFile to FileSystemManager
# Fixed setGameMode not working
# Fixed getDataFolderPath ignoring given sub folders
# Fixed DisplayableMessage not being displayed to players
# getOtherLoadedPlugins now returns instances of the Bukkit Plugin objects, accessible as Dynamics in Haxe
# Added getOtherLoadedHaxePlugins which returns Plugin instances of other Haxe plugins loaded on this server
# Haxe plugins can now be loaded and unloaded at runtime (without server reload) with commands /hxp load <name> and /hxp unload <name>
# Added shared plugin memory access to Java plugins running on the same server. Plugins need to add the HaxePluginLoader as a dependency and can then use HaxePluginHolder.getInstance().getSharedPluginMemoryForSpigotPlugin(yourPluginInstance);
# Added interface for SemanticVersion
# Added getLoaderVersion() to Plugin, which returns the SemanticVersion of the HaxePluginLoader the plugin is loaded by
# Added asDynamic() to EventData for potentially more access to specific event methods/fields
# Fixed async error when setting a potion effect
# Fixed async error when spawning a tree
# Spawning a tree now returns the block at the location the tree was generated on
# Exceptions on opening inventories that cannot be opened are now caught
# The loader now checks for new available updates (every time it enables)
# Exceptions that happen within a response to a shared memory value change are now caught, printing the stacktrace
#
# 05-01-2023: a0.21
# Aside from IOException, IllegalAccessError is now caught when loading all jar files in the plugins directory
# The console message about how many threads are used now specifies that they are used for Haxe plugins
# The loader should no longer load classes of non-haxe plugins
# Optimized class loading (classes won't be checked in packages haxe/, sys/ and /minecraft_api/ and vanilla plugins are skipped)
# The loader now warns when a supposed Haxe plugin has no implementation of the Gate interface
# Slightly altered the way terms "GATE" and "PLUGIN" are filtered from Haxe plugin names (last occurrence instead of first)
# Events that should get cancelled are now cancelled before the "occurrence" logic is called
# PlayerMoveEvent is no longer called threaded by default and does not log a message to the console when called to improve performance and reduce console spam
# Removed underline formatting from "new version available" message
#
# 25-03-2023: a0.3
# Fixed SpawningItemFactory not able to spawn items that also exist as entity
# Small bug fixes in version checking
# Fixed ShapedRecipe not registering correctly
# Changed Recipe.getResult method signature since the game does not allow recipe result amounts more than 1. This unfortunately can not be backwards compatible since the method name is the same and Haxe does not support this kind of overloading
# Methods getValue and setValue on Item now grants access to its underlying metadata if available. This currently has only been tested successfully for changing potion types. Changing the damage value or enchantment types has not been successful, as Spigot's deserialize method for items is the weakest part of the Spigot API I have seen so far
# Looked into adding a method to execute functions on the GPU with primitive ints and doubles, using aparapi, however, the library does not seem to support my hardware so it is not included
# Updated reflections api from 0.9.12 to latest (0.10.2) and refactored related deprecated code
# Expanded the ItemFactory: aside from just the material name, it now allows you give it the same input that Minecraft's /give command accepts to create items, allowing you to create much more detailed items
# Added a timeout of 2 minutes to all threads that are run from the loader (from Haxe plugins)
# The console now displays thread priority for Haxe plugins on load (aside from thread count)
# Added Game.executeCommand(command, arguments) to allow you to let the console execute any command from your plugin's code
# Updated to Haxe 4.3.1
# A few fixes to ArrayAdaptable
# Anything Throwable is now caught in anything executed from the ThreadedExecutor, where the stacktrace will be printed. Before, anything thrown that was not an Exception would just be ignored
# Better handling of plugin enable/disable error logs
#
#######################################################################################################################
#
# Version management:
# pre-decimal = major
# post-decimal = minor
#
# prefixes:
# d = development
# a = alpha (unstable release with bugs)
# b = beta  (stable release with probable bugs)
#
#######################################################################################################################