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.

MostafaSabry55

Members
  • Joined

  • Last visited

Everything posted by MostafaSabry55

  1. Just for curiosity, wouldn't that cause issues if multiple mods override the same item?
  2. 1.12 is not supported on this thread
  3. In the future, don't just say "I fixed it", tell us what you fixed so others know what was the cause (if they ran into the same problem), and for anyone to point out other errors/mistakes/bad-practices in your code!
  4. You don't need any more than 8GB of ram to play any modpack, unless you're planning to use shaders/32+ textures Also All the mods has an official discord, it's a better place to ask there than here However, the problem is with apotheosis/quark
  5. MCreator usually uses unnecessary code in all it does, atleast that's what I found out in mcreator 1.7.10 before I dropped it out due to it being limited, and doesn't let you work out things by yourself, you cannot call it a more developed modding tool just cause it makes things done by 1 click. Learn java, it's really easy to get it going Maybe start by doing something simpler, you don't have to go that far straight from start, also doesn't that "more developed modding tool" have the ability to create entities? Read the forge documentation? Also I don't think asking is a wrong thing, that's what this forum is for, just have knowledge of java and ask here That's the most fucking absurd thing I've ever heard, what do you mean? You think all developers here do it for the money? If you know java you'd know anything dependant on it, and I don't think learning java takes money
  6. Wait so can they access my mod through, let's say, 7zip and delete my recipes? That is if they don't use crafttweaker nor resourcepacks? Alright then, I won't do it!
  7. Whatever you do try staying away from HarryTalks and TechnoVision especially About your problem, you can try seeing other mod's sourcecode (credit them surely) or refer to vanilla dimensions, maybe you might find something
  8. Just use MultiMC/Twitch/GDLauncher, please
  9. So I want some items to be like #center_item where #center_item is anything decided by the config, which I know how to do thanks to diesieben07, but problem is is that ShapedRecipeBuilder#key() only accepts either a Tag<Item>, IItemProvider or Ingredient, how do I make it so I can use strings directly (#center)? also here's my code now ConditionalRecipe.builder() .addCondition( new BooleanCondition(() -> Config.COMMON.GEAR_RECIPES.get(), BooleanCondition.Type.ENABLE_GEAR.get()) ) .addRecipe( ShapedRecipeBuilder.shapedRecipe(GEAR) .patternLine(" x ") .patternLine("x#x") .patternLine(" x ") .key('x', INGOT) .key('#', Config.COMMON.CENTER_ITEM.get()) //this is the problem .setGroup("") .addCriterion("has_item", hasItem(Items.IRON_INGOT)) ::build ) .build(consumer, new ResourceLocation(MorePlates.MODID, material.toString() + "_plate")); also are _factories.json still a thing? or are they changed
  10. All right thank you, will do that!
  11. So I want to make it so some recipes do not exist if I wish based on a config option, what do I exactly do? #addCriterion seems to only require an ICriterionInstance, which, ofcourse, makes this not work : .addCriterion("is_craftable", Config.COMMON.PLATE_RECIPES.get()) so is there any other way to do this? thanks in regard
  12. Project and External Dependencies -> forge-version123whatever.recomp -> net -> minecraft -> block Now you know where the minecraft stuff are
  13. So if you saw my last post I fixed my recipe thingy, but I found out that Item Ingot = ForgeRegistries.ITEMS.getValue(material.getTag()); where material.getTag() is like this (getTag() return the first par, ignore the 2nd) DIAMOND(new ResourceLocation("forge:gems/diamond"), Type.GEM), return null, so, how do I solve this? Is the way I'm calling this wrong? It should've crashed if it's invalid tho??
  14. WHOOPS. I forgot to auto register a few materials (they're divided into seperate plugins, normal classes), printing is so useful Problem fixed, sorry for wasting your time
  15. Sure thing : public class MorePlatesItemGroup extends ItemGroup { public MorePlatesItemGroup() { super(MorePlates.MODID); } @Override public ItemStack createIcon() { return new ItemStack(ModItems.HAMMER.get()); } } public class RegistryHandler { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MorePlates.MODID); public static void init() { ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static RegistryObject<Item> register(String name) { return ITEMS.register(name, () -> new Item( new Item.Properties().group(MorePlates.ITEMGROUP) ) ); } } No no no no no, let me explain what I meant there, basically public class Recipes extends RecipeProvider { public Recipes(DataGenerator generatorIn) { super(generatorIn); } @Override protected void registerRecipes(Consumer<IFinishedRecipe> consumer) { for (EnumMaterials material : EnumMaterials.values()) { for (int i = 0; i < 2; i++) { if (i == 0) { Item Plate = ForgeRegistries.ITEMS.getValue(new ResourceLocation(MorePlates.MODID, material.toString() + "_plate")); Item Ingot = ForgeRegistries.ITEMS.getValue(material.getTag()); ShapelessRecipeBuilder.shapelessRecipe(Plate) .addIngredient(Ingot, 2) .addIngredient(ForgeRegistries.ITEMS.getValue(new ResourceLocation(MorePlates.MODID, "hammer"))) .setGroup(material.toString()) .addCriterion("has_item", hasItem(Ingot)) .build(consumer); } else { Item Gear = ForgeRegistries.ITEMS.getValue(new ResourceLocation(MorePlates.MODID, material.toString() + "_gear")); Item Ingot = ForgeRegistries.ITEMS.getValue(material.getTag()); ShapedRecipeBuilder.shapedRecipe(Gear) .patternLine(" x ") .patternLine("x#x") .patternLine(" x ") .key('x', Ingot) .key('#', Tags.Items.INGOTS_IRON) .setGroup(material.toString()) .addCriterion("has_item", hasItem(Ingot)) .build(consumer); } } } } } Now when I build my recipe " .build(consumer) ", it errors with a null pointer exception [m[32m[09:11:44] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:643]: Caused by: java.lang.NullPointerException [m[32m[09:11:44] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:643]: at net.minecraft.data.ShapelessRecipeBuilder.build(ShapelessRecipeBuilder.java:133) [m[32m[09:11:44] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:643]: at net.minecraft.data.ShapelessRecipeBuilder.build(ShapelessRecipeBuilder.java:111) at the line that I just posted consumerIn.accept(new ShapelessRecipeBuilder.Result(id, this.result, this.count, this.group == null ? "" : this.group, this.ingredients, this.advancementBuilder, new ResourceLocation(id.getNamespace(), "recipes/" + this.result.getGroup().getPath() + "/" + id.getPath()))); Now in THIS LINE in ShapelessRecipeBuilder, I noticed that the last parameter was the cause which is : new ResourceLocation(id.getNamespace(), "recipes/" + this.result.getGroup().getPath() + "/" + id.getPath()) was the cause, sorry for me changing them to my items, I was testing and I was also unclear, now I dunno what I'm doing wrong
  16. I fixed the error above but, After some even more painful investegating, I found out that my item's ItemGroup is null which is causing ShapelessRecipeBuilder.java:133 to error consumerIn.accept(new ShapelessRecipeBuilder.Result(id, this.result, this.count, this.group == null ? "" : this.group, this.ingredients, this.advancementBuilder, new ResourceLocation(id.getNamespace(), "recipes/" + this.result.getGroup().getPath() + "/" + id.getPath()))); the bit that errors is this new ResourceLocation( Registry.ITEM.getKey(Plate).getPath(), /* This line */ "recipes/" + Plate.getGroup().getPath() + "/" + Registry.ITEM.getKey(Plate).getPath()); Now I'm sure Iam setting an ItemGroup to it, as seen here public static RegistryObject<Item> register(String name) { return ITEMS.register(name, () -> new BaseItem( new Item.Properties().group(MorePlates.ITEMGROUP)) //This should work tho?? ); } I am in need of help, please
  17. I think I found the problem, I checked ShapelessRecipeBuilder.java:141 and it turns out if (this.advancementBuilder.getCriteria().isEmpty()) { throw new IllegalStateException("No way of obtaining recipe " + id); } is true, now there's this #addCriteria for recipe building, why do I need it and how do I use it?
  18. Iam completely sure I misunderstood what you said, please bear with me Item Plate = ForgeRegistries.ITEMS.getValue(new ResourceLocation(MorePlates.MODID, material.toString() + "_plate")); Item Ingot = ForgeRegistries.ITEMS.getValue(material.getTag()); ShapelessRecipeBuilder.shapelessRecipe(Plate) .addIngredient(Ingot, 2) .addIngredient(ItemTags.createOptional(new ResourceLocation(MorePlates.MODID, "hammer"))) .build(consumer); now that error is gone but it errors with the following [m[32m[21:16:39] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:643]: Caused by: java.lang.IllegalStateException: No way of obtaining recipe moreplates:brick_plate
  19. So basically I want to make lots of recipes, so public class Recipes extends RecipeProvider { public Recipes(DataGenerator generatorIn) { super(generatorIn); } @Override protected void registerRecipes(Consumer<IFinishedRecipe> consumer) { for (EnumMaterials material : EnumMaterials.values()) { for (int i = 0; i < 2; i++) { if (i == 0) { //final RegistryObject<Item> Plate = RegistryObject.of(new ResourceLocation(MorePlates.MODID, material.toString() + "_plate"), ForgeRegistries.ITEMS); final RegistryObject<Item> Ingot = RegistryObject.of(material.getTag(), ForgeRegistries.ITEMS); //TODO set back to Plate.get() ShapelessRecipeBuilder.shapelessRecipe(Ingot.get()) .addIngredient(Ingot.get(), 2) .addIngredient(ModItems.HAMMER.get()) .build(consumer); } else { final RegistryObject<Item> Gear = RegistryObject.of(new ResourceLocation(MorePlates.MODID, material.toString() + "_gear"), () -> Item.class); final RegistryObject<Item> Ingot = RegistryObject.of(material.getTag(), ForgeRegistries.ITEMS); ShapedRecipeBuilder.shapedRecipe(Gear.get()) .patternLine(" x ") .patternLine("x#x") .patternLine(" x ") .key('x', Ingot.get()) .key('#', Tags.Items.INGOTS_IRON) .build(consumer); } } } } So Plate.get() was erroring saying : [m[32m[20:36:27] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:643]: Caused by: java.lang.NullPointerException: Registry Object not present: moreplates:brick_plate So I commented it out, checked if normal materials do work, but the problem is still present : [m[32m[20:36:27] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:643]: Caused by: java.lang.NullPointerException: Registry Object not present: minecraft:brick This got me very confused, how am I supposed to DYNIMACALLY call RegistryObjects?? Some examples of what I set them to can be found in this part of my enum BRICK(new ResourceLocation("brick")), CHARCOAL(new ResourceLocation("charcoal")), COAL(new ResourceLocation("coal")), ALLTHEMODIUM(new ResourceLocation("allthemodium", "allthemodium")), ; EnumMaterials(ResourceLocation tag) { this.tag = tag; } @Override public String toString() { return name().toLowerCase(Locale.ENGLISH); } public ResourceLocation getTag() { return tag; } Any help is appreciated, thanks
  20. Oh dammit, that was all I was missing O.o, anyways thank you
  21. I think I'm completely messing up something, I've used RegistryObject#of to reference them, but how do I exactly get the Item or Block itself?
  22. Gotcha, looked at the docs and a McJty tutorial and it seems easier than it looks! thank you
  23. I will do that then, but, how do I dynamically generate tons of JSON files? I have got like 50 items that need to be done, and they'll increase as other mods arise fyi, it's a gears, plates and rods mod, it adds alot of those, so I need an easy way to do that!
  24. So I am a bit confused, IModelRegister used to be able to do this, now that it is gone, is there any work-around to it? I am trying to use only 1 JSON file for all my (non-metadata) items, can someone give me hints on how to do that? EDIT : Version 1.16.3 by the way
  25. Don't really wanna pump this thread but, what are those and how do you use them? I would really love to know that for a few mods that I am going to make

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.