Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Dylem

  1. I see, thank you for letting me now, topic solved.
  2. Hey, I have a problem with my Sword with metadata. I made an Item using variants (A, B, C) and it works good. But when I apply the same procedure to my sword, the variants get the same texture as the basic texture, and it looks "damaged" in inventory (with the green bar under it). See the problem : Here is the code :https://github.com/dylem/DylemTestMod/blob/master/common/net/dylem/test_mod/item/ItemSoulSword.java note : I also tried to add setHasSubtypes without seeing any change, appart from breaking my call to increase the medata to the item ( stack.setItemDamage(stack.getItemDamage() + 1); ). note 2 : addSoul is called from an event, but it is not related to the problem
  3. Problem solved ! The error was still the same, but it was caused by the fact that I didn't have a generic item model file in models/block/ ! Thank you all !
  4. Choonster did exactly what I did and it works for him, that's why I'm confused. I tried to replace "variant" by "test_mod:item_variants", or just "item_variants" and it doesn't work either. { "forge_marker": 1, "defaults": { "model": "test_mod:item/generated" }, "variants": { "test_mod:item_variants": { "a": { "textures": { "layer0": "test_mod:items/variants.a" } }, "b": { "textures": { "layer0": "test_mod:items/variants.b" } }, "c": { "textures": { "layer0": "test_mod:items/variants.c" } } } } }
  5. private void registerItemModelForMeta(final Item item, final int metadata, final ModelResourceLocation modelResourceLocation) { System.out.println(modelResourceLocation.toString()); ModelLoader.setCustomModelResourceLocation(item, metadata, modelResourceLocation); } That prints : [15:04:37] [main/INFO] [STDOUT]: [net.dylem.test_mod.init.ModItems$ModelHandler:registerItemModelForMeta:146]: test_mod:item_variants#test_mod:item_variants=a [15:04:37] [main/INFO] [STDOUT]: [net.dylem.test_mod.init.ModItems$ModelHandler:registerItemModelForMeta:146]: test_mod:item_variants#test_mod:item_variants=b [15:04:37] [main/INFO] [STDOUT]: [net.dylem.test_mod.init.ModItems$ModelHandler:registerItemModelForMeta:146]: test_mod:item_variants#test_mod:item_variants=c Here is the json : { "forge_marker": 1, "defaults": { "model": "item/generated" }, "variants": { "variant": { "a": { "textures": { "layer0": "test_mod:items/variants.a" } }, "b": { "textures": { "layer0": "test_mod:items/variants.b" } }, "c": { "textures": { "layer0": "test_mod:items/variants.c" } } } } } From what you did in your mod, that should work, shouldn't it ?
  6. I made a blockstate but still get the same errors of missing models. @Choonster how do you have no models for your variants in your testmod3 mod and still get it working with blockstates only ? I tried to do the same and get an incredible ammount of errors...
  7. Thanks, I get the error now. Here it is : https://pastebin.com/0yRa9HMw Apparently it says it doesn't find the file item_variants.json. I thought I only needed the jsons for the variants ? I'm a bit confused. Do I need to set the first variant as the "base" and redirect to the other variants from its json ?
  8. Unfortunately it does not, otherwise I would have fixed it myself. Here is the log : https://pastebin.com/G8WJsCkR
  9. One more thing, the textures are not showing up. Instead it prints the location which seems right to me :
  10. Nice, thank you ! Removed it because I wanted to change it and then forgot about it. Works now
  11. Hello, I tried to make variants for an item and I get a NullPointerException from this function (which is taken from ItemDye class) : @Override public String getUnlocalizedName(ItemStack stack) { int i = stack.getMetadata(); return super.getUnlocalizedName() + "." + EnumVariant.byMetadata(i).getName(); } However, when I remove the function, my 3 variants have the same unlocalized name so it doesn't load textures or names. Crash logs : https://pastebin.com/WcPiNHMb Full project code on github : https://github.com/dylem/DylemTestMod
  12. Yes sorry, only few should be replaced. That method would override gen layers on jungler hills I think I want to replace the jungle hills biome because I want my biome to be surrounded by jungle. But I'm making a GenLayer, sounds easier now..
  13. That would be nice, but I want the biome to be replaced with a random factor (to explain, I want to replace jungle hills with my own biome but it should be rare enough that the player doesn't feel like my mod changes the game).
  14. Hey, I'd like to replace every biome of a certain ID by my own biome, is there an easy way to do that with events, or should I make a GenLayer file ? The only event I found on biome spawn is WolrdTypeEvent.BiomeSize but it only concerns the size of biomes
  15. Hello, I was wondering if there was a documentation for all these p_(inert number here) variable ? For example, a function from GenLayer : /** * returns the most frequently occurring number of the set, or a random number from those provided */ protected int selectModeOrRandom(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) { if (p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_) { return p_151617_2_; } else if (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_) { return p_151617_1_; } else if (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_) { return p_151617_1_; } else if (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_) { return p_151617_1_; } else if (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_) { return p_151617_1_; } else if (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_) { return p_151617_1_; } else if (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_) { return p_151617_1_; } else if (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_) { return p_151617_2_; } else if (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_) { return p_151617_2_; } else { return p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.selectRandom(p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_); } } This function is pretty easy to understand as it is commented, but some aren't and sometimes waste me a lot of time for nothing. Is there really an interest in giving random-looking names to variables ? Is there a documentation about how they name their variables ?
  16. Just adding a comment to say that I found a very easy way to do it. Simply : public static LootEntry entry = new LootEntryItem( StyxItems.ANCIENT_COMPASS, 100, 50, new LootFunction[0], new LootCondition[0], "styx:loot_ancient_compass"); @SubscribeEvent public void onLootTableLoad(final LootTableLoadEvent event) { if(event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)) { event.getTable().getPool("main").addEntry(entry); } } That works surprisingly well and I don't have to override anything from Minecraft files.
  17. Thanks guys a lot, you were both very helpful. Made it, that wasn't that hard finally Note : I put a random attribute so I don't override all minecraft loot tables and it's still compatible with other mods !
  18. Thanks ! Will try to write my own once I understand what you did.
  19. Hey, I saw mineshaft chests loots are located in chests/abandoned_mineshaft.json. How do I add chests loots ? Is there a way to keep minecraft's base JSON so my mod still works great with other mods ?
  20. Well, I assume that your function : VillageStructures.getStructureVillageWeightedPieceList(rand, size) function doesn't have the line : net.minecraftforge.fml.common.registry.VillagerRegistry.addExtraVillageComponents(list, random, size);
  21. Under Eclipse, you could juste press CTRL + SHIFT + T and type Item to find the class.
  22. I think you are looking for net.minecraftforge.fml.common.registry.VillagerRegistry.addExtraVillageComponents in public static List<StructureVillagePieces.PieceWeight> getStructureVillageWeightedPieceList
  23. search on internet on how to update your mappings with forge
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.