Minecolonies & NameTags

in #utopian-io7 years ago (edited)

Hey everyone, besides drawing amazingly detailed comics on Steem I work in a project called "Minecolonies" which develops an amazing modification for the game Minecraft.

Over the next months I'll also update my progress updates here.

Today I want to talk about a quite recent update which allows the renaming of our citizens.

When our citizens come alive we usually generate a random name out of a collection of medieval names.

Like this little fellow:

Those names have to be unique since we use them in search functions in our code.

Now, players have asked in the past a lot about being able to rename citizens.

Nevertheless, I always stayed a bit worried since players might abuse this and use unappropriate names.

Thankfully I found a good solution to both problems:

First of all, I coded that Citizens can be renamed like minecraft animals, shift-right-clicking them with a nametag.

Which worked out great.

Following that I created a config option which allows server owners to define which trustable users are able to execute this feature.
(On our server these are for example the Patreons, Devs and Admins)

I added a way to trigger that on and off completely:

So basically each time a player tries to add a name to the citizen:

if(!citizenData.getName().equals(name) && Configurations.gameplay.allowGlobalNameChanges >= 0)
            {
                if (Configurations.gameplay.allowGlobalNameChanges == 0 &&
                        Arrays.stream(Configurations.gameplay.specialPermGroup).noneMatch(owner -> owner.equals(colony.getPermissions().getOwnerName())))

In the first line we check if the citizen already has that name, then we check if name Changes are on at all (> 0).

Then in the next if we check if only specific players are allowed to change names and then we go through all players in the "allowed people" list and check if the "owner" of that citizen is in it.

Our other maintainers were quite receptive:

Loooooks good to me!! :shipit:

and we merged it soon after

Happy End

Hope you like our new little feature.

See you the next time.

PS: All our PRs get ported and merged to 1.10, 1.11 and 1.12.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @raycoms I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Big fan of minecraft here. First time seeing your posts. Just saying hello and letting you know I decided to follow. Is minecraft/minecolonies in any way integrated with the steem blockchain yet that you know of?

Great to hear that and no we don't have any integration yet and I believe there is no other mod/plugin which has any integration yet. But we might plan it for the future.

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.030
BTC 60268.51
ETH 3201.96
USDT 1.00
SBD 2.43