Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.ai.control.MoveControl;
import net.minecraft.world.entity.ai.navigation.PathNavigation;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.WaterAnimal;
import net.minecraft.world.entity.animal.axolotl.Axolotl;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
Expand All @@ -21,6 +23,8 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import javax.annotation.Nullable;

@Mixin(Mob.class)
public abstract class MobMixin extends LivingEntity {

Expand Down Expand Up @@ -98,4 +102,11 @@ private void di_playAmbientSound(CallbackInfo ci) {
ci.cancel();
}
}

@Inject(method = "setTarget", at = @At(value = "HEAD"), cancellable = true)
private void di_setTarget(@Nullable LivingEntity livingEntity, CallbackInfo ci) {
if (TameableUtils.hasEnchant(this, DIEnchantmentRegistry.PACIFIST) && (livingEntity instanceof Animal || livingEntity instanceof WaterAnimal) ) {
ci.cancel();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public class DIEnchantmentRegistry {
public static final PetEnchantment BLAZING_PROTECTION = new PetEnchantmentLootOnly("blazing_protection", Enchantment.Rarity.VERY_RARE, 3, 8);
public static final PetEnchantment HEALING_AURA = new PetEnchantment("healing_aura", Enchantment.Rarity.RARE, 2, 12);

public static final PetEnchantment REJUVENATION = new PetEnchantment("rejuvenation", Enchantment.Rarity.UNCOMMON, 1, 6);
public static final PetEnchantment REJUVENATION = new PetEnchantment("rejuvenation", Enchantment.Rarity.COMMON, 1, 1);
public static final PetEnchantment PACIFIST = new PetEnchantment("pacifist", Enchantment.Rarity.UNCOMMON, 1, 4);
public static final PetEnchantment UNDEAD_CURSE = new PetEnchantmentCurse("undead_curse", Enchantment.Rarity.VERY_RARE);
public static final PetEnchantment INFAMY_CURSE = new PetEnchantmentCurse("infamy_curse", Enchantment.Rarity.VERY_RARE);
public static final PetEnchantment BLIGHT_CURSE = new PetEnchantmentCurse("blight_curse", Enchantment.Rarity.VERY_RARE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
"enchantment.domesticationinnovation.healing_aura.desc": "Pet will ocassionally heal owner and other pets around it, level determines strength of healing effect.",
"enchantment.domesticationinnovation.rejuvenation": "Rejuvenation",
"enchantment.domesticationinnovation.rejuvenation.desc": "When injured, pet may absorb experience orbs to heal itself.",
"enchantment.domesticationinnovation.pacifist": "Pacifist",
"enchantment.domesticationinnovation.pacifist.desc": "Pet will not attack other animals.",
"domesticationinnovation.sound.subtitle.collar_tag": "equipped Collar Tag",
"domesticationinnovation.sound.subtitle.magnet_loop": "Magnet buzzes",
"domesticationinnovation.sound.subtitle.chain_lightning": "Lightning zaps",
Expand Down