Closed John-Dean closed 1 year ago
I've done this as 3 independent commits which, in chronological order, do the following:
Commit 1:
Restructured resourcePack.ts's ResourceLocation class to have more outputs as follows: Addition of ofItemModelPath and ofBlockStatePath functions that were missing Change to all of... functions to use a standardized function (deconstruct) instead of repeated code Change to all of... functions inputs to both accept string and ResourceLocation types (Non-breaking change)
Restructured resourcePack.ts's ResourceLocation class to have more outputs as follows:
resourcePack.ts
ResourceLocation
ofItemModelPath
ofBlockStatePath
of...
deconstruct
string
Commit 2:
Reworked modelLoader.ts's new ModelLoader().loadModel to: Additional argument: folder defaults to blocks to make this a non-breaking change (mimics existing functionality) allows you to instead use items for item models (for example shown in item frames) Change to variable names to be clearer (parentModel and baseModel)
Reworked modelLoader.ts's new ModelLoader().loadModel to:
modelLoader.ts
new ModelLoader().loadModel
folder
blocks
items
parentModel
baseModel
Commit 3:
❗[Breaking change] Rework to the cache (.models) to instead use resourceLocation.toString() (instead of modelPath) This makes more sense, as different modelPath inputs could resolve to the same model, but resourceLocation.toString() is unique I can find no references to the cache within the code, so this shouldn't break anything within the library Moved the point where items are added to the cache to after the textures are loaded to prevent any potential issues Where a .models cache item is present it is now returned instead of re-loading the resource
.models
resourceLocation.toString()
modelPath
I've done this as 3 independent commits which, in chronological order, do the following:
Commit 1:
Commit 2:
Commit 3: