Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4332 #4356

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import net.minecraft.client.render.model.ReferencedModelsCollector;
import net.minecraft.client.render.model.ResolvableModel;
import net.minecraft.client.render.model.UnbakedModel;
import net.minecraft.util.Identifier;

Expand All @@ -37,6 +38,9 @@ abstract class ReferencedModelsCollectorMixin {
@Nullable
private ModelLoadingEventDispatcher fabric_eventDispatcher;

@Shadow
public abstract void add(ResolvableModel model);

@Shadow
abstract UnbakedModel computeResolvedModel(Identifier id);

Expand All @@ -45,7 +49,7 @@ private void onReturnInit(CallbackInfo ci) {
fabric_eventDispatcher = ModelLoadingEventDispatcher.CURRENT.get();

if (fabric_eventDispatcher != null) {
fabric_eventDispatcher.forEachExtraModel(this::computeResolvedModel);
fabric_eventDispatcher.forEachExtraModel(id -> add(computeResolvedModel(id)));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
{
"parent": "fabric-model-loading-api-v1-testmod:template_half",
"textures": {
"sand": "minecraft:block/sand",
"red_sand": "minecraft:block/red_sand",
"particle": "#sand"
},
"elements": [
{
"from": [ 0, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "texture": "#sand" },
"up": { "texture": "#red_sand" },
"north": { "texture": "#sand" },
"south": { "texture": "#red_sand" },
"west": { "texture": "#sand" },
"east": { "texture": "#red_sand" }
}
}
]
"half1": "minecraft:block/sand",
"half2": "minecraft:block/red_sand"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"textures": {
"particle": "#half1"
},
"elements": [
{
"from": [ 0, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "texture": "#half1" },
"up": { "texture": "#half2" },
"north": { "texture": "#half1" },
"south": { "texture": "#half2" },
"west": { "texture": "#half1" },
"east": { "texture": "#half2" }
}
}
]
}