diff --git a/README.md b/README.md index f1d96ced..b2402600 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java index 1e3e84c4..bfa89f02 100644 --- a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java +++ b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java @@ -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)") diff --git a/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java b/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java index a072e138..35d644ea 100644 --- a/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java +++ b/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java @@ -185,6 +185,7 @@ public List 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"); @@ -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": diff --git a/src/main/java/mod/acgaming/universaltweaks/tweaks/entities/armorstand/mixin/UTArmedArmorStandsMixin.java b/src/main/java/mod/acgaming/universaltweaks/tweaks/entities/armorstand/mixin/UTArmedArmorStandsMixin.java new file mode 100644 index 00000000..7308175c --- /dev/null +++ b/src/main/java/mod/acgaming/universaltweaks/tweaks/entities/armorstand/mixin/UTArmedArmorStandsMixin.java @@ -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 cir) + { + if (UTConfigTweaks.ENTITIES.utArmedArmorStandsToggle) this.setShowArms(true); + } +} \ No newline at end of file diff --git a/src/main/resources/mixins.tweaks.entities.armedarmorstands.json b/src/main/resources/mixins.tweaks.entities.armedarmorstands.json new file mode 100644 index 00000000..01d784df --- /dev/null +++ b/src/main/resources/mixins.tweaks.entities.armedarmorstands.json @@ -0,0 +1,7 @@ +{ + "package": "mod.acgaming.universaltweaks.tweaks.entities.armorstand.mixin", + "refmap": "universaltweaks.refmap.json", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "mixins": ["UTArmedArmorStandsMixin"] +} \ No newline at end of file