BlocklyNukkit —— Efficient plugin development framework

BlocklyNukkit —— Efficient plugin development framework 1.2.9.11

Fix compatibility with 1.18.0+
## 1.2.9.10

- Fix compatibility with 1.17.30+
- Fix custom item texture error
## 1.2.9.6
Bug Fixed
-Fixed a bug where the window callback accepts invalid window closing
Event
- AddMoneyEvent
- ReduceMoneyEvent
- SetMoneyEvent
New
-Slightly optimize JS loading performance
-Create a new file debug.inf in the core peer folder to start JS loading timing
manager
- void customEventListener(
String fulleventname, - Java class name of the event to be monitored
String callback function, - event callback function
String priority -- event priority, optional normal monitor low high
)-- dynamic monitoring events
- WsClient createWsClient(
String serverurl, - Remote WS server link
String newwsconnectcallback, - WS successfully connected callback
String closewsconnectcallback, - WS client disconnect callback
String receivestringcallback, -- received string data callback
String receivedatacallback -- non string data callback received
)-- create WS client
- WsServer createWsServer(
Int port, - port
String newwsconnectcallback, - there are new WS client connection callbacks
String closewsconnectcallback, - WS client disconnect callback
String receivestringcallback, -- received string data callback
String receivedatacallback -- non string data callback received
)-- create websocket server
-Long timing. Start() -- start timing, return timer ID, no impact on Performance
-Long timing. End (long ID) -- ends the timing and returns the nanosecond passed
-Long timing. Finish (long ID) -- ends the timing and outputs the result to the console
-Long timing.finish (string info) -- ends the last timer started and outputs the elapsed time to the console. Info will be used as the prefix of the output
blockitem
-@ comment (value = register a new simple item and allow any custom item)
Public void registersimpleitem (@ comment (value = ID of new item) int ID
, @ comment (value = name of new item) string name
, @ comment (value = maximum stack size of new items) int stacksize
, @ comment (value = category of new item, optional construction nature equipment items) string type
, @ comment (value = "show as tool (hold it upright)") Boolean isdisplayastool
, @ comment (value = whether it can be equipped in the assistant) Boolean canonoffhand
, @ comment (value = item initialization function) @ callbackfunction (classes = {"CN. Nukkit. Item. Item"}, parameters = {"self"}, comments = {"newly created item itself"}) string initfunction)
-@ comment (value = register a new tool item)
Public void registertoolitem (@ comment (value = ID of new item) int ID
, @ comment (value = name of new item) string name
, @ comment (value = tool type, which can be sword shot pickaxe hoe ") string tooltype
, @ comment (value = tool mining level 0-empty hand, 1-wood, 2-gold, 3-Stone, 4-iron, 5-diamond, 6-lower alloy) int tooltier
, @ comment (value = tool durability value) int durability
, @ comment (value = attack damage) int attackdamage
, @ comment (value = whether it can be equipped in the assistant) Boolean canonoffhand
, @ comment (value = item initialization function) @ callbackfunction (classes = {"CN. Nukkit. Item. Item"}, parameters = {"self"}, comments = {"newly created item itself"}) string initfunction)
-@ comment (value = register new food item)
Public void registerfooditem (@ comment (value = "ID of new item") int ID
, @ comment (value = name of new item) string name
, @ comment (value = maximum stack size of new items) int stacksize
, @ comment (value = hunger degree provided) int nutrition
, @ comment (value = "eating duration)") int eattime
, @ comment (value = whether it can be equipped in the assistant) Boolean canonoffhand
, @ comment (value = item initialization function) @ callbackfunction (classes = {"CN. Nukkit. Item. Item"}, parameters = {"self"}, comments = {"newly created item itself"}) string initfunction)
-@ comment (value = register a new drink item)
Public void registerdrinketem (@ comment (value = ID of new item) int ID
, @ comment (value = name of new item) string name
, @ comment (value = maximum stack size of new items) int stacksize
, @ comment (value = hunger degree provided) int nutrition
, @ comment (value = duration of drinking) "int drinktime
, @ comment (value = whether it can be equipped in the assistant) Boolean canonoffhand
, @ comment (value = item initialization function) @ callbackfunction (classes = {"CN. Nukkit. Item. Item"}, parameters = {"self"}, comments = {"newly created item itself"}) string initfunction)
-@ comment (value = register new armor item)
Public void registerarmoritem (@ comment (value = ID of new item) int ID
, @ comment (value = name of new item) string name
, @ comment (value = armor type, can be helmet chest legs boots ") string armortype
, @ comment (value = armor level 0-none, 1-leather, 2-iron, 3-chain, 4-gold, 5-diamond, 6-lower alloy) int armortier
, @ comment (value = tool durability value) int durability
, @ comment (value = armor value provided) int armorpoint
, @ comment (value = whether it can be equipped in the assistant) Boolean canonoffhand
, @ comment (value = item initialization function) @ callbackfunction (classes = {"CN. Nukkit. Item. Item"}, parameters = {"self"}, comments = {"newly created item itself"}) string initfunction)
Bug Fixed
-Fixed custom tool damage
-Fix the error of java package re import in JS
-Fix pepper store compatibility issues
-Fix the confusion of function calls with the same name in different modules
New
-Faster registration of custom items
-NPC pathfinding no longer displays path particles
blockitem
-Boolean isblockwaterlogged (block block block) -- check whether the block contains water
-Void addsoundfile (string soundname, string filename) -- add a new sound file to the material pack
-Void addarmortexture (@ comment (value = item ID ") int ID
, @ comment (value = path of material picture in armor item list) string inventorypicturepath
, @ comment (value = path of material picture when wearing armor) string modelpicturepath
, @ comment (value = (4D armor model file (. JSON), optional) string modeljsonpath)
--Add 4D model for custom armor
BNNPC
-Void start (player) -- only for one player
entity
-Routefinder builderroutefinder (entity entity) -- build pathfinder for entity
manager
-Void concurrent run (string functionname, < e + >... Args) -- runs functions in parallel
-Void jvm.close (int returncode / void) -- force to close the JVM and return the return value. It is optional. The default value is 0
-Jmemory JVM. Getmemory () -- get the JVM memory manager
-Class jvm.getjvmclass (string classname) -- get the JVM class object according to the class name
-Jclass jvm.newjvmclass (@ comment (value = Java class name)) string classname
, @ comment ("inherited from parent class name, optional") string extendfromclass / void
, @ comment ("implemented interface class name, optional") string... Interfaceclasses / void)
-Creating a new Java class constructor
JClass
- JClass addConstructor(String modifier, String proxyFunction, String... argumentClasses)
-Add constructors to new Java classes
-Modifier is a constructor modifier, such as public final, etc
-Proxyfunction is the name of the corresponding BN plug-in function. When calling, all the parameters of the constructor are passed in. The first parameter is always the class itself, and the rest are user-defined parameters
-Argumentclasses is the class name of the constructor custom parameter
-Returns itself for chain call
- JClass addField(String modifier, String fieldClass, String fieldName, Object defaultValue / void)
-Add a field (also known as a property or member variable) to a new Java class
-Modifier is a field modifier, such as public final, etc
-Fieldclass is the name of the field class
-Fieldname is the name of the field, which should comply with the Java specification
-The default value is the default value of the field, which can not be filled in. There is no default value by default, but the default value is null
-Returns itself for chain call
- JClass addMethod(String modifier, String returnClass, String methodName, String proxyFunction, String... argumentClasses)
-Add methods (also known as member functions) to new Java classes
-Modifier is a method modifier, such as public final
-Returnclass is the return value of the method. If there is no return value, fill in void
-Methodname is the method name
-Proxyfunction is the name of the corresponding BN plug-in function. When calling, all the parameters of the method are passed in. The first parameter is always the class itself, and the rest are user-defined parameters
-Argumentclasses is the class name of the constructor custom parameter
-Returns itself for chain call
- JClass finish()
-Complete the Java class construction, then the Java class can be used, and can not be changed again
-Returns itself for chain call
- Object newInstance(Object... args)
-Instantiate itself, that is, new the Java class built by itself
-It can only be used after finish!
JMemory
-Long getmax () -- get the maximum available memory size of the JVM
-Long getfree() -- gets the remaining memory size of the JVM
-Long gettotal() -- get the total memory size of the JVM
-Void GC () -- memory cleaning
RouteFinder
- Entity getEntity()
- void setSearchLimit(int searchLimit)
- int getSearchLimit()
- void setStart(Vector3 start)
- Vector3 getStart()
- void setDestination(Vector3 destination)
- Vector3 getDestination()
- void setLevel(Level level)
- Level getLevel()
- void setBoundingBox(AxisAlignedBB bb)
- AxisAlignedBB getBoundingBox()
- boolean hasNext()
- Node next()
- boolean hasReachedNode(Vector3 vec)
- Node get()
- void forceStop()
- void arrived()
- boolean hasRoute()
- boolean search()
- boolean research()
- boolean isSearching()
- boolean isSuccess()
## 1.2.9.4
New
-JS already supports for of loop
-Fixed wrong = > implementation in JS
-Add a new macro comment in JS: / / pragma optimal. After adding, BN will aggressively deduce the type of this code during loading to optimize the runtime performance
-BNP supports. Phpfile suffix
-BNP and bnpx can be loaded directly into the plugins folder
-Slightly optimize performance
-JS can directly use the full name of the class to use Java class, without introducing Java. Type or require
-Material packages are not generated repeatedly
HttpHandler
-New getrequestrawurl function in callback parameter
BNNPC
-Optimize AI algorithm to avoid NPC bug disappearing
manager
-Addcommandcompleter adds a new @ sub rule, which indicates a sub command completion option
-@ comment (value = run on powernukkit or not)
public boolean isPowerNukkit()
inventory
-@ comment (value = create a new funnel item column)
Public hopperfakeinventory addhopperinv (@ comment (value = 'included items, need to use' Java. To 'function conversion)) item [] item
,@Comment (value = item title) string name)
blockitem
-@ comment (value = register a new simple item and allow any custom item)
Public void registersimpleitem (@ comment (value = ID of new item) int ID
,@Comment (value = name of new item) string name
,@Comment (value = maximum stack size for new items) int stacksize
,@Comment (value = category of new item, optional construction nature equipment items) string type
,@Comment (value = show as tool (hold it upright) ") Boolean isdisplayastool
,@Comment (value = whether it can be equipped in the assistant) Boolean canonoff)
-@ comment (value = register a new tool item)
Public void registertoolitem (@ comment (value = ID of new item) int ID
,@Comment (value = name of new item) string name
,@Comment (value = "tool type, which can be sword shot pickaxe hoe") string tooltype
,@Comment (value = tool mining level 0-empty hand, 1-wood, 2-gold, 3-Stone, 4-iron, 5-diamond, 6-lower alloy) int tooltier
,@Comment (value = tool durability value) int durability
,@Comment (value = attack damage) int attackdamage
,@Comment (value = whether it can be equipped in the assistant) Boolean canonoff)
-@ comment (value = register new food item)
Public void registerfooditem (@ comment (value = ID of new item) int ID
,@Comment (value = name of new item) string name
,@Comment (value = maximum stack size for new items) int stacksize
,@Comment (value = supplied starvation) int nutrition
,@Comment (value = eating duration (carved))) int eattime
,@Comment (value = whether it can be equipped in the assistant) Boolean canonoff)
-@ comment (value = register a new drink item)
Public void registerdrinketem (@ comment (value = ID of new item) int ID
,@Comment (value = name of new item) string name
,@Comment (value = maximum stack size for new items) int stacksize
,@Comment (value = supplied starvation) int nutrition
,@Comment (value = "drinking duration (minutes)") int drinktime
,@Comment (value = whether it can be equipped in the assistant) Boolean canonoff)
-@ comment (value = register new armor item)
Public void registerarmoritem (@ comment (value = ID of new item) int ID
,@Comment (value = name of new item) string name
,@Comment (value = armor type, can be helmet chest legs boots ") string armortype
,@Comment (value = armor level 0-none, 1-leather, 2-iron, 3-chain, 4-gold, 5-diamond, 6-lower alloy) int armortier
,@Comment (value = tool durability value) int durability
,@Comment (value = armor value provided) int armorpoint
,@Comment (value = whether it can be equipped in the assistant) Boolean canonoff)
-@ comment (value = add new armor material)
Public void addarmortexture (@ comment (value = item ID) int ID
,@Comment (value = path of material image in armor item list) string inventorypath
,@Comment (value = path of material image when wearing armor) string modelpath)
-@ comment (value = add new material)
Public void additemtexture (@ comment (value = "item ID") int ID
,@Comment (value = material image path) string path)
-@ comment (value = add Chinese translation name for the specified ID item)
Public void additemchinesetranslation (@ comment (value = item ID) int ID)
,@Comment (value = Chinese name) string name)
-@ comment (value = add English translation name for the specified ID item)
Public void additemenglishtranslation (@ comment (value = item ID) int ID
,@Comment (value = English name) string name)
-@ comment (value = add a JSON file to the specified location in the material package)
Public void addresourcepackjsonentry (@ comment (value = relative position in material package, including path and full name of file)) string entrypath
,@Comment (value = JSON file content) string JSON)
-@ comment (value = add image file to specified location in material package)
Public void addresourcepackpictureentry (@ comment (value = relative position in material package, including path and full name of file)) string entrypath
,@Comment (value = the image path to be copied to the hard disk in the material package) string path)
world
- void defineChunkRenderAll(String callback,int priority / void)
-Add terrain render for all worlds
-Callback is the render callback function
-Priority is the priority. The higher the priority is, the higher the priority is. If it is not filled in, the default value is 0
entity
-@ comment (value = build 4D display model)
Public bnmodel buildmodel (@ comment (value = the location where the model is generated) position POS
,@Comment (value = model 4D skin ID) string modelskinid
,@Comment (value = model length) double length
,@Comment (value = model width) double width
,@Comment (value = model high) double height
,@Comment (value = model scale) double scale
,@Comment (value = timed callback function) @ callbackfunction (classes = {"com. Blocklynukkit. Loader. Other. Entities. Bnmodel", "int"}, parameters = {"model", "tick"}, comments = {"model entity executing this function", "current entity operation"}) string tickcallback
,@Comment (value = callback interval of timed callback function (engraved) ") int calltick
,@Comment (value = attacked callback function) @ callbackfunction (classes = {"com. Blocklynukkit. Loader. Other. Entities. Bnmodel", "CN. Nukkit. Event. Entity. Entitydamageevent"}, parameters = {"model", "damageevent"}, comments = {"model entity executing this function", "damage event received by entity"}) string attackcallback
,@Comment (value = entity interaction callback function) @ callbackfunction (classes = {"com. Blocklynukkit. Loader. Other. Entities. Bnmodel", "CN. Nukkit. Player", "CN. Nukkit. Item", "CN. Nukkit. Math. Vector3"}, parameters = {"model", "player", "item", "ClickPos"}, comments = {"model entity executing this function", "player initiating interaction", "item used in interaction"), "Interactive click location"}) string interactivecallback)
Bug Fixed
-Fixed BNP loader unable to load custom module name
-Fixed the problem that BN floating words can be typed
-Removed the old bnmiscbuild command
Bug Fixed
-Fixed the problem of asynchronous JSON and yaml conversion, greatly improved the conversion speed
-Arrow function can be used in JS
-JS can call Java class or other plug-ins through require (Java class name / file name)
-Fixed JS parser error parsing regular expressions in strings
-Fixed manager.doPathCreate Unable to create folder problem
-Fixed a problem with the BlackBerry collaboration API bug
-Fixed powernukkit 1.4.0. X biocompatibility issue
-NPC has default skin
Module
-Define a module by commenting the macro: pragma module module name
-After the module is defined, the exported functions in other modules can be introduced through the module name
manager
- void appendFile(String path,String text)
-Appending the contents of the written file
entity
- BNNPC buildNPC(Position pos,String name)
- void displayHurt(Entity e)
- void displayDie(Entity e)
blockitem
- void addFishingResult(String type,Item item,double chance)
-Add fishing product, type is the new product type, item is the product item, and change is the probability weight
-Type can take treasures, treasures, junks, garbage, fish, fish, both in Chinese and English
algorithm
- Position buildPosition(double x,double y,double z,Level level)
New Event
- BNInitializedEvent
-Issued after all BN plug-ins are initialized
-No member function, cannot be canceled
- BNClosedEvent
-Issued when BN is requested to be closed by NK
-No member function, cannot be canceled
- StartFishingEvent
-Issued when the player starts fishing
-Player getplayer () - returns to the fishing player
-Entityfishinghook getfishinghook() - returns the fishhook entity
-Void setcancelled (Boolean cancel / void) - sets the cancel event
-Boolean iscancelled () - whether the event is cancelled
BNPM
-Bnpm plug-in manager is added for one click installation, update and quick distribution of plug-ins
-Command:
-Bnpm install plug-in name - installs or updates the specified plug-in
-Bnpm delete plug-in name - unloads the specified plug-in
-Related links:
-Bnpm plug in center: https://wiki.blocklynukkit.com/bnpm/viewPlugin
Bugs fixed
- Fix the parameter dependence problem in entity.shootArrow()
- Fix BlockEntity cannot fall
- Reconstruct the AI architecture of BNNPC and fix the problem that BNNPC can't go pass doors
- Fix the problem of extracting the resource files in BN-plugin-packages
- More friendly debug for PHP users
- Fix PHP timeout bug
- Repair world.clearChunk()
- Fix database.localstroage.cache() error
- Fix the problem of switching to thunderstorm without rain
- Clean up some useless code
- //pragma es6 compile flag can be used in JS
- Fix the error of manager.getOnlinePlayers

new functions in particle :

- void drawDot(Position pos,int pid)
- void drawDot(Position pos,int pid,Player toPlayer)
- void drawDot(Position pos,int pid,int data)
- void drawDot(Position pos,int pid,int r,int g,int b)
- void drawDot(Position pos,int pid,int data,Player toPlayer)
- void drawDot(Position pos,int pid,int r,int g,int b,Player toPlayer)
- void drawEmitter(Position pos)
- void drawEmitter(Position pos,String id)
- void drawEmitter(Position pos,String id,Player toPlayer)
- these ids below can be used:
- minecraft:arrow_spell_emitter, minecraft:balloon_gas_particle, minecraft:basic_bubble_particle,
minecraft:basic_bubble_particle_manual, minecraft:basic_crit_particle, minecraft:basic_flame_particle,
minecraft:basic_portal_particle, minecraft:basic_smoke_particle, minecraft:bleach,
minecraft:block_destruct, minecraft:block_slide, minecraft:blue_flame_particle, minecraft:breaking_item_icon,
minecraft:breaking_item_terrain, minecraft:bubble_column_bubble, minecraft:bubble_column_down_particle,
minecraft:bubble_column_up_particle, minecraft:camera_shoot_explosion, minecraft:campfire_smoke_particle,
minecraft:campfire_tall_smoke_particle, minecraft:cauldron_spell_emitter, minecraft:cauldron_bubble_particle,
minecraft:cauldron_splash_particle, minecraft:colored_flame_particle, minecraft:conduit_particle,
minecraft:conduit_absorb_particle, minecraft:conduit_attack_emitter, minecraft:critical_hit_emitter,
minecraft:crop_growth_emitter, minecraft:dolphin_move_particle, minecraft:dragon_breath_fire, minecraft:dragon_breath_lingering,
minecraft:dragon_breath_trail, minecraft:dragon_death_explosion_emitter, minecraft:dragon_destroy_block,
minecraft:dragon_dying_explosion, minecraft:enchanting_table_particle, minecraft:endrod, minecraft:end_chest,
minecraft:elephant_tooth_paste_vapor_particle, minecraft:evocation_fang_particle, minecraft:evoker_spell,
minecraft:cauldron_explosion_emitter, minecraft:death_explosion_emitter, minecraft:egg_destroy_emitter,
minecraft:eyeofender_death_explode_particle, minecraft:misc_fire_vapor_particle, minecraft:explosion_particle,
minecraft:explosion_manual, minecraft:eye_of_ender_bubble_particle, minecraft:falling_border_dust_particle,
minecraft:falling_dust, minecraft:falling_dust_concrete_powder_particle, minecraft:falling_dust_dragon_egg_particle,
minecraft:falling_dust_gravel_particle, minecraft:falling_dust_red_sand_particle, minecraft:falling_dust_sand_particle,
minecraft:falling_dust_scaffolding_particle, minecraft:falling_dust_top_snow_particle, minecraft:fish_hook_particle,
minecraft:fish_pos_particle, minecraft:guardian_attack_particle, minecraft:guardian_water_move_particle,
minecraft:heart_particle, minecraft:honey_drip_particle, minecraft:huge_explosion_lab_misc_emitter,
minecraft:huge_explosion_emitter, minecraft:ice_evaporation_emitter, minecraft:ink_emitter, minecraft:knockback_roar_particle,
minecraft:lab_table_heatblock_dust_particle, minecraft:lab_table_misc_mystical_particle, minecraft:large_explosion,
minecraft:lava_drip_particle, minecraft:lava_particle, minecraft:llama_spit_smoke, minecraft:magnesium_salts_emitter,
minecraft:mobflame_emitter, minecraft:mobflame_single, minecraft:mobspell_emitter, minecraft:mob_block_spawn_emitter,
minecraft:mob_portal, minecraft:mycelium_dust_particle, minecraft:nectar_drip_particle, minecraft:note_particle,
minecraft:eek:bsidian_glow_dust_particle, minecraft:eek:bsidian_tear_particle, minecraft:phantom_trail_particle,
minecraft:portal_directional, minecraft:portal_east_west, minecraft:portal_north_south, minecraft:portal_reverse_particle,
minecraft:rain_splash_particle, minecraft:redstone_ore_dust_particle, minecraft:redstone_repeater_dust_particle,
minecraft:redstone_torch_dust_particle, minecraft:redstone_wire_dust_particle, minecraft:rising_border_dust_particle,
minecraft:shulker_bullet, minecraft:silverfish_grief_emitter, minecraft:soul_particle, minecraft:sparkler_emitter,
minecraft:splash_spell_emitter, minecraft:sponge_absorb_water_particle, minecraft:squid_flee_particle,
minecraft:squid_ink_bubble, minecraft:squid_move_particle, minecraft:stunned_emitter, minecraft:totem_particle,
minecraft:totem_manual, minecraft:underwater_torch_particle, minecraft:villager_angry, minecraft:villager_happy,
minecraft:water_drip_particle, minecraft:water_evaporation_actor_emitter, minecraft:water_evaporation_bucket_emitter,
minecraft:water_evaporation_manual, minecraft:water_splash_particle_manual, minecraft:water_splash_particle,
minecraft:water_wake_particle, minecraft:wither_boss_invulnerable

new functions in entity

- Entity spawnFallingBlock(Position pos, Block block, boolean enableGravity,boolean canBePlaced)
- EntityArrow shootArrow(Position from,Position to,Entity shooter,boolean canPickUp,double multiply)
- EntityArrow shootArrow(Position from,Position to,boolean canPickUp,double multiply)
- EntityArrow shootArrow(Position from,Position to,double multiply)
- EntityArrow shootArrow(Position from,Position to,boolean canPickUp)
- EntityArrow shootArrow(Position from,Position to)
- EntitySnowball shootSnowball(Position from,Position to,Entity shooter,boolean canPickUp,double multiply)
- EntitySnowball shootSnowball(Position from,Position to,boolean canPickUp,double multiply)
- EntitySnowball shootSnowball(Position from,Position to,double multiply)
- EntitySnowball shootSnowball(Position from,Position to,boolean canPickUp)
- EntitySnowball shootSnowball(Position from,Position to)

new functions in manager

- void removeCommand(String name)
- void sendMail(String smtpMailServer,String from,String to,String cc,String bcc,String subject,String content)
- \<E> syncCallFunction(String functionName,Object... args)
- void jvmGC()
- String getPlayerDeviceOS(Player player)
- boolean createHttpServer(int port)
- void startHttpServer(int port)
- boolean attachHandlerToHttpServer(int port,String path,String functionName)
- boolean attachHandlerToHttpServer(int port,String path,F function)

something about the callback functions of attachHandlerToHttpServer:

- Parameter: (HttpRequestEntry request);
- request成员函数:
- String getRequestUrl()
- String getPath()
- String getHeader()
- String getMethod()
- String getParameter()
- String getProtocol()
- String getFromAddress()
- void addResponseHeaderEntry(String name,String value)
- void addResponseHeader(String header)
- void addDefaultResponseHeader()
- void addDefaultResponseHeader(String charSet)
- boolean response(int statusCode,String content)
- boolean response(int statusCode,String content,String charSet)
- boolean response(int statusCode,byte[] content)

new functions in blockitem

- void addShapedCraft(String shape,Item output,(String key,Item value)...)
-This is a more comfortable way to add an ordered composition API. Shape is a synthetic shape string,
-Use a letter or number to represent the placement of synthetic raw materials, use "|" to connect three lines, and use spaces to occupy the space. If there is nothing in the last line or column, please do not keep it
-Output is a composite product, and the following parameters are the mapping table. Key is the character in your previous shape, and value is the item represented by this key
-There must be as many mapping parameters as there are strings in the shape
-For example, stone PICK: addshapedcraft ("SSS | I | I", stone pick item, "s", round stone item, "I", stick item)
-Worktable: addshapedcraft ("mm | mm", worktable item, "m", oak board item)
- void registerSimpleItem(int id,String name,int stackSize/void)
- If you register a simple pile of items, you can only override the education version items. Stacksize specifies the maximum number of items to be stacked, not 64
- void makeDropItem(Position position, Item item, boolean fly)
- void blockUpdate(Position position)

new funtion in BNNPC

- void reFresh()
new
Refactoring code loader code, refactoring the bnqqbot code, enhance stability, simplify interpreter
Add the function of BN plug-in package,. BNP (BN plug-in collection package) and. Bnpx (BN plug-in composite package) can be put into the blocklynukkit folder to run directly
The package can be operated by BNP command, and a BN plug-in package can be built by BNP build < makefile Path > command
Makefile is a package configuration file in JSON format, which consists of three fields: name, compress and plugins
Name is the name (string) of the packaged plug-in package, and compress is whether to compress the plug-in package (Boolean),
Plugins is a string array, which indicates the path of the BN plug-in to be typed into the package. It is loaded from top to bottom,
You can also type in the resource file in JSON YML XML TXT format, and the resource file will be decompressed sequentially to the relative position of the NK core when packaging.
You can use console in JS
Now JS plug-in error will display the correct file name
F (closure function) function is used to wrap closure
The; newline in bnapi now supports the use of \ \; to escape
Fixed the problem of F (closure) function return type error in PHP
Fixed the problem of logger (console) output null or nil error
Fixed a problem where the version command could not be modified
A new preprocessing statement pragma autoload false / true is added. Whether to let the BN interpreter load the plug-in automatically is true by default
Fixed an issue where archery does not trigger entitydamagebyentityevent
Fixed the problem that the URL could not be automatically encoded when HTTP processing
PHP
Update the PHP plug-in writing support based on Quercus PHP6 engine
For the running environment provided by Quercus, see http://quercus.caucho.com/quercus-3.1/doc/quercus.xtp
Compatible with all Java classes, nukkit API and BN base object, call BN API remember to add$
C/C++
Updated the C / C + + plug-in writing support based on webassembly technology stack
It can directly call Java and interact with Java, compile once, run everywhere, and support Windows Linux MacOS
export
You can export the functions in the BN plug-in to the global environment through the export tag, and then you can use Java classes
The command exportdevjar < BN plug-in name > will export the function header of BN plug-in to a jar package for development
javascript:
```javascript
export function MyFun(arg1,arg2,arg3){}
```
python:
```python
@export
def MyFun(arg1,arg2,arg3):
pass
```
lua:
```lua
function BlockPlaceEvent(ent)-->export
end
```
php:
```php
static function PlayerJoinEvent($event){
}
```
logger
-The function of logger has been enhanced, and now the object can be output in JSON format
database
-Localstorage: local storage manager
- void localStorage.cacheAll () -- read data from local and cache it to increase the speed of getting data at runtime
- String localStorage.cache (string key) -- read the specified data from local and cache it
- void localStorage.setItem (string key, string item) - set the data corresponding to the specified key to item
- String localStorage.getItem (string key) -- get the data corresponding to the specified key
- void localStorage.removeItem (string key) -- remove the data corresponding to the specified key
- String[] localStorage.getKeys () -- get all keys
- void localStorage.save () -- force to save the data immediately, BN will check and save the data every 3 seconds
-Memorystorage: memory shared storage manager
- void memoryStorage.setItem (object key, object item) -- set the data corresponding to the specified key to item
- String memoryStorage.getItem (object key) -- get the data corresponding to the specified key
- void memoryStorage.removeItem (object key) -- remove the data corresponding to the specified key
- Object[] localStorage.getKeys () -- get all keys
manager
- Player[] getOnlinePlayers()
-String getresource (string name) -- read resource
-Void runcmd (string CMD) -- execute command line program
- boolean isPathExists(String path)
- String[] getFolderFiles(String path)
- int getFileSize(String path)
- void deleteFile(String path)
- void doPathCreate(String path)
- boolean isPathReadable(String path)
- boolean isPathWritable(String path)
- void copyFile(String fromPath,String toPath)
- void qq.stopBot ()
-Void interrupt (string info) -- forcibly interrupts the current function
- void downloadFromURL(String url,String saveDir,String saveName)
-Thread runthread (string functionname, object... Args) -- executes a function in a new thread and returns the thread synchronously
-Void requiremenversion (string minversion, string failmessage) -- check the BN interpreter version. If it is too low, stop running and issue a failmessage
entity
- void shootArrow(Position from,Position to,boolean canPickUp,double multiply)
- void shootArrow(Position from,Position to,double multiply)
- void shootArrow(Position from,Position to,boolean canPickUp)
- void shootArrow(Position from,Position to)
- void lookAt(Entity e,Position pos)
window
-If the second text parameter of int [] setplayerbossbar starts with # XXXXXX or RGB (x, x, x), the custom color will be set for the boss blood bar
-Int [] setplayerbossbar can now be used in the text parameter; to add multiple ossbars
-Int [] setplayerbossbar (player, string text, float len) -- now returns an array containing the ID of each created ossbar
-Void removeplayerbossbar (player player, long ID) - related APIs now support the ID operation of specifying the ossbar
- double getLengthOfPlayerBossBar(Player player,long id)
- String getTextOfPlayerBossBar(Player player,long id)
-Void sendplayerxboxinfo (player from, player to) -- show the Xbox information of the player from to
-Void startedpoem (player) -- let the player begin to show the poem of the end on the screen
-Void setswingstyle (string style) -- set the style of swing
-Currently: darcula IntelliJ metal motif multi nimbus OS (system style)
- JFrame getStyledSwingWindow(String title,int width,int height,String iconPath)
-Get the swing window object according to the previously set style. If iconpath is null or "" will be replaced by bnlogo
WindowBuilders
- void showToPlayer(Player p,String callback,boolean acceptClose)
-Acceptclose is used to specify whether to call the callback function once when the window is closed
SimpleWindowBuilder
- buildButton(String text,String img)
- button(String text,String img)
- button(String text)
- setAction(String actionFunctionName/F function)
- action(String actionFunctionName/F function)
- setTitle(String title)
- title(String title)
- setContext(String context)
- context(String context)
- showToPlayer(Player p)
- showToPlayer(Player p,boolean acceptClose)
- showToPlayer(Player p,String callbackFunctionName/F function)
- showToPlayer(Player p,String callbackFunctionName/F function,boolean acceptClose)
- show(Player p)
- show(Player p,boolean accpetClose)
- show(Player p,String callbackFunctionName/F function)
- show(Player p,String callbackFunctionName/F function,boolean acceptClose)
ModalWindowBuilder
- setTitle(String title)
- title(String title)
- setContext(String context)
- context(String context)
- setButton1(String text)
- setButton2(String text)
- button1(String text)
- button2(String text)
- setAction(String callbackFunctionName/F function)
- action(String callbackFunctionName/F function)
- showToPlayer(Player p)
- showToPlayer(Player p,boolean acceptClose)
- showToPlayer(Player p,String callbackFunctionName/F function)
- showToPlayer(Player p,String callbackFunctionName/F function,boolean acceptClose)
- show(Player p)
- show(Player p,boolean accpetClose)
- show(Player p,String callbackFunctionName/F function)
- show(Player p,String callbackFunctionName/F function,boolean acceptClose)
CustomWindowBuilder
- setTitle(String title)
- showToPlayer(Player p)
- showToPlayer(Player p,boolean acceptClose)
- showToPlayer(Player p,String callbackFunctionName/F function)
- show(Player p)
- show(Player p,boolean accpetClose)
- show(Player p,String callbackFunctionName/F function)
- show(Player p,String callbackFunctionName/F function,boolean acceptClose)
- showToPlayer(Player p,String callbackFunctionName/F function,boolean acceptClose)
- showAsSetting(Player p, String callbackFunctionName/F function)
- showAsSetting(Player p, String imageURL, String callbackFunctionName/F function)
- buildLabel(String text)
- label(String text)
- buildInput(String title,String placeholder)
- input(String title,String placeholder)
- buildInput(String title,String placeholder,String defaulttext)
- input(String title,String placeholder,String defaulttext)
- buildToggle(String title)
- toggle(String title)
- buildToggle(String title,boolean open)
- toggle(String title,boolean open)
- buildDropdown(String title,String inner)
- dropdown(String title,String inner)
- buildDropdown(String title,String inner,int index)
- dropdown(String title,String inner,int index)
- buildSlider(String title,double min,double max,int step,double defaultvalue)
- slider(String title,double min,double max,int step,double defaultvalue)
- buildSlider(String title,double min,double max,int step)
- slider(String title,double min,double max,int step)
- buildSlider(String title,double min,double max)
- slider(String title,double min,double max)
- buildStepSlider(String title,String options)
- stepSlider(String title,String options)
- stepslider(String title,String options)
- buildStepSlider(String title,String options,int index)
- stepSlider(String title,String options,int index)
- stepslider(String title,String options,int index)
- setAction(String callbackFunctionName/F function)
- action(String callbackFunctionName/F function)
BNNPC
- void addExtraDropItem(Item item)
- boolean hasDropItem(Item item)
- void removeExtraDropItem(Item item)
- Item[] getExtraDropItems()
- Item[] getDropItems()
-Void setdrophand (Boolean drop / void) -- the default value is true when the parameter is not filled in
-Void setdropoffhand (Boolean drop / void) -- the default value is true when the parameter is not filled in
-Void adddropslot (int slot) -- specifies the slot of the backpack
- int[] getDropSlots()
- void removeDropSlot(int slot)
-Void doemote (string action / void) -- let NPC execute the specified facial expression action
-The action can be wave punch clap overthere hammer fall diamond pickaxe
-You can also fill in the corresponding Chinese wave boxing applause in that hammer fall diamond
-If not, choose one of the five actions above
-As for why there are only eight: because the rest can only get UUID after the purchase of krypton gold, it's cold and has no money
-Welcome to contribute UUID
-Boolean directmove (position to)
world
- void regenerateChunk(Position pos)
- void defineChunkRenderByName(String forLevel,String callback,int priority / void)
-Forlevel is the specified world name that the render can render
-Callback is the render callback function
-Priority is the priority. The higher the priority is, the higher the priority is. If it is not filled in, the default value is 0
- void drawPic(Position pos1,Position pos2,String img,int faceData)
-Draw the image on the IMG path from pos1 to pos2. Facedata specifies the orientation of the display box. Pos1 and pos2 must be in the same vertical plane
blockitem
- void registerSolidBlock(int id,String name,double hardness,double resistance,int toolType,boolean isSilkTouchable,int dropMinExp,int dropMaxExp,int mineTier)
-Register solid blocks, the parameters are block ID (only the educational version of blocks can be overridden), block name, block hardness, block explosion resistance, mining tools, accurate collection effect, minimum drop experience, maximum drop experience, mining level
-The greater the hardness of the block, the longer the excavation time and the higher the explosion resistance, the less likely it is to be blasted
-Mining tools 0-none, 1-sword, 2-shovel, 3-pick, 4-axe, 5-scissors
-Mining level 0 - empty handed, 1 - wood, 2 - gold, 3 - stone, 4 - iron, 5 - diamond
- void registerSimpleItem(int id,String name)
-Registration of simple items heap can only override educational items
## 1.2.8.3

Bugs Fixed

- fix bnnpc walking in air
- fix nullpointer exception when player change the world
- new error ui

manager

- <E> callFunction(String functionname,Object... args) --callFunction will return the return value of the function
- <E> getVariableFrom(String scriptName,String varName)
- void putVariableTo(String scriptName,String varName,<E> var)
- double getCPULoad()
- int getCPUCores()
- double getMemoryTotalSizeMB()
- double getMemoryUsedSizeMB()
- void forceDisconnect(Player player)
- Array<String> getEventFunctions(Event event)
- void getServerMotd(String host, int port, String callback)

blockitem

- void setItemColor(Item item,int r,int g,int b)
- void setItemUnbreakable(Item item,boolean unbreakable)

inventory

- Item getEntityHelmet(Entity entity)
- Item getEntityChestplate(Entity entity)
- Item getEntityLeggings(Entity entity)
- Item getEntityBoots(Entity entity)
- Item getEntityItemInHand(Entity entity)
- Item getEntityItemInOffHand(Entity entity)
- void setEntityItemHelmet(Entity entity,Item item)
- void setEntityItemChestplate(Entity entity,Item item)
- void setEntityItemLeggings(Entity entity,Item item)
- void setEntityItemBoots(Entity entity,Item item)
- void setEntityItemInHand(Entity entity,Item item)
- void setEntityItemInOffHand(Entity entity,Item item)
- Item getInventorySlot(Inventory inv,int slot)

window

- void forceClearWindow(Player player)
- int getEventResponseIndex(PlayerFormRespondedEvent event)

entity

- boolean isPlayer(Entity e)
- void spawnFallingBlock(Position pos, Block block, boolean enableGravity,boolean canBePlaced)

gameapi --新的基对象

- void createGame(String name,boolean useTeam,String startGameCallBack,String endGameCallBack,String mainLoopCallBack,String deathCallBack)
- void joinGame(Player player, String gameName)
- void leaveGame(Player player)
- boolean isPlayerInGame(Player player)
- GameBase getPlayerRoom(Player player)
- Array<GameBase> getAllRoomByName(String gameName)
- Array<String> getAllGameNames()
- Messager getMessager(String prefix)
- Messager getGameMessager(GameBase game)
- Multiline getMultiline(String messageType)
- InventoryMenu createInventoryMenu(String inventoryType, String title)
- FormMenu createFormMenu(String title, String content)
- void addMenuItem(InventoryMenu menu, int slot, Item item, String inventoryCallback)
- void addMenuButton(FormMenu menu,String buttonText,String imageData,String formCallback)
- Scoreboard getScoreboard(Player p)
- void setObjective(Scoreboard sb, String objectiveName,String displayName)

EventLoader --73 new

- BlockFadeEvent
- BlockFallEvent
- BlockFromToEvent
- BlockGrowEvent
- BlockIgniteEvent
- BlockPistonChangeEvent
- BlockRedstoneEvent
- DoorToggleEvent
- CreatureSpawnEvent
- CreeperPowerEvent
- EntityArmorChangeEvent
- EntityBlockChangeEvent
- EntityCombustByBlockEvent
- EntityCombustByEntityEvent
- EntityCombustEvent
- EntityDamageByBlockEvent
- EntityDamageByChildEntityEvent
- EntityExplodeEvent
- EntityMotionEvent
- EntityPortalEnterEvent
- EntityRegainHealthEvent
- EntityShootBowEvent
- EntityVehicleEnterEvent
- EntityVehicleExitEvent
- ExplosionPrimeEvent
- BrewEvent
- EnchantItemEvent
- InventoryMoveItemEvent
- StartBrewEvent
- ChunkLoadEvent
- ChunkPopulateEvent
- LevelInitEvent
- LevelLoadEvent
- LevelSaveEvent
- LevelUnloadEvent
- SpawnChangeEvent
- ThunderChangeEvent
- WeatherChangeEvent
- PlayerAchievementAwardedEvent
- PlayerAnimationEvent
- PlayerAsyncPreLoginEvent
- PlayerBlockPickEvent
- PlayerBucketEmptyEvent
- PlayerBucketFillEvent
- PlayerChangeSkinEvent
- PlayerChunkRequestEvent
- PlayerCreationEvent
- PlayerDropItemEvent
- PlayerEatFoodEvent
- PlayerEditBookEvent
- PlayerFoodLevelChangeEvent
- PlayerGameModeChangeEvent
- PlayerGlassBottleFillEvent
- PlayerInvalidMoveEvent
- PlayerItemConsumeEvent
- PlayerLocallyInitializedEvent
- PlayerMapInfoRequestEvent
- PlayerMouseOverEntityEvent
- PlayerServerSettingsRequestEvent
- PlayerSettingsRespondedEvent
- PluginDisableEvent
- PluginEnableEvent
- PotionApplyEvent
- PotionCollideEvent
- PlayerDataSerializeEvent
- RemoteServerCommandEvent
- EntityEnterVehicleEvent
- EntityExitVehicleEvent
- VehicleCreateEvent
- VehicleDamageEvent
- VehicleDestroyEvent
- VehicleMoveEvent
- VehicleUpdateEvent
- LightningStrikeEvent
Top