Class ModelData.Builder

java.lang.Object
net.neoforged.neoforge.client.model.data.ModelData.Builder
Enclosing class:
ModelData

public static final class ModelData.Builder extends Object
  • Field Details

    • HASH_THRESHOLD

      private static final int HASH_THRESHOLD
      Hash maps are slower than array maps for *extremely* small maps (empty maps or singletons are the most extreme examples). Many block entities/models only use a single model data property, which means the overhead of hashing is quite wasteful. However, we do want to support any number of properties with reasonable performance. Therefore, we use an array map until the number of properties reaches this threshold, at which point we convert it to a hash map.
      See Also:
    • properties

      private Map<ModelProperty<?>,Object> properties
  • Constructor Details

    • Builder

      private Builder(@Nullable @Nullable ModelData parent)
  • Method Details