Hello everyone Neil here decided to do another episode yeah family’s at a birthday party so I’ll probably just pound all these out today I’m feeling motivated so in our last video we did our block class we got everything into our made money class to get the crafting table registered and Declared and all that stuff so this episode what I think we’re gonna do is we are going to jump in and do the GUI GUI so GUI work-surface I’m putting it under my ma GUI package I’m hearing weird noises I don’t know what they could be probably a key key GUI work Surface this is actually going to extend GUI container and so we’re gonna go ahead and import that and it’s gonna ask us for a construct or now we’re gonna get rid all this crap we’re gonna get rid of all this crap because what we need to actually do is reference our container The right way so we are going to do that and how are we going to do that we are going to do that’s like this we’re going to say inventory player cuz we’re gonna need an inventory to show up when we actually go in to this crafting table And we’re just gonna call that inv player and we’re gonna need do you remove this comma and then we’re gonna need to specify the world world world and then we’re gonna need some coordinates and how we always do that in to why they’re int X int Y in C int Z There we go so super super super cool new container work surface I’m putting work surface you will put whatever the name of this badass crafting table is going to be and we are going to say in flare comma X comma X comma Y comma Z hold on Guinness Nice holy crap where’s the button baby oh there we go you wouldn’t know it because I had it muted but that was a good one that was a good one we’re gonna need to add some unimplemented methods and we’ll come back to that bad boy later so we are Going to say we’re just gonna put this bad boy in here on goon closed is going to be super dot supa soup I do we close that’s it that method sow today we have our draw a GUI container background layer you remember we also need the foreground layer so protected void draw GUI Container for ground layer and we’re gonna have int i int J now this we need to make sure that we’re we’re kind of organizing things right because I am going to be doing a 5×5 crafting table right so the size of my you know my crafting table needs to be pretty Specific this dot X is not why size and I’m actually matching the dimensions of our custom furnace that we did last time right I may need to make it a little bit bigger and we’ll kind of what kind of tinker with that as as we go Really what we’re gonna do at this point is typically what we see on a foreground is we will see the name of the item that you’re accessing and you are also going to see the inventory label right well five by five is going to be a pretty big Area so I’m not going to do those I’m just gonna put in the name of what this is at this particular point and then we’ll kind of what kind of decide as we go along how big we want this to be so we’re gonna go to our foreground Container this dot font renderer object dot draw string and I don’t recall which one of these it is so we’re going to manually type it out and we’re going to say stat collector dot translate to local and we are going to say in quotes jiminee quotes work surface now what do We specify here we specify some numbers will kind of come back to these here in just a moment zero X zero zero zero zero zero that’s black by the way these are our these are our coordinates essentially where we’re spacing of X and y axis of where we’re Gonna be putting this bad boy the background layer this is more or less going to be the texture right so we’re actually going to come back up here and we’re gonna say privates resource location and this may seem familiar from our oh hell from our furnace videos Right this is this is more or less where we’re we’re specifying our where our GUI is at now I’ve already created a GUI that we’re gonna use but we’re just gonna get in here I’m not gonna I’m not gonna actually load up the GUI yet mom Bod IDE plus ah geez man I’m just fat fingering all over the place textures GUI work-surface dot PNG crikey there we go let’s do some imports get those in there so for our background layer what we’re gonna do is get rid of that first and we are going to type GL 1 1 dot GL color for F and this is going to be one float one float one float one float and then we’re going to say minecraft dot get texture got ya get minecraft dot get texture manager right they that up don’t get texture manager dot bind texture what is the Texture that we’re going to bind the one that we specified it above easy-squeezy then we are going to add a draw texture modal rect and this is going to be GUI left and this is going to be GUI top zero comma zero peace exercise why sighs god bless america I’ll get there eventually there we go um what does it not like about that jaw textured I always do that goofy boy so there we go and believe it or not this is actually pretty much pretty much savvy at this point this is gooey we have an air in Here specifically that there is that we are missing a container so let’s get that container rolling well mouse over create glass let’s get that container opened up and so the container if you remember that is where we draw out essentially all of the the spots moving this to the container folder finish Container work service of course extends container we have a can interact with method which were just gonna we’re just really going to move this down to the bottom there’s a lot of the stuff that we’re putting in this container is a lot of what we did back in the in the Furnace like the transfer stacking slot so we’re gonna be doing some copypasta for that simply because what is that transfer stacking slot well you know it’ll you know it’ll check certain things that it will move them up and down in and out so I’ll be typing it all Out I’ll I’ll update the github sources than you guys see just either way or if you want to learn it just type it out don’t be lazy so we have that let’s let’s declare since yet yet the public inventory inventory crafting and we are going to call this Craft matrix this is straight out of Compton I mean straight out of source code this stuff that you’re seeing here to be honest with you we could just copy pasta all of our our vanilla code if we wanted to this one will be a private pride that world world object private Int pause X like so ctrl shift o let’s get our imports in there I always you know I I started out saying don’t do that and now I started doing it just be sure you know actually using ctrl shift o go back check your imports and make Sure that it looks a V make sure that there are majority of minecraft and that drawer base and any of that others yet um we need a constructor so there are certain things that we specified that we are going to be passing along to this container so we need to make sure that This container is able to receive that data so we’re gonna say public container work surface and we’re gonna have inventory player and we’re gonna call that in flavor in player like we did it on the other side we’re gonna have world world we’re gonna have an int X and int Y And an in Z coordinates truth craft matrix is going to equal a new inventory crafting and this is where we’re specifying how many spots this is this is going to be a 5×5 now do our imports real fast now what I’m gonna do is I’m actually Gonna kind of back up a little bit run over here to our reference libraries and for source and we are going to go to where containers at in here we’ve been through this before container workbench so you see a lot of what we’re doing here is exactly the Same as what we’re doing here right now that we just – the comments craft matrix equals new inventory crafting this 5×5 over here it’s actually a 3×3 right and I suppose we could actually technically do this if we want it to you just do it On the fly as we go I don’t want to do that cuz I don’t so you see a lot of a lot of similarities and what I think that we’ll probably do is when we get down to this transfer stack and slot we’ll just copy this out of vanilla upon Upon upon further analysis I decided that I don’t want to do that craft result equals new inventory crafter result that’s Bethan but like so and we’re gonna say world object equals world and we’re gonna say that position X and when I say when I write like position x Equals x like so you can also do this dot position y equals y I’ve done this in the past right there’s there’s nothing really nothing wrong with doing it either way there’s there’s there’s nothing so these it’s it’s really the exact same thing so really it’s just What you want to do why am i doing it this way because I’m lazy and I don’t want to type as much things as much things so what we need to do now is we need to add slots to our container so the first thing that we need to do is we Need to add this 5×5 slot grid where we are going to be putting our items that will result in an item that we have crafted so we’re gonna get back into four loops for int I equals 0 and I I is less than 5 so this is gonna go 0 1 2 3 4 times for a total of 5 for total 5 including 0 so 0 1 2 3 4 that’s 5 times we are going to do this top to bottom right so we’re gonna do 1 Row 2 Row 3 Row 4 o fibro you following me I plus plus The next thing that we’re going to do is we are going to say for int K into K equals 0 and this is really going to be the same thing K is less than 5 because we want to go left to right 1 2 3 4 5 We’re gonna say k plus plus like so what are we doing what are we doing now we’re gonna add the slots to the container and now we’ll add the slots to the Container 5 by 500 you know what I forgot to do I forgot to put in the output slot and We’ll do that first so we’ll do this dot ad slot to container which is going to be a new slot crafting and it is going to be in player play your craft matrix craft result and it’s gonna be slot zero and we’ll have it at 1 31 36 which in a Typical GUI textures into the do you do furnace no it doesn’t want to open it um it’s the output slot really that’s what that is that’s what that is I did the control shift zero craft matrix tonight they did grant result that’s that’s weode okay so Now we can actually add our five by five slots this ad slot container is going to be a new slot craft matrix and that is going to be a 1 plus L what we’re doing is we’re mapping out where it starts times 5/4 plus k1 times 18 3 plus I oh That’s a nice yeah 3 plus I 18 looking at my notes on them like L K 1 I 1 important slide we have errors because I didn’t name it okay one I just named okay and then three plus one oh good grief am I having trouble or What we’re gonna go down to braces we’re gonna do another for loop we’re gonna put our inventory and so for int I equals zero is less than three cuz we’re doing three rows i plus plus and we’re gonna say four int k equals 0 and k is Less than 9 k plus plus so we’re gonna do three rows and each row is going to have nine slots in it like so this dot add slots to container is going to be a new slot in player and this one is going to be K plus I Times 9 plus 9 o plus 9 times 9 plus 9 times 9 plus 9 comma 8 plus K times 18 94 which is that y-axis the 94 pixels from the top plus I times 18 so those are the what do we just do here so we added our Five by five we added our three rows of nine each for the inventory now we need to do that last bar which is essentially the items that you have on your bar that you scroll through one through nine so for int I equals zero I is less than Nine I plus plus and this is easy because any one we have to do one of these because it’s just one row that’s lots of container it’s going to be a new slot and that is going to be in player comma i eight plus i times 18 and then On the y-axis that starts at one forty eight you have an air here and that’s probably because i didn’t put in a plus like so we may need to do some adjustment to this may need to do some adjusting to this and specifically where it appears right because right now it Starts at eighteen so we may need to use a bigger GUI right so we’ll have this increase for the overall GUI size and then we will essentially have these y axes start a little bit lower will push them will push them down further down further down the pipeline yeah There’s one last thing we need to do here and that is right after this last for loop we are going to put on Kraft matrix changed and that will be Kraft matrix like so all right so that takes care of the constructor and we have about four more to do we’re gonna we’re Gonna copy in one right now and then call it good and that is going to be this this one right here this transfer stack and slot and this is essentially when you’re like shift clicking on stuff and putting it in so let’s actually put it below like so Because this is essentially going to be exactly what we have anyway so no big deal no big deal all right so that pretty much wraps up this episode they have any questions or concerns don’t hesitate to go to the forums or send me an email like comment Subscribe and I will see you for the next episode thanks Video Information
This video, titled ‘Minecraft Modding Tutorials 1.7.2 #20.2 – Custom Crafting Table’, was uploaded by Neale Gaming on 2014-05-04 03:00:47. It has garnered 5836 views and 67 likes. The duration of the video is 00:25:31 or 1531 seconds.
Some GUI Stuff; some Container stuff. Double Stuff Oreos.
Source: https://github.com/NealeGaming/nealecraft Forums: www.nealegaming.com/forum/ Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6UAUTQB5GKAD8