Skip to content

Commit

Permalink
Push commit with a (broken) mixin so CI stops complaining
Browse files Browse the repository at this point in the history
Will you please stop blowing up my freaking emails GitHub?
  • Loading branch information
Roadhog360 committed Sep 1, 2024
1 parent 8ef48cd commit e88e515
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/roadhog360/simpleskinbackport/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public String getMixinConfig() {
@Override
public List<String> getMixins(Set<String> loadedCoreMods) {
List<String> mixins = new ArrayList<>();

mixins.add("MixinModelBiped");
return mixins;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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 = "<init>(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);
}
}
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/ssb_at.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public net.minecraft.client.Minecraft field_110446_Y #fileAssets
public net.minecraft.client.Minecraft field_152350_aA
11 changes: 11 additions & 0 deletions src/main/resources/mixins.ssb.early.json
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit e88e515

Please sign in to comment.