Skip to content

Commit

Permalink
Merge pull request #619 from Rongmario/main
Browse files Browse the repository at this point in the history
EBWizardry + ConArm crash fix
  • Loading branch information
ACGaming authored Jan 28, 2025
2 parents 6469efe + 7f1ffd6 commit c23939f
Show file tree
Hide file tree
Showing 8 changed files with 302 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ final def mod_dependencies = [
'curse.maven:cofhworld-271384:2920434' : [debug_thermal_expansion],
'curse.maven:collective-342584:3533131' : [debug_collective],
'curse.maven:compactmachines-224218:2707509' : [debug_compact_machines],
'curse.maven:constructs-armory-287683:3174535' : [debug_tinkers_construct],
'curse.maven:cqrepoured-303422:3953103' : [debug_cqrepoured],
'curse.maven:ctm-267602:2915363' : [debug_chisel],
'curse.maven:cyclops-core-232758:3159497' : [debug_evilcraft],
'curse.maven:effortlessbuilding-302113:2847346' : [debug_effortless_building],
'curse.maven:electroblobs-wizardry-265642:5354477' : [debug_electroblobs_wizardry],
'curse.maven:elementary-staffs-346007:2995593' : [debug_elementary_staffs],
'curse.maven:elenaidodge2-442962:3343308' : [debug_elenai_dodge_2],
'curse.maven:emojicord-349107:4000684' : [debug_emojicord],
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ debug_compact_machines = false
debug_cqrepoured = false
debug_crafttweaker = false
debug_effortless_building = false
debug_electroblobs_wizardry = false
debug_elementary_staffs = false
debug_elenai_dodge_2 = false
debug_emojicord = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public class UTConfigMods
@Config.Name("Elementary Staffs")
public static final ElementaryStaffsCategory ELEMENTARY_STAFFS = new ElementaryStaffsCategory();

@Config.LangKey("cfg.universaltweaks.modintegration.electroblobswizardry")
@Config.Name("Electroblob's Wizardry")
public static final ElectroblobsWizardryCategory ELECTROBLOBS_WIZARDRY = new ElectroblobsWizardryCategory();

@Config.LangKey("cfg.universaltweaks.modintegration.elenaidodge2")
@Config.Name("Elenai Dodge 2")
public static final ElenaiDodge2Category ELENAI_DODGE_2 = new ElenaiDodge2Category();
Expand Down Expand Up @@ -496,6 +500,14 @@ public static class EffortlessBuildingCategory
public boolean utEFTransmutationFixToggle = true;
}

public static class ElectroblobsWizardryCategory
{
@Config.RequiresMcRestart
@Config.Name("Fix Construct's Armory Armors Crash")
@Config.Comment("Fixes crash when wearing armors from the Construct's Armory mod")
public boolean utConstructsArmoryFixToggle = true;
}

