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

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. Forge always tries to load the item model first and falls back to the blockstates file if that fails. If both fail, it logs both exceptions. Your blockstates file doesn't have a variant called variants , so an exception is thrown when Forge tries to load the model for that variant. The variants specified by your blockstates file are type=white , type=orange , etc.
  2. No, you can tell Minecraft to use the variants from your blockstates file as the models for your item. Use the name of the blockstates file as the domain and path of the ModelResourceLocation and the variant as the variant.
  3. In the defaults section, you set the model to the base model, e.g. minecraft:cube_all . For each variant, you set the all texture to the appropriate texture for that variant. I have a basic example here and a more complex example here.
  4. This isn't the case. You can register any model for your items, the registry name is simply the default. You need to call ModelLoader.setCustomModelResourceLocation for each metadata value of the Item . The ModelResourceLocation can either point to an item model or a variant of a blockstates file. I have an explanation of the model loading process and how ModelResourceLocation s are mapped to models here. Consider using Forge's blockstates format, it eliminates the need to create a model file for every variant of your block.
  5. It looks like you're using an unofficial/modified version of ForgeGradle, which I can't help you with. I suggest you take this to the author of FGOW or use the official ForgeGradle release. In future, please use [nobbc] [/nobbc] tags when posting code.
  6. Access Transformers allow you to change the access level (public, private, etc.) of classes, fields and methods. Since you don't know this, I'm guessing you're not using them yourself. Post your build.gradle file.
  7. Did you not understand my post? Post your access transformers.
  8. Did you read the error message? One of your access transformers is broken. If you want more help, post them.
  9. I'm glad you got it working.
  10. For some reason it's not finding the variants you've specified in the blockstates file (hence the MissingVariantException ). Could you set a breakpoint at the end of the catch block of ModelLoader.VariantLoader#loadModel and inspect the contents of the ModelBlockDefinition#mapVariants field for the mapVariants variable? Post the contents as a screenshot or text.
  11. Forge always tries to load the item model first and falls back to the blockstates file if that fails. If both fail, it logs both exceptions. What you've posted is only half of the error message (the item model / "normal location" half), the other half will tell you what went wrong while loading the model from the blockstates file. Please post the whole error message or FML log.
  12. The Universal Bucket uses the ModelDynBucket item model, which is dynamically retextured with the still texture of the Fluid contained in it. The OP wants a way to change which texture is used by ModelDynBucket , which to my knowledge isn't currently possible.
  13. You need to create an implementation of ICapabilityProvider to provide the IEnergyStorage instance. The ICapabilityProvider also needs to implement INBTSerializable to save the IEnergyStorage to NBT. Because you often need to implement these interfaces together, Forge provides the ICapabilitySerializable interface which is simply a combination of the two. Once you have the ICapabiltiyProvider implementation, override Item#initCapabilities to create and return an instance of it. This isn't specific to the energy capability, it applies to any capability you want an item to provide.
  14. Could this be where we should create out log4j property file or is this some kind of custom Forge configuration file? No, that's an outdated comment from before Minecraft switched to log4j. Edit: I've reported it here.
  15. This event is only fired on the client, which only has a single World : Minecraft#theWorld .
  16. RenderGameOverlayEvent.Text is an event, you need to subscribe to it with an event handler. Events and event handlers are explained here.
  17. Yes, that's the whole point of having a sound event contain multiple sound files.
  18. larsgerrits was correct: mob.barbarian.hurt is the name of your sound event, so use this in the ResourceLocation you pass to the SoundEvent constructor. minecolonies:mob/barbarian/hurt1 is the path to a sound file, which doesn't need to be registered.
  19. Override Block#canRenderInLayer(IBlockState, BlockRenderLayer) to return true if the block can render in the specified layer, split your model into one model per layer and then use the forge:multi-layer model in your blockstates file. This model takes the locations of the models to combine as custom data. The "base" model is used for the results of IBakedModel#isGui3d , IBakedModel#isAmbientOcclusion , IBakedModel#isBuiltInRenderer and IBakedModel#getParticleTexture . The "Solid" , "Mipped Cutout" , "Cutout" and "Translucent" models are the models used for those layers. When rendered as an item, all models (including "base" ) are rendered. The Crystallizer from DeepResonance has an example of this.
  20. Your blockstates file is incorrect. The forge/fluid model uses the "fluid" custom data key, not "fluids" . How are we supposed to help you without seeing your code and assets?
  21. You can't replace vanilla classes, the whole point of Forge is that mods don't need to modify the vanilla code. You should use the Capability system to store the player's upgrades. To render additional things on the player, you can add a LayerRenderer to the RenderPlayer instances. To completely replace the player model (for shapeshifting), subscribe to RenderPlayerEvent.Pre , cancel it and render your own model.
  22. It looks the version of log4j used by Minecraft only supports a single global configuration file, so you'll need to add this in code. I haven't done this myself, but the log4j website briefly explains it here. Like in the example, you'll probably need to create an Appender to append to your file and a LoggerConfig with the same name as your Logger (this is your mod ID if you're using the one returned by FMLPreInitializationEvent ). The LoggerConfig should be non-additive and have an AppenderRef to your Appender . You can also give it a MarkerFilter to only include messages with a specific marker.
  23. I think Tabula can export models to code, just not animations.
  24. You need some way to get the name and metadata of each variant if you want to automatically register a model for each one. An alternative to the interface may be a String[] , with the metadata as the index and the name as the value.
  25. If you create an interface that provides access to the name and metadata value of each variant and implement this on your variant enum, you can then create a method that iterates through the enum values and registers a model for each variant's metadata and name. I have an example of this in my mod: IVariant interface (link) BlockVariants with EnumType that implements IVariant (link) Model registration using the registerVariantBlockItemModels method (link) The registerVariantBlockItemModels method (link) The registerVariantItemModels method (link)

Important Information

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

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.