From 29ae24b044a793188f752af0637ae75e5fd6e0bf Mon Sep 17 00:00:00 2001 From: Nicholas Ignoffo Date: Mon, 30 Apr 2018 19:01:54 -0700 Subject: [PATCH] Fix altar double counting upgrades (#1291) --- .../WayofTime/bloodmagic/altar/AltarUtil.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/altar/AltarUtil.java b/src/main/java/WayofTime/bloodmagic/altar/AltarUtil.java index 7519c870..acde6d6d 100644 --- a/src/main/java/WayofTime/bloodmagic/altar/AltarUtil.java +++ b/src/main/java/WayofTime/bloodmagic/altar/AltarUtil.java @@ -50,19 +50,14 @@ public class AltarUtil { public static AltarUpgrade getUpgrades(World world, BlockPos pos, AltarTier currentTier) { AltarUpgrade upgrades = new AltarUpgrade(); - for (AltarTier tier : AltarTier.values()) { - if (tier.ordinal() > currentTier.ordinal()) - return upgrades; + for (AltarComponent component : currentTier.getAltarComponents()) { + if (!component.isUpgradeSlot() || component.getComponent() != ComponentType.BLOODRUNE) + continue; - for (AltarComponent component : tier.getAltarComponents()) { - if (!component.isUpgradeSlot() || component.getComponent() != ComponentType.BLOODRUNE) - continue; - - BlockPos componentPos = pos.add(component.getOffset()); - IBlockState state = world.getBlockState(componentPos); - if (state.getBlock() instanceof BlockBloodRune) - upgrades.upgrade(((BlockBloodRune) state.getBlock()).getBloodRune(world, componentPos, state)); - } + BlockPos componentPos = pos.add(component.getOffset()); + IBlockState state = world.getBlockState(componentPos); + if (state.getBlock() instanceof BlockBloodRune) + upgrades.upgrade(((BlockBloodRune) state.getBlock()).getBloodRune(world, componentPos, state)); } return upgrades;