Search in sources :

Example 1 with IFadedRune

use of WayofTime.alchemicalWizardry.api.altarRecipeRegistry.IFadedRune in project BloodMagic by WayofTime.

the class UpgradedAltars method getUpgrades.

public static AltarUpgradeComponent getUpgrades(World world, int x, int y, int z, int altarTier) {
    if (world.isRemote) {
        return null;
    }
    AltarUpgradeComponent upgrades = new AltarUpgradeComponent();
    List<AltarComponent> list = UpgradedAltars.getAltarUpgradeListForTier(altarTier);
    for (AltarComponent ac : list) {
        if (ac.isUpgradeSlot()) {
            // Currently checks the getRuneEffect.
            // TODO Change so that it uses the metadata instead, with the BlockID.
            Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
            int meta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
            if (testBlock instanceof BloodRune) {
                if (testBlock instanceof IFadedRune && altarTier > ((IFadedRune) testBlock).getAltarTierLimit(meta)) {
                    return UpgradedAltars.getUpgrades(world, x, y, z, ((IFadedRune) testBlock).getAltarTierLimit(meta));
                }
                switch(((BloodRune) testBlock).getRuneEffect(meta)) {
                    case 1:
                        upgrades.addSpeedUpgrade();
                        break;
                    case 2:
                        upgrades.addEfficiencyUpgrade();
                        break;
                    case 3:
                        upgrades.addSacrificeUpgrade();
                        break;
                    case 4:
                        upgrades.addSelfSacrificeUpgrade();
                        break;
                    case 5:
                        upgrades.addaltarCapacitiveUpgrade();
                        break;
                    case 6:
                        upgrades.addDisplacementUpgrade();
                        break;
                    case 7:
                        upgrades.addorbCapacitiveUpgrade();
                        break;
                    case 8:
                        upgrades.addBetterCapacitiveUpgrade();
                        break;
                    case 9:
                        upgrades.addAccelerationUpgrade();
                        break;
                }
            }
        }
    }
    return upgrades;
}
Also used : IAltarComponent(WayofTime.alchemicalWizardry.api.tile.IAltarComponent) IFadedRune(WayofTime.alchemicalWizardry.api.altarRecipeRegistry.IFadedRune) Block(net.minecraft.block.Block) BloodRune(WayofTime.alchemicalWizardry.common.block.BloodRune)

Aggregations

IFadedRune (WayofTime.alchemicalWizardry.api.altarRecipeRegistry.IFadedRune)1 IAltarComponent (WayofTime.alchemicalWizardry.api.tile.IAltarComponent)1 BloodRune (WayofTime.alchemicalWizardry.common.block.BloodRune)1 Block (net.minecraft.block.Block)1