Skip 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.

V0idWa1k3r

Members
  • Joined

  • Last visited

Everything posted by V0idWa1k3r

  1. 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
  2. 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/
  3. That is an issue we'll need a log for
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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
  9. Well something(ModItems.wring) on that line is null. When and how are you setting that field/registering your item?
  10. If you are using Then the methods that are annotated with SubscribeEvent must be static
  11. 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.
  12. Minecraft inverts the V axis for whatever reason afaik. Flip the UV map vertically and it should work.
  13. 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.
  14. 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?
  15. 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.
  16. 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.
  17. 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?
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  22. Show the log file, it usually contains descriptive errors. Also make sure that your material(not the file) is actually called Material.
  23. 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.
  24. Wrong subforum. Wrong import. Wrong version(aka 1.7.10 is no longer supported on this forum)

Important Information

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

Account

Navigation

Search

Search

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.