Hey guys welcome this is Scott singleton aka brewing coder brew drink code sometimes just Brewer if I can catch that that username and I just want to go through a little bit about the Minecraft data file generator plugin for IntelliJ that I’m just submitting up to the plug-in repository at JetBrains and I Wanted to talk a little bit about how this works because this you know developing for minecraft its although it’s not hard has a lot of different constraints that you absolutely have to file follow to get your mod to work correctly and everybody programs their mods a little bit differently so I can’t Guarantee that this plug-in is gonna work for you and I’m going to show you some of the caveats and show you how it works it’s really simple I’ve installed this manually it’s not yet available up on the repository but it will be soon according to them it takes two days to Approve it’s all open source the links to the github location are right here in the description hop on over you can take a look at all the codes see what it does take a look at the template files and what it generates it’s all in there love To have some contribution love to make this a little bit more intelligent right now its intelligence is very limited so what this does is this generates all these JSON files for your blocks that you need and it can also create derivatives of your base blocks this is especially useful if you’re creating a Section of your mod that creates decorative blocks which in this case of this mod code that we’re looking at right now it does this is my brew block mod where I bring in just some decorative blocks into Minecraft we’ll talk a little bit about what it does This is my registry line and we’ll zoom in here inside of this video so you can see this line it’s it’s pretty simple all this does is register this block with Minecraft I mean yes it doesn’t in a weird but there’s a couple of key things we Have to pay attention to in this line for this plug-in to work first off this is the internal name and this is a static variable here this is the internal name of my slab let’s not pick slab let’s pick a base block down here cord is a good one this is Corey stone Kind of like the old railcraft quarried stone I didn’t get my texture exactly similar I couldn’t figure out you know it couldn’t get it quite right but it’s gets there it’s a little bit white with just maybe a hint of some specks of some brown in it but it’s close and this is My base cuboid block this is the block that is out there and it is registered through this registration process and this is my registry name so there’s a couple things as mods gonna do first thing it’s going to do is it’s gonna look at your project name your project Name must be the name of your mod casing doesn’t matter it’s gonna convert it all the lowercase right because the in Minecraft in our data files everything has to be all lowercase all the time so it’s gonna take this and of course it’s brew blocks and that’s the name of the Internal name of my mod if we go over and we look at our main class here you can see that that is my mod ID all lowercase brew blocks that is the name of this project it it extracts the name of the project it’s not smart enough to Go look at this base class or go out and look at the the Tavo file for the you know the actual mod package and extract it it just gets the name of the project converts to the lowercase boom that’s the name of your mod the next thing it Does is try to determine what the internal name of your block is your code name it looks for whatever the word is that’s to the left of your equal sign so in this case this is what is gonna determine this as we record the second Thing it does or the third thing it does is determine the register registration name of your block which is what’s inside of quotes in this line so we have three things that we need to do to create the data files for korede as we need to know What the project name is we need to know what this block name is and we need to know what the registration is because what we’re gonna do is we’re gonna generate the stairs for this quarry block now stairs are a pain in the butt just to create a cuboid out of a box Requires four JSON files right if you create stairs I think you need what seven eight JSON file the model state is huge 30 40 lines long it’s a painter but yes you can copy an old one search or replace do all that nonsense yeah I Don’t know I don’t want to do that I want to click me it’s all the same thing over and over and over again especially with decoration blocks so what I’m gonna do here is I’m gonna come in here and I’m going to just have my cursor on this Line and I’m gonna go to minecraft code gem which is a menu item it’s injected by the plug-in and I’m gonna create stairs from this base block so when I click on this it’s going to extract that information it’s gonna inject a line of code after the initial registration That’s gonna basically duplicate this line and just change the name of the the blocks and it’s going to use the setting is set naming convention and then it’s going to generate all the files you can see that I have quarried here Cory brigs cork cobble core smooth bricks cracked I Do not have those are all my cuboid blocks I do not have stairs so let’s go ahead and give it a try and see if it works or if it blows up and eats our children stairs from the base block all right so you can see what it’s done is It’s using we just gotta do some cleanup here because it’s not that smart it is created a line of code for me where it’s automatically named the internal named quarried stairs the registration name is basically this registration name plus underscore stairs and if it’s created the this is the block state right block State so let’s go take a look at that we have our mod named block quarry stairs stairs need model files so we have our stairs stairs outer quarters so this all this is all following the standard naming convention that most mods use so let’s take a look At our models do we have all the models that we were supposed to so we have chlorine stairs cord stairs inter imported stairs outer those are all the ones specified here so let’s take a look here all right so here are textures it is assuming that your texture name is Exactly the name of your registration for your block in most cases that is the case there are certain types that are not so it’s created all three of the models the inner of the outer and the main it’s created your item model which really is just a point back to the Parents accord stairs it has created the loot table which is basically saying I dropped my self when looted and it’s created a recipe using the standard recipe format for stairs based on the base of the base block the line that we had highlighted plus adding the results Of the new block and a returning four items so it uses what six source blocks cuz here’s your pattern six source blocks of this block returns 4 of this block so that’s it that one click right there would have taken me 30 30 minutes even copying and Pasting and doing you know search and replaces so we can do the same thing with slabs right click on here let’s create slabs slab from base block registration boom now our slabs are done just got to clean up this line because my code is a little really formatted it Doesn’t care about whitespace it will turn any whitespace it finds on these guys so feel free to you know your code alignment here doesn’t matter it really the key things are that equal sign where is that equal sign whatever is to the left of it is your block name whatever is the FIR Item that’s in quotes is your registration name and that’s done the other menu item that we have here which is called data files from block registering line that is if you are creating a new block and you want to create I don’t I think all these are Already created if I create a new block called test block all this other code does not matter so that’s my new block I’ve created my new block line to register it but now if I was just I’d have to go and create all of the JSON files associated because it’s Registering your block these days really doesn’t do anything all all it’s doing is telling Minecraft that the block exists you you know it’s been a we’ve been doing using models for a long time but the whole concept of the loop tables and the recipe tables that’s all new Usually we you had to do that in code that’s all now done in JSON so if I do this and right-click and do the data files then you can see that I just get the data files for that block there’s no new line of code here because I’m just Registering this one block but all the data files are out here so I can come in here and modify to my heart’s content it creates the initial it treats it as a cuboid block it creates the the block state and the model which is just based On block and does all of that for you but like I said the it big things that rely on is the format of the line that you’re working with it has to look like this it doesn’t take much a lot of people a lot of people who are just Starting out have a tendency to go through the old-school way of doing it I mean that you saw how small my my my initial mod go back to apparently code these days your main mod file tiny all my registration is being handled here I’m saying hey this is Inject this event I don’t even need to go through this whole registration process we need to go through that we used to go through it is just hey subscribe me and then this is the event down here and says hey as long as this will fire as long as that as long as That decorator that mod have met bus subscriber is around the class it’ll look in here and say oh well I need to file on registry and what I’m doing basically is when this class you can see that all these are static finals these are up here outside of any method And they’re just calling register which really just adds it to an ArrayList then on registry it goes through the ArrayList and processes it very simple a lot less code these days my you know I know that it’s a pain if you’re trying to convert an older mod but you’re if You’re creating a new mod from scratch it’s a ton less code than it used to be back in the you know 1.7 1.8 you know even we will 1.10 days the the the newer code really leaves it you know a lot of the standard stuff up to JSON data files And the reason is is because now you can create data packets that just you you can put a lot of functionality into minecraft just using simple JSON data but you know they have functionality and have things happen when lots you know break or you know what have you you have To do still have to do a mods so anyway that’s what this plug-in does and hopefully we can you know progress and and mature this product to the point where it’s a little bit smarter I have no idea how to use some of the psi functionality inside of inside the Plug-in architecture to actually kind of deconstruct this line and try to determine this based on its position rather than using regex which is what it’s doing right now to find these to find these items but as it stands right now this plugin will save me hours hours per day generating decoration blocks so Anyway thank you I hope you contribute hope you use it hope you enjoy it drop me a note tell me you liked it and thank you very much Video Information
This video, titled ‘IntelliJ plugin demo for Minecraft data generation’, was uploaded by Scott Singleton on 2020-05-23 18:25:17. It has garnered 124 views and 5 likes. The duration of the video is 00:13:20 or 800 seconds.
a brief demo of the requirements and how to use the plugin