Of this so yeah let’s keep rolling let’s keep rolling we’re actually going to jump back into our GUI class so right here and still receiving the error there we’ll get to that first thing we want to do is we need to specify the image that we’re gonna use right this bad boy we’re Gonna be using this image as our background for when we right-click on our oven this is what’s going to open up so we need to actually specify that so let’s do that now public static final and this is going to be a resource location then we’re just Going to name it feet ground and then this is going to be equal to new resource location and we’re just gonna be we’re gonna reference Neil craft dot mod ID comma and it’s gonna be located in textures GUI and this would be GUI alabaster oven dot PNG one of the rare Times where we actually put PNG in let’s deport this and let’s make sure that our file path is right here GUI alabaster oven and it is going to be under source so here’s our assets file right so it’s going to be under our mod ID textures GUI alabaster oven right there oh yeah So we’ve specified what the background is but when you look at this right this is a 256 by 256 image and we really only want to look at just this section right here so what we’ll do is we use our selection tool and we need to get the X Size of this which is 176 and then we want to get the Y size which is 166 so one seven six one six six and then what we want to do is we actually want to come in right under here and we want to Say this dot X size is equal to 176 this dot Y size is going to be equal to one six six so if you’ve never seen in mods we’re like the GUI is much larger than you’re used to seeing this is where it’s at 256 five to 256 is kind of kind of What you can use beware though because some people you know you have their UI jacked up to where it’s huge so I’m gonna be careful with that there’s actually a method that we’re missing here and we need to actually go ahead and key that in now so what we’re gonna Have is public void draw GUI container for brown layer and we will do inch par one in part two like so so what are we doing here this is the foreground layer so this is what’s going to be laid on top of our GUI one of the things that we’re going To have on here is the name of this item right the second thing that we’re gonna have is the the word inventory listed right if we probably won’t do bad on us oh no gonna let us we just won’t go anywhere near that block so if we Actually come in here and we look at this furnace we see furnace at the top and we see inventory down here right so that’s part of the foreground that we have to that we have to draw so what we need to do is as you saw on furnace it’s That furnace we need to go out and actually get the name of what this what this bad boy is so what we’re gonna do is we’re gonna get the name we’re gonna call declare a variable by the name of names and it’s gonna be a string and It’s gonna come from this dot alabaster oven dot has custom the inventory name now this method hasn’t been built yet right alabaster oven is actually coming from entity entity is coming from what the tile into the alabaster oven so we actually hold over this we see tile into The alabaster oven and then we see what is reference to gy alabaster oven alabaster oven right but that’s not there yet we haven’t built that yet so we’ll come back here in a little bit excuse me we’ll come back hearing a little bit we’ll build that method into Our tile entity it was that this dot alla what alabaster oven dot get the inventory gain else and this is going to be i18 in dot format and it’s actually going to be this dot alabaster oven dot get inventory name comma r1 array of object and this will just be new object zero Like so so couple of couple of boo-boos in here right we’ve got to go over where you’ve got to create those methods and we’ll do that here in a little bit so no stress so really what this is doing is it’s going out and it’s getting that Name so that way when we go to our GUI it’ll say alabaster oven does that make sense just not yes yes totally this this dot font font renderer object dot drawstring I don’t know which one of those to choose so we were just going to type This out oh stop so this is where we’re gonna write out the name and it is going to be this dot X size divided by 2 minus this dot font renderer object dot get string width it’s going to be the name it’s going to be divided by 2 and it’s Going to be 6 and then the color of it is going to be 4 2 1 0 7 5 2 that’s the color white so what is it what is this what is what is this whole line doing really what we’re doing is we’re writing the name alabaster of it and it’s going To be at the top of our GUI right here so what we’re doing is we’re saying hey what we want to do is we want to say this dot X eyes divided by 2 so this dot X is divided by 288 so we want it to be 88 and it would normally start right there and then go to the right however what we’re doing is we’re actually getting the width of the name alabaster oven and dividing that by 2 so really what we’re going to be doing is we’re gonna be writing it right here but it’s Going to be alabaster over here and then oven further on so the middle of alabaster oven it’s going to be in there at half the size half the size of our excess the next thing that we need to do is we need to write our inventory so this dot font Renderer object dot drawstring again I don’t know which one of those to choose so we’re just going to do it manually type it out this I capital i18n dot format and this will be container dot inventory and it will be a new object array of zero and it’s going to be a Eight and it will be it this dot Y size – 96 plus – now you’re like why are you doing – 96 plus – why don’t you just do – 94 you can do that I’m just matching what the vanilla code has here and honestly if you want it to work right Make it like they made it so what this is going to do is this is actually going to write inventory the word inventory starting it ate on the x-axis and then this not Y size essentially it’s going to go down 94 so what we’ll do is we’ll Go down 94 before that takes us down into their 94 this stop white size – 96 what’s ry size 166 – 94 it’s gonna be 72 so it’s gonna take it down to 72 and it’s going to be 8 in you see what the problem is there you know it’s going to Start writing it and it’s gonna write it out here right what we actually want to do is you know we want it to be along that same level but we don’t want it to be over these containers so rather than it being at 8 let’s actually come out a bit further And we’ll have it start right here which would be let’s do it at 130 now 128 128 like so give that a save and that pretty much takes care of this method here right set the resource location let’s go over to our tile entity if you actually hold your mouse Over your tile and Eddie right here and you hold in your control button you can click it and it’ll open that up we need to build some couple of things in here because we want to get rid of these errors this has custom inventory name and the get inventory name so let’s do That right meow yeah public string get inventory name and this used to be something weird it was like is in name but when it was one six four but they kind of kind of tune all those up right now so we’re gonna return this dot as custom customer as custom Inventory name and this dot localized name otherwise we’ll do container dot faster you should always have you know what did what you used to have to do is this would go back and reference the language registry you would actually go to your main modeling class and you would write language with a language Registry so on so forth container dial Abbas from it and then you give it a name I’m not sure what it does now does it actually go to your length file or not so I’m not entirely sure it should always have a localized name though so we should be okay it says Of course that we have that so we need to create that method so let’s do that it’s public its boolean what we want to do is we want to return this dot localized name it’s not equal to null and this localized name dot length is greater than zero like so pretty sweet So we do that we come back here we’re gonna notice that let’s make that public soon that way this class can see it haha those are gone like what we see what we’re gonna do now is we’re gonna actually create the number of slots but we know that we have one slot I should say 0/0 slot 1 slot 2 0 1 2 for a total of course of 3 slots altogether so what we’re gonna do is we’re gonna create we’re gonna create those slots right now let’s come down here and we’re gonna say private itemstack alright we’re gonna name the side of stack slots And it’s gonna be equal to a new item stack of 3 like so forth those minecraft item stack so we’re good there now what’s the purpose of this right so we need to essentially tell this tile entity that we have three slots that we’re gonna be working with when we come Back and actually do like a dual input furnace this is gonna be a 4 because we’re gonna have our two inputs our fuel and then our output right if we were to come back to this and say something something like this to where it has two inputs and then like an upgrade slot That’s gonna be an item stack of 5 because you’ll have an item you have your upgrade slot your fuel slot your two inputs excuse me and then your output so that would be five so you gonna see where we’re gonna be going with that however we’re gonna need To know how many slots that we have later on I mean we know right it’s in our branch but we need to we need to make sure that program knows that this tile entity knows so we are going to say public int get size inventory and really What we’re gonna return is this slots so we just created that that length like so so we’re gonna return this pile entity slots right here length slots be nice if it actually twelve oh sorry so what else do we want to do a tile entity let’s actually do implements I sided inventory And we’re gonna import that we have a whole ton of unimplemented methods and we’re gonna get a couple of these out of the way right now so the first ones on I always like to do are these this this open inventory this closed inventory so cognition just drag this up like that Drag this one up to here here we need to get rid of override up pretty much all these let’s finish up with our can insert an item can’t extract that and so we’re gonna we’re gonna return some things on these so let’s return really what does this can insert of an item can Extract that and this is hoppers can a hopper insert an item into this and we want to say yes it can however we only want to do it if this is item valid for slot and it’s gonna be I is it’s gonna be I it should be I To be able to even more easily identify what these are Madame stack so is item valid for this lock what do we want to be able to insert items into well we want to be able to insert items into here right into our fuel slot we also want to be Able to insert items into our inventory like what’s being worked and we what we will do is we will we’ll work on this a little bit later on the get accessible slots from sides this one right here but essentially we want a hopper to be able To drop items in from the top of the block in here and then we want to be able to insert items from the side but here and then when we get to extract we want to be able to extract this item for me to the side or the bottom we’ll get To that we’ll get to that don’t stress don’t get them we’ll get to it most important thing is that you you understand you know what each of these methods is doing that’s really what this is all about I don’t want you just writing what I’m typing up here I want You to understand this I want you to be a more powerful programmer she’d be a more powerful matter I’m waxing eloquent on you right now I itemstack J you know what I mean though I mean I’m not trying to get all cheating on you right so if if the slot equals zero the Slot does not equal zero right we don’t want to go extracting items out of this we don’t want to go extracting it items out of this this is 0 this is 1 right and so if J so slot is not equal to 0 or and remember these guys if you hold down Shift and you hit that slash key right above your Enter key you’ll see the long vertical line there this is or so as long as the slot does not equal 0 slot or the slot does not equal 1 or itemstack dot getitem is equal to items dot welcome So you can extract anything as long as it’s not out of that slot it’s not a slot and it’s not a bucket don’t extract the bucket and that pretty much does it we covered a lot of stuff in this episode I packed a lot into the 25 Minutes that we’ve been working on this but you know the the tiling and these like the real the real meat and potatoes of what’s going on in this bad boy so it’s important you know we’d sell a lot of – dues in here but you’ll see that Our errors are dwindling we still have this one persistent one but we haven’t even touched our container yet so we’re gonna need to do that where you don’t want to do it here we’re gonna do it in our actual container so that being said this is Neal this is What episode four yep episode four I’m gonna get this uploaded we’re gonna move on episode 5 thanks like comment subscribe let me know how you’re doing reach out to me write the Skype via email whatever you want reach out to me let me know how you’re doing I’m more Than happy to help you out thanks everybody you make it happen see you in the next episode Video Information
This video, titled ‘Minecraft Modding Tutorial 1.7.2 #13.4 Custom Furnace’, was uploaded by Neale Gaming on 2014-04-15 06:55:00. It has garnered 4581 views and 70 likes. The duration of the video is 00:25:58 or 1558 seconds.