Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
XFactHD committed Jun 10, 2024
1 parent d868475 commit e0cc6dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

public ModelResourceLocation(ResourceLocation id, String variant) {
variant = lowercaseVariant(variant);
@@ -21,6 +_,13 @@
@@ -21,6 +_,14 @@

public static ModelResourceLocation inventory(ResourceLocation p_352141_) {
return new ModelResourceLocation(p_352141_, "inventory");
+ }
+
+ /**
+ * Construct a {@code ModelResourceLocation} for use in the {@link net.neoforged.neoforge.client.event.ModelEvent.RegisterAdditional}
+ * to load a model at the given path directly instead of going through blockstates or item model auto-prefixing.
+ */
+ public static ModelResourceLocation standalone(ResourceLocation id) {
+ return new ModelResourceLocation(id, STANDALONE_VARIANT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public ModelBakery getModelBakery() {
/**
* Fired when the {@link net.minecraft.client.resources.model.ModelBakery} is notified of the resource manager reloading.
* Allows developers to register models to be loaded, along with their dependencies. Models registered through this
* event must use the {@link ModelResourceLocation#STANDALONE_VARIANT} variant
* event must use the {@link ModelResourceLocation#STANDALONE_VARIANT} variant.
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
Expand All @@ -146,6 +146,8 @@ public RegisterAdditional(Set<ModelResourceLocation> models) {

/**
* Registers a model to be loaded, along with its dependencies.
* <p>
* The {@link ModelResourceLocation} passed to this method must later be used to recover the loaded model.
*/
public void register(ModelResourceLocation model) {
Preconditions.checkArgument(
Expand Down

0 comments on commit e0cc6dd

Please sign in to comment.