Everything posted by MostafaSabry55
-
[1.16.3] Edit Vanilla Items
Just for curiosity, wouldn't that cause issues if multiple mods override the same item?
-
I need help with this crash
1.12 is not supported on this thread
-
[Fixed] Redstone Output on Block
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!
-
1.16.3 Forge crash log (All The Mods 6 modpack)
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
-
Mcreator uses Forge and lets you use custom code
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
-
Using Strings with recipe DataGenerators
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!
-
[1.16.3] How do I create a new Dimension?
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
-
Forge "fake" instalation v2
Just use MultiMC/Twitch/GDLauncher, please
-
Using Strings with recipe DataGenerators
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
-
Toggling recipes with a config option
All right thank you, will do that!
-
Toggling recipes with a config option
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
-
Torch original code?
Project and External Dependencies -> forge-version123whatever.recomp -> net -> minecraft -> block Now you know where the minecraft stuff are
-
Calling ForgeRegistries...getValue on OreDictionary ResourceLocations return null
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??
-
All RegistryObjects not being present while using Data Generators?
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
-
All RegistryObjects not being present while using Data Generators?
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
-
All RegistryObjects not being present while using Data Generators?
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
-
All RegistryObjects not being present while using Data Generators?
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?
-
All RegistryObjects not being present while using Data Generators?
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
-
All RegistryObjects not being present while using Data Generators?
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
-
Referencing Items/Blocks from other mods
Oh dammit, that was all I was missing O.o, anyways thank you
-
Referencing Items/Blocks from other mods
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?
-
How to make 1 JSON file for multiple items?
Gotcha, looked at the docs and a McJty tutorial and it seems easier than it looks! thank you
-
How to make 1 JSON file for multiple items?
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!
-
How to make 1 JSON file for multiple items?
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
-
[1.16.3] Modding Tutorial
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
IPS spam blocked by CleanTalk.