generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
57 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 2 additions & 8 deletions
10
common/src/main/java/dev/dhyces/trimmed/impl/client/models/source/NamedModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
package dev.dhyces.trimmed.impl.client.models.source; | ||
|
||
import net.minecraft.client.renderer.block.model.BlockModel; | ||
import net.minecraft.client.resources.model.ModelResourceLocation; | ||
import net.minecraft.resources.ResourceLocation; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public record NamedModel(ResourceLocation id, Supplier<BlockModel> model, @Nullable ModelResourceLocation modelId) { | ||
public record NamedModel(ResourceLocation id, Supplier<BlockModel> model) { | ||
public static NamedModel item(ResourceLocation fileId, Supplier<BlockModel> model) { | ||
return new NamedModel(fileId, model, convertToItemModelId(fileId)); | ||
} | ||
|
||
public static ModelResourceLocation convertToItemModelId(ResourceLocation modelFileId) { | ||
return new ModelResourceLocation(modelFileId.withPath(s -> s.substring(s.indexOf("/")+1)), "inventory"); | ||
return new NamedModel(fileId, model); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters