Jump to content

Cadiboo

Members
  • Posts

    3624
  • Joined

  • Last visited

  • Days Won

    58

Everything posted by Cadiboo

  1. Are those fields being properly filled by @ObjectHolder? They need to have the same name as the registry name of the object they aren’t going to hold. Please post your ModBlocks class and your block registration method
  2. Post your new log and where you got your 1.13.2 mods from.
  3. That means that you're registering a null Block or ItemBlock somewhere
  4. Erm yes, Realised that I'm in the middle of rewriting something and I haven't pushed everything for a while. If you look at the second code block in my previous response you'll see the new method that I use and I've added the 1.12.2 stuff for it (thats gone in 1.13.2) too.
  5. Have you tried restarting your computer and/or killing everything Java related?
  6. Forge can only load mods built for the same Minecraft version. All your mods except OptiFine are made for <1.12.2 which is not and cannot be supported on 1.13.2. OptiFine is not quite compatible with Forge on 1.13.2 yet, but I'm pretty sure that OptiFine will release a compatible update within this week.
  7. Right now you can look a the 1.13.2 branch to see how I do the registration. My old approach was to call a utility method inside all my constructors. This is bad for a number of reasons including passing this out of a constructor and preventing other mods from registering objects that extend your objects. Registration should also be kept separate from the object classes. Example: //Registration event.getRegistry().registerAll( new ItemOldApproach("old_approach"), new ItemOldApproach("old_approach2") ); //Item Class Constructor public ItemOldApproach(@Nonnull final String name) { ModUtil.setRegistryNames(this, name); } //ModUtil setRegistryNames method @Nonnull public static <T extends IForgeRegistryEntry.Impl<?>> T setRegistryNames(@Nonnull final T entry, @Nonnull final String name) { entry.setRegistryName(new ResourceLocation(ModReference.MOD_ID, name)); if (entry instanceof Block) { ((Block) entry).setTranslationKey(name); } if (entry instanceof Item) { ((Item) entry).setTranslationKey(name); } return entry; } My current approach is to instantiate my objects, call a helper method on them and then register them. Example: //Registration event.getRegistry().registerAll( setup(new ItemNewApproach(), "new_approach"), setup(new ItemNewApproach(), "new_approach2") ); //Item Class Constructor public ItemNewApproach() { } //setup method @Nonnull public static <T extends IForgeRegistryEntry> T setup(@Nonnull final T entry, @Nonnull final String name) { return setup(entry, new ResourceLocation(MOD_ID, name)); } @Nonnull public static <T extends IForgeRegistryEntry> T setup(@Nonnull final T entry, @Nonnull final ResourceLocation registryName) { entry.setRegistryName(registryName); if (entry instanceof Block) { ((Block) entry).setTranslationKey(MOD_ID + "." + registryName.getPath()); } if (entry instanceof Item) { ((Item) entry).setTranslationKey(MOD_ID + "." + registryName.getPath()); } return entry; }
  8. Restore the world from a backup. If you didn’t keep any backups then AFAIK everything is permanently gone.
  9. In future please leave the problem and post your solution to help other people in the future
  10. Depends on the mod, what mods are you adding? If you put them in /run/mods they should work fine if their reflection and/or ASM code is properly written. If you want to use the mods classes they need to be placed in /libs/ and you need to run the setup task again
  11. You probably want blending not alpha testing. (Haven’t looked at your code, going off the title) Also, DONT use GL directly (GL11.glColor) use GLStateManager
  12. To extend what Lex said: If Vanilla doesn’t make it a registry, Forge is not in a position to rewrite massive amounts of vanilla code to make it a registry. If you feel strongly about this, you should contact Mojang.
  13. Yes, show your main mod class.
  14. Until recent Forge versions mods couldn’t package any libraries under the Apache package (for security reasons?). You’re using a pretty old forge version.
  15. Use forges ItemHandlerCapability. Look at other mods that do this, I’ll make an example when I get home
  16. if (Minecraft#player==event#entity) return; Make sure to only run that on the client side
  17. You need to override initCapabilities in your item and attach your capabilities to the ItemStack.
  18. The registration in the 1.12.2 version in slightly sketchy. I’ve fixed it all up in 1.13.2 and I’m planning on backporting it.
  19. Because it’s only part of the error log, we need more. Please post your mod list too
  20. In my forge version (#100) it’s used in a method in ForgeEventFactory. For me method is called from vanilla code. I’ll see if I can reproduce this issue when I get home
  21. Also, don’t use RF, use FE, forges built in energy system. It’s optional to use, but it’s the replacement for RF and increases compatibility between mods
  22. Forge works like this 1) download minecraft 2) decompile minecraft 3) apply patches 4) recompile minecraft 5) remap the obfuscated names to human readable names using MCP (4 and 5 may be in the opposite order) If you have a mapping that no longer works, you can look at the vanilla code to see what it was changed to.
  23. Loop over all your items and call the same code you would have in IHasModel. You subscribe to the registry event in the relevant EventSubscriber. Models should go in the client-only event subscriber, Object registration should go in the common/normal event subscriber. Extract to a helper method means moving the same code that you call a lot into 1 helper method
  24. Yes. Remember that these mapping’s are applied to the minecraft jar, so you can just look at where the now-broken mapping was normally used and find the new mapping
  25. MCP (Mod Coder Pack) Mappings are what Forge uses to deobfuscate minecraft’s code and turn it into something human-readable. These names are provided by the community and can change, so its relatively important to keep them up to date. You can find a list of mappings here. Simply copy the name/date of the release and put it into your build.gradle file in the minecraft block. The 1.12.2 Example Mod was done with the latest stable mapping’s for 1.12.2 (stable_39). getDomain->getNamespace setUnlocalisedName->setTranslationKey getTabIconItem->createIcon
×
×
  • Create New...

Important Information

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