Jump to content

fweo

Members
  • Posts

    28
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by fweo

  1. The error is telling you that you are applying the @ObjectHolder annotation to a field that does not correspond to a registry, namely one of type CreativeTabs. If you annotate the class with @ObjectHolder like you have done, it will try to use all of the fields in there as object holders, regardless of their type, so it is trying to use SOUL_FORGERY as an object holder. You can get around this by either having only the things you want as object holders in that class and moving the others, or by annotating each field instead of the whole class (see this link).
  2. ItemFood is gone now, whether or not something is a food is defined by a field in the item's properties (this is nice because something can now easily be a food and also something else, because it doesn't have to be an ItemFood AND an ItemArmour, for example). This is the same object you give it when you set the registry name and group on, so you can just call all the necessary methods on that object. If you have a look at how a food item (bread, for example) is created in the vanilla Items class, a (currently unnamed) method is called on the properties given to the item. This method takes a Food object, and you can check the Foods class to see how you make the Food objects. The methods it uses for this are also still unnamed, but you can probably work out what each one does by looking at what food each Food object corresponds to. If you're new to programming aren't certain about how to check these things, I'm not sure about the exact process in Eclipse but if you right-click on the name of a class somewhere in your code there should be the option to view the source somewhere, this is a good way of learning how things work by checking how vanilla does things. You can also just browse through the vanilla code in your project libraries, which in Eclipse are (I think?) down the side underneath all your classes you've written and stuff.
  3. I've noticed that world generation is different from 1.12.2. Is there a registry for world generation similar to how you used to use GameRegistry.registerWorldGenerator? There isn't a registry for it in the list in the documentation, but that's for 1.13 and it tends to be outdated regardless. I can't see one used in the vanilla code either, but I haven't looked incredibly hard. Looking at how vanilla does it, I can see a lot has changed (everything seems to be a Feature now and there are a bunch of config things like OreFeatureConfig and CountRangeConfig), but I can't work out how to hook my code into it, because the biomes seem to just call a long list of functions that add all the features in their constructors. Are there any resources that give an overview of these changes or examples of how to do world generation now? Edit: After looking for a little longer I've worked out that I can loop through ForgeRegistries.BIOMES and call addFeature on each of the biomes. This doesn't feel like a particularly great way of doing things, is there a nicer way?
×
×
  • Create New...

Important Information

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