diff --git a/src/main/java/de/dafuqs/spectrum/mixin/PassiveEntityMixin.java b/src/main/java/de/dafuqs/spectrum/mixin/PassiveEntityMixin.java new file mode 100644 index 0000000000..daad9e0ed8 --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/mixin/PassiveEntityMixin.java @@ -0,0 +1,26 @@ +package de.dafuqs.spectrum.mixin; + +import de.dafuqs.spectrum.registries.*; +import net.minecraft.entity.*; +import net.minecraft.entity.passive.*; +import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.injection.*; +import org.spongepowered.asm.mixin.injection.callback.*; + +@Mixin(PassiveEntity.class) +public abstract class PassiveEntityMixin { + + @Shadow + public abstract boolean isBaby(); + + @Inject(at= @At("HEAD"), method= "setBreedingAge", cancellable = true) + private void spectrum$preventGrowUp(int age, CallbackInfo ci) + { + var entity = (LivingEntity) (Object) this; + if(this.isBaby() && entity.hasStatusEffect(SpectrumStatusEffects.SCARRED)) + { + ci.cancel(); + } + } + +} diff --git a/src/main/resources/assets/spectrum/lang/en_us.json b/src/main/resources/assets/spectrum/lang/en_us.json index 217f1a025e..14b0cff2ec 100644 --- a/src/main/resources/assets/spectrum/lang/en_us.json +++ b/src/main/resources/assets/spectrum/lang/en_us.json @@ -3749,7 +3749,7 @@ "book.spectrum.guidebook.sawblade_holly.name": "Sawblade Holly", "book.spectrum.guidebook.sawblade_holly.page0.text": "These berries remind me of [#](bb00bb)Sweet Berries[#](). Unlike those, however, these are rather dry.\\\n\\\nCan be eaten, but have an unpleasant consistency. Better than nothing, when the going gets tough.", "book.spectrum.guidebook.sawblade_holly.page1.text": "Harvested by shearing a Sawblade Holly Bush. Can be used as a [Potion Reagent](entry://brewing/potion_workshop_reagents@prickly_bayleaf) and in cooking.\\\n\\\n*Clearly easier to digest cooked than raw...*", - "book.spectrum.guidebook.scarred.page0.text": "Prevented me from regenerating health by natural means while also preventing me from sprinting.\\\n\\\n*A vicious cycle, should something attack me*", + "book.spectrum.guidebook.scarred.page0.text": "Prevented me from regenerating health by natural means while also preventing me from sprinting.\\\nAlso prevents baby animals from growing up.\\\n\\\n*A vicious cycle, should something attack me*", "book.spectrum.guidebook.semi_permeable_glass.page0.text": "Those pesky monsters that appear at night have long since ceased to be a threat to me, now merely serving as a resource supplier, if anything. But that doesn't stop them from stalking and harassing me.\\\nI've spent more time keeping those pesky monsters out of my base than I care to admit.", "book.spectrum.guidebook.semi_permeable_glass.page1.text": "Then I remembered my [Gemstone Glass recipe](entry://decoration/gemstone_glass) that I had created earlier.\\\n\\\nWith a bit of magical energy, it was no problem to make it not only transparent, but also passable for me (but not for them!).\\\n\\\nBonus: I made it look exactly like regular glass in case I want to fool my competitors.", "book.spectrum.guidebook.semi_permeable_glass.page2.text": "Looks exactly like its mundane counterpart, but only players can pass through it. All other creatures will bounce off it like a fly off a window.", diff --git a/src/main/resources/spectrum.mixins.json b/src/main/resources/spectrum.mixins.json index b4b6260079..5461bda4c5 100644 --- a/src/main/resources/spectrum.mixins.json +++ b/src/main/resources/spectrum.mixins.json @@ -59,6 +59,7 @@ "MobEntityMixin", "NbtPredicateMixin", "NoteBlockMixin", + "PassiveEntityMixin", "PiglinBrainMixin", "PistonBlockMixin", "PlantOnCustomFarmlandMixin",