MC 1.13 - Server side modding - new blocks?

Discussion in 'Spigot Discussion' started by sirati97, Feb 20, 2018.


What do you think?

  1. I am interested in helping

  2. I am interested in using this later

  3. I think no one ever wants to add new blocks or items

  1. well if you think so, you can try implementing joining two inventories together and showing both of them to the player :D (fully interactive of course)
    NMS and CraftBukkit is a big no no tho
    #21 sirati97, Mar 5, 2018
    Last edited: Mar 5, 2018
  2. Oh yeah another thing: Again I am not showing NMS to the plugin/mod. This api is there to change inventory behaviour and representation. So it’s not doing the same as bukkits api. It is also calling normal bukkit events just as every other inventory would.

    And don’t forget bukkits api is also realised through NMS.
  3. I would like to see some use cases where the Bukkit API is not sufficient enough. As well some screenshots where you merged two inventories together.
    • Like Like x 1
  4. Couldn't you just make Material implement an interface that custom item types implement as well, then add a method to register them sothat custom item types are included in Material's getter methods?
  5. Material is an enum for reason, and the reason it because you couldn't add new values to it. Bukkit is needed for modifying behaviour of existing elements not for adding more. There have been tries of merging plugins and modded but got abandoned because got messy and unmaintainable.
    • Agree Agree x 1
  6. i.e. showing the enderchest inventory and player inventory at the same time to a third player (bad example because of 7 rows i know, but still an example)
    doing stuff like that requires around 10 lines with my API, while with bukkit one would basically need to reimplement Container. My API is not intended to be used this way, it is however still easily possible.

    Look my inventory/user-interface API and Bukkit's do not overlap at all. You cannot use my API to get the ItemStack of a slot. My API is only there to present the player with non-vanilla inventories so that he can interact with those.

    Also, I do not want to have a discussion here about whether bukkits API is sufficient or not. It certainly is sufficient for the scope of Bukkit, but not for the scope of OilMod. I have programmed lots of proprietary software using Bukkit, CraftBukkit, Spigot and NMS and I am aware of their limitations and caveats. Please understand I have a very harsh timetable and not a lot of time, so I want to use that time productively and not by convincing you that Bukkit has a scope at which Bukkit is good and that there are things which are outside of Bukkits scope. Bukkit is not build to modify NMS behaviour, so if you want to do something which is very straightforward using NMS it isn't necessarily easy in Bukkit.
    #26 sirati97, Mar 6, 2018
    Last edited: Mar 6, 2018
  7. As @Parozzz said Material is an enum and as such intended to not be modified. Its possible however to use reflection to add new members at runtime while keeping ordinals consistent. Currently, it is planned to use this to represent custom materials to Bukkit Plugins.

    Only plugins using a switch case block without a non-failing default block would get into trouble, so that is the best solution. As the material interface changes from Version to version anyway and the material interface has such a large amount of member I do not assume that to ever happen.
  8. What Material interface? How is messing with reflection cleaner than an interface that Material implements? Isn't the goal of this project to change the limitation that we can only modify the behaviour of existing elements?
  9. If I let Material implement an interface no Bukkit plugin would know about it. So they would still be unable to deal with modded materials. If I change it from an enum to a static class it would break all bukkit plugins.

    Reflection is often very unclean. Here for once, it is the only sensible solution. I am literally just using reflection to create valid instances of the enum and let them behave as Bukkit plugins would expect.
    • Informative Informative x 1

Share This Page