Everything posted by Choonster
-
How to set up an item model .json file for a meta block?
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.
-
How to set up an item model .json file for a meta block?
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.
-
How to set up an item model .json file for a meta block?
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.
-
How to set up an item model .json file for a meta block?
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.
-
Forge MDK build failed
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.
-
Forge MDK build failed
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.
-
Forge MDK build failed
Did you not understand my post? Post your access transformers.
-
Forge MDK build failed
Did you read the error message? One of your access transformers is broken. If you want more help, post them.
-
[1.10.2] Blockstates, models, and files...again
I'm glad you got it working.
-
[1.10.2] Blockstates, models, and files...again
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.
-
[1.10.2] Blockstates, models, and files...again
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.
-
[1.9-1.10] Overriding universal bucket of custom liquid texutre
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.
-
How to create an EnergyItem with CapabilityEnergy
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.
-
Proper way to use a Logger
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.
-
Add text to f3 debug screen.
This event is only fired on the client, which only has a single World : Minecraft#theWorld .
-
Add text to f3 debug screen.
RenderGameOverlayEvent.Text is an event, you need to subscribe to it with an event handler. Events and event handlers are explained here.
-
Correctly access nested sounds in sounds.json
Yes, that's the whole point of having a sound event contain multiple sound files.
-
Correctly access nested sounds in sounds.json
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.
-
[1.9.4][1.10.2] Block Model Selective Transparency and Cutout Possible?
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.
-
[1.10.2] Custom fluid not using textures specified
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?
-
[1.9.4] Overriding the EntityPlayer class.
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.
-
Proper way to use a Logger
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.
-
[1.8.9+] What is the current best tool for modeling?
I think Tabula can export models to code, just not animations.
-
[1.10.2] [SOLVED] JSON Subfolder
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.
-
[1.10.2] [SOLVED] JSON Subfolder
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)
IPS spam blocked by CleanTalk.