Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. The FML log (logs/fml-client-latest.log in the game directory) should say why the textures aren't working, please post it using Gist or Pastebin.
  2. Item models loading from blockstates files is a Forge addition, Minecraft itself doesn't allow it.
  3. I found the issue: glass_bottle_chaos_essence.json uses the Forge blockstates format, but it's located in models/item so Minecraft tries to parse it as an item model rather than a blockstates file. It doesn't have the "parent" or "elements" properties, so it gets parsed as a model with zero elements (annoyingly, Minecraft doesn't detect this as invalid and throw an exception). Since there's zero elements, there's nothing for Minecraft to render and the item appears invisible. You need to move glass_bottle_chaos_essence.json to the blockstates directory. As I said in my previous post, you also need to move standard_item.json to models/block (or a subdirectory) to it can be used by blockstates files. It should also extend minecraft:item/generated instead of copying it. Another issue I noticed is that you're passing null as the CreativeTabs argument of Item#getSubTypes even though it's marked as non-null (by the @ParametersAreNonnullByDefault annotation applied to all vanilla packages). Your IDE should warn you about nullability issues like this. Use CreativeTabs.SEARCH as the default tab for Item#getSubTypes. I also recommend annotating your event handler classes with @Mod.EventBusSubscriber rather than manually registering them with the Forge event bus, but this isn't required.
  4. I can't really help you with rendering specifics like this, all I can suggest is looking at ForgeBlockModelRenderer#renderModelFlat/ForgeBlockModelRenderer#renderModelSmooth (called by BlockModelRenderer#renderModel) to see how they render block models.
  5. Get its texture with BakedQuad#getSprite. This is a TextureAtlasSprite, a sprite on the block/item texture atlas (like IIcon).
  6. That's a "random" number derived from the BlockPos, use MathHelper.getPositionRandom to calculate it.
  7. Yes, you should use it too. Use Minecraft#getBlockRendererDispatcher to get the BlockRenderDispatcher instance.
  8. As I said, look at BlockRendererDispatcher#renderBlock.
  9. The main problem you'll run into is that blocks no longer have textures, they now have models. An IBakedModel can have any number of BakedQuads, each of which belongs to an EnumFacing (or null) and has a texture. You can use IBakedModel#getQuads to get the BakedQuads for an optional IBlockState and optional EnumFacing. You'll need to work out what to do if the model has either zero or more than one BakedQuads for EnumFacing.UP (probably blacklist that state from being smoothed). Look at BlockRendererDispatcher#renderBlock to see how it gets the actual state from the in-world state, the model from the actual state and the extended state from the actual state before rendering the model.
  10. I'm not seeing any obvious issues. Is ItemRenderRegister.registerItems being called? Are models being registered for each of your Items? Step through the code in the debugger if you're not sure. I'll need to debug your code locally to help you further. Please create a Git repository of your mod on a site like GitHub (if you haven't already) and link it here. See my repository and its .gitignore file for an example of the structure to use and which files to include.
  11. But what are you trying to render? Where are you rendering it? IIcon and RenderBlocks were replaced by the baked model system, but it's hard to tell you what you need to do when we don't actually know what you're trying to do.
  12. What "stuff"? You're being very vague, which makes it hard to help you.
  13. What is your overall goal? What feature is this code a part of? We need some more context than a snippet of code.
  14. Post the FML log from 1.12 (logs/fml-client-latest.log in the game directory) using Gist or Pastebin.
  15. The logging of missing models was broken in Forge 1.12-14.21.0.2363 (commit dc043ac) and fixed in Forge 1.12-14.21.1.2390 (commit ede05a2). Update Forge and run Minecraft again to see the model errors. Where is the dimensionshiftmain:item/standard_item model located? Blockstates files only load models from the models/block directory, so it should be located at assets/dimensionshiftmain/models/block/item/standard_item.json. You should extend minecraft:item/generated instead of copying it.
  16. Post your model registration code and JSON files (including the and the dimensionshiftmain:item/standard_item model) and the FML log.
  17. Minecraft uses = to separate properties and values in variant strings, not :. Instead of "test:2", use "test=2". If each metadata value has its own variant in the blockstates file, make sure you use that variant in the ModelResourceLocation you pass to ModelLoader.setCustomModelResourceLocation. e.g. Instead of hardcoding "test=2", use "test=" + meta.
  18. Gradle uses the JDK specified by the JAVA_HOME environment variable, it looks like it's pointing to a JRE on your machine.
  19. Some people on Minecraft Forum still provide support for 1.7.10. I strongly recommend updating to a modern version of Minecraft, though.
  20. Forge works on any OS that runs the desktop edition of Minecraft, there aren't any OS-specific versions.
  21. 1.7.10 is no longer supported on this forum, update if you want help.
  22. You'll need to monitor the food stats on ClientTickEvent, since there aren't any events fired on the client when the food stats change. Make sure you check the event's Phase to avoid running your code twice per tick.
  23. That's not the full error, the NoClassDefFoundError was almost certainly caused by another exception that indicates what actually went wrong. The FML event bus (FMLCommonHandler#bus) has been deprecated since 1.8.9 (when it was merged with the Forge event bus), don't use it. As explained in Forge's documentation on events, registering an instance with an event bus will only register the non-static @SubscribeEvent methods and registering the Class object (or annotating the class with @Mod.EventBusSubscriber) will only register the static @SubscribeEvent methods. If you're using @Mod.EventBusSubscriber, you don't need to manually register your class with the Forge event bus. Your code is quite hard to read on the dark theme. In future, please paste your code into the post without formatting and use the built-in syntax highlighting of the code blocks. Alternatively, post your code using Gist or Pastebin.
  24. This is controlled by the display transformations specified in the item model (or its parent). It looks like you've extended minecraft:item/handheld (used by swords and tools) rather than minecraft:item/generated (the basic item model with the standard display transformations).
  25. For a recipe to be unlocked when a player first has its ingredients, you need to create an advancement that unlocks it. If you don't, the recipe will only be unlocked when the player first crafts it.
×
×
  • Create New...

Important Information

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