BlockAPI

BlockAPI 1.0.1

Compatible API Versions
1.0.9+
Sourcecode
https://github.com/PetteriM1/BlockAPI
With BlockAPI plugin developers can easily replace blocks with custom ones to change their behaviour


Notice:
- Make sure you are using the latest Nukkit build.
- It is recommended that the new block extends the original block to avoid problems.
- All the plugins that don't use Block.get() won't use the custom blocks.
- There can be only one block per id. If you register two blocks with the same id the first one will be overwritten.


Plugins using BlockAPI:
None yet but hopefully we will get some soon :)


API methods:
Register a custom block
Code:
me.petterim1.blockapi.API.registerBlock(int blockId, Class<? extends Block> blockClass)
Register multiple custom blocks
Code:
me.petterim1.blockapi.API.registerBlocks(Map<Integer, Class<? extends Block>> blocks)
Unregister a custom block
Code:
me.petterim1.blockapi.API.unregisterBlock(int blockId)
Unregister all custom blocks
Code:
me.petterim1.blockapi.API.unregisterAll()
Get all registered custom blocks
Code:
me.petterim1.blockapi.API.getAllCustomBlocks()
Enable/disable random tick updates for a block
Code:
me.petterim1.blockapi.API.setRandomTickingEnabled(int blockId, boolean randomTickingEnabled)

Maven dependency:
Code:
<dependency>
    <groupId>me.petterim1.blockapi</groupId>
    <artifactId>BlockAPI</artifactId>
    <version>1.0.1</version>
    <scope>system</scope>
    <systemPath>${basedir}/BlockAPI-1.0.1.jar</systemPath>
</dependency>

Example plugin:
https://github.com/PetteriM1/BlockAPIExample


Want to support the development of this plugin? Donate via PayPal
Author
PetteriM1
Downloads
1,528
Views
5,098
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from PetteriM1

Latest updates

  1. BlockAPI 1.0.1

    - Added API method to enable/disable random block ticking per block - Modifying a block now also...
Top