[Open Source] SkyBlock Minecraft Addon - Enhanced island flags [New features #7]steemCreated with Sketch.

in #utopian-io6 years ago (edited)
@sausemaus and @creeperm4ster helped me debugging the new flags, thank you guys! =)

Hello everyone,

I hope, you guys had some nice Christmas days with people you like.

Today, I show you new enhancements for the SkyBlock Minecraft add-on based on Skript. Since the new flags have been introduced, people wanted it to be more configurable for different groups of players. This now following change allows players now to set flags, like opening and closing doors dedicated for foreign players, trusted players and island members. This gives the island leader the opportunity for a better and more customizable SkyBlock experience.

1. Repository

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

2. Index

  1. Repository
  2. Index
  3. New Features
    3.1. Enhanced island flags
    3.2. Added more data output to /island info
    3.3. /island home can now also teleport to homes of others
    3.4. The action bar is now called using a function
  4. Pull requests
  5. GitHub Account
  6. How to contribute

3. New Features

I added new features people have been asking for now some time.

3.1. Enhanced island flags

Island leaders can now select the player group within the menu.
The new island flags now allow the island owner to set specific protection settings to - foreign players - trusted players - island members

Example:
The island owner can now toggle settings (flags) like, if trusted players should be allowed to break and place blocks or access to chests to either true (on) or false (off). This not only reduces the risk of abuse and griefing, but also gives the players way more options on how to play the game. As always, the server operator can also disable this feature in the configuration like before.

How this works:
The new flags have some new variables, these contain either true or false.

{SB::island::%{_x}%_%{_y}%_%{_z}%::flag::%{_playertype}%::button}

Is the flag to allow buttons and levers, the {_x}, {_y} and {_z}variables contain the location of the bedrock of the island (the island middle).
The {_playertype} variable contains either "foreign", "trusted" or "member" as a text, this results in three different variables for the button:

{SB::island::%{_x}%_%{_y}%_%{_z}%::flag::foreign::button}
{SB::island::%{_x}%_%{_y}%_%{_z}%::flag::trusted::button}
{SB::island::%{_x}%_%{_y}%_%{_z}%::flag::member::button}

These flags are checked once a event is triggered, there it can be canceled, if the island owner has disabled the interaction.

If the server operator allowed it to toggle flags, the island leader can open the flag menu with /island flags and then toggle the flags for his island for foreign, trusted and member players.

This is done by a new menu, which opens once the player types in /island flags. There, the player can select, which player group should be changed and then toggle the flags. To make this new menu work, I changed the openflagmenu function and added the following code:

    if {_type} is "":
        opengui({_p},5,"%{SB::lang::flag::flagst::%{_lang}%}%","HOPPER")
        setguiitem({_p},0,"farmland",1,"&r%{SB::lang::flag::foreignt::%{_lang}%}%","&r%{SB::lang::flag::foreignd::%{_lang}%}%","openflagmenu(""%{_p}%"" parsed as player,""foreign"")",false)
        setguiitem({_p},2,"grass path",1,"&r%{SB::lang::flag::trustedt::%{_lang}%}%","&r%{SB::lang::flag::trustedd::%{_lang}%}%","openflagmenu(""%{_p}%"" parsed as player,""trusted"")",false)
        setguiitem({_p},4,"grass",1,"&r%{SB::lang::flag::membert::%{_lang}%}%","&r%{SB::lang::flag::memberd::%{_lang}%}%","openflagmenu(""%{_p}%"" parsed as player,""member"")",false)
        stop

This now allows the island leader to first set a player group and then edit the flags for the specified group.

All changed have been done in the pull request linked below, there were two bugs which have been fixed in another pull request later.

Pull request: https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/63
Pull request (fixed): https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/64

3.2. Added more data output to /island info

This is how the new /island info looks like.

Players wanted to know more about their island and also the islands of others. The new /island info has now some new data to show:

  • Last active
  • Island upgrades
  • Trusted players

This is only a small change but people wanted it, that's why I squeezed it into this pull request... =D

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

3.3. /island home can now also teleport to homes of others

