Everything posted by V0idWa1k3r
-
I'm not able to register model to my item
The way it is defined in your model file right now it would actually be src/main/resources/assets/simplerings/textures/textures/wooden_ring.json. You probably want to change the way you define your texture in your model file. Basically the path will be src/main/resources/assets/%modid%/textures/%path%.png. So a path like "simplerings:items/wooden_ring" will lead to a location of src/main/resources/assets/simplerings/textures/items/wooden_ring.png
-
I'm not able to register model to my item
Well the log says: Is there an actual file at that location(src/main/resources/assets/simplerings/models/item/wooden_ring.json) or a blockstates file at src/main/resources/assets/simplerings/blockstates/wooden_ring.json with an inventory variant defined? You'll need either of the two. Edit: yeah, your item model file must be located at src/main/resources/assets/simplerings/models/item/
-
I'm not able to register model to my item
That is an issue we'll need a log for
-
I'm not able to register model to my item
Yeah, that will work too. I still think that modders should use registry events even if they are not required to as that will make it easier to update later.
-
I'm not able to register model to my item
clinit is a way to say "class init", when all static things are set and the static block is fired alltogether. Practicaly what I'm saying is "define your item as public static final Item item = new WoodenRing(yourparams) and when your class is constructed the item will be initialized aswell". The docs are being worked on right now, I think. Apart from that they are open-sourced and if you do not like the spelling you are free to change it and submit a PR. Or an issue. Considering that the docs were written for modders in the first place... Anyway the registry system is pretty simple, actually. I'll link you an example in a minute and I'll edit this post when I'll do. EDIT: here(and fields) is an example. This is actually somewhat not the way you are supposed to do it now, but I am not sure if the way to do it now will work in whatever version you are developing for. You should still keep the 'latest' way to do it in mind though.
-
I'm not able to register model to my item
Booted an older project, checked the thing. Apparently in older versions ModelRegistryEvent is fired before pre-init so you can't have your items being created in pre-init. You need to use forge's registry system. Creating your item instances at clinit(public static final Item name = ...) 'should' work but is not advised. Haven't tested that.
-
I'm not able to register model to my item
You have only changed the method name. That does nothing, your method can be called whatever you'd like it to be. To change the lifecycle event(aka loading stage) change the parameter. There is FMLPreInitializationEvent for pre-init, FMLInitializationEvent for init, FMLPostInitializationEvent for post-init and a bunch of others.
-
I'm not able to register model to my item
No you didn't
-
I'm not able to register model to my item
ModelRegistryEvent is fired before init. Either populate this field at clinit(public static final Item wring = new WoodenRing(...)) and register the item at pre-init, do everything at pre-init or use forge's registry events and ObjectHolders
-
I'm not able to register model to my item
Well something(ModItems.wring) on that line is null. When and how are you setting that field/registering your item?
-
I'm not able to register model to my item
If you are using Then the methods that are annotated with SubscribeEvent must be static
-
[1.12] Registering for Dummies [Solved]
Well, Lex says differently. As far as I am aware the registry events have been moved to directly after pre-init but before init. Maybe the docs are not updated yet? I am subscribing my handlers for registries during pre-init and it works fine.
-
Load Obj Models
Minecraft inverts the V axis for whatever reason afaik. Flip the UV map vertically and it should work.
-
[1.12] Registering for Dummies [Solved]
a final static void?... Why?.. You might want to finish your code here. In any class an instance of you subscribe to forge's event bus during pre-init/automatically. Proxies are for distinguishing between physical sides. There should not be a common proxy to begin with, only a server one and a client one. Any common code can go in any common class, including your mod class for example. Assuming latest forge for 1.12: Not necessary. Registry events are fired after pre-init so you can subscribe your handler to a bus in pre-init and be done. It will especially not work as the methods are not static - EventBusSubscriber(or subscribing a class to a bus) will only process static fields.
-
I'm not able to register model to my item
ItemModelMesher is outdated and buggy. Use ModelLoader. Your models must be registered in a ModelRegistryEvent. Or during pre-init if you do not want to use the new registry events and are not using latest versions of forge. Unlocalized names have nothing to do with registry/modelresourcelocation names, use Item::getRegistryName(). What is that substring for?
-
[1.10.2]+ Getting Merchant Recipes/Shop Items
Actually if you want to do something like that a custom GUI should suffice. You can use your custom GUI to add buttons and handle recipes/transactions/etc. and just send it to the server which validates that the client is not trying to lie with the transaction/do the logic/etc. You can get all recipes at IMerchant::getRecipes, that returns you a MerchantRecipeList that is an implementation of ArrayList<MerchantRecipe> so you should be able to get all recipes this way. The MerchantRecipe contains MerchantRecipe::getItemToBuy(first requested item), MerchantRecipe::getSecondItemToBuy(second requested item) and getItemToSell(the result). All those are ItemStacks so you should not have issues with those. I do not know how you would implement your transaction logic, that is up to you. Just do not forget that all logic must be ran or at least checked on the server so a malicious client can't lie to the server and you should be fine. Additionally there are other useful methods in MerchantRecipe that you may or may not need, like MerchantRecipe::isRecipeDisabled(checks if the player traded maximum amount of times for the recipe), MerchantRecipe::getToolUses(the amount of time the recipe was traded), MerchantRecipe::getMaxTradeUses(pretty self-descriptive ) and others. If you want the "press button -> send packet -> check trade -> spawn items & take currency" you should be able to bypass the container entirely as if it never existed.
-
[1.10.2]+ Getting Merchant Recipes/Shop Items
Well, the items in the inventory would be null at the time the GUI opens. Those are the items in the slots that the player physically puts in. By the time the GUI is open those are null as the player couldn't have placed anything in the container. You can use MerchantInventory::getCurrentRecipe to get the currently selected recipe.
-
Load Obj Models
Well, I've tested it and it seems that triangulated faces load and render just fine for items so that seems to not be an issue. Can you please provide new fixed obj and mtl files?
-
Load Obj Models
I am not sure, I'll try it out later. L #230 : usemtl None You need to provide an actual material for the object in your model editor. Also should there not be an object definition(o name) at the beggining of the file right after the material file definition? It seems that you've made your model incorrectly in your model editor.
-
Load Obj Models
Caused by: java.lang.RuntimeException: OBJLoader.Parser: Exception parsing line #232: `f 66/1/1 67/2/1 65/3/1` Your model's face definition is invalid. Caused by: java.lang.NullPointerException at net.minecraftforge.client.model.obj.OBJModel$Material.access$100(OBJModel.java:595) ~[OBJModel$Material.class:?] Looks like something went wrong with the material, it might be null. Post your obj file somewhere so I can check if it is correct.
-
[1.10.2]+ Getting Merchant Recipes/Shop Items
From the docs of the GuiOpenEvent: This event is called before any Gui will open. If you want to override this Gui, simply set the gui variable to your own Gui. There is a setGui method in the event. This will also not work as you expect it to as you are only replacing the GUI, but the server still has the villager's original container open. You need to handle that too. Apart from that - how do you know that merchantInventory is null? From what I can tell it should not be null and that is also what my debugger tells me. In any case you can have anything you want as the merchant's inventory in your container. See how ContainerMerchant initializes the inventory. Nothing stops you from doing the same.
-
Load Obj Models
Caused by: java.io.FileNotFoundException: progressiveg:models/item/ak_47_0.mtl Yeah, fix the wrong material and post the new log. Remember that the obj file must also be named the same as the mtl file.
-
Load Obj Models
Show the log file, it usually contains descriptive errors. Also make sure that your material(not the file) is actually called Material.
-
Method Undefined
Either this is a part of an if statement or you have one too many closing parentheses. Why are you asking? Your IDE should tell you if your syntax is correct or not.
-
ResourceLocation does not work. Please help
Wrong subforum. Wrong import. Wrong version(aka 1.7.10 is no longer supported on this forum)
IPS spam blocked by CleanTalk.