Jump to content

Maideniles

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by Maideniles

  1. I have an item which takes durability damage in the crafting table after each crafting. I have it registered in the ore dictionary using the WILDCARD_VALUE. When I use the item in a shaped recipe, the item takes durability damage and is reusable just as it's supposed to be. But if I make a shapeless recipe, it becomes completely useless after only being used once. Can someone help me figure out where I goofed up with this? Thank you. The item class: public class ItemMortarAndPestle extends Item { private Item containerItem; public ItemMortarAndPestle(String name) { setUnlocalizedName(name); setRegistryName(name); setMaxStackSize(1); setMaxDamage(64); setNoRepair(); } @Override public boolean hasContainerItem() { return true; } @Override public ItemStack getContainerItem(ItemStack itemStack) { return itemStack.getItemDamage() < itemStack.getMaxDamage() ? new ItemStack(itemStack.getItem(), 1, itemStack.getItemDamage() + 1) : ItemStack.EMPTY; } } The item's Ore Dictionary registry entry: OreDictionary.registerOre("mortar_and_pestle", new ItemStack(ItemInit.mortar_n_pestle, 1, OreDictionary.WILDCARD_VALUE)); And lastly, an example of a shapeless recipe in which the item is used: (This example stops working after one use) { "type": "minecraft:crafting_shapeless", "ingredients": [ { "item": "maidensmaterials:amethyst_chunk" }, { "type": "forge:ore_dict", "ore": "mortar_and_pestle" } ], "result": { "item": "maidensmaterials:amethyst_fragments", "count": 8 } }
  2. I was afraid that was why I couldn't get it to work. There's a method in the ItemPotion code, but that does nothing for me since this is a potion and there doesn't seem to be a way to register an ItemPotion...well, that I can find, anyway. lol How does one do a Pull Request? And thanks for the quick reply
  3. I'm sorry, I guess I didn't word my question as well as I thought I did. I mean the inventory texture of the potion bottle--the way that it glows, like an enchanted item. I want to get rid of it, if possible, so that my potion just has a plain texture. Everything else about my potions code works--the brewing recipes, etc. I just don't like the shiny overlay. How can I send it packing? As you requested-- here's my code, and a couple of screenshots of what I want. And yes, I'm aware I haven't done the status icon texture yet. I haven't decided what I want it to be yet, so I will come back to it later. Potions Registry: public class PotionTypeRegistry { public static final PotionType GREEN_THUMB = new PotionType("green_thumb", new PotionEffect[] {new PotionEffect(TreeMod.GREEN_THUMB, 230)}).setRegistryName("green_thumb"); public static final PotionType GATHERER = new PotionType("gatherer", new PotionEffect[] {new PotionEffect(TreeMod.GATHERER, 260)}).setRegistryName("gatherer"); public static void registerPotionTypes() { ForgeRegistries.POTION_TYPES.register(GATHERER); ForgeRegistries.POTION_TYPES.register(GREEN_THUMB); //---Recipes---// PotionHelper.addMix(PotionTypes.MUNDANE, Items.GOLD_NUGGET, GATHERER); PotionHelper.addMix(GATHERER, ItemInit.FLORAL_ESSENCE, GREEN_THUMB); } } Green Thumb potion: public class PotionGreenThumb extends Potion { public PotionGreenThumb() { super(false, 65460); setPotionName("effect.green_thumb"); setRegistryName(new ResourceLocation(Reference.MODID + ":" + "green_thumb")); } } Gatherer Potion: public class PotionGatherer extends Potion { public PotionGatherer() { super(false, 16776960); setPotionName("effect.gatherer"); setRegistryName(new ResourceLocation(Reference.MODID + ":" + "gatherer")); } } What I DON'T want: http://tinypic.com/r/2cdd7ow/9 What I DO want: http://tinypic.com/r/2rz28g3/9
  4. I've made some custom potions and I would like to remove the annoying glowing texture from them. How can I do that?
  5. I hope I'm not resurrecting a dead thread, since it's only been a couple months, but I think I can help you. If you use a json recipe for your crafting, it allows you to get the NBT data for potions. Here's an example for you: { "type": "minecraft:crafting_shaped", "pattern": [ "PPP", "PBP", "PPP" ], "key": { "P": { "item": "minecraft:potion", "data":0 }, "B": { "item": "minecraft:bucket" } }, "result": { "item": "minecraft:water_bucket", "count": 1 } } I hope this helps. Moreover, I hope you already found the answer you needed and I'm just late to the party, but maybe it can help the next person who sees this.
  6. What does your log say? I'm somewhat new at this myself-- not new to java, but to modding. I'm going to just guess here that your blockstate is missing the variants you declared in the BlockLeaf class-- ' check_decay' and 'decayable'. Try adding those to your blockstate and see if it doesn't help. Example: "check_decay=true,decayable=true,variant=apple": { "model:" "tm:leaves_apple"} You'll want to have a true and false for each of the leaf-specific variants. And I can vouch for Jabelar's tutorial. I just recently did some trees myself, and I had started out with following a youtube tutorial. But I got really stuck and I found Jabelar's tree tutorial and it helped me figure out where I went wrong. Also, I recommend following the advice given about going with the flat method rather than variants. I switched mine around as suggested, and it made it much easier to understand. I hope this is helpful to you, and I hope you get your trees working.
  7. True, true. But as someone who is still trying to figure out how JSON works, I'm unsure where I call the data for each of the multiple models that make up the door blockstate. Do they get added in the layer values, or in the referenced types?
  8. Forgive me, i am new to the json scene. When i learned java it was 20 years ago and back then json wasn't a thing yet, neither was minecraft, of course. Lol. I did make a couple of attempts at it already, but i obviously didn't do it right because my json code wouldnt validate. After several failed attempts and consulting with a couple of other modders i know, I thought perhaps it isn't feasible. Which brought me here. How would you recommend doing this?
  9. I had a block I made that had solid and transparent parts, and was rendering all kinds of crazy. Thanks to the folks in here I was able to get it working correctly using the forge multi-layer blockstate. My question is this...can the same method/principle be applied to a door? My goal is to make a door with a window inside it that has a texture similar to stained glass, rather than just be clear (cutout). Using a texture with some transparent parts on the regular door model gives much the same result as I had with my previous block--choppy textures, parts look like they are gone, etc. Using a custom model made with cubes that have a transparent texture applied to them gives even worse results. So is it possible to fix this using the forge multi-layer blockstate, like it fixed the other block?
  10. Disregard my last question--I got it! Woot! It took me looking once again over what I had seen as examples, versus what I was using in my blockstate, to realize where I went wrong. I had incorrectly been using paths to separate blockstates (that didn't exist) inside the "Base", "Solid", and "Translucent " values. All I needed was to have it's own blockstate, with the type. (I hope I am referring to these by their right names) So I put my "mff:backsplash" blockstate into each of the Solid, Base and Translucent values, with a # to refer to the corresponding variant types, then I defined each type with the appropriate models for "base" and "translucent". Bingo. My block appears exactly as I wanted it to, with no funky textures. Thank you so much for your help.
  11. Earlier you answered yes, when I asked this: So would this be the right way to do it? (Forgive the odd formatting, please--the editor isn't letting me fix it.) "custom": [{ //variant type named custom "Base": {"model": "mff:backsplash_base"}, //variant value named Base with a model override "Solid": {"model": "mff:backsplash_base"}, //variant value named Solid with a model override "Translucent": {"model": "mff:backsplash_bricks"} //variant value named Translucent with a model override }],
  12. which part are you saying yes to in my first question? the making 2 more block classes, or the part where I reference each model in "base" or "transparent" values?
  13. Okay, so I have 3 more questions. 1. Do I need to make 2 more block class files, one for each part of the backsplash block? Or is it enough to have the variant type "custom", with the three variant values "Base", "Solid" and "Translucent" reference just the two block models, backsplash_base and backsplash_bricks? 2. How do I add the variant type "facing" to this? My BlockBacksplash class file extends a custom block called BlockFurnishing, in which I have the facing properties, but I am unsure how to call these properties in the blockstates file, as a single block. Is it as simple as putting the blockstate into the "north": {}, etc. value, instead of the "model": {}, etc. value? 3. Do I have to add a "normal": {} variant type to this? I remember seeing the console giving an error at one point that "normal" was missing, so I am also unsure about this. Thank you for all of your help so far. I feel like I am starting to understand it a bit better and I am one step closer to success.
  14. I'm attempting to correct this... What I am understanding is that 'custom' should be a variant type instead of a value, and 'solid' and 'translucent' should be variant values with their separate model overrides. Am I even headed in the right direction here? I'm sorry if I'm not getting it, I am still learning all of this...
  15. I tried this, and still it is that error block. { "forge_marker": 1, "defaults": { "model": "forge:multi-layer", "transform": "forge:default-block" }, "variants": { "normal": [{ "custom": { "base": "mff:backsplash#base", "Solid": "mff:backsplash#base", "Translucent": "mff:backsplash#trans" } }], "base": [{ "model": "mff:block/backsplash_base" }], "trans": [{ "model": "mff:block/backsplash_bricks" }] } }
  16. Sorry if this is a dumb question, but does each model file need it's own blockstate? Is that what I'm missing?
  17. So you are saying that my code isn't telling it that the variants are the models, rather, it is referencing other (nonexistent) blockstates? I'm sorry if I sound like a dunce here, like I said, I'm still learning. If that is the case, do you have a suggestion that would help it point to the models instead?
  18. I'm sorry, this is my first time doing something complicated ike this with json files. I know how to do facing and block connecting and changing the block faces depending on the state. I didn't even know that multi-layering is possible until I read those forum posts about it. I was just following what I saw since they had the same problem, and they managed to get it working with the suggestions and corrections given to them. I have tried putting mff:block/backsplash_base, and mff:block/backsplash_bricks to point to the models that I made for it. It still didn't work.
  19. { "forge_marker": 1, "defaults": { "model": "forge:multi-layer", "transform": "forge:default-block" }, "variants": { "normal": [{ "custom": { "base": "mff:backsplash_base#base", "Solid": "mff:backsplash_base#base", "Translucent": "mff:backsplash_bricks#trans" } }], "base": [{ "model": "mff:backsplash_base" }], "trans": [{ "model": "mff:backsplash_bricks" }] } }
  20. I don't... there is only one blockstates file for this one, and I did a thorough search through my entire folder to make sure that there is only one blockstates file that refers to the backsplash_bricks and backsplash_base models. Am I supposed to have a blockstate for each of those models? Or do I need to put something in the models that will connect with the blockstate? I'm not fantastic with Java, what I know I have learned from trial and error, tutorials and just looking through github and the minecraft block classes to figure stuff out...so I'm still kind of a noob at this. As I was looking through the log from before I noticed there was reference to the blockstate not being able to find the variants for facing in the different directions. I went back and instead of having this block extend the blockfurnishing (its the base block I use that contains the methods for facing, and connecting to eachother, etc), I changed it to just extend Block. Did that mess it up even further? I hope I didn't. I'm half tempted to delete the whole thing from the mod and start the block from scratch...?
  21. Hi, sorry it took so long to get this. I went back and fixed a bunch of the other errors from the blocks I left unfinished last year. The log is much shorter now and I had a much easier time finding all the errors related to this particular block. So, here you go... [22:37:37] [Client thread/ERROR] [FML]: Exception loading model for variant mff:backsplash_bricks#trans java.lang.Exception: Could not load model definition for variant mff:backsplash_bricks#trans at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:285) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1192) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError(ModelLoaderRegistry.java:203) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.MultiLayerModel.buildModels(MultiLayerModel.java:82) ~[MultiLayerModel.class:?] at net.minecraftforge.client.model.MultiLayerModel.bake(MultiLayerModel.java:93) ~[MultiLayerModel.class:?] at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.bake(ModelLoader.java:809) ~[ModelLoader$WeightedRandomModel.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:193) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?] at net.minecraft.client.Minecraft.processKeyF3(Minecraft.java:2146) [Minecraft.class:?] at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2002) [Minecraft.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1846) [Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model mff:blockstates/backsplash_bricks.json at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:205) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:281) ~[ModelLoader.class:?] ... 29 more Caused by: java.io.FileNotFoundException: mff:blockstates/backsplash_bricks.json at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:103) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:79) ~[SimpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:198) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:281) ~[ModelLoader.class:?] ... 29 more [22:37:37] [Client thread/ERROR] [FML]: Exception loading model for variant mff:backsplash_base#base java.lang.Exception: Could not load model definition for variant mff:backsplash_base#base at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:285) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1192) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError(ModelLoaderRegistry.java:203) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.MultiLayerModel.buildModels(MultiLayerModel.java:82) ~[MultiLayerModel.class:?] at net.minecraftforge.client.model.MultiLayerModel.bake(MultiLayerModel.java:93) ~[MultiLayerModel.class:?] at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.bake(ModelLoader.java:809) ~[ModelLoader$WeightedRandomModel.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:193) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?] at net.minecraft.client.Minecraft.processKeyF3(Minecraft.java:2146) [Minecraft.class:?] at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2002) [Minecraft.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1846) [Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model mff:blockstates/backsplash_base.json at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:205) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:281) ~[ModelLoader.class:?] ... 29 more Caused by: java.io.FileNotFoundException: mff:blockstates/backsplash_base.json at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:103) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:79) ~[SimpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:198) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:185) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:281) ~[ModelLoader.class:?] ... 29 more
  22. Yes, I thought that might be it, too, so i tried that before i posted this. It didn't work, unfortunatley. I am working, so when i am done i will see if i can clean up the log file. Thanks for helping.
×
×
  • Create New...

Important Information

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