From e88e515155cd4c239e8e817dd0ccbb0b706a7496 Mon Sep 17 00:00:00 2001 From: roadhog360 Date: Sun, 1 Sep 2024 03:40:16 -0500 Subject: [PATCH] Push commit with a (broken) mixin so CI stops complaining Will you please stop blowing up my freaking emails GitHub? --- gradle.properties | 2 +- .../simpleskinbackport/ClientProxy.java | 16 ++++ .../SimpleSkinBackportEarlyMixins.java | 2 +- .../mixins/early/MixinModelBiped.java | 85 +++++++++++++++++++ src/main/resources/META-INF/ssb_at.cfg | 2 + src/main/resources/mixins.ssb.early.json | 11 +++ 6 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 src/main/java/roadhog360/simpleskinbackport/mixins/early/MixinModelBiped.java create mode 100644 src/main/resources/META-INF/ssb_at.cfg create mode 100644 src/main/resources/mixins.ssb.early.json diff --git a/gradle.properties b/gradle.properties index 4a8fb26..c1b6506 100644 --- a/gradle.properties +++ b/gradle.properties @@ -73,7 +73,7 @@ apiPackage = # Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ # There can be multiple files in a space-separated list. # Example value: mymodid_at.cfg nei_at.cfg -accessTransformersFile = +accessTransformersFile = ssb_at.cfg # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = true diff --git a/src/main/java/roadhog360/simpleskinbackport/ClientProxy.java b/src/main/java/roadhog360/simpleskinbackport/ClientProxy.java index d0ce761..269942f 100644 --- a/src/main/java/roadhog360/simpleskinbackport/ClientProxy.java +++ b/src/main/java/roadhog360/simpleskinbackport/ClientProxy.java @@ -1,8 +1,24 @@ package roadhog360.simpleskinbackport; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; + +import java.io.File; + public class ClientProxy extends CommonProxy { // Override CommonProxy methods here, if you want a different behaviour on the client (e.g. registering renders). // Don't forget to call the super methods as well. + @Override + public void init(FMLInitializationEvent event) { + super.init(event); + +// TextureManager texManager = Minecraft.getMinecraft().renderEngine; +// File skinFolder = new File(Minecraft.getMinecraft().fileAssets, "skins"); +// MinecraftSessionService sessionService = Minecraft.getMinecraft().func_152347_ac(); // getSessionService +// Minecraft.getMinecraft().field_152350_aA/*skinManager*/ = new NewSkinManager(Minecraft.getMinecraft().func_152342_ad()/*getSkinManager*/, texManager, skinFolder, sessionService); + } } diff --git a/src/main/java/roadhog360/simpleskinbackport/mixinplugin/SimpleSkinBackportEarlyMixins.java b/src/main/java/roadhog360/simpleskinbackport/mixinplugin/SimpleSkinBackportEarlyMixins.java index 60dcf39..e2dc08d 100644 --- a/src/main/java/roadhog360/simpleskinbackport/mixinplugin/SimpleSkinBackportEarlyMixins.java +++ b/src/main/java/roadhog360/simpleskinbackport/mixinplugin/SimpleSkinBackportEarlyMixins.java @@ -24,7 +24,7 @@ public String getMixinConfig() { @Override public List getMixins(Set loadedCoreMods) { List mixins = new ArrayList<>(); - + mixins.add("MixinModelBiped"); return mixins; } diff --git a/src/main/java/roadhog360/simpleskinbackport/mixins/early/MixinModelBiped.java b/src/main/java/roadhog360/simpleskinbackport/mixins/early/MixinModelBiped.java new file mode 100644 index 0000000..78f8f0e --- /dev/null +++ b/src/main/java/roadhog360/simpleskinbackport/mixins/early/MixinModelBiped.java @@ -0,0 +1,85 @@ +package roadhog360.simpleskinbackport.mixins.early; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +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.Constant; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyConstant; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import roadhog360.simpleskinbackport.SimpleSkinBackport; + +@Mixin(ModelBiped.class) +public abstract class MixinModelBiped extends ModelBase { + + @Shadow public ModelRenderer bipedHead; + @Shadow public ModelRenderer bipedHeadwear; + @Shadow public ModelRenderer bipedBody; + @Shadow public ModelRenderer bipedRightArm; + @Shadow public ModelRenderer bipedLeftArm; + @Shadow public ModelRenderer bipedRightLeg; + @Shadow public ModelRenderer bipedLeftLeg; + @Shadow public ModelRenderer bipedEars; + @Shadow public ModelRenderer bipedCloak; + + //new stuff + public ModelRenderer bipedLeftArmwear; + public ModelRenderer bipedRightArmwear; + public ModelRenderer bipedLeftLegwear; + public ModelRenderer bipedRightLegwear; + public ModelRenderer bipedBodyWear; + public boolean smallArms = true; + + @Inject(method = "(FFII)V", at = @At("TAIL")) + private void injectNewLimbs(float z, float p_i1149_2_, int texWidth, int texHeight, CallbackInfo ci) { + + if (smallArms) { //thin arms, set to true for now + bipedLeftArm = new ModelRenderer(this, 32, 48); + bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, z); + bipedLeftArm.setRotationPoint(5.0F, 2.5F, 0.0F); + + bipedRightArm = new ModelRenderer(this, 40, 16); + bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, z); + bipedRightArm.setRotationPoint(-5.0F, 2.5F, 0.0F); + + bipedLeftArmwear = new ModelRenderer(this, 48, 48); + bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, z + 0.25F); + bipedLeftArm.addChild(bipedLeftArmwear); + + bipedRightArmwear = new ModelRenderer(this, 40, 32); + bipedRightArmwear.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, z + 0.25F); + bipedRightArm.addChild(bipedRightArmwear); + } else { + bipedLeftArm = new ModelRenderer(this, 32, 48); + bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, z); + bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + + bipedLeftArmwear = new ModelRenderer(this, 48, 48); + bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, z + 0.25F); + bipedLeftArm.addChild(bipedLeftArmwear); + + bipedRightArmwear = new ModelRenderer(this, 40, 32); + bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, z + 0.25F); + bipedRightArm.addChild(bipedRightArmwear); + } + + bipedLeftLeg = new ModelRenderer(this, 16, 48); + bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, z); + bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F); + + bipedLeftLegwear = new ModelRenderer(this, 0, 48); + bipedLeftLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, z + 0.25F); + bipedLeftLeg.addChild(bipedLeftLegwear); + + bipedRightLegwear = new ModelRenderer(this, 0, 32); + bipedRightLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, z + 0.25F); + bipedRightLeg.addChild(bipedRightLegwear); + + bipedBodyWear = new ModelRenderer(this, 16, 32); + bipedBodyWear.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, z + 0.25F); + bipedBody.addChild(bipedBodyWear); + } +} diff --git a/src/main/resources/META-INF/ssb_at.cfg b/src/main/resources/META-INF/ssb_at.cfg new file mode 100644 index 0000000..dca4326 --- /dev/null +++ b/src/main/resources/META-INF/ssb_at.cfg @@ -0,0 +1,2 @@ +public net.minecraft.client.Minecraft field_110446_Y #fileAssets +public net.minecraft.client.Minecraft field_152350_aA diff --git a/src/main/resources/mixins.ssb.early.json b/src/main/resources/mixins.ssb.early.json new file mode 100644 index 0000000..22218db --- /dev/null +++ b/src/main/resources/mixins.ssb.early.json @@ -0,0 +1,11 @@ +{ + "required": true, + "minVersion": "0.8.5-GTNH", + "package": "roadhog360.simpleskinbackport.mixins.early", + "refmap": "mixins.ssb.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8", + "overwrites": { + "conformVisibility": true + } +}