Minecraft / Core Keeper furnace like crafter

filod

Member
let's say my need is store Ingredients/Fuels into a furnace, then the furnace automatic craft the results,
solution 1: use different 3 inventory ItemCollections on furnace, write a custom `FurnaceMenu` ui, and 3 custom `ItemViewSlotsContainer`(or 1*1 InventoryGrid with filter?) to handle Item drag/drop stuff
solution 2: use 1 ItemCollection, and use ItemSlotCollectionView&ItemSlotSet to distinguish Ingredients/Fuels/Results.

which solution is proper way do implement this ? i do read these posts:

seems you suggest solution 1 ? if it is the case, can you elaborate it more on how to implement this ?
 
Last edited:
Both solutions are valid. There's not one better than the other.
It depends which ones makes more sense to you.

What I would probably do is somethng slightly different. Similar to solution 1 but with a single custom ItemViewSlotsContainer
Solution 3:
1) Have an Inventory with 3 ItemCollections;
2) Make a custom ItemViewSlotsContainer called 'FurnaceSlotsContainer' that detects where items are added and in which slot index.
3) When you drag and drop set the drop action to ItemViewSlotsContainer Add. This will try to add the Item through the ItemViewSlots, notifying it of the slot you have dropped the item to.
4) In the 'FurnaceSlotsContainer' you now give the item to the correct ItemCollection matching the ItemSlotView it was dropped in because you know what slot it was added to. This can be done by index or indentifyin the ItemViewSlot with a component, tag, name, etc...

This approach is more contained and versatile. For example if in the future you want more than 3 slots, You can very easily scale it to 6, 9, etc... Or you can have furnaces of different sizes etc...
 
Top