SkyBlock Minecraft Addon #18 - Added custom armor stands add-on

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@immanuel94·
0.000 HBD
SkyBlock Minecraft Addon #18 - Added custom armor stands add-on
<div><img src="https://cdn.steemitimages.com/DQmSC1Ke48W8UUx8iRqLnJzDYKXsHQxZvegJR1k6rzU7Aou/2019-02-15_16.56.52.png"/>
<div class="text-justify"><blockquote>@sausemaus suggested to have custom armor stands on SKYBLOCK.SK, now they have been added. Thank you for suggesting them! =)</blockquote></div></div>

---

Hello everyone,

Today I have some new things to show which have been included in SKYBLOCK.SK. I have added a couple of improvements and also a new feature which allows players to modify their armor stands very easy. I decided to show off some pictures what can be done with these armor stands, this is nice to have for every island owner. =) As I don't have many pictures for most of the changes, I decided to put some pictures of the new armor stand add-on capabilities in here to give the eyes some rest.

### 1. Repository
https://github.com/Abwasserrohr/SKYBLOCK.SK

### 2. Index
1. Repository
2. Index
3. New Features and changes
3.1. ```/island warp``` visits are now counted & top list added
3.2. Some config files now use ```.yml``` instead of ```.sk```
3.3. Players now get a message if they hit the border of the island which could get upgraded
3.4. ```gui.sk``` now uses non-persistent metadata instead of variables
3.5. Added custom armor stands addon
4. Pull requests
5. GitHub Account
6. How to contribute

### 3. New Features
#### 3.1. ```/island warp``` visits are now counted & top list added
In the late game of SkyBlock, players want to show off their island, maybe even get a big store set up to sell stuff. Counting the visits to the island with another top list gives the players another challenge: Get as many people to your island as possible. Especially for shop owners, this could be a big deal to get to the shop easier. To accomplish being on top of the top list might need some extra work for the island owner, like setting up jump and runs to give the players some reasons to visit the island, besides the store.

<div><a href="https://cdn.steemitimages.com/DQmY7JiYz1J5wRNW5HWSkMaSoYE3QWytyFS5m7un2TjEWQb/c1.png"><img src="https://cdn.steemitimages.com/DQmY7JiYz1J5wRNW5HWSkMaSoYE3QWytyFS5m7un2TjEWQb/c1.png"/></a>
</div><div class="pull-right"><a href="https://github.com/Abwasserrohr/SKYBLOCK.SK/blob/6bb8bb67ab087402eea5e82f2f45224de4c0c906/SkyBlock/SKYBLOCK.SK/Functions/warphandler.sk#L46"><code>View on GitHub</code></a></div><hr>

<div class="pull-right"><a href="https://cdn.steemitimages.com/DQmegg7wz8wHSSPVqx9LJERKzB41BULzR6L394vjvYQdYqS/2019-02-17_19.35.34.png"><img src="https://cdn.steemitimages.com/DQmegg7wz8wHSSPVqx9LJERKzB41BULzR6L394vjvYQdYqS/2019-02-17_19.35.34.png"/>
<div class="text-justify"><blockquote>Here are some people standing in a store at the cashier. A pretty island can boost the popularity of it, which is important to get into the top list of /island warps.</blockquote></div></a></div>

This is a little snippet of the ```warphandler``` function, in which the visits are counted. Currently, this is not abuse proof. There is some sort of protection to prevent someone from increasing this counter endlessly needed. An idea would be to use non-persistent metadata to count the visit only once for every player per island and server restart.

While other players could increase the counter, the player itself can't, I integrated there already an if statement that the counter only increases if the player isn't the warp target.


Commit: [Added warptoplist function & extra argument to warphandler](https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/146/commits/6bb8bb67ab087402eea5e82f2f45224de4c0c906)
Pull request: [146](https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/146)

---
#### 3.2. Some config files now use ```.yml``` instead of ```.sk```
Skripts ```.sk``` files have advantages if it comes to customization of items. But sometimes, no items are used. In these cases, ```.yml``` is better. Now, why is ```.yml``` better for the server operator? Since ```.yml``` is very easy to understand and commonly used on other plugins, most server operators already know how these work, it is also harder to mess up a ```.yml``` than a ```.sk``` configuration. But that's not all, we can change ```.yml``` files on the fly from the server, that means a server operator menu where the server operator can change settings right out of the game is going to be possible. This is also possible with ```.sk``` files but way easier to do with yaml files.

The only disadvantage on my side is that I have to load and parse all the data as needed. But that's worth it, in my opinion.

I use the SkQuery dependency to get yaml values and lists, here is how I do it:


