[Open Source] SkyBlock Minecraft Addon - We Need to Go Deeper [New feature #14]steemCreated with Sketch.

in #utopian-io5 years ago (edited)
The players of the SKYBLOCK.SK Minecraft game can now experience the nether by going through the portal.

Hello everyone,

Today, I can announce the addition of the nether to the game and also a change of the calcisland function. As I created the calcisland function, I didn't made it as I should have done it. This time, I improved it further and also added a complete configuration with every material compatible with the Spigot API (the server software, which is a dependency). If you're new here or just came through a search engine, SKYBLOCK.SK is free to use and open source (MIT licence), feel free to look into the repository linked below.

1. Repository

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

2. Index

  1. Repository
  2. Index
  3. New Features
    3.1. Added the nether
    3.1. Improved calcisland function
  4. Pull requests
  5. GitHub Account
  6. How to contribute

3. New Features

3.1. Added the nether

If a player decides to have seen enough on his island or the island is already full of stuff, the player can experience the same thing again on the nether side. It is also an empty room world where the player can build, but with a darker environment. There are spawning lava slimes and zombie pigman, which can drop some valuable resources. Because this changes the game for players, server operators can disable it, if they want.

This is how it works for players to enter the nether. The obsidian duplication prevention is also working in the video.

Because the nether is a separated world, it is needed that SKYBLOCK.SK can handle the world like the normal SkyBlock world to prevent any gliches or griefing. Fortunately, most parts of SKYBLOCK.SK were already made to support a nether automatically. Now, what had to be done to make it possible?

  • Problem 1: The default portal spawning
    If a player builds a nether portal in the vanilla game and then goes through it, it won't place the portal on the exact same location as in the normal world, because the locations are used differently. With default Minecraft, every step in the nether is 8 steps in the normal world.
    While this is a nice thing for transportation, it isn't that nice for SkyBlock, since everyone should have the portal on his island at the same spot and no special portal placement behaviour and also no difference to the normal world in distances.

    To prevent the default portal spawning behaviour, we have to cancel the teleport event, which is caused by the nether portal.

  • Problem 2: No portal is being created on the other side
    The teleport has been cancelled; now, we have to create our own portal on the opposite site of the world (nether or world). For this, I created a new function, which is called syncobsidian, which is going to need one obsidian to start and then searches all nearby obsidian blocks and portal blocks and copies them to the other world.

  • Problem 3: Obsidian duplication
    The player could deconstruct the portal in the nether and repeat endlessly to get more and more obsidian. This is normal and also possible in vanilla Minecraft.
    But in vanilla Minecraft, it doesn't make sense, since there is lava all over the place. But in SkyBlock, it is rare. We have to prevent that; I'll show that later in the post. Here is how I done the teleportation cancellation and the call of the syncobsidian function.

With this done, the player will now no longer be able to teleport using the vanilla way and gets a obsidian portal created on the other side of the world (nether or world). Now, we just have to focus on Problem 3, the player shouldn't be able to duplicate obsidian endlessly.

Because it makes kind of sense to simply remove the obsidian on the other side of the world at the same location, if there is an obsidian block, I now simply remove the block on the opposite site.

Example: I created a portal and thinking: I might be able to trick the system. Then I go to the nether, farm all the obsidian off and go back to my normal island using /island home. Then I see that the portal is gone on the normal world. That means, I have removed obsidian in the nether but it also got removed in the normal world because it is linked together. This is not included in vanilla so I had to include it. I added this to Events.sk

I only show new code here, but this event has some more code, I linked the Events.sk above.

Thanks to the new changes, the on world change event has now been removed, the same functions are now within the on teleport event, which works better than before with the on world change event.

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

McSiempre helped me out testing the nether for all kinds of bugs that might occur in the nether. Most parts have been working without any change, which is a good thing. =)

3.2. Improved calcisland function

The improvement of the calcisland has been forced by the new nether update, because it now no longer has only to calculate the normal island of the player, but also calculate the nether part.
While changing calcisland to work with the nether, I searched in the Javadocs of Spigot for some options to make the calcisland function faster and easier to configure.

