From ae6f96e01571ed953dd27c07387ddc878e4f61e9 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 28 May 2021 17:22:49 -0400 Subject: [PATCH] Koloss blade will respect strength --- .../com/legobmw99/allomancy/api/IAllomancyData.java | 2 +- .../modules/combat/item/KolossBladeItem.java | 12 +++++------- .../allomancy/modules/powers/CommonEventHandler.java | 2 +- .../modules/powers/data/DefaultAllomancyData.java | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/legobmw99/allomancy/api/IAllomancyData.java b/src/main/java/com/legobmw99/allomancy/api/IAllomancyData.java index 69075725..3b2d9f01 100644 --- a/src/main/java/com/legobmw99/allomancy/api/IAllomancyData.java +++ b/src/main/java/com/legobmw99/allomancy/api/IAllomancyData.java @@ -15,7 +15,7 @@ public interface IAllomancyData { * * @param player the player being checked */ - void updateMetalBurnTime(ServerPlayerEntity player); + void tickBurning(ServerPlayerEntity player); /** * Get if the player has the supplied power diff --git a/src/main/java/com/legobmw99/allomancy/modules/combat/item/KolossBladeItem.java b/src/main/java/com/legobmw99/allomancy/modules/combat/item/KolossBladeItem.java index 9c150d8b..dbaf76bb 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/combat/item/KolossBladeItem.java +++ b/src/main/java/com/legobmw99/allomancy/modules/combat/item/KolossBladeItem.java @@ -30,13 +30,11 @@ public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int i PlayerEntity player = (PlayerEntity) entityIn; if (isSelected && (player.getOffhandItem() != stack)) { - player.getCapability(AllomancyCapability.PLAYER_CAP).ifPresent(data -> { - if (!data.isBurning(Metal.PEWTER)) { - player.addEffect(new EffectInstance(Effects.DIG_SLOWDOWN, 10, 10, true, false)); - player.addEffect(new EffectInstance(Effects.WEAKNESS, 10, 10, true, false)); - player.addEffect(new EffectInstance(Effects.MOVEMENT_SLOWDOWN, 10, 0, true, false)); - } - }); + if (!player.hasEffect(Effects.DAMAGE_BOOST) && !player.getCapability(AllomancyCapability.PLAYER_CAP).filter(data -> data.isBurning(Metal.PEWTER)).isPresent()) { + player.addEffect(new EffectInstance(Effects.DIG_SLOWDOWN, 10, 10, true, false)); + player.addEffect(new EffectInstance(Effects.WEAKNESS, 10, 10, true, false)); + player.addEffect(new EffectInstance(Effects.MOVEMENT_SLOWDOWN, 10, 0, true, false)); + } } } } diff --git a/src/main/java/com/legobmw99/allomancy/modules/powers/CommonEventHandler.java b/src/main/java/com/legobmw99/allomancy/modules/powers/CommonEventHandler.java index 86f6f33f..911fd19e 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/powers/CommonEventHandler.java +++ b/src/main/java/com/legobmw99/allomancy/modules/powers/CommonEventHandler.java @@ -227,7 +227,7 @@ public static void onWorldTick(final TickEvent.WorldTickEvent event) { // Run the necessary updates on the player's metals // Ran AFTER duralumin and aluminum to make sure they function correctly if (curPlayer instanceof ServerPlayerEntity) { - data.updateMetalBurnTime((ServerPlayerEntity) curPlayer); + data.tickBurning((ServerPlayerEntity) curPlayer); } diff --git a/src/main/java/com/legobmw99/allomancy/modules/powers/data/DefaultAllomancyData.java b/src/main/java/com/legobmw99/allomancy/modules/powers/data/DefaultAllomancyData.java index be2db156..b17ed6b7 100644 --- a/src/main/java/com/legobmw99/allomancy/modules/powers/data/DefaultAllomancyData.java +++ b/src/main/java/com/legobmw99/allomancy/modules/powers/data/DefaultAllomancyData.java @@ -48,7 +48,7 @@ public DefaultAllomancyData() { } - public void updateMetalBurnTime(ServerPlayerEntity player) { + public void tickBurning(ServerPlayerEntity player) { for (Metal metal : Metal.values()) { if (this.isBurning(metal)) { if (!this.hasPower(metal)) {