<div><a href="https://cdn.steemitimages.com/DQmWeESegkhZFRce2DUBM1LnYHhzTKSEvD5MNNSbrS9Eaae/c4.png"><img src="https://cdn.steemitimages.com/DQmWeESegkhZFRce2DUBM1LnYHhzTKSEvD5MNNSbrS9Eaae/c4.png"/></a>
</div><hr>


And the yaml file looks like this:

<div><a href="https://cdn.steemitimages.com/DQmX2fPM6DJGkwYKaCMjvvbV3nP9FkndzBEybvFNTd4wCf7/c3.png"><img src="https://cdn.steemitimages.com/DQmX2fPM6DJGkwYKaCMjvvbV3nP9FkndzBEybvFNTd4wCf7/c3.png"/></a>
</div><hr>

With this setup, the user could enter as many yaml values as needed and I could later loop through a list which I read with the skript above. This is only a small example, of course. I want to mention that I should have separated the pull request for the configuration file format change but I didn't. But the commit messages pretty much explain which of these commits have something to do with the configuration file change. =)


Pull request: [146](https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/146)

---
#### 3.3. Players now get a message if they hit the border of the island which could get upgraded

<div class="pull-right"><a href="https://cdn.steemitimages.com/DQmVPZLfbJifHKRX3bPHCQsFCKhBtNLreP6tcWsqPS1E63i/2019-02-17_19.35.56.png"><img src="https://cdn.steemitimages.com/DQmVPZLfbJifHKRX3bPHCQsFCKhBtNLreP6tcWsqPS1E63i/2019-02-17_19.35.56.png"/>
<div class="text-justify"><blockquote>Decorating some shelves with goods is a great way to give a house a unique identity.</blockquote></div></a></div>

Previously, people who reached the border of the island where either confused or thought that the island is that size. Many didn't recognize that there are upgrades, to solve this issue, I added a notification if the player hits a border which could get upgraded.

I created a new function called ```checkforupgrades``` which is called if the player has no rights to build on the area. Then it is being checked if the player has the rights to build on the center of this island where the player currently has no rights. If the player has rights at the center but not at the border of the island, that means that the island isn't fully upgraded and the player should get a notification for that to upgrade it later.

Pull request: [151](https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/151)

---
#### 3.4. ```gui.sk``` now uses non-persistent metadata instead of variables
As I started creating SKYBLOCK.SK, I didn't really know much about metadata, but as I have seen, metadata is a nice way to store non-persistent data. ```gui.sk``` needs to store some data temporary to handle the GUI menus of the players. Variables are a good way of storing data persistently. While that works also for ```gui.sk```, a non-persistent storage solution like metadata is better, since I don't have to worry about not correctly deleted persistent data on server crashes.

Working with metadata is similar to variables, here is a quick example how it works:
<div><a href="https://cdn.steemitimages.com/DQmcGZUe4NWZZuuKbSVwJhsTxk2WMsamNmLvQ8cEJfH7hng/c5.png"><img src="https://cdn.steemitimages.com/DQmcGZUe4NWZZuuKbSVwJhsTxk2WMsamNmLvQ8cEJfH7hng/c5.png"/></a>

The example here isn't a code example of SKYBLOCK.SK but I wanted to show how it looks like and the reason behind it. Metadata can be used the same way as variables, but it is non-persistent, that's all and the reason why I switched to it for ```gui.sk```.

Pull request: [158](https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/158)

---
#### 3.5. Added custom armor stands addon

<div class="pull-right"><a href="https://cdn.steemitimages.com/DQmeeegCmjS6ZrjZrWvDftb7uGoRRBpAKqnZGHnpJKWPEes/2019-02-17_19.35.42.png"><img src="https://cdn.steemitimages.com/DQmeeegCmjS6ZrjZrWvDftb7uGoRRBpAKqnZGHnpJKWPEes/2019-02-17_19.35.42.png"/>
<div class="text-justify"><blockquote>With this add-on, almost everything is possible. The only necessary part is imagination, a stack of armor stands and some blocks.</blockquote></div></a></div>
First of all, thank you for suggesting this add-on for SKYBLOCK.SK, @sausemaus, and apologies for the pictures above about this add-on here, but I wanted to show these image and I didn't want to place them all here on the bottom of the post. The ability to customize the island furthermore like crazy is always a good thing in my opinion. As you have seen above, there are many ways and almost everything is possible with these armor stands. 

While there are already some plugins for that, I noticed that they all have made weird choices on how to edit the armor stands. I really tried to use it to explain it later to my users how they work but had to give it up after about 5 hours trying to figuring these out. Maybe I'm dumb and others can use it better but I decided to create one which is easy to use for me and the users on my test server seem to like it too.

