[MUSIC]
>> Welcome to the second stream about
Azure Cloud and this time
we are trying to do some of the things we
did last time and then we are going to jump over to setting up
an actual development Minecraft Server
and trying to access that one with IntelliJ.
The idea here is that you can much quicker test out
new ideas and features in
Minecraft if you have a direct connection to the server,
and you can then change code in IntelliJ and that will directly
affect the gameplay without rebooting
the server or uploading a new file of something.
This is what we are trying to achieve this time.
First step, I guess,
is to quickly show you what we did before.
You just click on ''Start free account'' and then you can see
here you will get $200 of free Azure credits.
After you have set that up,
you are going to get into this view
here and last time we created a virtual machine.
We're just going to create a new Ubuntu Server,
then we use all the defaults here and this one, for example,
then we are just going to go with
the server idle head last time and we are going to say again,
I just want a normal password here.
Then the only important thing is that there
is at least this is the edge port available,
otherwise we cannot connect to
the server and that's pretty much it.
The idea of this was just to show you,
it can be much easier than last time.
If you done this once,
the next time is much easier.
Now this server is being deployed for us,
this should take maybe a minute or something.
While this is happening in the background,
we can already go to the next step because we want to
create a Minecraft Server and we want to set up a plugin on this.
You can see here they are just setting up a normal project.
All you need to do then after this has been set up,
is you have this Go to resource and then you
get into the normal view of this server.
Create a connection to the server and for that,
we'll need to know the IP address so
we can connect to it and that is shown over here,
this is the IP address that I need.
Let me quickly set up that,
we just need to create a
new and you can see you are connected then to
the given server and then you just need to provide
the password and that should now give you access.
That's pretty much it. Now you have
a running server and you
can not only install obviously Minecraft on this,
but you could host a website and stuff on that
and run Nginx and things like that.
Then the next thing here we can see we need some Java version,
to be able to start a Java in Minecraft instance.
This is done now, Java minus
minus version and we can see if this is
now 17.0.1 and that's the same that I have locally installed.
To the next step, we said we need a blank spigot plugin.
We need to set up something for that.
All we need to do for that is we need to go into
IntelliJ and we say then, for example,
new project and in my case,
I want to have a Maven project.
Now we need a name for that let's go into
development Azure and then let's call it tutorial.
Now we have a new project you can see here
there are some defaults set up.
The first thing we need to do is
follow some of the instructions that we had in the tutorial here.
We are going to wait for this to finish.
What we need to do now is we are building
this bigger JAR on the server,
but we need that on the local computer.
Because we want to develop
the plugin locally and then we want to upload that to
the server once and after that we
want to use the hot swapping functionality if possible.
Wait for this year to quickly
finish and then after that has finished,
we want to download the files from
the server to our local machine,
and we are done now.
Let me try the same commands with this one.
Let's see what happens then.
We have this part so we can close this for now and
we can go back to the tutorial thing and we'll
see that the only thing that they do is basically create
a new package and then in that they create their first Java file.
Now the next part is that this file cannot yet be found by spigot.
We need to make sure that it can be found by spigot and
for that, we need to provide a plugin YAML file.
We are going to go under the source folder new create
a text file path was DE and then this and then the plugin name.
We should be able to create a JAR file out of this.
This building gives us then
a small JAR file here and
this JAR file is basically like a ZIP file.
What we can do, we can actually look into that ZIP file.
We can see if this is what it looks internally.
We have our plugin YAML and then we
also have the file that is being referenced in here
so that should be working and now
we should have our second version of
our plugin running on the server as soon as this
blows up and we can quickly test if the command works.
Now let's just write a test.
We can see in the console already command is working.
Then let us also do the same with
a Minecraft client to make sure that works and we are
going to say we need the IP address of
our new Azure testing server and that was over here.
That works already. If I now type a test we can see it tells us,
''I'm sorry, but you have no permission to use that command.''
I am not allowed to use that command.
We should be able to get around this by making me an op
in Minecraft that is the Atman rank in Minecraft.
Now I can write a test.
We can't see any outputs.
It does tell us we executed that,
but it doesn't give us output
because that output is only the console.
It still works even though we own the game.
What we can do now is we can start
connecting to the server and for that,
we only need the IP address again from
our current server in IntelliJ we go up here to have
the run configuration and in the run configuration we want to have
a remote and then the address in this case,
I define here as a local address.
To create a tunnel to
a given server all you need to
do you don't even need this spot thing here,
you just say SSH.
Tunnel should be on our local machine on port
5008 also on the remote machine on 5008.
We could change this to any other thing.
Then we need to provide this server that
we want to connect to so that we can again,
obviously look up in here.
That is our IP address and now it ask us again about
the password because we need to authenticate ourselves.
Now we can see we are connected,
address already in use.
Well, then that did not work. Let's exit.
Let's just check 5009 maybe.
We don't have these error messages.
We should be connected with that and now we have
a connection from our local machine to the Azure Cloud Server,
and that should allow us now
to connect to that. We can set this up.
This is remote hot swap and now we should
just be able to say we want to connect to the server.
Now we can start changing our Minecraft Server on the fly.
Now we can actually say this is a parameter here,
we can accept the parameter,
now we can actually return this length of the input.
We could say input.length and then we need to make
sure that our system doesn't break if that is null or something.
If this hot swap go back to
the server console and type in the command
again and we can see we get a length
of four and now we can just change this right,
we can say length of I don't know s, so this is super awesome.
We can, instead of needing to reboot and
re upload every single change that we do,
we can do that on the fly now.
Now we have the play object and now we
can do some simple operations on the player directly.
We could say the test command should now
instead of just typing something,
it should actually do something to the player object.
In this case, we can say for example,
player and then set velocity and
that is the current speed that we have in a given direction.
We want that to be a new vector.
This would tell the system now that
this specific player should be moving up into the air.
Now if we save that we hot swap this again,
we go back into the Minecraft client
and we type in the same commands,
we jump pretty high to our death maybe even.
But now we basically have
a super jump commands and we
didn't even need to reboot the server. This is super awesome.
We can just do that while the system is
running and we can test out new ideas.
We are good for today and thank you
for watching and participating.
[MUSIC]