Skip to content

Commit

Permalink
Implement armed armor stands tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jan 11, 2024
1 parent ebd91b2 commit 4809d54
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ All changes are toggleable via config files.

* **AI Improvements:** Replaces/removes entity AI for improved server performance
* **Always Eat:** Allows the consumption of food at any time, regardless of the hunger bar
* **Armed Armor Stands:** Enables arms for armor stands by default
* **Armor Curve:** Adjusts the armor scaling and degradation formulae for mobs and players
* **Attributes:** Sets custom ranges for entity attributes
* **Auto Jump Replacement:** Replaces auto jump with an increased step height (singleplayer only)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ public static class EntitiesCategory
@Config.Comment("Removes entity AI for improved server performance")
public boolean utAIRemovalToggle = false;

@Config.RequiresMcRestart
@Config.Name("Armed Armor Stands")
@Config.Comment("Enables arms for armor stands by default")
public boolean utArmedArmorStandsToggle = false;

@Config.RequiresMcRestart
@Config.Name("Auto Jump Replacement")
@Config.Comment("Replaces auto jump with an increased step height (singleplayer only)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public List<String> getMixinConfigs()
configs.add("mixins.tweaks.entities.ai.json");
configs.add("mixins.tweaks.entities.ai.saddledwandering.json");
configs.add("mixins.tweaks.entities.ai.wither.json");
configs.add("mixins.tweaks.entities.armedarmorstands.json");
configs.add("mixins.tweaks.entities.burning.horse.json");
configs.add("mixins.tweaks.entities.burning.zombie.json");
configs.add("mixins.tweaks.entities.damage.arrow.json");
Expand Down Expand Up @@ -381,6 +382,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return UTConfigTweaks.ENTITIES.utSaddledWanderingToggle;
case "mixins.tweaks.entities.ai.wither.json":
return UTConfigTweaks.ENTITIES.utWitherAIToggle;
case "mixins.tweaks.entities.armedarmorstands.json":
return UTConfigTweaks.ENTITIES.utArmedArmorStandsToggle;
case "mixins.tweaks.entities.burning.horse.json":
return UTConfigTweaks.ENTITIES.UNDEAD_HORSES.utBurningUndeadHorsesToggle;
case "mixins.tweaks.entities.burning.zombie.json":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package mod.acgaming.universaltweaks.tweaks.entities.armorstand.mixin;

import net.minecraft.entity.item.EntityArmorStand;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
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(EntityArmorStand.class)
public abstract class UTArmedArmorStandsMixin
{
@Shadow
protected abstract void setShowArms(boolean showArms);

@Inject(method = "getShowArms", at = @At("HEAD"))
public void utArmedArmorStands(CallbackInfoReturnable<Boolean> cir)
{
if (UTConfigTweaks.ENTITIES.utArmedArmorStandsToggle) this.setShowArms(true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.entities.armorstand.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTArmedArmorStandsMixin"]
}

0 comments on commit 4809d54

Please sign in to comment.