What is up all my geeks and gamers tech geek 10:19 here coming at you with the fourth part of the in tutorial today we will be continuing our teleporter class so last time we left off we started our place an existing portal method here and we will Be continuing that so we had an if statement right here and we will go from here with an else statement for that if statement and the else will say will have a for loop in it and it’ll be for l3 it’ll equal L minus short one and if you Look up here L is our exposition and short one is 128 so that is what we have there and then l3 will be less than or equal to one so it’ll check if it’s less than or equals one plus 128 and then we will have plus plus l3 so it’ll keep Going and it’ll run it okay then for loop we will have a double D four will equal double L 3 plus 0.5 be minus minus entity dot POSIX POSIX there we are and there you go for that so for L being L 3 being L minus short 1 and L 3 being less Than or equal to 1 plus 128 we will have a double that will be L 3 which we defined up here plus 0.5 minus the exposition so that is what that means right there and then we will have another for loop for integer l1 it will be equal to i1 – Short one so this looks like we are setting up our Z position here is what it appears to me or something having to do with the Z because as you can see up there I 1 is our Z position and then we have L 1 is less than or equal to i1 Plus short 1 which is 128 and then plus plus 1 or L 1 right L 1 sorry about that inside of this for loop we will have another double this one being t5 and this time it’ll be a double of L 1 obviously and it’ll be less than no more That plus 0.5 D again and then minus the entities Z position okay there you go with that and then we will have another for loop and I would assume that this for the height yes it is integer I 2 is going to equal this not world server Instance dot get actual height so this is the height which is the Y minus 1 and I 2 being greater than or equal to 0 because obviously you want the elevation to be more than 0 and minus minus 2 I 2 inside of this for loop we’re going to Have an if statement and it’s going to be if this dot world server instance dot get block walk your block l3i 2 and L 1 equals equals our portal block what did we have sapphire portal our portal block so if the block at the X what is that Let’s see at the l3 the what did we set that that was the x thing that we had up here and then the Z which we had up here as well as well heard that is here the Y and the Z the certain X Y and Z’s are Our portal blocks then obviously you want to do something with that so inside of our if statement will have wile so it’s going to be if that while our world server instance dot get block is l3 and i2 minus 1 so below the thing as well as A1 again and as long as it equals the same thing that we had up here so as long as the block that we are looking at amp while the block below that one then we’re going to have minus minus i2 ok and then we are going to go outside of This while loop and go back into our if so if that happens we’re going to set d7 equal to a double of i2 plus 0.5 D as we did before minus the Y position so we’ve done all the positions so far and we’re going to have another double-double d8 And that is going to be D 4 times D 4 plus D 7 times D 7 plus D 5 times D 5 so if we look at this closely d 4 is our our L 3 plus 0.5 minus our X so that we’re multiplying those two together Plus D 7 and D 7 which is d 7 is what we declared up here the Y and D 5 and D 5 which is our Z coordinates so outside that we’re going to have if D 3 is less than 0 point 0 D or D 8 is less than D 3 Then D 3 is going to equal D 8 which we declared up there and I is going to equal L 3 which was that Y so I is now this is our integer before that equaled 0 J is going to equal I 2 and K is going To equal L 1 so basically what we just did there is we set up a bunch of coordinates for this thing to go and check so that it can place it in existing portal so it’s checking our players coordinates so that it knows basically where to put the portal when You go through the other side so that’s basically what that’s doing so we will now go out actually one two one two three four five six almost to the return false so one two three four five six yeah outside of this so right here if d3 is Less than or equal to zero point zero so if it’s less than equal to zero and if the flag that we declared I believe earlier where was that yes the flag is false so if it is false then this dot destination coordinate cache dot add j1 And that is going to be a new teleporter sapphire dot portal position they are not declared portal position position and the portal position is going to be I J okay which we just set up as well as the world server instance and the world time get total world time okay there you Go with that so that’s good so if it’s false and D 3 is greater than or equal to zero then we’re going to add a new portal position on the x y&z is what it’s saying there and then we’re going to also add a destination coordinates Key with a long value of J 1 so that is setting with our key to the other one and we’re going to system dot out dot print Allen aye our we’re gonna print out the location plus j1 okay I’m going to have that print out okay then outside of this one We have I know this is a lot of math a lot of the coordinates and stuff like that we’re getting close to the end of this class so hang in there with me okay so we’ll have a double D 11 and we’re just going to equal double I spell Double our own double I plus 0.5 so that’s our X and then double T 6 is going to be a double of J which I believe was the Y plus 0.5 and D 7 is now going to equal a double double of the Z and 0.5 okay That’s where we have there in order to sit integer I for equal to negative 1 for right now okay so it sounds good so far we’re going to have a bunch of if statements here now if this now this is where the stuff that we had earlier in These tutorials went into play it is going to be checking for a bunch of stuff and I will explain it once I finished this one so this is I minus 1 J and K and it is going to check if it’s equal to our our portal block obviously and that is Going to set I for equal to – okay so I – one that would be the block to the left okay so that is the block to the left and it is going to set I for equal to two okay then we will have another one and I’m actually going to copy this entire if statement oh shoot copy this entire if statement and actually paste it a couple times one two three so that we have four if statements and we’re just going to change this to plus 1 so that is to the right and then We’re going to get rid of that and add it onto the end of K so that’s the Z and I and K plus 1 and that is all going to check the positions this is going to equal 0 this is going to equal 3 and This is going to equal 1 and that is that so basically it’s checking that all of these positions to the left to the right to the back to the front our portal so it’s checking that and then we’re going to set an integer of J 2 equal to entity dot gets teleport Direction so this is it’s checking the that is going to be the direction that you are facing so backwards forward so that knows where to place you when you come out of the portal and then we’re going to have another if statement that if I 4 is less than negative 1 which Really wouldn’t happen since we say which is when it’s regular so when it’s not one of those blocks basically they’re going to be a couple things and this is all going to deal with the rotation of your players so it’s going to set integer K 2 equal to the direction dot rotate left So this must be and then a parameter for an array of AI for my bed so I guess that’s basically rotating you so like you go in to the portal facing the one the one way then that’s not facing towards the portal then it’s going to turn you basically and then we’re going To have another integer that is l2 and this is going to be the direction dots offset X and there’s an integer I 3 is going to equal the direction offset z of i-4 and integer K 3 is going to J 3 from whoops and so your J 3 is going to be The direction dots offset X but this time for K 2 where did I declare k2 not exactly sure I must have declared it earlier and then integer K 3 is going to be the same thing as this one except for its you okay okay and we’re also going To set boom flag 1 equal to if the world server if it doesn’t equal the world if flag 1 equals not this world search that is err block at I plus L 2 plus J 3 and J just J because that’s why and k plus I 3 plus K 3 so this is adding together all of the coordinates and rotations at this point or does not is not this dot world server instance is air block again and this time it is at I is at I plus L 2 plus J 3 and we’ll go back in and we’ll go back And look at this stuff over again obviously and this is going to be J plus 1 so the y plus 1 as well as k plus I 3 plus a 3 so much math right guys yay for math okay and then we’re gonna have another booing that’s also flagged too And it’s going to equal just about the same thing except it looks like we’re getting rid of K 3 so the offset of Z at K 2 so I’m just gonna copy this guy and we are going to go at fad and we’re just going to get rid of the K threes here Everything else appears to stay the same ok now excuse me we’re going to have an if statement that will deal with the flags so if you have flag one end flag two at the same time here comes more directions then it is going to be I four Is now going to be equal to direction that rotate opposite of i-4 okay and then k2 is now going to be the direction dot rotate opposite of k2 okay and then l2 is now going to be equal to the direction dot offset X and that is going To be i-4 and I 3 is now going to be equal to the direction dot offset Z of i-4 and then we can actually copy these two because we’re going to just use it both different variables and this is going to be J 3 and this is going to be K 3 and under K 3 we are going to have L 3 it’s now going to equal I minus J 3 so I – which I was the X minus the offset of the X d11 is not going to eat is not going is going to be less than negative Not equal to double J 3 and integer K 1 is going to be equal to K minus K 3 so our Z minus the offset of the Z now I forgot to change these these are cashews okay and what else do we have d 7 is not going to be equal to I did the other way not equal to double of k3 and flag one is now going to be equal to the same things that we had up there I believe let me just make sure yeah the same things as these so the two flags are still gonna be are still gonna Still gonna happen so the flags are going to be equal to the same thing what if I won one why what did I have wait what why would I like to do it there but they different uh-oh no boolean’s no boolean’s sorry just because we already said that they’re Bullying up there so this is Phi 1 and Phi 2 are still gonna be equal to this outside of this we’re going to have float f1 it’s going to be equal to 0.5 F and float f2 is also going to be 0.5 F okay all right guys we are back sorry About that xsplit bug down a little bit but that’s no matter let us just continue on if not flag one and slide two not flag flag then F 1 which tower float was earlier is going to be 1.0 F we are going to then have another if Statement if flag one and not flag 2 then F 1 is going to equal zero point zero F pretty standard also oh these are supposed to be alpha L sips so this is an else if flag one and two are true then f1 f2 actually is going to also be Equal to zero point zero F and this is supposed to be an else–if whoa what happened to my keyboard it just like got stuck on the s okay okay that is what we have there and then down here we have D eleven plus equals a double double float That is J 3 times F 1 plus F 2 times of floats of l2 and D 7 is now going to plus equal a double of again a float of K 3 times F 1 plus F 2 times a floats of i3 ok and then we’re going to have a Couple new floats float f3 it’s going to equal 0 point 0 F float f4 they’re all going to actually equal the same things so I could actually just copy-paste this one 1 2 3 this is going to be 4 5 & 6 so we have a couple more if statements If I four is equal to J 2 then F 3 will now equal 1 and F 4 will also equal 1 else if I 4 equals the direction that rotate opposite of J 2 the opposite rotation of J 2 then F 3 will equal negative 12.0 F and so will at 4th and Then another else if that should be Jesus birthday else if then another else if that if I 4 again equals the direction dot this time rotate right the rotation to the right of J 2 then F 5 will equal one point O and that’s six or Equal negative one point and then else F 5 will equal negative 1 and F 6 will equal one instead okay and that’s how we do that couple more lines here outside of this else we have a couple doubles that is d9 and that will equal the motion of the X of The entity so the motion towards the X as well as a double of d-10 which is going to equal the entity motion towards the Z which is backwards and forwards and then we’re going to have entity dot motion X is going to equal d9 x a double Of f3 plus B 10 times a double of f6 which f6 was 0.0 okay and then the same thing with Z except instead I’m just gonna copy this to save time instead it is going to be the motion of the Z this is still going to be d9 and the double Will be for f5 instead and for f4 at the end and then we’re going to have the entity’s rotation y’all and that is going to equal the entity not the entity what’s not let’s eat my code sorry about this guy’s what is this I set this equal To oh it’s a float what did I call it in this I called it just part eight okay it is going to equal part eight I go back down so everywhere it is going to equal part eight – a float of j2 x 90 so it’s like 90 degrees I would assume Plus a float of i-4 also times 90 90 degrees again I would assume and then we’re going to outside of this bracket have another else and this else is going to be the motion of the X is going to equal the entity’s motion on the Y as Well as the entity’s motion on the Z which is going to all equal zero because you don’t want it to move anywhere and then outside of that we’re going to have the entity dot set dot set location and angles just going to be D 11 d6 d7 the Entity dot rotation y’all as well as the entities rotation pitch and these are all going to return true and then another else smell else wrong and then else we are going to return false so that will go there instead and that ladies and gentlemen is one part of this This is our place in existing portal so all of this which I messed up there all of this is going to tell the game where to put you if you go through the portal and there is a portal on the other side so it’s gonna check for its coordinates it’s going to Check for your coordinates if you’re near it then it is going to put you in that portal because you are in the same place now I believe so we’re done with that for now I believe I had something that I wanted to add in here that I messed up Maybe not I feel like I did I messed up on something in here as I was reading my code the other day I realized that I had messed something up but I guess I did not then so yeah I guess good ok so there you go guys There is the place and existing portal in our teleporter class and we have a couple more like one more really really really long method that we have to do basically and then a couple short ones and we’ll be done with this class but for right now I’d like to thank you guys So much for watching I’m sorry it took me so long to put out this part school had really limited me and there’s a lot of schoolwork and stuff so I’m really sorry as I mentioned in the beginning of the video I have Amazon referral links That really helps me out so if you guys ever want some computer items just use my links and it’ll help support me also you may have noticed that little I in the top right corner of your screen and it is fan support if you guys want to Donate to me to keep the content alive and help me make better content even then you can donate a few bucks to me it’s not necessary but if you want to be if you’re feeling generous then go ahead donate to me I’m really appreciative and thank you guys so much so once again Thank you 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 4’, was uploaded by techgeek1019 on 2015-04-23 01:35:29. It has garnered 5032 views and 35 likes. The duration of the video is 00:34:21 or 2061 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
Amazon Referral Links: Graphics Card: http://amzn.to/1HWKgEz Motherboard: http://amzn.to/1aTqFYl Processors: http://amzn.to/1EeyNOZ RAM: http://amzn.to/1yRMm6x
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!