Jump to content

badkraft

Members
  • Posts

    40
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by badkraft

  1. It's great when all we get is a link that doesn't tell us how to implement something. Great question, though. I've got the same problem trying to figure out how to get the ingredient count. "ingredients": [ { "item": "foundations:rough_stone_rock", "count": 4 } ] So I wrote a method called from `fromJson(...)`. Iterating the public MasonryBenchRecipe fromJson(ResourceLocation containerId, JsonObject json) { JsonArray ingredients = GsonHelper.getAsJsonArray(json, "ingredients"); NonNullList<Ingredient> inputs = NonNullList.withSize(ingredients.size(), Ingredient.EMPTY); for (int i = 0; i < ingredients.size(); ++i) { Ingredient ingredient = getIngredient(ingredients.get(i).getAsJsonObject()); inputs.set(i, ingredient); } return new MasonryBenchRecipe(containerId, output, inputs); } private Ingredient getIngredient(JsonObject json) { Ingredient ingredient = Ingredient.fromJson(json); int count = 1; if (json.getAsJsonObject().has("count")) { count = GsonHelper.getAsInt(json, "count"); } ItemStack itemStack = ingredient.getItems()[0]; itemStack.setCount(count); return ingredient; } And when the recipe initializes, now the ItemStack has a size of 4 according to the recipe.
  2. It's kind of a convoluted process unlike what was evidently available in 1.18.1. They really made a breaking change according to what Kaupenjoe demonstrated in a 1.18.1 tutorial. I created something similar to what Kaupenjoe has here. package com.badkraft.foundations.tags; import com.badkraft.foundations.Foundations; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.tags.ITag; public class ModTags { public static class Items { public static final TagKey<Item> FLINT_TOOL_MATERIALS = bind("flint_tool_materials"); public static final ITag<Item> STONE_ITEMS = createTag("stone"); public static final ITag<Item> MASONRY_ITEMS = createTag("masonry"); private static ITag<Item> createTag(String name) { return ForgeRegistries.ITEMS.tags().getTag(tag(name)); } private static TagKey<Item> tag(String name) { return ItemTags.create(new ResourceLocation(Foundations.MOD_ID, name)); } private static TagKey<Item> forgeTag(String name) { return ItemTags.create(new ResourceLocation("forge", name)); } } private static TagKey<Item> bind(String name) { return TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation(name)); } }
  3. Is there a place on this forum where I can ask others to join me in developing a mod? I understand it's off-topic from Forge. So I'm wondering if it's even okay.
  4. Fixed... Used Blockbench to create the textures and exported the correct model.json.
  5. I have the block below (`clay oven`). It is supposed to be a half-height block. I'm looking for blocks in vanilla I can research that might give me a clue how to correct the rendering so the top renders where it's supposed to be and the top half of the block is transparent. Another problem I'm having with this block is that when I place it, I get the back side facing me. How do I correct that? Here is the current source (pretty basic at this point): Side note: `getShape` is deprecated. What are we supposed to use? Campfire is using this method override.
  6. My configured feature was wrong. I had the wrong block as the provider (state). It's working now.
  7. After a couple of weeks thinking about this while on the road, I'm going to replace the standard clay block in generation with mine. You'll still be able to craft the `minecraft:clay` but it won't generate. Later, I'll upgrade generation with a structure. That will allow multiple block types. I'm going to stick with 1.18.2 until I get Foundations where I want it. By then, around 1.21, 1.22 or 1.25, I'll update. I just can't see doing all this work for every version. If I'm always updating to a new version, I can't actually create features.
  8. It's easier at this point just to modify the clay loot table. I've not seen enough in 1.19.x to make that leap. I've still got a long way to go with this.
  9. I began wondering the same - if there was a file missing or something. I kind of did the same as you, removing `minecraft:clay` from the disk_clay feature and that doesn't make a difference. It's like the feature is being ignored altogether. I'm going to work around the problem in a 2-step process. I really want to be able to modify the biome. remove all the custom `river.json`, etc. from my mod with just the modified configured/placed feature in the minecraft/data folder; or, modify the `minecraft:clay` loot table to drop my custom item
  10. Yeah, I've tried that. When I paste the link and click `Insert Into Post`, the button acts like it's disabled. I'm going to add my json files in the previous post. It's usually some kind of little detail - like using `minecraft:` instead of my mod name.
  11. He's actually got a mistake in the video. It's relatively minor, though. But as far as accuracy, no one really tells you what to do to include biome modifications, configured/placed features, etc. You never get all the information in one place. Developers are the world's most ineffective documenters (I know because I am one) ... This is what I've done so far... First using Data Pack Generators created a project and organized like mod directory structure. Second, I created a custom `configured_feature/disk_clay` and `placed_feature/disk_clay` for the `minecraft:river` biome to reference. But I have more planned changes to the river biome (and others). So, I copied minecraft `river.json`, place that in the `foundations/data/worldgen/biome/` directory. To have minecraft reference the biome, I overrode the default `minecraft/data/dimension/overworld.json`. Where ever I found `minecraft:river` in overworld.json, I replaced with `foundations:river`. The clay is still just minecraft:clay ... not foundations:clay_block. See screen shot. So, I don't know what is keeping my clay blocks from being in the feature. See directory structure. There are 8 entries in `minecraft/dimension/overworld.json` where we can find `foundations:river`. The file is huge so I'm only including one of the biome entries... `foundations/worldgen/biome/river.json` See entry near the bottom of the features list. `foundations/worldgen/configured_feature/disk_clay.json` And finally, `foundations/worldgen/placed_feature/disk_clay.json` P.S. -- how come I can insert image links from imgur?
  12. Ok... I'm not getting anything helpful in the directories. I've looked in the 1.18.2 since that's the version I'm working from. Image insert isn't working so here is my directory structure. I'll just start putting my modified .json files in ... let me see - ./data/modid/worldgen/ biome placedfeature etc.
  13. Are these files in minecraft data? If so, where? But, spot on. That's what I was hoping for. Thanks!
  14. I'm researching the how to create biomes in json. There is a great tool for creating the jsons online. Using the vanilla `river` biome, I want to essentially create a custom disk feature that mixes 3 blocks instead of a single-block provider. Any ideas on where to start with that?
  15. I figured out what was wrong ... you can spot it pretty quick most likely: { "type": "minecraft:smelting", "ingredient": { "item": "minecraft:gold_nugget_ore" }, "result": "minecraft:gold_nugget", "experience": 0.25, "cookingtime": 150 } ... so, after changing `minecraft` to `foundations` for all the custom items and all the recipes work. Well that's what copy/paste will get you. One last question about recipes, though. What does the following json key/value do in the game? "group": "copper_ingot"
  16. I've made a few recipes (smelting & shape). I have the .json recipes that, for instance, produce a spacium ingot: either smelt a spacium ore block or put 9 spacium nuggets into a crafting grid. Well, those have specific names for the json - spacium_ingot_from_spacium_ore.json spacium_ingot_from_spacium_nuggets.json If there was only one shaped or shapeless recipe to create spacium ingot, then naming the recipe `spacium_ingot.json` is all you have to do. But because we have 2 recipes producing the same item from two different processes, I'm trying to figure out how to "register" these recipes. Kaupenjoe is talking about a custom item from a custom block (gem cutting). If I need to build all the same registry items - e.g. recipe serializers - then that's fine. I'm trying to find the correlation between the name of the .json file and what is in the code. That's where I'm really missing something integral.
  17. Well, I didn't realize documentation was entirely community generated. My apologies. So then, is Forge developed by community efforts?
  18. No...not insulted at all. No one knows who I am or what I do. No worries. I do wish there was better Forge documentation, though.
  19. I'm not having trouble with Java ... picking it up pretty fast. I've been a software engineer for .Net C# for 10+ years. I'm following his tutorial for an advanced block with recipes (the gem cutting station). There is a lot more to write for recipes than for just blocks and items. That's not a problem. Just having to watch many times to get it all.
  20. Unfortunately, the results are slim. I'll approach from a couple of avenues: 1. Look at available source from other mods 2. Follow kaupenjoe's tutorial on YouTube. Problem with kaupenjoe is that I'm not a advanced yet as he's starting. I've got a couple recipes to craft court ingot to nuggets and copper nuggets to ingot. Then I've gotta add some smelting recipes to smelt nuggets ores into nuggets - copper, iron, gold. Changing up the diamond drops a bit so I'll have some green cutting recipes to add. Those are more advanced. Then some carpentry recipes changing up how we work with logs, planks, fencing, walls, doors, floors, etc. Got a lot of work ahead. But it's fun. Also gotta learn about block generation. Ugh... anyone wanna help? 😁
  21. I'm adding quite a few recipes. Some are shapeless but I'm not sure how to add shapeless recipes when they are like nuggets -> ingot & ingot -> nuggets. I've also got some smelting recipes for the furnace. It looks like it is fairly involved - adding some class implementations, etc. No big deal, just need a simple, step-by-step tutorial. I'm actually seeing where there is a huge need for tools to help build mods. Oh boy... Any leads on adding some special recipes for the campfire would be nice...
  22. I read both of those and with the help of an online loot table generator, I was able to see how it is constructed. I ended up successfully modifying the gravel loot table. Thanks... { "type": "minecraft:block", "pools": [ { "rolls": 1, "bonus_rolls": 0, "entries": [ { "type": "minecraft:alternatives", "children": [ { "type": "minecraft:item", "name": "minecraft:gravel", "conditions": [ { "condition": "minecraft:match_tool", "predicate": { "enchantments": [ { "enchantment": "minecraft:silk_touch", "levels": { "min": 1 } } ] } } ] }, { "type": "minecraft:item", "name": "minecraft:flint", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.45 } ] }, { "type": "minecraft:item", "name": "minecraft:coal", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.20 } ] }, { "type": "minecraft:item", "name": "foundations:iron_nugget_ore", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.057 } ] }, { "type": "minecraft:item", "name": "foundations:clay_ore", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.038 } ] }, { "type": "minecraft:item", "name": "minecraft:raw_iron", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.0075 } ] }, { "type": "minecraft:item", "name": "foundations:gold_nugget_ore", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.0025 } ] }, { "type": "minecraft:alternatives", "conditions": [ { "condition": "minecraft:survives_explosion" } ], "children": [ { "type": "minecraft:item", "name": "minecraft:flint", "conditions": [ { "condition": "minecraft:table_bonus", "enchantment": "minecraft:fortune", "chances": [ 0.1, 0.142387, 0.25, 1.0 ] } ] }, { "type": "minecraft:item", "name": "minecraft:gravel" } ] } ] } ] } ] } { "type": "minecraft:block", "pools": [ { "rolls": 1, "bonus_rolls": 0, "entries": [ { "type": "minecraft:alternatives", "children": [ { "type": "minecraft:item", "name": "minecraft:gravel", "conditions": [ { "condition": "minecraft:match_tool", "predicate": { "enchantments": [ { "enchantment": "minecraft:silk_touch", "levels": { "min": 1 } } ] } } ] }, { "type": "minecraft:item", "name": "minecraft:flint", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.45 } ] }, { "type": "minecraft:item", "name": "minecraft:coal", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.20 } ] }, { "type": "minecraft:item", "name": "foundations:iron_nugget_ore", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.057 } ] }, { "type": "minecraft:item", "name": "foundations:clay_ore", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.038 } ] }, { "type": "minecraft:item", "name": "minecraft:raw_iron", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.0075 } ] }, { "type": "minecraft:item", "name": "foundations:gold_nugget_ore", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.0025 } ] }, { "type": "minecraft:alternatives", "conditions": [ { "condition": "minecraft:survives_explosion" } ], "children": [ { "type": "minecraft:item", "name": "minecraft:flint", "conditions": [ { "condition": "minecraft:table_bonus", "enchantment": "minecraft:fortune", "chances": [ 0.1, 0.142387, 0.25, 1.0 ] } ] }, { "type": "minecraft:item", "name": "minecraft:gravel" } ] } ] } ] } ] } I treat gravel as a filter catch-all. Some extra minor drops - adding some nugget ores so you don't get iron ores dropping from gravel except on rare occurrence. Clay ore is a new item I've implemented that drops from a new clay block added to regular clay generation. ...edited the loot table. It was an older one while I was building it. This one is the complete loot table.
  23. Here's the default loot table for gravel block: { "type": "minecraft:block", "pools": [ { "rolls": 1.0, "bonus_rolls": 0.0, "entries": [ { "type": "minecraft:alternatives", "children": [ { "type": "minecraft:item", "conditions": [ { "condition": "minecraft:match_tool", "predicate": { "enchantments": [ { "enchantment": "minecraft:silk_touch", "levels": { "min": 1 } } ] } } ], "name": "minecraft:gravel" }, { "type": "minecraft:alternatives", "conditions": [ { "condition": "minecraft:survives_explosion" } ], "children": [ { "type": "minecraft:item", "conditions": [ { "condition": "minecraft:table_bonus", "enchantment": "minecraft:fortune", "chances": [ 0.1, 0.14285715, 0.25, 1.0 ] } ], "name": "minecraft:flint" }, { "type": "minecraft:item", "name": "minecraft:gravel" } ] } ] } ] } ] } This is a finicky loot table. If I add anything to it, nothing drops. I've added pools, entries, children ... you name it. Does anyone know the particulars about this table? I mean, periodically gravel drops flint instead of a gravel block. I understand the condition that could drop flint if the block survives an explosion. Otherwise, it drops the gravel block itself. I would like to further understand why the use of `children` and the set of `chance` values given in the explosion child entry. What I do understand is that `"type" : "minecraft:alternatives"` means that if this child/entry is successful, then it stops generating loot for this entry/pool. How often does the flint drop and is that taken care of in another location? Is that in a `"condition" : "minecraft:table_bonus"` loot table? Hmmm... I'll have to go take a look and see if there is something called table_bonus.json.
  24. What would the parameters be to make a permanent, unbreakable item with infinite uses? I can use the largest values for an int, float, etc. But is that appropriate?
×
×
  • Create New...

Important Information

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