Skip to content

Redo methods with items #23

@ErrorCraft

Description

@ErrorCraft

Every method that takes or returns a net.minecraft.item.Item or net.minecraft.item.ItemConvertible needs to be replaced with one that uses a registry key or a registry entry. This will be done in batches of each method, where all classes are sorted lexicographically. These batches are made for references as of 24w10a. Any new references will be done separately. Not all methods get their own batch, usually because they aren't used that much, because they are very likely already done, and because there are so many of them. On top of that, net.minecraft.registry.Registries.ITEM will also get its own batch, despite not being a method.

From now on the net.minecraft package will be omitted in here and any of the batches for the sake of readability, since everything is always part of it.

Ignored packages, classes and methods

Every reference in the data package will be ignored as they are unused for gameplay, as well as that the generated files are already present in the vanilla game. This includes any bootstrapping methods for dynamic registries, like flat level generator presets and item trims. Items that are only used for item groups (so every reference in the item.ItemGroups class) and items that are used for villager trades (so every reference in the village.TradeOffers class) will be ignored as well. The reason for this is that item group entries and villager trades are data-driven, so there is no need to modify them. Almost all references that are present in any class that extends item.Item will be ignored as well, because they have been replaced with item components. All of these references will be omitted in the batches.

Example

The lists of methods only show the methods they are used in and the fields they are used for. When a reference has been changed, it should be ticked to mark it as complete. Methods and fields may appear multiple times in a list if they contain multiple of the same method references. If a method or field uses a reference from item.Items or block.Blocks, it will have an arrow (->) pointing towards the used reference. However, if no reference is present, that means it got the used value from elsewhere, such as a field, a method parameter or a local. References from the item.Items class are prefixed with item, and references from the block.Blocks class are prefixed with block to differentiate references with the same name. An example of such list is as follows:

example.ExampleClass

  • exampleMethodA()
  • exampleMethodB() -> item:minecraft:stick
  • exampleMethodB() -> block:minecraft:cobblestone
  • EXAMPLE_FIELD -> item:minecraft:stick
  • EXAMPLE_FIELD -> block:minecraft:cobblestone

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions