Skip to content

Commit

Permalink
Slightly nerf Dolphin's Grace
Browse files Browse the repository at this point in the history
Fixes #50
  • Loading branch information
Dariensg committed Jun 29, 2023
1 parent 3490ee3 commit 42386a0
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

import java.util.Random;

import net.minecraft.world.item.enchantment.Enchantment.Rarity;

public class GraceEnchantment extends Enchantment {

public GraceEnchantment(Rarity rarityIn, EquipmentSlot... slots) {
Expand Down Expand Up @@ -99,13 +97,11 @@ public static void onLivingUpdate(LivingEvent.LivingTickEvent event) {
for (int i = 0; i < nbtList.size(); i++) {
CompoundTag idTag = nbtList.getCompound(i);
if (idTag.getString("id").equals(MMEnchantments.GRACE.getId().toString())) {
if (livingEntity.hasEffect(MobEffects.DOLPHINS_GRACE) && playerEntity != null && !playerEntity.isCreative() && rand.nextInt(100) == 0) {
stack.hurtAndBreak(1, livingEntity, (onBroken) -> {
onBroken.broadcastBreakEvent(EquipmentSlot.CHEST);
});
if (livingEntity.hasEffect(MobEffects.DOLPHINS_GRACE) && playerEntity != null && !playerEntity.isCreative() && rand.nextInt(80) == 0) {
stack.hurtAndBreak(1, livingEntity, (onBroken) -> onBroken.broadcastBreakEvent(EquipmentSlot.CHEST));
}
if (((LivingEntityAccess) livingEntity).getGraceRecharged()) {
livingEntity.addEffect(new MobEffectInstance(MobEffects.DOLPHINS_GRACE, 120 * idTag.getInt("lvl")));
livingEntity.addEffect(new MobEffectInstance(MobEffects.DOLPHINS_GRACE, 100 * idTag.getInt("lvl")));
((LivingEntityAccess) livingEntity).setGraceRecharged(false);
}
}
Expand Down

0 comments on commit 42386a0

Please sign in to comment.