<div class="pull-right"><a href="https://cdn.steemitimages.com/DQmTveLyo4k82yFTgHunGs5NGzauGmSTYBgFGRv76XXt2pq/2019-02-17_19.37.55.png"><img src="https://cdn.steemitimages.com/DQmTveLyo4k82yFTgHunGs5NGzauGmSTYBgFGRv76XXt2pq/2019-02-17_19.37.55.png"/>
<div class="text-justify"><blockquote>Players could build their favorite fastfood chain on the island.</blockquote></div></a></div>

Players can edit the armor stands by clicking on them and go through a menu which allows changing each EulerAngle of these stands and some other settings directly from the menu. Within the menu, they can click for example on "change angle x of the head" and then scroll with the mouse wheel to adjust the armor stand as needed while looking at it. That's how it should be in my opinion and it works fine. =)

To get this working, I have to start a while loop after the player selected which part should be moved. Then I can check on which hotbar slot the player currently is. If a player scrolls with the mouse wheel, the hotbar slot is changed either higher or lower. I can save the last hotbar slot and determine if the slot increased or decreased and then do the adjustment on the fly. I have made a video below where it can be seen how the hotbar scrolling works. The hotbar is the inventory part of the player which is displayed always on the bottom of the game.

<div class="pull-right"><a href="https://cdn.steemitimages.com/DQmTMfP1A7PB2PPQS2jKXT7h9omESDkG5bnJZzTgvgRwRBQ/2019-02-17_19.38.01.png"><img src="https://cdn.steemitimages.com/DQmTMfP1A7PB2PPQS2jKXT7h9omESDkG5bnJZzTgvgRwRBQ/2019-02-17_19.38.01.png"/>
<div class="text-justify"><blockquote>Build you friends into the decoration of the buildings on the island.</blockquote></div></a></div>

As this while loop would go on forever, I decided to add a timeout, if the player looks 5 seconds away from the armor stand, the while loop stops automatically. The counter gets deleted if the player looks again at the armor stand. 

Compared to do everything with numbers and complicated commands, this is really fun to do and I had a good time creating these armor stands, It is really satisfying to make them. I need more spare time to make more of these custom armor stands. :3 These examples in the pictures have been made by me and @mountaindewd.

Here I show off how it works and how fast I get things done with this newly added add-on:

https://www.youtube.com/watch?v=EnT5PzVaRO8


Sometimes I also have some old habits, I didn't notice that I merged the addon ```customarmorstands.sk``` with tabs instead of spaces, this is going to be fixed soon in the following pull request to keep consistency. =)

Pull request: [156](https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/156)

---

### 4. Pull requests
https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/146
https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/151
https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/156
https://github.com/Abwasserrohr/SKYBLOCK.SK/pull/158

---

### 5. GitHub Account
https://github.com/Abwasserrohr

---

### 6. How to contribute
You're interested in contributing to SKYBLOCK.SK? Feel free to contact me on Discord, it is the easiest way to get in contact with me and I'm open to everyone who wants to join. I'm the sewage pipe there.

Discord: https://discord.gg/FRuK5BC

---

<div class="pull-right"><a href="https://cdn.steemitimages.com/DQmbNASWZgTDCnTEGPXKyxeyPffNrKaSH7UK5F61m6N4P9e/2019-02-15_16.10.59.png"><img src="https://cdn.steemitimages.com/DQmbNASWZgTDCnTEGPXKyxeyPffNrKaSH7UK5F61m6N4P9e/2019-02-15_16.10.59.png"/>
<div class="text-justify"><blockquote>There where some people who helped me testing the new addon out which also gave me important feedback. Thank you for your help, flyerchen, skyroadfan, mcsiempre, jongartv, altonos and sausemaus. :)</blockquote></div></a></div>


Thank you for reading my contribution post. I thought on how to accomplish a smooth and easy way to get the armor stands to work, which took some time. 

I've gone through around 5 different concepts on how to change the armor stands and doing it with the scrolling wheel of the mouse was the easiest way in Vanilla Minecraft for me. Of course, there are easier ways, but Vanilla Minecraft simply doesn't have that kind of custom menus which would be needed to make it even easier. 

It seems that most of the players are happy with it. There are always people who understand it instantly and some who need a 2-hour tutorial to forget it 5 minutes later again. But everyone said that it is way easier than before which was my goal. :3 Also, I had to include SKYBLOCK.SK support, which was another reason why I created it.


Do you have feedback to this contribution post, SKYBLOCK or the new addon? Please share your feedback with me in the comments. =)


Have a great week

@immanuel94
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,