Sometimes, players want to visit other players. Since trusted players might want to build something on the island on which they're trusted, it is nice to have access to all homes of the island. With this new enhancement, the players can teleport to the homes of the island, if the island leader has enabled the flag for it.

They simply have to type in /island home [<player>] [<home>] to get to the home of the player, if this is enabled. It also displays, if the home is not set and prints all available homes of that player.

        else if arg-1 is "home":
            if arg-3 is set:
                set {_p} to arg-2 parsed as offline player
                homehandler({_p},"home",arg-3,player)
                stop
            homehandler(player,"home",arg-2,player)

If the player types in /island home Immanuel94 home, there are 3 arguments set, if a 3rd argument is set, the code above detects this and parses the 2nd argument as a player and then calls the homehandler function with the parameters we need.

This allows us to do two things at once:

PlayerA can execute the command like below:

/island home home

At the same time, PlayerB can execute the command to get to the home of PlayerA

/island home PlayerA home

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

3.4. The action bar is now called using a function

Now, there are proper Java classes used to perform a action bar message, before, vanilla commands have been used.

Since Spigot also has some Java classes which are meant to be used with BungeeCord but also work without it, this is nice to have:

import:
    net.md_5.bungee.api.ChatMessageType
    net.md_5.bungee.api.chat.TextComponent  

The small action bar function, which only needs a player and the text as parameter, sends the specified text to the player in his action bar. This is a great way to print messages to player, thanks to the bungee api.

function actionbar(p: player, t:text):
    set {_tc} to new TextComponent({_t})
    set {_cmt} to ChatMessageType.ACTION_BAR!
    {_p}.spigot().sendMessage({_cmt}, {_tc})

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

4. Pull requests

https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/62
https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/63
https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/64

5. GitHub Account

https://github.com/Abwasserrohr

6. How to contribute

If you want to know how Skript works or you want to contribute to this project, just contact me on Discord trough the link below. I'm Abwasserrohr there. =) Also, feel free to fork the project or send pull requests if you want.

Discord: https://discord.gg/FRuK5BC


Thank you for reading this contribution post. As the time goes on, more and more features have been added. Now, most of the features I tough of have been added. Once all issues are completed and new challenges and admin commands are added, I'll try to make final changes to make everything as readable as possible and then release the first version of SKYBLOCK.SK.

Feedback is also very appreciated. =)

Keep on steeming and a happy new year. :3

@immanuel94

Sort:  

Thank you for your contribution. This must be a fun game to play even I didn't know the .SK script, I can still read and understand most of it given the syntax is pretty much Python - although github does not understand the syntax.

  1. Great comments.
  2. I see constants (string literals, magik numbers) are directly used in the .SK script. It might be better (if .SK allows defining constants) to extract these somewhere in a common file.
  3. Do you plan to add lang/en.sk?

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? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey @justyy! =)
Thank you for reviewing my contribution post. If there are values which should be controlled or changed later, they are saved in the config.sk. Variables in .SK script are persistent and I'll try to use them always if I want something to be changed later trough the user. I never seen something like defining constants in vanilla Skript, but once I use skript-mirror more often for some functions, I might have the option to use constants there. (skript-mirror is a mirror tool to use Java classes in skript)

lang/en.sk ist planned, but I want to complete the translations and new features first and then rearrange the lang/de.sk file first before starting with other languages to reduce the work being involved with multiple languages at once.

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

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

SB Flags eine kleine Meisterleistung. Nun ist alles möglich, fast nichts unmöglich.

Vielen Dank fürs testen gestern, @sausemaus! Freut mich, dass dir die neuen Flags gefallen.^^

Nice Sache :)

Freut mich, dass es dir gefällt.^^

Coole neue Funktionen.

Congratulations @flyerchen ! Your post received a small upvote from @ongame as incentive for sharing gaming content.
Want to know more about Ongame.io ? Join us now!

  • All Recent Games (More than 70k)
  • Live Stream & external sources
  • Review Games and get rewarded
  • And many more... !!!

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.19
TRX 0.14
JST 0.030
BTC 59479.71
ETH 3174.48
USDT 1.00
SBD 2.44