Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

  • Author

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.