What is up all my geeks and gamers techique 1019 here coming at you with the second part of the dimension tutorial for minecraft forge 1.7.10 last time we left off we made our own neighbor block change method which told our portal block what to do when certain things were on each Side of it so let’s get right back into it next method next method we’re gonna do is a public integer quantity dropped it’s just going to be a random integer if I could spell random that I’d be create this is pretty self-explanatory I would assume we’re using Java util this Is pretty self-explanatory it’s just a method that says what it would drop or how many of the item it would drop if you broke it and we’re going to put 0 because if you break the portal you don’t want to drop anything so next method we’re going to do is Public void on entity collided with block obviously this is just going to be a method that tells the portal what to do if an entity walks through and basically what we want that to do is we want to send it to our new dimension so it’s going to be world world in integer X integer Y integers Z and an entity and there you go and we’re going to import entity and that’s net dot minecraft entity so we’re going to say if entity dot writing not ridden by entity dot writing entity equals equals null and the entity dot written by Entity equals null and I spelled no wrong and entity is an instance of entity player and P basically what that’s saying if the entity writing entity is null so as if you’re not writing something I believe and you’re not being written by anything and it’s an instance of player and ste player MP I’m not sure what that is that is just this is basically just the entity player just the just the player so if that then entity player and we’re going to set that as the player because that’s what you are is a entity player and the entity inside of that it’s gonna be Minecraft server server equals minecraft server dot get server we’re just getting the minecraft server here so now we’re gonna say if entity instance of hence the player MP and it’s cheap player okay which is true because we set it up there entity player and entity instance entity is the instance of that And we said if it is so that already says that it is because otherwise it wouldn’t get past here so that it’s true and also if the player which we set up there dot time dot time until portal is greater than zero basically the time until portal what does this say time Until portal whether the entity right render entity even if that’s other care I’m using Koval rendering that’s that right anything else that’s just it okay so I assume that it is just the time until the portal is rendered soon then the player dot time until portal is ten And then we’re going to have an else if else if else if the player dot to mention does not equal our dimension it’s not deep so if the player dimension is not our dimension then the player that time until portal equals 10 I still don’t know what that means but we are Going to say if he is not in our dimension and he’s in any other dimension and we make the portal and he goes into the portal then the player that MC server dot get configuration manager dot transferred the player to the dimension this is actually going to Be the other one but we are going to have the player and the dimension dimension ID as well as our teleporter which we will creates at a later date this is going to be our teleporter so that it knows where to send us and this is going to have the server dot worlds This is the world server for dimension and this is for this dimension that we are creating obviously what else after this we shall create an else statement else the player that time so portal equals 10 so basically this is saying if he is in our dimension Then we send him then we send him its configuration manager dot transfer player to dimension it is the player the dimension ID which is 0 because that is the over world as well as put him through our teleporter again sorry about that I’m confused and I believe it is The same except the server dot the world server for the dimension is 0 because that is the overworld and there we go for the entity collided on blocks so that will tell it what to do when a player goes through this portal block ok seems good there Alrighty now we will just set a few things there’s a few things left I think that’s fine alrighty next method we’ve got is a public join and it is try to try to create a portal and it is going to try to create the portal in a world With an integer X Y & Z of course in this method we are going to set any biked this bike is going to be called B 0 and it’s going to equal 0 and another byte which is B 1 and it is also going to equal 0 So we’re going to start off with an if statement and if the world dot get block if world dot get block that would be X minus one y and z equals our block or our or should I say that is going to be our surrounding block for the same thing basically So we’ll just copy paste this into here and this is instead going to be X plus one so we’re back into these this math stuff that we had before you know where the block to the left and to the right is our block or to the right should I Say then we’re going to have the byte equal what so it is going to be true and outside of that if statements we are going to have another if statement and it is going to be just about the same thing so we shall just copy the whole Thing and I did not put it in its parenthesis and basically it is going to be the same thing except it is going to be up and down rather than left and right I actually messed that up right there it is going to be Z minus one as Well as Z plus one so anything to if it’s the top and bottom is our block or should I say top and top or bottom is our block below or above it then byte 1 is going to equal 1 as well outside of that if bite 0 equals fight 1 then return boss So if they are the same thing if basically if both of these if that is the same as that then don’t create the portal because otherwise you’re basically having a block to the left and above it so then it wouldn’t work then you can’t you can’t create the portal Okay then we are going to have an else and this else will say if world dot get block get block X – bite 0 y + Z – bite 1 equals equals dot air so if the block to the left of our portal block is Sapphire or because we set B 0 equal to 1 which means it’s true and the block below it is and the block below the portal is air then we want to set the X not equal to by eat 1 0 + and the z- equals b1 oh excuse me All righty outside of this we’re going to have three integers int L integer 1 oh no sorry just two integers and we’re going to have a for loop for L equaling negative 1 and I 1 less than or equal to 3 and for that as well As for I 1 I 1 equaling negative 1 and I 1 being less than or equal to 3 and I actually think I messed this up yes this is L excuse me and this is less than or equal to 2 excuse me for that all right We’re gonna have a boolean flag and it’s going to equal L which is going to equal negative 1 or l equals 2 for I 1 equals a 1 or I 1 equals 3 because that is obviously going to be well I did something wrong there that should be negative 1 my bad So the flag is going to be L is negative 1 or L is negative or as 2 or I 1 is negative 1 and I 1 is 3 and that’s completely possible because we set it less than or equal to and we also set it equal to negative 1 over here so we’re Going to have if L is not equal to negative 1 which should be and L is not equal to 2 or I 1 is not equal to negative 1 or sorry excuse me and L bow hold on getting lost in my code I want is not Equal to 3 and I believe I missed mmm space there and we should be good and I 1 is not equal to 3 then block J 1 will call it is world dot get block X plus bi 0 times L which L is going to not equal 1 and equal and not equal to as well as what else then y plus I 1 oops caps I 1 and Z plus V 1 times L so that’s what that is and then we’re going to have if the flag if we have that flag that we declared Right up here so if I is not equal 1 and L does not equal to or I 1 does not equal 1 and I 1 does not equal 3 and if J 1 which is that block does not equal our block that surrounds our portal if It does not equal that then we return false because it cannot equal that false that because if it does not satisfy those things proper blocks are not around that and it cannot create these Portola nice alright so outside the second bracket over here went I have an else if statement and It’s going to say if the J one block does not equal blocks is not equal block stock air so if that block does not equal the air and G 1 does not equal our block that so if else if this block up here where is it the block to thee let Me think let me think let me think 1 plus plus 1 I believe that is the block to the right and to the top it’s the top right most block that you can have and the Y would be behind it I think or so so if it doesn’t equal or if It doesn’t equal the air and the block then oh actually this is going to be our fire once we make it we’re going to make fire eventually so if it doesn’t equal air and it doesn’t equal fire because the fire would light it then it will return false again And came what’s wrong here if J 1 does not equal sorry we don’t have that yet return false all the way out here then 1 2 3 right here we’re going to have a for loop to close it out and it’s going to be 4 L equaling zip and 4 L being less Than 2 L suppose L so this is basically what we were doing before except it equals 0 and it’s gray lug less than 2 so it’s in between 0 2 and then we’re gonna have the for I 1 equals 0 and I 1 less than 3 and plus plus I 1 and then We’re going to go under that and we’re going to say world stop set block X plus white 0 times L y y plus I 1 and Z plus bi 1 times L and the block is going to be sapphire blocks shots were teleporter block that we do not have yet dot block Oh wait is this theory buck I think this is our way I think it’s a portal block yeah 0 & 2 then after all that we’re finally going to get it to return true and it will create this portal for now so that we could run it I’m going to set this to Block stop fire and I’m going to can I run this yet I think that it’s just not going to let us go through it I mean just check on that if not then we’ll leave it for later let’s see here oh you are not going to be able to see this so Let me do this then real quick let’s do they’re nice I like that actually I’m gonna shrink that a bit actually I’ll take it and I will go like that free guys because you don’t really have to just see it there you go all right so we’re gonna go into our single-player World here and we are going to check it out so we have our portal block no because I did not put it in a tab I don’t think did I did I not to put it in a tab probably so we’re gonna go out to the Top here and we’re going to right after this super just say this dot set creative tab where did I where did I put it what’s my what’s my tab again called sapphire tab cool all right now we can launch it alright guys so turns out I Won’t be able to show you the block in game because there’s something wrong with my computer right now it keeps crashing the graphics driver but that’s no matter I will get it working by the next tutorial hopefully and then I will be able to show you guys our block but In the meantime thank you guys so much for watching hope this helped you guys if it did be sure to hit that like button third part Oriole will be out most likely next week but other than that don’t forget to subscribe for more tutorials and I will see you guys next time peace Video Information
This video, titled ‘[1.7.2]Minecraft Forge Modding Tutorial #17 – Custom Dimension : part 2’, was uploaded by techgeek1019 on 2015-03-01 03:03:53. It has garnered 3837 views and 47 likes. The duration of the video is 00:26:30 or 1590 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!