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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. From the MDK gradle file...
  2. One last question: Any way to do something similar with regular items? All I'm seeing are these predicate overrides which point to alternate model jsons. Its fine if not, just would've been nice.
  3. Point. However, that's only true when the classes are not related at all. For cases where you're taking a generic object and downcasting to a more specific one, where it will sometimes be valid, then that won't throw a pre-compile error. eg String s = "hello"; Object o = s; Integer i = (Integer) o;
  4. Writing code that does a cast will always compile. It's when it tries to cast something and it can't be that it will crash. There's no syntax error with what you've written, but there is a fundamental problem that will cause runtime exceptions.
  5. Github for Windows isn't completely terrible, but yeah: I would recommend using something else.
  6. Ah, thank you. I knew there was something in the code that did it already, I just couldn't track it down. I knew I could get the list of states simply by iterating through the metadata values, but that was unclean (not all blocks will have 16 states, etc.) and still didn't help translate that into a "prop=v;prop2=x" type string. The state mapper though. Muuuch more useful. StateMapperBase b = new DefaultStateMapper(); ImmutableList<IBlockState> values = block.getBlockState().getValidStates(); for(IBlockState state : values) { String variant = b.getPropertyString(state.getProperties()); int metadata = block.getMetaFromState(state); //register variant with metadata }
  7. You need to disable GL11.GL_LIGHTING, if I recall correctly.
  8. Awesome, that got things working. Much happy. Mostly my problem came down to not knowing what "<variant>" was supposed to be in diesieben07's explanation (the name, the value, a combination?). Now I'm just on a way to generalize this into a method to take in a block (and an arbitrary list of IProperties?) and loop through the variant list without doing it manually per-block. Doing one property was easy, it's getting the arbitrary list of them that'll be difficult.
  9. Thanks Choonster. The example definitely helps, too. I have a dentist appointment in about 20 minutes, so I'll poke around some more afterwards.
  10. Don't forget blocks like the piston head or the portal block.
  11. Done. https://github.com/MinecraftForge/Documentation/compare/master...Draco18s:patch-1
  12. I have a blockstate file that specifies the variants: Note that each variant is defined by a very generic "overlay_n" texture. This is so that I can change ores by changing one thing between two files: the base texture. I want to do this with my items. How? I do not want to end up with 176 virtually identical json files. I didn't have to do it for the block, I don't want to do it for the item. Thank you for linking the Forge documentation on blockstates, but it still doesn't answer the question of how do I use this for an item?
  13. AFAICT, this means I need a separate model file for each variant: every example I can find (vanilla, tutorials, other mods on github) all have a separate model file for each meta-variation. Earlier you said I didn't need it and could in fact use the blockstate json file I already had. So how do I do that?
  14. The name morefuelsmod-1.8.9:pelletBlock has been registered twice
  15. The tutorial you're watching might have all of those files hidden under a "Referenced Libraries" folder that the tutorial author never expanded. Sometimes I end up with this folder, sometimes I do not. I haven't figured out why yet.
  16. This hasn't helped any. :\ ModelBakery.registerItemVariants(item, new ModelResourceLocation(item.getRegistryName(), "inventory")); results in using the single default variant texture. ModelBakery.registerItemVariants(item, new ModelResourceLocation(item.getRegistryName(), "ore_density")); results in purple squares. Also do I do this before, after, or instead of ModelLoader.setCustomMeshDefinition?
  17. I....think I'm going to need an example of using it.
  18. // TODO Auto-generated method stub return null;
  19. No, don't do that. If you have a blockstate json it must be in /blockstates/. Post the full error. This was the error (not relevant anymore, see other section). Was for the same code above. You could call setCustomModelResourceLocation for all of them or use a ItemMeshDefinition, which is basically a callback for "give me the model for this ItemStack". Using an ItemMeshDefinition has mostly made things much better. Probably the single thing I've done that hasn't made things worse before making them better. I've got item models, but they don't show the variant textures. They all show the default texture.
  20. You need to reference it like this: GuruItems.EarthOrb That's your class and it's static item reference field.
  21. You're passing a class reference for your event handler, the Forge event bus doesn't accept static references (until build 2014, and even then your handler method isn't static). You need to pass new ChickenFollowHandler() instead.
  22. Can't figure out how to point it at the existing BlockState json, but I did get an error trying to load a file inside /models/item so I copied the json to that location. Now there's no errors but I still have untextured, unscaled blocks. Correction: the item that shows up in the creative inventory has a completely nill model (100% invisible) but using pickBlock results in a missing texture cube. ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(),"ore_density")); where `item` is the custom item block instance. I assume this is because I've only set the custom model for metadata 0. How do I get all possible metadata values from an arbitrary block so I'm not writing special-case code for every block? Obviously in this instance it would be 0-15, but that isn't always the case. Also, invisible item.
  23. Then I am not understanding how to specify the variant.

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.