public static class ElementaryStaffsCategory
{
@Config.RequiresMcRestart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class UTMixinLoader implements ILateMixinLoader
put("mixins.mods.compactmachines.spawns.json", () -> loaded("compactmachines3") && UTConfigMods.COMPACT_MACHINES.utAllowedSpawnsImprovementToggle);
put("mixins.mods.cqrepoured.json", () -> loaded("cqrepoured"));
put("mixins.mods.effortlessbuilding.json", () -> loaded("effortlessbuilding") && UTConfigMods.EFFORTLESS_BUILDING.utEFTransmutationFixToggle);
put("mixins.mods.electroblobswizardry.json", () -> loaded("ebwizardry") && loaded("conarm") && UTConfigMods.ELECTROBLOBS_WIZARDRY.utConstructsArmoryFixToggle);
put("mixins.mods.elementarystaffs.json", () -> loaded("element"));
put("mixins.mods.elenaidodge2.json", () -> loaded("elenaidodge2"));
put("mixins.mods.enderio.chorus.json", () -> loaded("enderio") && UTConfigMods.ENDER_IO.utChorusStackOverflow);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
package mod.acgaming.universaltweaks.mods.electroblobswizardry;

import c4.conarm.client.models.ModelConstructsArmor;

import net.minecraft.client.model.ModelRenderer;
import net.minecraft.inventory.EntityEquipmentSlot;

public class FixedConstructsArmoryModel extends ModelConstructsArmor
{
public ModelRenderer pantsAnchor;
public ModelRenderer belt;
public ModelRenderer skirtLeft;
public ModelRenderer skirtRight;
public ModelRenderer skirtFront;
public ModelRenderer skirtBack;

public ModelRenderer legLeftAnchor;
public ModelRenderer legRightAnchor;
public ModelRenderer legLeft;
public ModelRenderer legRight;

public ModelRenderer bootLeftAnchor;
public ModelRenderer bootRightAnchor;
public ModelRenderer bootLeft;
public ModelRenderer bootRight;
public ModelRenderer bootPlateLeft;
public ModelRenderer bootPlateRight;

public ModelRenderer chestAnchor;
public ModelRenderer chestBottom;
public ModelRenderer chestTop;
public ModelRenderer chestFront;
public ModelRenderer chestBack;

public ModelRenderer armLeftAnchor;
public ModelRenderer armRightAnchor;
public ModelRenderer shoulderLeft;
public ModelRenderer shoulderLeftEx;
public ModelRenderer gauntletLeft;
public ModelRenderer shoulderRight;
public ModelRenderer shoulderRightEx;
public ModelRenderer gauntletRight;

public ModelRenderer headAnchor;
public ModelRenderer helmet;
public ModelRenderer face;

public FixedConstructsArmoryModel(EntityEquipmentSlot slot)
{
super(slot);

this.textureWidth = 64;
this.textureHeight = 64;

float scale = 0.6F;

//Helmet
this.headAnchor = new ModelRenderer(this, 0, 0);

this.face = new ModelRenderer(this, 3, 10);
this.face.setRotationPoint(0.0F, 0.0F, -1.5F);
this.face.addBox(-4.0F, -8.0F, -2.5F, 8, 8, 5, scale + 0.7F);

this.helmet = new ModelRenderer(this, 32, 48);
this.helmet.setRotationPoint(0.0F, 0.0F, 0.0F);
this.helmet.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, scale + 0.4F);

//Chestplate
this.chestAnchor = new ModelRenderer(this, 0, 0);

this.chestBack = new ModelRenderer(this, 50, 13);
this.chestBack.setRotationPoint(0.0F, 6.1F, 2.3F);
this.chestBack.addBox(-3.0F, 0.0F, -0.5F, 6, 3, 1, scale + 0.1F);

this.chestTop = new ModelRenderer(this, 0, 23);
this.chestTop.setRotationPoint(0.0F, 0.0F, 0.0F);
this.chestTop.addBox(-5.0F, 0.0F, -3.0F, 10, 6, 6, scale + 0.1F);

this.chestFront = new ModelRenderer(this, 50, 13);
this.chestFront.setRotationPoint(0.0F, 6.1F, -2.3F);
this.chestFront.addBox(-3.0F, 0.0F, -0.5F, 6, 3, 1, scale + 0.1F);

this.chestBottom = new ModelRenderer(this, 0, 55);
this.chestBottom.setRotationPoint(0.0F, 5.0F, 0.0F);
this.chestBottom.addBox(-4.0F, 0.0F, -2.0F, 8, 5, 4, scale + 0.1F);

this.armLeftAnchor = new ModelRenderer(this, 0, 0);
this.armLeftAnchor.setRotationPoint(5.0F, 2.0F, 0.0F);
this.armRightAnchor = new ModelRenderer(this, 0, 0);
this.armRightAnchor.setRotationPoint(5.0F, 2.0F, 0.0F);

this.gauntletLeft = new ModelRenderer(this, 36, 0);
this.gauntletLeft.setRotationPoint(0.0F, 7.50F, 0.0F);
this.gauntletLeft.addBox(-1.0F, -2.0F, -2.5F, 4, 5, 5, scale + 0.2F);

this.gauntletRight = new ModelRenderer(this, 36, 0);
this.gauntletRight.mirror = true;
this.gauntletRight.setRotationPoint(0.0F, 7.50F, 0.0F);
this.gauntletRight.addBox(-3.0F, -2.0F, -2.5F, 4, 5, 5, scale + 0.2F);

this.shoulderLeft = new ModelRenderer(this, 44, 28);
this.shoulderLeft.setRotationPoint(0.0F, -2.0F, 0.0F);
this.shoulderLeft.addBox(-1.0F, -2.0F, -2.5F, 5, 4, 5, scale + 0.2F);
this.setRotateAngle(shoulderLeft, 0.0F, 0.0F, -0.17453292519943295F);

this.shoulderRight = new ModelRenderer(this, 44, 28);
this.shoulderRight.mirror = true;
this.shoulderRight.setRotationPoint(0.0F, -2.0F, 0.0F);
this.shoulderRight.addBox(-4.0F, -2.0F, -2.5F, 5, 4, 5, scale + 0.2F);
this.setRotateAngle(shoulderRight, 0.0F, 0.0F, 0.17453292519943295F);

this.shoulderRightEx = new ModelRenderer(this, 52, 20);
this.shoulderRightEx.mirror = true;
this.shoulderRightEx.setRotationPoint(-2.6F, -1.5F, 0.0F);
this.shoulderRightEx.addBox(-1.0F, 0.0F, -2.0F, 2, 4, 4, scale + 0.2F);
this.setRotateAngle(shoulderRightEx, 0.0F, 0.0F, 0.08726646259971647F);

this.shoulderLeftEx = new ModelRenderer(this, 52, 20);
this.shoulderLeftEx.setRotationPoint(2.6F, -1.5F, 0.0F);
this.shoulderLeftEx.addBox(-1.0F, 0.0F, -2.0F, 2, 4, 4, scale + 0.2F);
this.setRotateAngle(shoulderLeftEx, 0.0F, 0.0F, -0.08726646259971647F);

//Leggings
this.pantsAnchor = new ModelRenderer(this, 0, 0);

this.belt = new ModelRenderer(this, 0, 0);
this.belt.setRotationPoint(0.0F, 9.5F, 0.0F);
this.belt.addBox(-4.5F, 0.0F, -2.5F, 9, 2, 5, scale - 0.2F);

this.skirtFront = new ModelRenderer(this, 54, 7);
this.skirtFront.setRotationPoint(0.0F, 11.5F, -2.5F);
this.skirtFront.addBox(-2.0F, 0.0F, -0.5F, 4, 5, 1, scale + 0.0F);
this.setRotateAngle(skirtFront, -0.08726646259971647F, 0.0F, 0.0F);

this.skirtRight = new ModelRenderer(this, 36, 10);
this.skirtRight.mirror = true;
this.skirtRight.setRotationPoint(-4.5F, 11.5F, 0.0F);
this.skirtRight.addBox(-0.5F, 0.0F, -2.5F, 2, 6, 5, scale + 0.0F);
this.setRotateAngle(skirtRight, 0.0F, 0.0F, 0.20943951023931953F);

this.skirtLeft = new ModelRenderer(this, 36, 10);
this.skirtLeft.setRotationPoint(4.5F, 11.5F, 0.0F);
this.skirtLeft.addBox(-1.5F, 0.0F, -2.5F, 2, 6, 5, scale + 0.0F);
this.setRotateAngle(skirtLeft, 0.0F, 0.0F, -0.20943951023931953F);

this.skirtBack = new ModelRenderer(this, 54, 0);
this.skirtBack.setRotationPoint(0.0F, 11.5F, 2.5F);
this.skirtBack.addBox(-2.0F, 0.0F, -0.5F, 4, 6, 1, scale + 0.0F);
this.setRotateAngle(skirtBack, 0.08726646259971647F, 0.0F, 0.0F);

this.legLeftAnchor = new ModelRenderer(this, 0, 0);
this.legRightAnchor = new ModelRenderer(this, 0, 0);

this.legRight = new ModelRenderer(this, 0, 40);
this.legRight.mirror = true;
this.legRight.setRotationPoint(-1.9F, 0.0F, 0.0F);
this.legRight.addBox(-2.0F, 0.0F, -2.0F, 4, 9, 4, scale + 0.1F);

this.legLeft = new ModelRenderer(this, 0, 40);
this.legLeft.setRotationPoint(1.9F, 0.0F, 0.0F);
this.legLeft.addBox(-2.0F, 0.0F, -2.0F, 4, 9, 4, scale + 0.1F);

//Boots
this.bootLeftAnchor = new ModelRenderer(this, 0, 0);
this.bootRightAnchor = new ModelRenderer(this, 0, 0);

this.bootPlateRight = new ModelRenderer(this, 38, 21);
this.bootPlateRight.mirror = true;
this.bootPlateRight.setRotationPoint(-2.0F, 5.1F, -2.0F);
this.bootPlateRight.addBox(-2.5F, 0.0F, -1.0F, 5, 5, 2, scale + 0.0F);

this.bootPlateLeft = new ModelRenderer(this, 38, 21);
this.bootPlateLeft.setRotationPoint(2.0F, 5.1F, -2.0F);
this.bootPlateLeft.addBox(-2.5F, 0.0F, -1.0F, 5, 5, 2, scale + 0.0F);

this.bootLeft = new ModelRenderer(this, 16, 43);
this.bootLeft.setRotationPoint(1.9F, 6.0F, 0.0F);
this.bootLeft.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, scale + 0.4F);

this.bootRight = new ModelRenderer(this, 16, 43);
this.bootRight.mirror = true;
this.bootRight.setRotationPoint(-1.9F, 6.0F, 0.0F);
this.bootRight.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, scale + 0.4F);

