BlocklyNukkit —— Efficient plugin development framework

BlocklyNukkit —— Efficient plugin development framework 1.2.9.11

1.2.8.2:
Fix bugs
-Fixed the problem of bnnpc and BN floating words disappearing
New features
-Now you can add a line of comment //pragma es9 at the beginning of JS code to enable es9 language features, but there will be some performance loss, and the loss is not big, so you can use it with confidence
-The bninstall command has been abandoned, and all libraries are packaged into the BN interpreter jar. This is to save memory space, which can save up to 50MB of memory space.
Two member functions are added to the Advanced menu manager of customwindowbuilder
-Custom showasetting (player P, string callback) uses this advanced form as the player's server settings page
-Custom build dropdown (string title, string inner, int index) builds a drop-down menu and specifies default options
Eventloader adds 1 event
-Chunk unload event
Six new functions for entity
-Void setplayerexp (player player, int exp) sets player experience
-Int getplayerexp (player player)
-Void setplayer explevel (player player, int LEL) sets the player level
-Int getplayerexplevel (player player) to get player level
-Void setplayer Hunter (player player, int hunger) sets the player's hunger level
-Int getplayerhunger (player player) to get player hunger
Two new functions are added in window
-Void maketipsvar (string Varname, string providercallback) creates dynamic tips plug-in variables
-Void maketips static (string Varname, string to replace) creates static tips plug-in variables
## 1.2.8.1

Entity

- BNNPC buildNPC(Position pos,String name,String skinID,int calltick,String callfunction,String attackfunction)
- void showFloatingItem(Position pos,Item item)
- void removeFloatingItem(Position pos,Item item)

windowbuilder

- Custom buildSlider(String title,double min,double max)
- Custom buildSlider(String title,double min,double max,int step)
- Custom buildSlider(String title,double min,double max,int step,double defaultvalue)
- Custom buildStepSlider(String title,String options)
- Custom buildStepSlider(String title,String options,int index)

window

- String getEventCustomVar(PlayerFormRespondedEvent event,int id,String mode)
- mode可以为input toggle dropdown slider stepslider

BNNPC

- void displaySwing()
- void setSwim(boolean swim)
- void setSwim()
- void setTickCallback(String callback)
- void setAttackCallback(String callback)

manager

- void bStats(String pluginName,String pluginVer,String authorName,int pluginid)
- void callFunction(String functionname,Object... args) --修复了错误的拼写

world

- void loadScreenTP(Player player,Position pos)
- void loadScreenTP(Player player,Position pos,int loadScreenTick)
- void clearChunk(Position pos)

EventLoader

- PlayerHeldEvent
- InventoryClickEvent
Class library manager

-Now the class library manager can install the module directly. For now, there are only Python and database modules
-Use the command bninstall module name to install the class library

window

- void setBelowName(Player player,String str)

manager

- void loadJar(String path)

world

- void setOceanGenerator(int seaLevel)

entity

- BNNPC buildNPC(Position pos,String name,String skinID)
- BNNPC buildNPC(Position pos,String name,String skinID,int calltick,String callfunction)

BNNPC

- void turnRound(double yaw)
- void headUp(double pitch)
- void setEnableAttack(boolean attack)
- void setEnableAttack()
- void setEnableHurt(boolean hurt)
- void setEnableHurt()
- void displayHurt()
- void start()
- void setEnableGravity(boolean gravity)
- void setEnableGravity()
- void setG(double newg)
- void lookAt(Position pos)
- Player getNearestPlayer()

- boolean isSneak()

- void setSneak(boolean sneak)

- void setSneak()

- void jump()

- void setJumpHigh(double j)

- void setEnableKnockBack(boolean knock)

- void setEnableKnockBack()

- void setKnockBase(double base)

- boolean canMoveTo(Position to)

- boolean findAndMove(Position to)

- void setSpeed(double s)

- void setRouteMax(int m)

- void stopMove()

- void hit(Entity entity)

bug fixed:

-Some potions of entity effect do not display problems, but there are still some potions that cannot be displayed because NK does not support it

-Error in generating void and ocean by world

-Space world configuration loss

-SSH error reporting

-Now the window manager's operation function returns itself, which can be linked directly in the code

Languages

Now you can use Python 2.7 to make plug-ins

