Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. Sorry I wasn't very clear about this, your Type needs to be your own class or another class not directly a primitive class. Because as you have witnessed you can't just instantiate a Byte or an Integer.
  2. This requires you to create your own capability and register it. To create your own Capability create a public static final Capability<Type> field and annotate it with @CababilityInject @CapabilityInject(value = Type.class) public static final Capability<Type> CAPABILITY; // Where type is a class that stores the information that you want. In your case probably a byte or a int. Then you will have to register it. Via CapabilityManager.INSTANCE.register The parameters are the Type class from above, an instance of IStorage which you will need to create, and a Callable that returns an instance of your Type from above. Then just override initCapabilities in your Items class, and return a new instance of ICapabilitySerializable and handle those methods.
  3. First lets establish some of the parameters of the situation. What are you wanting to store? Will it only be stored on one of your Items?
  4. Oh, that's my bad when I read it I inserted an 'I' after the mod link.
  5. You simply just needed to use reflection to change the values of the fields in your preInit method seeing as how botania still uses an old method of instantiating their IForgeRegistry fields and make your mod load after botania, which it should do anyways. Now what would have made it a pain is if vazkii had updated to the new way because then you would have had to use reflection to change the fields and register them yourself. Of course it's more work than simply overriding the registry, but let's be real here why couldn't you have just done a pull request on vazkii's github to allow for the configuration options. It probably would've been easier to create than an addon.
  6. Post your log it should have the error in it. However I think you Json doesn't have the right syntax.
  7. True, but lets be honest the likelihood of this occurring isn't that high. I can't name a mod that actually does this to modded items or blocks. That's not what I was doing, I had switched to explaining what you could do instead of @ObjectHolder
  8. The @ObjectHolder annotation populates a static final field that exists in one of the forge registries. IE if I wanted a local instance of the Emerald Item @ObjectHolder("minecraft:emerald") public static final Item EMERALD = null; That field now stores Items.EMERALD in it. You can use this for your Items, but it is by no means required to use to get rid of static initializers. To get rid of static initializers means to not do public static final Item NAME = new Item().setRegistryName...; // OR public static Item NAME; static { NAME = new Item().setRegistryName...; } So instead you should do public static void registryEvent() { ModItems.NAME = new Item().setRegistryName... // Register. }
  9. ItemStacks cannot and should not ever be null. Use ItemStack.EMPTY.
  10. I believe there is a class called ForgeChunkLoader or ForgeChunkManager? That allows you to do something with them. I'm not really sure.
  11. If it is not being manually kept loaded, ie spawn chunks or chunk loader. Then once they are a distance away from the player they unload, in singleplayer it is the render distance (I believe) in multiplayer it's a "render distance" that is specified in the server.properties file.
  12. Learn Java before making a mod. Try a different tutorial possibly in vain. Or better yet, learn Java.
  13. Sorry, 1.7.10 is no longer supported on here due to it's age. It's more than 4 years old. Please update to the latest version to receive assistance.
  14. Its a class you have to make. It can be named anything you want, but it needs to have the @Mod annotation.
  15. Any Java tutorial really. Stanford has a really good YouTube playlist of their Java course. That code looks good.
  16. He meant a StackOverFlow Exception. You shouldn't be calling a method inside of itself unless you know what you are doing. You need to call your register method from your @Mod class.
  17. Post the log for the server. Uh, no. Where did you hear that?
  18. I assume you mean for 1.13, in which case. "The update for 1.13 is being worked on, but there is no release date for it yet. Updates to a new version of Minecraft take a lot of work, so please be patient. Please refrain from making "is it done yet?" threads. The update will be ready when it is ready." If not post what you did after you downloaded the mdk.
  19. Dont post your code as a download, use the built in code format(<>), or an online code site(github, bit bucket, etc.). There is a method in the Container class called addSlot use that.
  20. Well, don't follow it. You don't always find the correct answer on YouTube. Instead do what V0idWa1k3r said.
×
×
  • Create New...

Important Information

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