diff options
author | SHsuperCM <shsupercm@gmail.com> | 2023-01-02 10:40:47 +0200 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2023-01-02 10:40:55 +0200 |
commit | b994cb2059e5ff8d6e532d83aa14779ffd7c6339 (patch) | |
tree | 707b975246bcaeb6498e89abdf94460cb5c09bff /defaults | |
parent | 9c28f947a88506c3183dadc921f66590a9925a66 (diff) | |
download | CITResewn-b994cb2059e5ff8d6e532d83aa14779ffd7c6339.tar.gz CITResewn-b994cb2059e5ff8d6e532d83aa14779ffd7c6339.tar.bz2 CITResewn-b994cb2059e5ff8d6e532d83aa14779ffd7c6339.zip |
Moved new resource/atlas mixins out of Defaults
This is to prepare for future cit modeling api
Diffstat (limited to 'defaults')
2 files changed, 0 insertions, 45 deletions
diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/common/AtlasPreparationMixin.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/common/AtlasPreparationMixin.java deleted file mode 100644 index cfbc4d3..0000000 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/common/AtlasPreparationMixin.java +++ /dev/null @@ -1,22 +0,0 @@ -package shcm.shsupercm.fabric.citresewn.defaults.mixin.common; - -import net.minecraft.client.render.model.SpriteAtlasManager; -import net.minecraft.client.texture.Sprite; -import net.minecraft.util.Identifier; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Mixin(SpriteAtlasManager.AtlasPreparation.class) -public abstract class AtlasPreparationMixin { - @Shadow public @Nullable abstract Sprite getSprite(Identifier id); - - @Inject(method = "getSprite", cancellable = true, at = @At("HEAD")) - private void citresewn$unwrapTexturePaths(Identifier id, CallbackInfoReturnable<Sprite> cir) { - if (id.getPath().startsWith("textures/") && id.getPath().endsWith(".png")) - cir.setReturnValue(getSprite(new Identifier(id.getNamespace(), id.getPath().substring(9, id.getPath().length() - 4)))); - } -} diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/common/ResourceFinderMixin.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/common/ResourceFinderMixin.java deleted file mode 100644 index 7893760..0000000 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/common/ResourceFinderMixin.java +++ /dev/null @@ -1,23 +0,0 @@ -package shcm.shsupercm.fabric.citresewn.defaults.mixin.common; - -import net.minecraft.resource.ResourceFinder; -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Mixin(ResourceFinder.class) -public class ResourceFinderMixin { - - @Shadow @Final private String fileExtension; - - @Inject(method = "toResourcePath", cancellable = true, at = - @At("HEAD")) - private void citresewn$forceAbsoluteTextureIdentifier(Identifier id, CallbackInfoReturnable<Identifier> cir) { - if (id.getPath().endsWith(".png") && this.fileExtension.equals(".png")) - cir.setReturnValue(id); - } -} |