Add full support for Python development plug-ins, just download additional py support packages to use Python plug-ins

The support for Python development plug-ins will be synchronized with JavaScript. Python and JS use the same set of BN class libraries. All the BN class libraries of JS (except Java modules) can be called directly in Python without import

Support all Python 2.7 native standard syntax and standard library, run time is the same as JS, compiled to Java bytecode run, do not worry about inefficiency

Download the python for BN support module: https://tools.blocklynukkit.com/pythonForBN.jar

After downloading, put it directly under the. / plugins / blocklynukkit folder

EventLoader

- PlayerInteractEntityEvent

- PlayerDamageByPlayerEvent

- EntityKilledByEntityEvent

- PlayerDamageByEntityEvent

- EntityKilledByEntityEvent

- EntityKilledByPlayerEvent

- PlayerRespawnEvent

window

- void setPlayerBossBar(Player player,String text,float len)

- void removePlayerBossBar(Player player)

- double getLengthOfPlayerBossBar(Player player)

- String getTextOfPlayerBossBar(Player player)

manager

- void createPermission(String per,String description,String defaultper)

- void removePermission(String per)

- boolean checkPlayerPermission(String per,Player player)

- String MD5Encryption(String str)

- String SHA1Encryption(String str)

- void createCommand(String name, String description, String callbackFunctionName, String per)

- void newCommand(String name, String description, Function jsFunction,String per)

entity

- int getNetworkID(Entity entity)

- String getIDName(Entity entity)

- void spawnEntity(String name,Position pos)

notemusic

- HornSongPlayer buildHorn(Song song, Position pos, boolean isloop, boolean isautodestroy)

- void addPlayerToHorn(HornSongPlayer SongPlayer, Player player)

- void removePlayerToHorn(HornSongPlayer SongPlayer, Player player)

- Array getPlayerInHorn(HornSongPlayer radioSongPlayer)

- void setHornStatus(HornSongPlayer radioSongPlayer, boolean isplaying)

- Song getSongInHorn(HornSongPlayer radioSongPlayer)

world

-New ocean world generator for genlevel

bug fixed

- setNameTagAlwaysVisable error


manager

- String formatJSON(String json)

-Fixed the error that the WriteFile function could not automatically create a path
Performance:

Performance optimization is carried out to force invokemethod optimization to be started when the underlying JS translates Java bytecode

Function:

For manager base objects:

New function:

String readFile(String path)

void wirteFile(String path,String text)

boolean isFileSame(String path1,String path2)

String JSONtoYAML(String json)

String YAMLtoJSON(String yaml)

void newCommand(String name, String description, Function fun)

int setTimeout(Function fun,int delay,<E+>... args)

void clearTimeout(int id)

int setInterval(Function fun,int delay,<E+>... args)

void clearInterval(int id)

void isWindows()

int getPlayerGameMode(Player player)



For JS loader:

What's new

Name indicates the name of the loaded JS file (it can prevent low-level name change and reselling)

24-hour mandatory update after new release

You can use let and const to define variables in Es5 syntax



For custom / Modal / simple window builders

New function:

- void showToPlayerCallLambda(Player p, Function fun)



For blockitem base objects:

New function:

Array<Enchantment> getItemEnchant(Item item)

int getEnchantID(Enchantment enchantment)

int getEnahcntLevel(Enchantment enchantment)



For event callers:

New event

PlayerJumpEvent

PlayerToggleFlightEvent

PlayerToggleGlideEvent

PlayerToggleSwimEvent

PlayerToggleSneakEvent

PlayerToggleSprintEvent
Sandbox isolation for each JS file runtime, namespace and cross namespace calls are added, article NBT and window default values are added.
you can use FloatingText in BlocklyNukkit now
and other new functions
many bugs fixed
now you can use http api to call javascript functions and get the retun value.
now you can compile your js plugin to jar file
We made a JavaScript IDE for BlocklyNukkit developers and users. It is very powerful!
Use it Online: BlocklyNukkit_JSEditor
Fix bugs:
fix nashorn javascript engine doesn't work on java11
New Functions:
you can use private event calls
better http server inside,you can use ip: Port/file/xxxx to download files in the folder ./plugins/BlocklyNukkit/file
better English support!
Top