SkyBlock Minecraft Addon #20 - New store addon & toplist command improvementssteemCreated with Sketch.

in #utopian-io5 years ago
This is the new store addon for SKYBLOCK.SK, it allows server operators to buy and sell items very easy. It also has support for already existing SKYBLOCK.SK addons for being sold in this shop.

Hello everyone,

Today, I have two new exciting changes for SKYBLOCK.SK to show you guys. One of them is a store, where players can sell their stuff, the other one is a new toplist of the islands. Another new feature is the openbook function, which opens a book to the player, which is currently in the hand of the player.

1. Repository

https://github.com/Abwasserrohr/SKYBLOCK.SK

2. Index

  1. Repository
  2. Index
  3. New Features and changes
    3.1. New addon: store.sk
    3.2. Added openbook function
    3.3. Changed island toplist: /island top
  4. Pull requests
  5. GitHub Account
  6. How to contribute

3. New Features

3.1. New addon: store.sk

This new addon finally allows server operators to sell their stuff with SKYBLOCK.SK, the advantage of this addon is that it can sell not only regular items but also any defined ItemStack. That means the server operator can create completely custom ItemStacks and sell them. This is very useful, since SKYBLOCK.SK addons use custom items, which could also be sold within the new store. These add-on items could be robots, parkour sets, storage units, JetBoots, loot boxes or custom decoration heads.

But that's not all, what this addon does. For me as a server operator, it was always annoying to make the menu look good by manually set all the items to their slots. When I created the new store.sk addon, I focused on creating an admin shop where the server operator doesn't have to determine all the slots and rather than that only select which categories there should be and which items should be sold and bought in these categories. While I kept that in my mind, I also tried to make it easy to navigate through the store.

To make this easy setup complete, the store.sk addon supports unlimited categories and unlimited items to be added to every category. This doesn't fix the server operator to only one site per category and makes it way more efficient to add new items and blocks to the store because the server operator doesn't have to mind how it looks like at the end.

Another thing that bothered me was the lack of language support for multiple players at once. store.sk does support the SKYBLOCK.SK languages and is capable of serving different languages to all the players at once. There isn't any other language available besides German though. But soon, more languages will be added to SKYBLOCK.SK.

Here is a video that shows off the store.sk shop with its default configuration. This default config may change in the future and is there to make SKYBLOCK.SK working well without any changes and also makes it easy to understand how it works.

Here is a little part of the new store I want to explain:


This part of the store.sk addon detects if the island level threshold is reached and the item can be sold to the player. That way, the server operator can set an island level threshold to specific items, like animal eggs to prevent new players from buying them directly. This can be very important to keep the late game interesting for players since there are always new things to be discovered and it doesn't get boring as fast as it would get without it.

Now here is how a server operator can create a new category, which sells 1 of beacon for 500 money and buys it again for 100. Pretty cheap, but an example of how it works.

First, the category has to be defined. This is only one line:


I have named my new category "valuable" and can also add a translation for it.


Then, we can go forward and define new items which should be placed within this new "valuable" category.


Here, lists are used. These lists can then be later used and looped to display everything to the user. I also want to note that the prices and threshold are entered as a string (text) because otherwise Skript would not add it to the list of objects but rather add it as a number and then increase the number every time and not add it to the list.

There are still some new ideas which I might add in the future to the store.sk addon, but for now, I first need some feedback from the players to improve already existing parts of it before extending it furthermore.

I'm sorry that I used tabs instead of spaces. It is still new for me to use spaces and sometimes it just happens and I do tabs again. I have added a commit which changed this mistake below the pull request. :3

Pull request: https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/170
Fixed spacers: https://github.com/Abwasserrohr/SKYBLOCK.SK/blob/39a1ea0f63e41ec8d2090aa30b389098ba922e6a/SkyBlock/addons/store.sk


3.2. Added openbook function

The now added openbook function allows SKYBLOCK.SK to send the Minecraft client a packet which opens a book for the player. This can be very useful if there should be books opened to the player, which have been generated before. Like a toplist, a server guide or something else.


The new function makes use of the net.minecraft.server.%version%.PacketPlayOutCustomPayload class to send the player a specific packet. Thanks to some changes in Minecraft Version 1.13, the Client now accepts actual human readable MinecraftKey, like minecraft:book_open which is amazing, in my opinion. =)

