Skip to content

Commit 214b39c

Browse files
committed
Fixes for LBG+Diagonal Fences together
1 parent a327b46 commit 214b39c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakeryMixin.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@
4444
import org.spongepowered.asm.mixin.Mixin;
4545
import org.spongepowered.asm.mixin.Mutable;
4646
import org.spongepowered.asm.mixin.Shadow;
47-
import org.spongepowered.asm.mixin.injection.At;
48-
import org.spongepowered.asm.mixin.injection.Inject;
49-
import org.spongepowered.asm.mixin.injection.ModifyArg;
50-
import org.spongepowered.asm.mixin.injection.Redirect;
5147
import org.spongepowered.asm.mixin.injection.*;
5248
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
5349
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@@ -179,7 +175,7 @@ private Object captureMissingModel(Object model) {
179175

180176
@Inject(method = "loadModel", at = @At(value = "HEAD"), cancellable = true)
181177
private void ignoreNonFabricModel(ResourceLocation modelLocation, CallbackInfo ci) throws Exception {
182-
if(this.inTextureGatheringPass && !this.forceLoadModel && !this.injectedModels.contains(modelLocation)) {
178+
if(this.inTextureGatheringPass && this.blockStateFiles != null && !this.forceLoadModel && !this.injectedModels.contains(modelLocation)) {
183179
// Custom model processor, try to avoid loading unwrapped models
184180
// First add this to the list of models to scan for textures
185181
ResourceLocation blockStateLocation = null;
@@ -210,7 +206,7 @@ private void ignoreNonFabricModel(ResourceLocation modelLocation, CallbackInfo c
210206
this.cacheAndQueueDependencies(modelLocation, this.missingModel);
211207
this.forceLoadModel = false;
212208
if(this.smallLoadingCache.get(modelLocation) != this.missingModel) {
213-
/* probably a wrapped model, allow it to load normally */
209+
// probably a wrapped model, allow it to load normally
214210
isWrappedModel = true;
215211
}
216212
this.smallLoadingCache.clear();
@@ -344,6 +340,8 @@ private Object getMissingModel(Map map, Object rl) {
344340

345341
@ModifyVariable(method = "cacheAndQueueDependencies", at = @At("HEAD"), argsOnly = true)
346342
private UnbakedModel fireUnbakedEvent(UnbakedModel model, ResourceLocation location) {
343+
if(this.inTextureGatheringPass)
344+
return model;
347345
for(ModernFixClientIntegration integration : ModernFixClient.CLIENT_INTEGRATIONS) {
348346
try {
349347
model = integration.onUnbakedModelLoad(location, model, (ModelBakery)(Object)this);

0 commit comments

Comments
 (0)