From bde3ba26ebf99fc6dc9c0799be0a0188b9df3e2d Mon Sep 17 00:00:00 2001 From: IM23a-spirgif Date: Mon, 26 May 2025 11:55:55 +0200 Subject: [PATCH] Adjusted damage boost levels for player and allies. Removed inventory-based effect application logic. --- .../stalinium/item/StaliniumSwordItem.java | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/src/main/java/net/krituximon/stalinium/item/StaliniumSwordItem.java b/src/main/java/net/krituximon/stalinium/item/StaliniumSwordItem.java index a356ad2..66a66d0 100644 --- a/src/main/java/net/krituximon/stalinium/item/StaliniumSwordItem.java +++ b/src/main/java/net/krituximon/stalinium/item/StaliniumSwordItem.java @@ -23,13 +23,13 @@ public class StaliniumSwordItem extends SwordItem { public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { Level world = attacker.getCommandSenderWorld(); if (!world.isClientSide && attacker instanceof Player player) { - player.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, 100, 1, false, true)); + player.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, 100, 0, false, true)); AABB box = player.getBoundingBox().inflate(5.0); List allies = world.getEntitiesOfClass( Player.class, box, p -> p instanceof ServerPlayer && player.isAlliedTo(p) ); - MobEffectInstance allyBuff = new MobEffectInstance(MobEffects.DAMAGE_BOOST, 100, 0, false, true); + MobEffectInstance allyBuff = new MobEffectInstance(MobEffects.DAMAGE_BOOST, 100, 1, false, true); for (Player ally : allies) { ally.addEffect(allyBuff); } @@ -37,36 +37,6 @@ public class StaliniumSwordItem extends SwordItem { return super.hurtEnemy(stack, target, attacker); } - @Override - public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) { - super.inventoryTick(stack, world, entity, slot, selected); - if (world.isClientSide || !selected || !(entity instanceof Player player)) return; - if (player.getHealth() < 10.0f) { - MobEffectInstance res = new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 20, 0, false, false); - player.addEffect(res); - AABB area = player.getBoundingBox().inflate(3.0); - List allies = world.getEntitiesOfClass( - Player.class, area, - p -> p != player && player.isAlliedTo(p) - ); - for (Player ally : allies) { - ally.addEffect(res); - } - } - if (player.getHealth() < 4.0f) { - MobEffectInstance res = new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 100, 1, false, false); - player.addEffect(res); - AABB area = player.getBoundingBox().inflate(5.0); - List allies = world.getEntitiesOfClass( - Player.class, area, - p -> p != player && player.isAlliedTo(p) - ); - for (Player ally : allies) { - ally.addEffect(res); - } - } - } - @Override public boolean isDamageable(ItemStack stack) {