//Hierarchy
this.headAnchor.addChild(this.helmet);
this.headAnchor.addChild(this.face);

this.chestAnchor.addChild(this.chestTop);
this.chestTop.addChild(this.chestBack);
this.chestTop.addChild(this.chestBottom);
this.chestTop.addChild(this.chestFront);
this.armLeftAnchor.addChild(this.shoulderLeft);
this.armLeftAnchor.addChild(this.shoulderLeftEx);
this.armLeftAnchor.addChild(this.gauntletLeft);
this.armRightAnchor.addChild(this.shoulderRight);
this.armRightAnchor.addChild(this.shoulderRightEx);
this.armRightAnchor.addChild(this.gauntletRight);

this.pantsAnchor.addChild(this.belt);
this.pantsAnchor.addChild(this.skirtBack);
this.pantsAnchor.addChild(this.skirtFront);
this.pantsAnchor.addChild(this.skirtLeft);
this.pantsAnchor.addChild(this.skirtRight);

this.legLeftAnchor.addChild(this.legLeft);
this.legRightAnchor.addChild(this.legRight);

this.bootLeftAnchor.addChild(this.bootPlateLeft);
this.bootLeftAnchor.addChild(this.bootLeft);
this.bootRightAnchor.addChild(this.bootPlateRight);
this.bootRightAnchor.addChild(this.bootRight);