Turns out that there were some things that helped me a lot! Before, every item had to be configured via. config.sk, but since that would be really messy over time, I decided to use yaml files. Yaml files are perfect for this kind of stuff. The negative side is that reading yaml files is slower than just using the variables.

That said, the island calculation takes some time and is within a separated thread. There is no lag and the loading of all item values out of the yaml file takes "just" 0.1- 0.11 seconds. This is reasonable for that amount of data being loaded, because it is within a thread and doesn’t halt the game.
This is how the blocks.yml file is structured, of course, there are more materials defined than just these two. But to show it, I decided to only add two. =)

For those who might be new to Skript and want to see some new stuff, here is how I loaded the yaml file list into a local list variable.

With that, I can now have a really big list, named "blocks" in the blocks.yml file in the yaml format and use it as a local variable. If I need for example the experience of a dirt block, I can get it by looking into the {_blockexp::DIRT_BLOCK} variable.

This new addition makes it a lot easier for server operators to change the experience per block, because all the materials are already predefined and only have to be changed in blocks.yml. The default block experiences are not balanced perfectly yet and are going to get some changes with feedback from users later.

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

4. Pull requests

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

5. GitHub Account

https://github.com/Abwasserrohr

6. How to contribute

If you like Minecraft and also have some fun by playing around with Minecraft server tools, SKYBLOCK.SK is a project you might want join. If you want to get more information, join the Discord below, I'm Abwasserrohr there, the sewage pipe guy. =)

Discord: https://discord.gg/FRuK5BC


Thank you for reading my contribution post. :) People have all kinds of ideas, sometimes they're very nice and sometimes either completely overpowered or hard to accomplish. But the nether was something that had to be added, it is just a nice opportunity for players to farm enough obsidian, and then go in the nether to have more space to use.
I'm sorry that I added the blocks.yml in the pull request, I could have done that separately, since it doesn't really have much to do with developing, it's more like configuring something... =D

I'm trying to make every weekend a contest where people can win some STEEM, SBI or other stuff. If you want, you can join. This weekend, everyone who dismantles at least one snowman gets 1 SBI, the top 3 get more. Feel free to join with Minecraft Java 1.12.2 - 1.13.2 on join.skyroad.me.

As suggested in the last comment by @helo, I tried out https://carbon.now.sh for the code part to make it more comfortable for the eyes to read. Adding Skript to carbon is not that hard as I tought. But making it better than now with all the RegExp seems painful for me. :3

For that reason, I'm not going to finish it completely for now and work with it or use screenshots of Notepad++, where I use a custom language syntax which works nicely. I also asked the Skript community if they're interested in adding Skript to carbon and if there would be someone who could help me with it. But the people there are more interested in a fully working editor and not that much in carbon to create pictures of code. ._.

Do you have any feedback regarding this post, the new nether, the new calcisland function or SKYBLOCK.SK as a whole? Feel free to tell me your feedback, suggestions or other things either here in the comments, on Github or on Discord.

Have a nice weekend and keep on steeming

@immanuel94

Sort:  
  • Great article, awesome explanation of the problems encountered.
  • The video and images add to the quality of the article.
  • Good try on the code sample, it made me realise the difference of syntax for the if statement with the possessive 'sand world is, it was quite humanly readable.

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. =)
I'm trying to improve the syntax highlighting for code samples further in the future.

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

ǝɹǝɥ sɐʍ ɹoʇɐɹnƆ pɐW ǝɥ┴

Hello, mad curator! :P

Thank you. ^^

Ich finde es cool, dass es jetzt einen Nether gibt

Hi @jongartv!^^

Freut mich, dass dir der Nether gefällt. =) Wenn du Bugs findest oder Ideen hast, melde dich gerne jederzeit. ;)

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

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 6 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 6 SBD worth and should receive 129 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

This post has received a 3.13 % upvote from @drotto thanks to: @sbi-booster.

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.18
TRX 0.13
JST 0.029
BTC 57659.57
ETH 3030.07
USDT 1.00
SBD 2.26