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

Posts posted by Choonster

  1. ·

    Edited by Choonster

    The registry system has been overhauled in 1.12, you need to use registry events. Forge's documentation explains them here. You can see some examples in my mod's init classes.

     

    Unlocalised names should not be used for anything except display/translation purposes, use the Item's registry name (IForgeRegistryEntry#getRegistryName) as the default model location (since it's the default model that vanilla loads for every Item).

     

    Use ModelLoader.setCustomModelResourceLocation/setCustomMeshDefinition rather than ItemModelMesher#register to register Item models. Do this in ModelRegistryEvent.

     

    The tutorial you followed is outdated and poorly written. None of this is new to 1.12; ModelLoader was introduced in 1.8, registry names were introduced in 1.8.9, IForgeRegistryEntry was introduced in 1.9, registry events were introduced towards the end of 1.10.2.

  2. This hasn't changed. If it's not working, there should be an error in the FML log telling you what went wrong.

     

    If you can't figure it out, post your code and the FML log.

     

    One thing that has changed is the order of events: Registry events are now fired after preInit instead of before preInit. If you register everything in the appropriate registry event, you shouldn't need to worry about this.

     

    Side note: ModelLoader.setCustomModelResourceLocation automatically calls ModelBakery.registerItemVariants, you don't need to call it yourself.

  3. One of your mods hasn't been updated to use the new registry system introduced in Forge 1.12-14.21.0.2348. Unfortunately the crash report doesn't say which one, so you'll need to remove mods until this error no longer occurs.

  4. You'll need to create a class that extends StateMapperBase and implements StateMapperBase#getModelResourceLocation to do something similar to StateMap#getModelResourceLocation. Instead of using the Block's registry name as the domain/path of the ModelResourceLocation directly, it should prefix the path with the name of the subdirectory.

     

    Register an instance of this for your Block(s) with ModelLoader.setCustomStateMapper in ModelRegistryEvent.

  5. I'm not sure why it's not working, that class definitely exists.

     

    All I can suggest is deleting the Gradle cache with the cleanCache task, deleting the build directory with the clean task and deleting your IDE project with the cleanEclipse/cleanIdea task before setting up the project again by following these instructions exactly.

  6. ·

    Edited by Choonster

    net.minecraftforge.registries.IForgeRegistryEntry only exists in Forge 1.12-14.21.0.2348 and later (with the overhaul of the registry system), before that it was net.minecraftforge.fml.common.registry.IForgeRegistryEntry. I'm not sure why your IDE let you compile and run your project while referencing a class that doesn't exist.

     

    Update to the latest version of Forge.

  7. ·

    Edited by Choonster

    11 minutes ago, dwilby said:

    Ya, sorry, I understand where you register the blocks, but where do you call the class that registers the blocks?

     

    I don't call it from anywhere, the @Mod.EventBusSubscriber annotation automatically subscribes it to the Forge event bus in the mod construction phase.

  8. ·

    Edited by Choonster

    19 hours ago, ctbe said:

    I did notice that the comparison with instanceof always yields false since you are asking if Item (what is returned) is an instance of ItemSpear. It is not. ItemSpear may be an instance of Item, not the other way around. Meaning the code inside the if will never run. However, I tried by making a comparison with an item's unlocalized name and the code ran, yet it didn't do anything like you said.

     

    ItemSpear is (presumably) a subclass of Item, so it's entirely possible for a method with Item as the return type to return an instance of ItemSpear. Checking if an ItemSpear is an instance of Item is pointless, since it will always be true.

     

    That part of the OP's code is correct. Using unlocalised names for anything except translation/display purposes is a bad idea, since they're not unique and can change at any time.

  9. ·

    Edited by Choonster

    There was a major overhaul of the registry system in Forge 1.12-14.21.0.2348, so any mod built for an earlier version of Forge is unlikely to work.

     

    Forge for 1.12 isn't yet stable, so breaking changes will be common until the first stable version.

     

    If you want help with the freeze, post the new FML log.

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.