
OpenJavascript
Create custom menus, commands, plugins, systems, basically anything with scripts in Javascript! With multithreading and Folia support! Everything is fully documented in the documentation!
1.1K
21
Список изменений
Alpha Build - Use at your own risk! Full release soon!
Changelog
General Fixes & Improvements
- Reviewed and fixed numerous bugs across the entire codebase.
- Added a debug mode boolean to the config for easier troubleshooting.
- Fixed a bug where reloading with the reload command would not update the debug mode boolean until a full restart.
- Fixed an issue where deleting folders inside the script folder was not possible due to the file watcher locking them.
- Removed all deprecated code and cleaned up a large portion of the codebase.
Dialog API
- Created a new DialogService for managing in-game graphical dialogs.
- Added NMS support for the Dialog API.
- Added backwards compatibility for
Inventory.setTitlevia ProtocolLib.
Task API
- Tasks are now shared across all scripts, meaning they can be cancelled from external scripts using
setSharedandgetShared. - Added
task.latch()which returns an object with the following thread-safe methods:.destroy(),.connect(function),.wait(),.invoke(),.fire(), and.Fired. - Added
task.threadType()which returns a string indicating the thread type (main,async, orsync). - Enhanced thread safety in
DelayTaskby properly handling thread interruptions.
FileManager API
- Added
FileManager.getPath(File), which returns the relative path of a file based on the script's folder. - Added support for ZIP files: any
.zipfile containing aninfo.jsonwill automatically be extracted into a folder named after the zip file. - Fixed a bug where the file watcher could receive
nullpaths, causing errors. - Improved watcher robustness by handling
OVERFLOWevents and adding a null check for the watch service when clearing listeners. This fixed many errors with the file listener, its more reliable now
ProtocolLib Integration
- Added the following new ProtocolLib methods:
broadcastServerPacket(packet, source, broadcastRange)— broadcasts a packet to nearby players.sendServerPacket(player, packet)— sends a packet directly to a specific player.createPacket(packetTypePath)— creates a packet by type path.
PlaceholderAPI
- Fixed
parseStringnot working correctly when passing an offline player as the target.
Inventory API
- Added the following new methods:
getSlot(slot)retrieves the item in a given slot.setItemLore(slot, lore)sets the lore of an item in a slot.setItemName(slot, name)sets the display name of an item in a slot.
- Fixed colors not being applied correctly in item lore.
Service Objects & Internal Refactoring
- Refactored Folia support initialisation for improved performance, including a centralised
init()method and pre-cached scheduler. - Refactored
PublicVarManager's waiting mechanism, replacing complex lock logic with a simpler and saferwait()/notifyAll()approach. - Optimised script preprocessing to read from
CODE_CACHEfirst, avoiding unnecessary disk reads. - Switched import ID generation in
importJavaToJsGCfrom random strings to anAtomicLongcounter (__import_0,__import_1, ...) for better performance. - Added player permission verification (
openjs.use) at the start ofonCommandto prevent unauthorised command execution. - Added
Array.from()support. - Created custom mappings to support Minecraft 1.13 through the current version.
- Fixed
importClass()it now correctly translates Java classes into Javascript objects - Fixed
Java.type()it can now correctly read and translate external plugin classes too! This is huge, trust me :)
Файлы
openjs-1.4.0 ALPHA.jar(2.52 MiB)
ОсновнойМетаданные
Канал релиза
Alpha
Номер версии
1.4.0a
Загрузчики
FoliaPaperPurpur
Версии игры
1.13–1.21.11
Загрузок
24
Дата публикации
3 нед. назад
