Everything posted by Draco18s
-
Create a Cauldron Thingy That Takes items and outputs results.
Use the debugger.
-
Create a Cauldron Thingy That Takes items and outputs results.
Your AABB is static, that won't work. Each TE needs to have its own AABB collection volume, or they will only pull items from the world origin
-
Create a Cauldron Thingy That Takes items and outputs results.
You're attempting to spawn the recipe result before you've checked to make sure that there IS a result.
-
Create a Cauldron Thingy That Takes items and outputs results.
In your TE: CauldronRecipes.getResult(myItems) In CauldronRecipes: public static ItemStack getResult(List<ItemStack> items) { foreach(ICauldronRecipe recipe in RECIPES) { if(recipe.matches(items)) { //do stuff } } }
-
Create a Cauldron Thingy That Takes items and outputs results.
I use a library API reference. But your CauldronRecipes class can just contain a static reference to the list of ICauldronRecipe instances. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/entities/TileEntitySifter.java#L91
-
Create a Cauldron Thingy That Takes items and outputs results.
I have a class like this for one of my "machines": https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/recipes/OreProcessingRecipes.java (Actually, three machines)
-
Create a Cauldron Thingy That Takes items and outputs results.
That's what CaudronRecipes is for. It should contain a list of all ICauldronRecipe instances.
-
Creating blocks with metadata
We still don't know how that information will be represented though. Technically metadata is already gone for blocks, but still exists as an implementation detail. That may still be true.
-
Create a Cauldron Thingy That Takes items and outputs results.
The TE passes a list of item stacks (its contents) to the recipe's matches method. That method compares the contents as I originally described. Captured Drops should be stored in an ItemStackHandler inventory. 1. ItemStackHandler as any other inventory. Creating a list from this should not in any way require my help. It's basic Java 2. See above. 3. For each recipe, does it match, if so, get that recipe's output. You will already have a reference to the recipe in order to check matches, just use that same reference. 4. new EntityItem(...); entity.spawnInWorld(...) 5. If the recipe matches, remove its recipe inputs from the TE's inventory
-
Create a Cauldron Thingy That Takes items and outputs results.
Post your current code and describe the problem that is still affecting you. I also recommend using the debugger.
-
Create a Cauldron Thingy That Takes items and outputs results.
static wasn't an appropriate keyword anyway. You want the list to be per recipe.
-
Creating blocks with metadata
You use Block States. You need to create an Enum property. This is the best example I have, my ore block takes in the enum as a constructor parameter, so it makes it more difficult to follow. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/block/BlockMillstone.java#L42-L58 The enum used there is over here: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/api/blockproperties/ores/MillstoneOrientation.java but it's got a lot of extra information tied in. For ores though, you probably just need one more like this: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/api/blockproperties/ores/EnumOreType.java
-
Create a Cauldron Thingy That Takes items and outputs results.
Well, you need to make sure that your matches method isn't modifying the recipe. You can do this by cloning the list that has items removed from it, and removing from the clone.
-
Save Slider Settings
GUIs don't store data. You need to store the data somewhere else.
-
Create a Cauldron Thingy That Takes items and outputs results.
CauldronRecipe(List<Item> items, ItemStack output) See that list? You are currently throwing it in the garbage can. for (int i = 0; i < itemStacks.size(); i++) { for (ItemStack itemstack1 : itemStacks) { See these two loops? They iterate over the same items. They will always match. You need to get the first list (from the constructor) into the second loop.
-
Create a Cauldron Thingy That Takes items and outputs results.
And how, pray tell, do you expect the list to be tracked? Why are you matching a list against itself? Why is your "list of recipes" also a recipe?
-
Tile Entity Placing
You need to implement it yourself. There's a method available for this, go look at any other TE block.
-
Create a Cauldron Thingy That Takes items and outputs results.
Why are you matching a list against itself? You HAVE a resultItem field! Not to mention that this list is unused and shouldn't be here anyway. This is a recipe class, it's only a template, you should create a new instance and pass it a list of items and result.
-
Create a Cauldron Thingy That Takes items and outputs results.
Your TE's inventory capability. You probably don't even need it at all, unless you plan on doing NBT data items
-
Create a Cauldron Thingy That Takes items and outputs results.
You know how recipes extend IRecipe and how there is a CraftingManager that knows about all the recipes that exist? You need to mimic that.
-
Create a Cauldron Thingy That Takes items and outputs results.
Ok so 1) You need a list of recipes to check against 2) Your ICauldronRecipe interface does not contain any method for getting the result. 3) Your ICauldronRecipe is not a valid interface. Interfaces do not define methods, only declare them 4) You didn't post the crash
-
Create a Cauldron Thingy That Takes items and outputs results.
If the recipe matches, get the recipe's output.
-
Store blocks in area as nbt
Built in? No. Doable? Yes.
-
Create a Cauldron Thingy That Takes items and outputs results.
Step 1: create a list. Step 2: populate it with the desired items to match against. Step 3: for each item in the block's contents (crafting grids are 3x3, your container will just be a list), do something. Step 4: for each item in the list created in steps 1 and 2, do something. Step 5: do the the items match? Step 6: if they do, remove from the list. Step 7: if they don't, return false, there's something extra. Step 8: the loops are complete, are there any items not found?
-
Create a Cauldron Thingy That Takes items and outputs results.
You haven't even looked at the class, have you? Take a look at the matches method (link is a custom recipe, but its still shapeless). None of that code deals with JSON data files*, especially not matches. Look at what it does. Look at how it does it. Ask yourself, "is this methodology suitable for solving my problem?" *The code that deals with JSON files is actually ShapelessRecipe.Factory, which is a completely different class. It's just in the same file.
IPS spam blocked by CleanTalk.