Skip to content

Commit

Permalink
Prevent animated texture mixin from early-cancelling method call to a…
Browse files Browse the repository at this point in the history
…llow for other mixins to run if needed
  • Loading branch information
Tslat authored and Witixin1512 committed Sep 20, 2023
1 parent 44380d6 commit 70c1e08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class TextureManagerMixin {

@Shadow public abstract void register(ResourceLocation resourceLocation, AbstractTexture abstractTexture);

@Inject(method = "getTexture(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/renderer/texture/AbstractTexture;", at = @At("HEAD"), cancellable = true)
@Inject(method = "getTexture(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/renderer/texture/AbstractTexture;", at = @At("HEAD"))
private void wrapAnimatableTexture(ResourceLocation path, CallbackInfoReturnable<AbstractTexture> callback) {
AbstractTexture existing = this.byPath.get(path);

Expand All @@ -28,7 +28,5 @@ private void wrapAnimatableTexture(ResourceLocation path, CallbackInfoReturnable

register(path, existing);
}

callback.setReturnValue(existing);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class TextureManagerMixin {

@Shadow public abstract void register(ResourceLocation resourceLocation, AbstractTexture abstractTexture);

@Inject(method = "getTexture(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/renderer/texture/AbstractTexture;", at = @At("HEAD"), cancellable = true)
@Inject(method = "getTexture(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/renderer/texture/AbstractTexture;", at = @At("HEAD"))
private void wrapAnimatableTexture(ResourceLocation path, CallbackInfoReturnable<AbstractTexture> callback) {
AbstractTexture existing = this.byPath.get(path);

Expand All @@ -28,7 +28,5 @@ private void wrapAnimatableTexture(ResourceLocation path, CallbackInfoReturnable

register(path, existing);
}

callback.setReturnValue(existing);
}
}

0 comments on commit 70c1e08

Please sign in to comment.