What is up all my geeks and gamers tech geek 1019 here coming at you with another Forge modding tutorial today we are continuing with the dimension tutorial last time we left off we actually created our portal block but now we need to create our actual teleporter so that we can go into the Other world and it creates the portals and stuff like that so let’s get right to it to begin we have to create something actually up here and it is a private final world server and it’s called world server in Stan’s Stan’s world server instance and we’re going to put that in Here that’s gonna be this world server instance server so basically what this is is this is the server that all of the data of the world is going to be stored on we’re also going to create another private final there’s going to be a random okay And instead of here we have this dot random equals new random and this is going to be world server get seed and this is going to basically be saying it’s gonna get a random seed when we go through the portal okay first method we have I don’t know why of this much space In here first of all that we have is public void place it in portal and this is going to have an entity entity double our to double our for and double our six and no not double floats are eight okay this is obviously going to place you in A portal and it is also going to create one if it needs to so the first thing we’re going to do is if this world server instance provider dot dimension ID does not equal 1 which is the nether and if this does not is not a place entity an existing portal entity two Four six eight then we’re going to make the portal for the entity and we are or we are going to place you in an existing portal at these parameters okay so that is what we have here okay two things outside of this we are going to have an else and this else Is going to say int I is going to equal math helper dot for double and it is going to be our and to be depth position X so instance your eye is going to be the entities position copy that Jay is going to be Our Y position K is going to be our Z position this is actually going to be our y -1 for some reason don’t actually know why that’s weird we’re also going to have some bytes that is b0 and there’s going to equal 1 1 and we’re also going to bite dealing fight B 1 and it is going to also equal 0 not also it is going to equal 0 okay down here we’re gonna have a for loop and it’s going to be for integer L equaling negative 2 and L is equal to 2 and plus myself okay and then another One for integer 1 equal to negative 2 L less than or equal to negative 2 2 plus 1 and for integer J 1 equaling negative 1 J being less than 3 lose to that and plus plus J 1 we’re going to have integer K 1 equal to I which is our is the exposition plus I 1 times byte 0 plus L times byte 1 is your L 2 L 1 my bad is going to equal J plus J 1 and integer I 2 is going to equal K plus I 1 times B 1 minus L times Byte 0 and there you go we’re gonna have a flag as equal to J 1 less than 0 which is always going to happen since J 1 is negative 1 which is less than 0 and then we’re gonna have this dot world server Instance dot set block K 1 L 1 and I 2 and if the flag happens then we aren’t you have our surrounding thing which goes in our or replacing air so we’re just going to place down our portal blocks obviously okay down here we’re going to have entity dot set location And angles and we’re going to make a double of I a double of J double of K and also we’re going to have the entity rotation and regard to dude zero point zero F okay so that’s setting the where he’s going to end up on the XY and Z as well As his rotation and then we’re going to have the motion on the X which is going to be equal to the motion on the Y which is going to be equal to the motion on the Z which is all going to be equal to zero because you don’t move when you Create a portal you don’t move when you are in the portal you just stay still okay all righty so looking good there okay so we’re done with that message for now not for now we are actually done with that method right there okay so our Next method is going to be a public lean place in existing portal and it is going to actually contain the same parameters as this one so I’m just going to copy paste so that I don’t have to do that okay nice all right um okay this is going to put the player In a portal if it already exists so this is going to tell stuff like where to put it basically sir gonna create a short that it’s going to be 128 because that is the building height of minecraft or a double that is d3 and it’s going to be Equal to negative 1 we’re going to have the integer I that is going to be equal to zero we’re going to have an integer J that is going to be equal to zero we are going to have an integer K that is going to be equal to zero We are going to have an integer L that is going to be equal to another one of these which is the position of the X let’s see we are going to have yet another one it’s your I 1 that is going to be the Z position and then we’re going to have a Long J one that is going to equal chunk chord beat hair dot chunk that and L and I 1 so this is this long is the the what’s called the x and z chunk that is going to want to check for in a little bit we’re gonna have a double that’s d7 Not 8 7 and we’re going to have an integer that is ll supreme all of these will come into play in a little bit now before we move on in this method we are actually going to have to go up to the top here and go out here And we need another private final except this is going to be a long man and this is going to have destination coordinate cache and those are going to go new long gosh okay and basically what this is is it’s for storing existing portal locations so That the game can quickly go like oh the player is here and there is a look a portal right here so let’s put them in that portal so that’s what that’s gonna be used for we’re also going to have another private final list and there’s going to be destination chords in it Keys there’s going to be a new array list put that and it’s yeah and this is what basically this is is this is the list of coordinates for the portals okay so the next thing is an if statement and it is if this the destination coordinate Cache dot contains item J one which was our long that we created before which was the x and z coordinates then d3 is going to equal zero which I believe it equaled negative one before and then we were going to have I equal to the position oh wait no whoops I forgot to Set something before d3 actually it’s going to teleport or sapphire dot portal position which is a new thing I’ll total position which is going to be equal to this is the teleporter dot or position and whether this is going to be easy this is going to be this destination coordinate Cache dot get value by key and the key is j1 which is the X and the Z so this is going to find our portal position on the x and z coordinates we’re gonna set d3 equal to zero point zero we are going to set now I isn’t going to equal our Position on the X J is now actually going to be the port position on the Y and K is going to be the portal position on the Z and then we’re gonna have portal position dot last time update time and it’s going to evil this dot world server instance and I’m just going To get to the total world time so it’s just going to check the time and make sure that it is the same time and then we’re gonna have a flag that is going to equal false so it went leer we can check for a flag what’s wrong oops skip something I Forgot a boolean flag that originally true now it’s going to equal false if it contains our X and Z so there you go so it’ll let it run then so I think that’s all I’m going to do for today I know this is a lot of information oh yeah I forgot we want This to the entire statement just to get ready Eric return false it’s going to return false anyway all right now that is the last oh wait that is a semicolon there you go okay that is the last thing that we are going to do for today I know this is a Lot of Mason information so I just want you guys to you know get this information without you know overloading I will obviously put the source code onto github that a link is in the description so if you want to check it out and compare just make sure you’re Doing everything right you can check that out but otherwise thank you guys so much for watching I hope this helped if it did be sure to hit that like button if you have any problems please do email me it is in the description I it’s kind of hard to reply to comments because Your questions and problems actually just get lost in the comments because I get a lot of comments obviously so try to email me instead I will definitely reply a lot faster if you do so if you want a quicker reply then I would suggest emailing me if you think it’s Like a simple problem then you could put it in the comments because there should be some people at least in the comments that could help you out so yeah once again thank you so much for watching and I’ll see you guys next time peace Video Information
This video, titled ‘[1.7.10/1.7.2]Minecraft Forge Modding Tutorial #17 – Custom Dimension : Part 3’, was uploaded by techgeek1019 on 2015-03-28 18:35:46. It has garnered 4570 views and 34 likes. The duration of the video is 00:19:10 or 1150 seconds.
Check out the other tutorials here: http://bit.ly/TechgeekTuts
Don’t forget to Subscribe: ►►►http://bit.ly/SubToTechgeek1019◄◄
src code: http://bit.ly/ModdingFiles
Social Media ● Twitter: https://twitter.com/techgeek1019 ● Facebook: https://www.facebook.com/techgeek1019youtube ● Instagram: http://instagram.com/techgeek1019
Thanks for watching all my geeks and gamers! Remember to rate, like and subscribe if you haven’t already!