headAnchor.showModel = slot == EntityEquipmentSlot.HEAD;
chestAnchor.showModel = slot == EntityEquipmentSlot.CHEST;
armRightAnchor.showModel = slot == EntityEquipmentSlot.CHEST;
armLeftAnchor.showModel = slot == EntityEquipmentSlot.CHEST;
pantsAnchor.showModel = slot == EntityEquipmentSlot.LEGS;
legLeftAnchor.showModel = slot == EntityEquipmentSlot.LEGS;
legRightAnchor.showModel = slot == EntityEquipmentSlot.LEGS;
bootLeftAnchor.showModel = slot == EntityEquipmentSlot.FEET;
bootRightAnchor.showModel = slot == EntityEquipmentSlot.FEET;
bipedHeadwear.showModel = false;

bipedHead = headAnchor;
bipedBody = chestAnchor;
bipedRightArm = armRightAnchor;
bipedLeftArm = armLeftAnchor;

if (slot == EntityEquipmentSlot.LEGS)
{
bipedBody = pantsAnchor;
bipedLeftLeg = legLeftAnchor;
bipedRightLeg = legRightAnchor;
}
else
{
bipedLeftLeg = bootLeftAnchor;
bipedRightLeg = bootRightAnchor;
}
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package mod.acgaming.universaltweaks.mods.electroblobswizardry.mixin;

import c4.conarm.client.models.ModelConstructsArmor;
import c4.conarm.lib.tinkering.TinkersArmor;

import mod.acgaming.universaltweaks.mods.electroblobswizardry.FixedConstructsArmoryModel;

import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.inventory.EntityEquipmentSlot;

import net.minecraft.item.ItemStack;

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(TinkersArmor.class)
public class UTTinkersArmorMixin
{
@Shadow(remap = false)
protected ModelBiped model;

@Inject(method = "getArmorModel", at = @At("HEAD"), remap = false)
private void utGetArmorModel(EntityLivingBase entity, ItemStack stack, EntityEquipmentSlot slot, ModelBiped _default, CallbackInfoReturnable<ModelBiped> cir)
{
if (this.model == null || this.model.getClass() == ModelConstructsArmor.class)
{
this.model = new FixedConstructsArmoryModel(slot);
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/universaltweaks/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ cfg.universaltweaks.modintegration.collective=Collective
cfg.universaltweaks.modintegration.compactmachines=Compact Machines
cfg.universaltweaks.modintegration.cqrepoured=Chocolate Quest Repoured
cfg.universaltweaks.modintegration.effortlessbuilding=Effortless Building
cfg.universaltweaks.modintegration.electroblobswizardry=Electroblob's Wizardry
cfg.universaltweaks.modintegration.elementarystaffs=Elementary Staffs
cfg.universaltweaks.modintegration.elenaidodge2=Elenai Dodge 2
cfg.universaltweaks.modintegration.emojicord=Emojicord
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/mixins.mods.electroblobswizardry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.mods.electroblobswizardry.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTTinkersArmorMixin"]
}

0 comments on commit c23939f

Please sign in to comment.