To get PacketPlayOutCustomPayload to work, a buffer is needed, which then is serialized. It can then be sent to the player.

This new function allows working with books for top lists or island information in the future. Again, I had some type of bad day and used tabs instead of spaces, it has been fixed in the pull request below.

Commit: https://github.com/Abwasserrohr/SKYBLOCK.SK/commit/fa67dd40f94db9f2ac423c25cbee85ac0f3adabb


3.3. Changed island toplist: /island top

While the chat is pretty nice to display information, it is not great user experience, because there might be important stuff to read in the chat, which then gets spammed way by the /island top. This has now been fixed, thanks to the new openbook function, the toplist is now created within a book and then directly opened to the player.

Here is a side by side difference:

While it the opentoplist function is pretty big, here is an example of how I created the book instead of making it in the chat.


I'm using BaseComponent, which is very good explained here to create the book with click and hover events. This is great because it is possible to add additional data, like island levels, island members of the island to the text as a hover effect. Once we have created our BaseComponent, we can go forward and make a newly written book and get the metadata out of it.


Then, some important metadata has to be set, nobody will see this ever, besides us. But it is required to be accepted by the client of the player.


Then, we can add the previously generated sites above with the BaseComponent to the book meta.


Now, we just have to:

  • Set the book metadata back to the written book item
  • Save the current tool of the player with the new book
  • Replace the current tool of the player with the written book item
  • run the openbook function with the player as a parameter
  • replace the current tool of the player with the saved one
  • the player is now looking at our new book. =)


Pull request: https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/173


4. Pull requests

https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/170
https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/173


5. GitHub Account

https://github.com/Abwasserrohr


6. How to contribute

You want to contribute to SKYBLOCK.SK? Get in touch with me on Discord, I'm the sewage pipe there. I also look forward to meeting beginners, who are still new to Skript but are interested to help on SKYBLOCK.SK.

Discord: https://discord.gg/FRuK5BC


Did you know? It is also possible to swim faster in Minecraft now. I really didn't tried it out until now. :3

Thank you for reading my contribution post. With the new store, server operators can easily set up a store which is directly accessible through the /island main menu and automatically fit the corporate design of SKYBLOCK.SK.

The openbook function opens new ways to make menus. Not only a toplist of the best islands is a great way of using books, but also other things, where much information has to be displayed is quite handy. /island info and /island help will also get this upgrade to a book in the future.

Do you have feedback about this contribution post, SKYBLOCK.SK or the new features? Share them with me in the comments. =)

Have a great weekend

@immanuel94

Sort:  
  • Great article with all the right stuff.
  • You're the comment king! ;-)
  • Don't forget that you can make a task request on Utopian and get your project translated in many languages, just get white listed, set it up on crowndin and let your fellow Utopians join in the fun of Skyblock.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for reviewing my contribution post. =)
Once I have all languages well organized and done, I'm going to try out these task requests.^^

Thank you for your review, @helo! Keep up the good work!

Nice that there is now a shop. ^^

Hello @altonos! =)

Yeah, hopefully, you also like it. ;) If you find something not looking that nice or disturbing, just tell me. :3

Die neuen Funktionen sind erstklassig.

Vielen Dank für das Feedback. =)

Hi @immanuel94!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Sehr schoen die Neuerungen. Die beschleunigte Levelberechnung gefaellt mir sehr gut aber auch der Shop ist gut gelungen.

Freut mich, dass dir die neuen Änderungen gefallen! =)

Who haven't heard about it, utopian.io is also running an indiegogo Campaign, you can read here more about that, I suggest backing a little amount. =)

Das neue /is top ist cool. Schade das die Maus immer zurueck gesetzt wird

Ja, das mit der Maus ist tatsächlich noch ein Problem, aber dafür wird es sicher früher oder später, vielleicht schon mit der Minecraft Version 1.14 eine Lösung geben.

gut dass es nun auch einen shop auf SB gibt.

Ja, der Shop hat wirklich gefehlt!^^

skyblock wird immer besser . im store kriegt man alles notwendige fuer den passenden taler ^^

Ja. ;) Falls du noch Ideen hast, was man zur Standardkonfiguration hinzufügen könnte, melde dich einfach.^^

Hey, @immanuel94!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.033
BTC 62559.43
ETH 3092.10
USDT 1.00
SBD 3.86