Fix altar double counting upgrades (#1291)

This commit is contained in:
Nicholas Ignoffo 2018-04-30 19:01:54 -07:00
parent d29b91a106
commit 29ae24b044

View file

@ -50,19 +50,14 @@ public class AltarUtil {
public static AltarUpgrade getUpgrades(World world, BlockPos pos, AltarTier currentTier) { public static AltarUpgrade getUpgrades(World world, BlockPos pos, AltarTier currentTier) {
AltarUpgrade upgrades = new AltarUpgrade(); AltarUpgrade upgrades = new AltarUpgrade();
for (AltarTier tier : AltarTier.values()) { for (AltarComponent component : currentTier.getAltarComponents()) {
if (tier.ordinal() > currentTier.ordinal()) if (!component.isUpgradeSlot() || component.getComponent() != ComponentType.BLOODRUNE)
return upgrades; continue;
for (AltarComponent component : tier.getAltarComponents()) { BlockPos componentPos = pos.add(component.getOffset());
if (!component.isUpgradeSlot() || component.getComponent() != ComponentType.BLOODRUNE) IBlockState state = world.getBlockState(componentPos);
continue; 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; return upgrades;