Skip to content

Commit

Permalink
fix the dumb
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcat101 committed Nov 22, 2023
1 parent 1f457e0 commit 7186c2c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/owmii/powah/armor/ArmorEffectsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.entity.ai.attributes.ModifiableAttributeInstance;
import net.minecraft.entity.ai.attributes.AttributeModifier.Operation;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
Expand Down Expand Up @@ -41,7 +43,13 @@ public class ArmorEffectsHandler {
HANDLERS.put("blazing", new ArmorEffect(player -> {getArmorData(player).putBoolean("hasJumpBoost", true);}, player -> {getArmorData(player).putBoolean("hasJumpBoost", false);}));
HANDLERS.put("niotic", new ArmorEffect(player -> {getArmorData(player).putBoolean("hasWaterBreathing", true);}, player -> {getArmorData(player).putBoolean("hasWaterBreathing", false);}));
HANDLERS.put("spirited", new ArmorEffect(player -> {getArmorData(player).putBoolean("hasNightVision", true);}, player -> {getArmorData(player).putBoolean("hasNightVision", false);}));
HANDLERS.put("nitro", new ArmorEffect(player -> {player.getAttribute(Attributes.MAX_HEALTH).applyNonPersistentModifier(armorHealthModifier);}, player -> {player.getAttribute(Attributes.MAX_HEALTH).removeModifier(armorHealthModifier);}));
HANDLERS.put("nitro", new ArmorEffect(player -> {
ModifiableAttributeInstance maxHealth = player.getAttribute(Attributes.MAX_HEALTH);
if (!maxHealth.hasModifier(armorHealthModifier)) maxHealth.applyNonPersistentModifier(armorHealthModifier);
}, player -> {
ModifiableAttributeInstance maxHealth = player.getAttribute(Attributes.MAX_HEALTH);
if (maxHealth.hasModifier(armorHealthModifier)) maxHealth.removeModifier(armorHealthModifier);
}));
HANDLERS.put("overcharged", new ArmorEffect(player -> {player.abilities.allowFlying = true;}, player -> {player.abilities.allowFlying = false; player.abilities.isFlying = false;}));
}

Expand Down

0 comments on commit 7186c2c

Please sign in to comment.