Jump to content

[1.10.2] Xbox like crafting table


Jedispencer21

Recommended Posts

Image:

1pyyvo.png

What I am trying to do is create a crafting bench, sorta like the one in the xbox version, except it won't have any tabs, just a scrollable list with all items that are craftable. Right now I am having trouble with a few things. What I want to do is have it so that the slots where the required items are displayed, it will condense them into stacks of similar items, instead of having, say each slot have 1 of the same item. In the output slots where all craftable items are shown, if an item has similar items (like stairs), or has metadata (like dye), I want those to be in the same slot, but in a list that can be went through (like the xbox has the small list of all similar items), and I would like to sort the output list based on where the items originate from (such as vanilla items appear first, then modded items). Next, I am also having trouble making it only display items that the player can craft, it seems to really just display most recipes, and sorta in a random order. My current code (although it is definitely not the best at all) is here: http://pastebin.com/rSRtBWew

Link to comment
Share on other sites

1. You need to loop through the players inventory and compare that to recipes, since recipes normally only have one in each slot just compare them in numbers and items (stacksize and the item).

 

2. You will need a way to identify what is a stair block, not all mods extend BlockStair. Maybe the best way to do that would be to compare collision boxes. And also do the instance of check.

 

3. The list should be handled on the gui then synced with the container using packets(to notify the container of the new slots). You should not use vanilla slots for this instead create a custom slot you will most likely have to disable the slots clicking based on z level(this way you dont click on multiple visably, instead you click on the one above the rest) i would just sort the list or map of the slots based on the zlevel.

 

4. Also sort the recipe list based on modid obviously put minecraft first.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

One problem I am having right now is figuring out how I can take a recipes required crafting items, then from those, I would find all similar/non-similar items in the Recipes 'recipeItems' ItemStack[], and create a new ItemStack[] out of the items that instead of all similar items being separate in the ItemStack[], the would be one stack.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.