Hey guys so before the video starts I just wanted to mention that in the description of all my videos is our official discord server that you can join now it is open and it’s got a ton of amazing channels that you can join to meet people in the community get help With your mods get help with plug-in development or just Java in general we’ve also got things like a star board so you can show off your work and rate it with stars we’ve got bots that have custom economies memes that you can send to friends a Idol minecraft mining game That’s really fun to play as well as just general chat channels and all sorts of great stuff so I really hope that you join the link is in the description and there really is something for everyone over here so definitely come check it out hey guys it’s Thomas here with tech No vision and welcome to some minecraft modding for 1.16 in this episode we’re not going to be doing any coding but we are going to be reorganizing all of our classes and packages into a new format that I think will be a lot better for you guys so definitely watch this video So that you’re not left behind and understanding where the classes are in the newer videos or tutorials to come and the reason I’m doing this is because I recently talked to another minecraft modding youtuber named dirty word e on discord and we decided that it would be Best if our packages sort of lined up with each other more or less they’re not going to be exact but I’m going to be copying his structure somewhat so that those of you who finish my videos and are looking for more but can’t seem to make the switch to Therese videos it’s Going to be an easy transition for you and you can come back and forth between our videos no problem hopefully so that’s why I’m doing this and yeah let’s just get right into it we got to get through a lot of stuff so bear with me Here first thing I want to do for sure we’ve got a bunch of unnecessary packages here like we’ve got our mod armor material and our mod items here in their own packages even though we’re not really gonna put anything else in these because I’m just gonna throw my like Advanced tools and armor into items at the end of the day so what we can do is we can create a new package in the world folder and not world sorry util and create a new package and I want to name this just enums because we wanted to store all our items In one place because it is like a utility class essentially so we can just drag our mod item tear into enums refactor and we can drag our mod armor material into enums as well refactor and now we have both our mod armor material and our mod item tier again these are Our like armor and tool like tier classes into a enums package in Utah so that means we can now delete the tools folder and we can delete the armor folder as well there we go lock cleaner now another thing that I want to do is I want to I’m Gonna leave blocks and items out in the open dirty Bertie has them in objects folder but I’m just gonna leave them out because it shouldn’t really matter too much I mean it’s just one extra package but another thing I’m going to do is I’m Going to and this is a big one here I’m going to remove the registry handler and essentially what I’m gonna do is I’m gonna put all the items that we have into their own separate item class and then I’m going to put all the blocks that we have in their own separate block Class and I’m doing this for a few reasons and it’s actually something that I would recommend you do whenever you make a mod and essentially what it’ll do is it’ll allow you to organize everything by type so like if you want to access an item instead of doing Registry handler dot and then trying to like find the item through a huge list of stuff you can just do mod items dot and then find the item super easily that’s how it should be and it’s my mistake that I did this way from the beginning so I apologize for that but to Make it better what we can do is we can come over to our main package here create a new package and we’re just gonna name this init which stands for initialization you could also name it like registry or registries either those is fine we’re gonna create a new class In here and the first one is going to be mod items and again you can replace a mod with the name of your mod if you want like tutorial items that’s fine too and inside of here we’re gonna first copy our items deferred register from a registry handler let me close out these And paste it in there we go and then so we have our items deferred register and now we need to paste in all of our actual registry objects so grab all of the objects that are items so you want to ignore like blocks here but you want to grab all of These items here and paste them in right below and we also want to grab as well our block item because even though they’re they’re called block items there’s still technically items that are registered in the the items registry deferred registry so we have to copy Those as well let me get the tag there the comment alright paste this in below and there we go so now we can actually delete all of these here except for blocks because you want to keep that of course alright so all of our items are Gone now we can get rid of it from the init here and we can get rid of the deferred register too now there’s a few things you have to do because the blocks are no longer in the same class to access blocks for your block items you’re gonna have to access them from The block class once we set it up so just keep that in mind these will be read here but we’ll fix that in a second so with this registry handler class what you can do is we can create a new class in MA init package here create a new Java class and I’m just gonna name this mod blocks and we can add a repository and I’m just gonna copy everything that I’ve gotten registry handler left over and we’ll paste it in and you want to get rid of this like init method here because we’re not gonna use that anymore Well we’ll replace it with something else so there we go we’ve got our mod blocks package or class rather here with our blocks and our deferred register for blocks and we’ve got our mod items here with our deferred register for items and all the different item types if you Really wanted to go like super overboard you could also I think make like your own class for tools and armor but that’s a little ridiculous in my opinion just because they are still items and they’re registered under this you’d be making multiple instances of this deferred register kind of unnecessary so if you Don’t need that but to fix this air here with our items you can see that they’re red here to get to access a ruby block now or any of your custom blocks now what you’re gonna do is type mod’ blocks dot and then you have a list of blocks you can See it’s way cleaner and it just gives you exactly what you need right away so we want our Ruby I think it was Ruby block right yeah Ruby block and then once again for the or we’re gonna do mod blocks dot Ruby or and then for the oven Mod blocks dot oven so hopefully you’re seeing why I’m doing this it’s a lot cleaner and yeah and I’m also going to do a few other things so I’m going to move our Lamba statements down on the second line here see every single line where the right where these I guess it’s Called a supplier starts you can just move this down and I think this will be a lot cleaner for us to look at our code in videos so you can reference it I’ve got a few suppliers that I did not start very well to begin with like separating Them on two separate lines so we can fix that you don’t have to do this again this is just a personal thing that I’m going to do just so it lines up with dirties videos and also just cuz I think it’s easier to see on the github page Pretty much and again we can do it here move those suppliers down make a space between each item so much cleaner it’s gonna be so much easier for you to find everything you need especially if you have like hundreds of items that’s gonna be a nightmare with the current system We have so definitely keep that in mind alright so we’ve got everything on a new line and then I mean you don’t have to do it with these ones because some of our items here are just basic items that have a really simple supplier so no need To really move those to a separate line but if you want you can move them to a separate line here so there we go we’ve got all of our mod mod items set so now in the future I’m just gonna show it here whenever you want to or I guess I Shouldn’t show here because this is the class let’s just go in our old registry handler class here in the future whenever you want to access your custom items you’re gonna type mod’ items dot and then you can choose your item from this list if you want to access custom blocks you Can do mod blocks dot and then there are your blocks so a lot easier a lot cleaner no more registry handler so keep that in mind so we have to delete our registry into our class actually you can delete it real quick ee anyway and you’re going to get a ton Of errors because remember that we’ve used registry handler in pretty much every single class that we access our items so we’re gonna have to go through every class I know it’s like annoying but we’re gonna go through every class and we’re going to change registry handler to the corresponding class so we Can get rid of this init method because we will be fixing that in a second we want our Ruby here for our custom item tab this is registry handler it should be it’s Ruby so it’s an item so mod items we can import that and let’s Just make sure yeah there we go okay so mod items taxes our Ruby let’s see where else would we be using registry handler I believe not in blocks not in events most likely so mod client events where all of your events are change a registry Handle here this is a block so Ruby or not Ruby mod blocks rather there we go we can change poison apple here to mod items because poison apple was an item if you remember import class yeah and let’s see what else alright so that’s all the registry handlers in here I Don’t believe there’s any and modest server events yeah then we want to make sure that in mod armor material as well yeah there we go so we access our Ruby here from register handler now we need to do more items import that really quickly and anywhere Else in here no mod item tier yes we have to also do mod items to get our Ruby there we go so import class not too hard as long as you know Java this shouldn’t be too big of a deal which you should know Java anyway so And I believe that is it maybe mod or Jen yeah so and then last one is mod or Jen it seems so in mod or Jen for our Ruby or we want mod blocks to access it and import class and we can just paste that for all the other Ones because you are actually seeing our Ruby or here so there we go yeah file save all and I believe that is all of the errors that are necessary to fix all right cool so we can close all of these now what we need to do is Actually register our our items so to do that come to your main class here your tutorial class and you want to go to your constructor here and right below where you get the mod event bus and add listeners and stuff you want to register for each of the classes we mange so We’ve got if we open into here mod blocks and mod items so first you’re gonna want to do mod blocks because they have to be added first to the game so mod blocks dots blocks dots register and then you’re gonna pass in FML Java mod loading context dot gets dots get Modified bus and we can just copy and paste this down below and change mod blocks to mount items and then blocks to items all right so now we have our mod blocks class being registered with the event bus and then we have mod items being ready to share with the event bus And remember very important blocks have to be registered before items because some of the items and mod items actually reference stuff from blocks so that’s very important otherwise you will get an error so yeah so there we go and this is gonna be a lot better because as we add Like entities the game and tile entities and screens or geo eyes will be making separate registry classes here in our in a package over time so it’ll be a lot more organized and yeah so I think that is pretty much it so let’s just run through this one more time we’ve got our Blocks class which has all of our blocks in it that’s all fine nothing changed there Vence class stay the same got all our events in it we now have a new package called in it that holds a mod blocks class and a mod items class each holding items and then blocks respectively Instead of our registry handler so no more registry handler items stay the same in util we now have a new package called enums and we’ve stored our mod armor module on our mod item tier in there and I believe that’s pretty much it so yeah now this is all a lot more Organized and to make sure that it’s running well we do want to run really quick so I’m gonna run the game and we’ll make sure everything is ok all right so we’re inside of the game now and let’s just make sure in our creative inventory yep we have our custom tab and All of our items are there and they all work I mean you can test them if you want but they all work pretty much exactly like they did before so yeah now we know that the mod is actually still working all right so that’s gonna do it For this video thanks guys so much for watching hopefully this establishes a sort of like universal format with turdy wordy and some other modders I know that this is not exactly the same package format he uses but I think it’s pretty close and it’ll help the transition a Lot for a lot of people and overall it’s a lot cleaner in my opinion so yeah thanks guys for taking the time to sort of go through and reorganize everything with me and I will see you in the next episode You Video Information
This video, titled ‘Minecraft 1.16: Forge Modding Tutorial – Package Organization (#16)’, was uploaded by TechnoVision on 2020-07-23 02:25:22. It has garnered 5507 views and 220 likes. The duration of the video is 00:14:12 or 852 seconds.
Learn to code a Minecraft mod from scratch in this complete tutorial series! In this episode, we rename and reorganize some of our classes and packages to help organize our mod.
— Important Links —
● Discord: https://discord.gg/ZsB3Eha ● GitHub Repository: https://github.com/TechnoVisionDev/Minecraft-1.16-Modding-Tutorial.git
— Music —
● Chill Out Media – Minute Mix
— My Channel —
● Subscribe: http://tinyurl.com/zbc7mwy ● Instagram: https://www.instagram.com/tomm.peters ● Twitter: https://twitter.com/TechnoVisionTV
#minecraft #modding #tutorial