Pre-Version of the new Plugin API

  • Hi folks!


    A preview version of the new Plugin API is now available. You can get an impression on what is possible with the API, and you can also start working on your first plugins.
    You find a new section in the forum now, which is dedicated to the Plugin API. You can ask questions or discuss any API related things there, or request new features in the Feature Requests section.


    In contrary to the Lua API, a documentation (JavaDoc, which also contains some examples) is also available. In can be downloaded with the Plugin API (you can load it in your IDE and access it while coding), or alternatively you can watch the online version here: https://javadoc.rising-world.net/


    Unfortunately you can't add the plugins to your server yet. The servers will be updated within the next weeks, you can take advantage of the time to get used to the new API, or to prepare your plugins. Once the servers have been updated, the old Lua API will still be supported for ~ 4-8 weeks until it will be removed.


    Please note that a few events and functions are still missing, they will be added soon. If there is something wrong with the new API, or you have any questions or suggestions, feel free to leave your feedback :)


    Download link: https://download.rising-world.net/api/Pre-PluginAPI.zip


    Getting started: Getting started
    First steps: Create a Plugin

  • Just had a look at the docs. Looks VERY promising with a lot of useful additions. THANKS!


    Assuming the events present in the old LUA framework and currently absent in this preliminary version will be added (for instance, placing/removing/destroying of anything other than blocks), the only area remaining somehow grey is custom 3D models.


    There are functions to load a 3D model from disk, which return a ModelInformation object, but no obvious way to place the model itself in the world: did I overlook something?


    Question: if I am not mistaken, it seems the current concept of a script-relative database no longer exists. Does this means that all script-dependent data will reside in the world database? There are possibly reasons for this (efficiency? connection pooling?) but some care should be taken to avoid table name clashing: many scripts use a table equally named, for instance, "players"?

  • Awesome questions @Miwarre


    May i ask/suggest to anyone this be added to the Plugin-Api section just incase somebody is asking the the same question then its easy to point in that direction along with other possible questions.
    dang it, i got butterflies in my tummy from this pre-version alone.

  • Assuming the events present in the old LUA framework and currently absent in this preliminary version will be added

    Yes, exactly, those events will be added very soon :)


    There are functions to load a 3D model from disk, which return a ModelInformation object, but no obvious way to place the model itself in the world: did I overlook something?

    The ModelInformation object is basically just the reference to the 3D model. The class to create a model in the world is the World3DModel (just like 3D texts etc), you can assign the ModelInformation to it by calling the setModel(ModelInformation) method. Unfortuntely there is a small mistake in the current API: All world elements are just interfaces, that's not intended, they will be converted to classes (so you can create a new instance directly)... this will be changed shortly!
    After the change it will probably look like (maybe it will look a little bit different):

    Question: if I am not mistaken, it seems the current concept of a script-relative database no longer exists

    Oh, that's also something that will be added soon ;)


    A way to issue a console command from a script

    That could be added. Maybe create a new topic about that in the plugin section, so this suggestion does not get lost :D


    The use case is to support commands like setplayergroup which are not possible (yet?) via the regular framework

    If it's explicitly about changing the playergroup, that can be done this way:

    Java
    Player player = Plugin.getServer().getPlayer("Miwarre");
    player.setPermissionGroup("moderator");
  • Thanks for the reply! I imagined I was overlooking some detail, a lot of docs to wade through (which is fine, VERY FINE!).

    The ModelInformation object is basically just the reference to the 3D model. The class to create a model in the world is the World3DModel (just like 3D texts etc), you can assign the ModelInformation to it by calling the setModel(ModelInformation) method.[...]

    Damn! I didn't scroll down to 'W'! :whistling:


    That could be added. Maybe create a new topic about that in the plugin section, so this suggestion does not get lost


    I'll do it; I didn't want to pollute the forum with duplicate posts.

    If it's explicitly about changing the playergroup, that can be done this way:

    Java
    Player player = Plugin.getServer().getPlayer("Miwarre");
    player.setPermissionGroup("moderator");

    Another detail I overlooked! Thanks!

  • @red51 you're too nice :) you even added a very detailed walkthrough. If I may ask now: As red has made his walkthrough can someone please provide a detailed walkthrough in English on how to create a mod/plug-in for Rising World. I have so many ideas but understand naught, having a walkthrough video series would be very beneficial for everyone here. Thank you @red51 :)

  • captain,


    I am struggling myself and i am just trying to import a model but i see now what my mistakes are and i am going to try again tomorrow. I havent written any uselful java in 4 years and I am quickly seeing how much I have forgotten. Im getting errors as well. If you wanna add me on steam then maybe we can learn together. My id is zork_foxfire

  • Ive only done very limited amount of java oO but been playing around today and seems im picking this up fast yay lol cant wait to be able to test our plugins in game

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • Arcane,


    What exactly are you wanting to try? I'm working on getting an old 3d model imported. I want to tinker around with compass stuff next.

    In the game Minecraft there's a mod to tweak biomes it's called Biomes O' Plenty. There's a tree called a Sakura and I would like to add it to Rising World as a very tiny mod to help me get started on understanding on how to write mods or in this case we call them plug-ins. I would add the tree, saplings for it and it's own variants to the block bench. @red51 said this stuff would only be static. Even so it would be nice to add a new tree to the plains.

  • In the game Minecraft there's a mod to tweak biomes it's called Biomes O' Plenty. There's a tree called a Sakura and I would like to add it to Rising World as a very tiny mod to help me get started on understanding on how to write mods or in this case we call them plug-ins. I would add the tree, saplings for it and it's own variants to the block bench. @red51 said this stuff would only be static. Even so it would be nice to add a new tree to the plains.

    Hmmm... I know you can add custom models. I'm working on the same right now. However, I do not know if you can register a custom Inventory item (only in-game items are available without hacking) or modify crafting bench items. I'll study the API a bit more but it looks like the API already supports some functions for chat messaging so it might be possible to create a function linked to a chat window command (still not positive. i'll study more when I am home) . Meanwhile, Can you aquire some models of such a tree? there are lots of 3d modeling students out there sharing their work on the internet. shouldn't be too hard to come up with something.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!