Search in sources :

Example 11 with Affinity

use of am2.api.spell.enums.Affinity in project ArsMagica2 by Mithion.

the class FlickerOperatorContainment method DoOperation.

@Override
public boolean DoOperation(World worldObj, IFlickerController habitat, boolean powered, Affinity[] flickers) {
    if (worldObj.isRemote)
        return true;
    int lastRadius = getLastRadius(habitat);
    int calcRadius = calculateRadius(flickers);
    if (lastRadius != calcRadius) {
        RemoveOperator(worldObj, habitat, powered, flickers);
    }
    boolean hasArcaneAugment = false;
    for (Affinity aff : flickers) {
        if (aff == Affinity.ARCANE) {
            hasArcaneAugment = true;
            break;
        }
    }
    for (int i = 0; i < calcRadius * 2 + 1; ++i) {
        if (hasArcaneAugment) {
            // -x
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord - calcRadius, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord + calcRadius + 1 - i, 9);
            // +x
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord + calcRadius + 1, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord - calcRadius + i, 9);
            // -z
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord - calcRadius + i, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord - calcRadius, 9);
            // +z
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord + calcRadius + 1 - i, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord + calcRadius + 1, 9);
        } else {
            // -x
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord - calcRadius, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord + calcRadius + 1 - i, i == 0 ? 9 : 3);
            // +x
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord + calcRadius + 1, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord - calcRadius + i, i == 0 ? 9 : 4);
            // -z
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord - calcRadius + i, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord - calcRadius, i == 0 ? 9 : 5);
            // +z
            setUtilityBlock(worldObj, ((TileEntity) habitat).xCoord + calcRadius + 1 - i, ((TileEntity) habitat).yCoord, ((TileEntity) habitat).zCoord + calcRadius + 1, i == 0 ? 9 : 6);
        }
    }
    setLastRadius(habitat, calcRadius);
    return true;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) Affinity(am2.api.spell.enums.Affinity)

Example 12 with Affinity

use of am2.api.spell.enums.Affinity in project ArsMagica2 by Mithion.

the class SpellBase method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
    if (!stack.hasTagCompound())
        return;
    ItemStack legacySpell = SpellUtils.instance.constructSpellStack(stack);
    SpellRequirements reqs = SpellUtils.instance.getSpellRequirements(legacySpell, player);
    float manaCost = reqs.manaCost;
    float burnout = reqs.burnout;
    ArrayList<ItemStack> reagents = reqs.reagents;
    ManaCostEvent mce = new ManaCostEvent(legacySpell, player, manaCost, 0);
    MinecraftForge.EVENT_BUS.post(mce);
    manaCost = mce.manaCost;
    list.add(String.format("\2477Mana Cost: %.2f", manaCost));
    if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
        HashMap<Affinity, Float> affinityData = SpellUtils.instance.AffinityFor(legacySpell);
        for (Affinity aff : affinityData.keySet()) {
            list.add(String.format("%s (%.2f%%)", aff.toString(), affinityData.get(aff) * 100));
        }
        if (stack.stackTagCompound.hasKey("Lore")) {
            NBTTagList nbttaglist1 = stack.stackTagCompound.getTagList("Lore", Constants.NBT.TAG_COMPOUND);
            if (nbttaglist1.tagCount() > 0) {
                for (int j = 0; j < nbttaglist1.tagCount(); ++j) {
                    list.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + nbttaglist1.getStringTagAt(j));
                }
            }
        }
    } else {
        list.add(StatCollector.translateToLocal("am2.tooltip.shiftForAffinity"));
    }
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) SpellRequirements(am2.spell.SpellUtils.SpellRequirements) ManaCostEvent(am2.api.events.ManaCostEvent) Affinity(am2.api.spell.enums.Affinity) ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 13 with Affinity

use of am2.api.spell.enums.Affinity in project ArsMagica2 by Mithion.

the class SpellScrollRenderer method renderItem.

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    if (mc.thePlayer.isPotionActive(Potion.invisibility.id))
        return;
    ItemStack scrollStack = null;
    if (item.getItem() instanceof ItemSpellBase) {
        scrollStack = item;
    } else if (item.getItem() instanceof ItemSpellBook) {
        scrollStack = ((ItemSpellBook) item.getItem()).getActiveScrollInventory(item)[((ItemSpellBook) item.getItem()).GetActiveSlot(item)];
    }
    if (scrollStack == null)
        return;
    Affinity affinity = SpellUtils.instance.mainAffinityFor(scrollStack);
    renderEffect(affinity, true, data);
}
Also used : ItemSpellBase(am2.api.spell.ItemSpellBase) Affinity(am2.api.spell.enums.Affinity) ItemStack(net.minecraft.item.ItemStack) ItemSpellBook(am2.items.ItemSpellBook)

Example 14 with Affinity

use of am2.api.spell.enums.Affinity in project ArsMagica2 by Mithion.

the class AffinityHelper method onEntityLivingBase.

@SubscribeEvent
public void onEntityLivingBase(LivingUpdateEvent event) {
    EntityLivingBase ent = event.entityLiving;
    if (ent instanceof EntityEnderman) {
        if (ent.getLastAttacker() != ent.getAITarget() && ent.getAITarget() instanceof EntityPlayer) {
            AffinityData affinityData = AffinityData.For(ent.getAITarget());
            float enderDepth = affinityData.getAffinityDepth(Affinity.ENDER);
            if (enderDepth == 1.0f) {
                ent.setRevengeTarget(null);
            }
        }
    }
    if (!(ent instanceof EntityPlayer))
        return;
    AffinityData affinityData = AffinityData.For(ent);
    affinityData.tickDiminishingReturns();
    float waterDepth = affinityData.getAffinityDepth(Affinity.WATER);
    float fireDepth = affinityData.getAffinityDepth(Affinity.FIRE);
    float natureDepth = affinityData.getAffinityDepth(Affinity.NATURE);
    float iceDepth = affinityData.getAffinityDepth(Affinity.ICE);
    float lifeDepth = affinityData.getAffinityDepth(Affinity.LIFE);
    float enderDepth = affinityData.getAffinityDepth(Affinity.ENDER);
    float lightningDepth = affinityData.getAffinityDepth(Affinity.LIGHTNING);
    AffinityModifiers.instance.applySpeedModifiersBasedOnDepth((EntityPlayer) ent, natureDepth, iceDepth, lightningDepth);
    AffinityModifiers.instance.applyHealthModifiers((EntityPlayer) ent, enderDepth, waterDepth, fireDepth, lightningDepth);
    applyFulmintion((EntityPlayer) ent, lightningDepth);
    if (lightningDepth >= 0.5f) {
        ent.stepHeight = 1.014f;
    } else if (ent.stepHeight == 1.014f) {
        ent.stepHeight = 0.5f;
    }
    affinityData.accumulatedLifeRegen += 0.025 * lifeDepth;
    if (affinityData.accumulatedLifeRegen > 1.0f) {
        affinityData.accumulatedLifeRegen -= 1.0f;
        ent.heal(1);
    }
    if (natureDepth == 1.0f) {
        if (ent.worldObj.canBlockSeeTheSky((int) ent.posX, (int) ent.posY, (int) ent.posZ) && ent.worldObj.isDaytime()) {
            affinityData.accumulatedHungerRegen += 0.02f;
            if (affinityData.accumulatedHungerRegen > 1.0f) {
                ((EntityPlayer) ent).getFoodStats().addStats(1, 0.025f);
                affinityData.accumulatedHungerRegen -= 1;
            }
        } else {
            ((EntityPlayer) ent).addExhaustion(0.025f);
        }
        if (ent.isCollidedHorizontally) {
            if (!ent.isSneaking()) {
                float movement = ExtendedProperties.For(ent).getIsFlipped() ? -0.25f : 0.25f;
                ent.moveEntity(0, movement, 0);
                ent.motionY = 0;
            } else {
                ent.motionY *= 0.79999999;
            }
            ent.fallDistance = 0;
        }
    }
    // Ender Affinity
    if (enderDepth >= 0.75f && affinityData.hasActivatedNightVision()) {
        if (!ent.worldObj.isRemote && (!ent.isPotionActive(Potion.nightVision.id) || ent.getActivePotionEffect(Potion.nightVision).getDuration() <= 220)) {
            ent.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, 1));
        }
    }
    if (ent.onGround)
        affinityData.setLastGroundPosition(new AMVector3(ent));
    affinityData.tickCooldown();
    if (ent.isInWater()) {
        float earthDepth = affinityData.getAffinityDepth(Affinity.EARTH);
        if (earthDepth > 0.25f && ent.motionY > -0.3f) {
            ent.addVelocity(0, -0.01f * earthDepth, 0);
        }
        if (waterDepth > 0.5f) {
            if (!ent.isPotionActive(BuffList.swiftSwim.id) || ent.getActivePotionEffect(BuffList.swiftSwim).getDuration() < 10) {
                ent.addPotionEffect(new BuffEffectSwiftSwim(100, waterDepth > 0.75f ? 2 : 1));
            }
        }
        if (waterDepth > 0.4 && ent.worldObj.rand.nextInt(20) < 4)
            ent.setAir(ent.getAir() + 1);
        if (!ent.worldObj.isRemote && ent.worldObj.rand.nextInt(100) < 5) {
            ent.setAir(ent.getAir() + 1);
            byte[] data = new AMDataWriter().add(ent.getEntityId()).add(ent.getAir()).generate();
            AMNetHandler.INSTANCE.sendPacketToClientPlayer((EntityPlayerMP) ent, AMPacketIDs.SYNC_AIR_CHANGE, data);
        }
        boolean waterMovementFlag = false;
        if ((ent instanceof EntityPlayer && ((EntityPlayer) ent).inventory.armorInventory[1] != null && ((EntityPlayer) ent).inventory.armorInventory[1].getItem() == ItemsCommonProxy.waterGuardianOrbs)) {
            waterMovementFlag = true;
            if (!ent.worldObj.isRemote && (!ent.isPotionActive(BuffList.waterBreathing) || ent.getActivePotionEffect(BuffList.waterBreathing).getDuration() <= 200))
                ent.addPotionEffect(new BuffEffectWaterBreathing(400, 2));
        }
        if (waterDepth > 0.5f || waterMovementFlag) {
            applyReverseWaterMovement(ent);
        }
    }
    if (ent.worldObj.isRaining() && !ent.worldObj.isRemote && ent.worldObj.getBiomeGenForCoords((int) Math.floor(ent.posX), (int) Math.floor(ent.posZ)).canSpawnLightningBolt()) {
        float airDepth = affinityData.getAffinityDepth(Affinity.AIR);
        if (airDepth > 0.5f && airDepth < 0.85f && !ent.worldObj.isRemote && ent.worldObj.rand.nextInt(100) < 10) {
            if (!ent.isSneaking() && !ent.isPotionActive(BuffList.gravityWell) && !ent.isInsideOfMaterial(Material.water) && ent.isWet()) {
                double velX = ent.worldObj.rand.nextDouble() - 0.5;
                double velY = ent.worldObj.rand.nextDouble() - 0.5;
                double velZ = ent.worldObj.rand.nextDouble() - 0.5;
                ent.addVelocity(velX, velY, velZ);
                AMNetHandler.INSTANCE.sendVelocityAddPacket(ent.worldObj, ent, velX, velY, velZ);
            }
        }
    }
    if (ent.isSneaking()) {
        if (iceDepth >= 0.5f) {
            makeIceBridge((EntityPlayer) ent, iceDepth);
        }
    }
}
Also used : PotionEffect(net.minecraft.potion.PotionEffect) AffinityData(am2.playerextensions.AffinityData) AMDataWriter(am2.network.AMDataWriter) AMVector3(am2.api.math.AMVector3) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityEnderman(net.minecraft.entity.monster.EntityEnderman) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 15 with Affinity

use of am2.api.spell.enums.Affinity in project ArsMagica2 by Mithion.

the class AMConfig method init.

public void init() {
    PlayerSpellsDamageTerrain = get(CATEGORY_GENERAL, KEY_PlayerSpellsDamageTerrain, true, "Set to false to prevent terrain damage from player-casted spells.").getBoolean(true);
    NPCSpellsDamageTerrain = get(CATEGORY_GENERAL, KEY_NPCSpellsDamageTerrain, false, "Set to false to prevent terrain damage from NPC-casted spells.").getBoolean(false);
    DamageMultiplier = (float) get(CATEGORY_GENERAL, KEY_DamageMultiplier, 1.0, "How much the damage in Ars Magica is scaled.").getDouble(1.0);
    UseSpecialRenderers = get(CATEGORY_GENERAL, KEY_UseSpecialRenderers, true, "Render spell effects on equipped scrolls rather than the scroll itself (only applies to the in-game one, the one on your hotbar remains unchanged)").getBoolean(true);
    boolean def = !Loader.isModLoaded("NotEnoughItems");
    DisplayManaInInventory = get(CATEGORY_GENERAL, KEY_DisplayManaInInventory, def, "This will toggle mana display on and off in your inventory.  Default 'O' key in game.").getBoolean(def);
    FrictionCoefficient = (float) get(CATEGORY_GENERAL, KEY_FrictionCoefficient, 0.8, "This is the multiplier used to determine velocity lost when a spell projectile bounces. 0.0 is a complete stop, 1.0 is no loss.").getDouble(0.8);
    Property retroWorldGenProp = get(CATEGORY_GENERAL, KEY_RetroactiveWorldGen, false, "Set this to true to enable retroactive worldgen for Ars Magica structures and ores.  *WARNING* This may break your save!  Do a backup first!  Note: This will automatically turn off after running the game once.");
    RetroWorldGen = retroWorldGenProp.getBoolean(false);
    if (RetroWorldGen) {
        retroWorldGenProp.set(false);
    }
    secondarySkillTreeTierCap = get(CATEGORY_GENERAL, KEY_SecondarySkillTreeTierCap, 99, "Sets how far a player may progress into secondary skill trees.").getInt();
    mageVillagerProfessionID = get(CATEGORY_GENERAL, KEY_MageVillagerProfessionID, 29).getInt();
    manaHudPosition = new AMVector2(get(CATEGORY_UI, KEY_ManaHudPositionX, 0.7104166746139526).getDouble(0.7104166746139526), get(CATEGORY_UI, KEY_ManaHudPositionY, 0.9137254953384399).getDouble(0.9137254953384399));
    burnoutHudPosition = new AMVector2(get(CATEGORY_UI, KEY_BurnoutHudPositionX, 0.13333334028720856).getDouble(0.13333334028720856), get(CATEGORY_UI, KEY_BurnoutHudPositionY, 0.9176470637321472).getDouble(0.9176470637321472));
    positiveBuffsPosition = new AMVector2(get(CATEGORY_UI, KEY_BuffsPositivePositionX, 0.5145833492279053).getDouble(0.5145833492279053), get(CATEGORY_UI, KEY_BuffsPositivePositionY, 0.47843137383461).getDouble(0.47843137383461));
    negativeBuffsPosition = new AMVector2(get(CATEGORY_UI, KEY_BuffsNegativePositionX, 0.46666666865348816).getDouble(0.46666666865348816), get(CATEGORY_UI, KEY_BuffsNegativePositionY, 0.47843137383461).getDouble(0.47843137383461));
    levelPosition = new AMVector2(get(CATEGORY_UI, KEY_LevelPositionX, 0.49791666865348816).getDouble(0.49791666865348816), get(CATEGORY_UI, KEY_LevelPositionY, 0.8117647171020508).getDouble(0.8117647171020508));
    affinityPosition = new AMVector2(get(CATEGORY_UI, KEY_AffinityPositionX, 0.9770833253860474).getDouble(0.9770833253860474), get(CATEGORY_UI, KEY_AffinityPositionY, 0.9).getDouble(0.9));
    armorPositionChest = new AMVector2(get(CATEGORY_UI, KEY_ArmorPositionChestX, 0.004166666883975267).getDouble(0.004166666883975267), get(CATEGORY_UI, KEY_ArmorPositionChestY, 0.5568627715110779).getDouble(0.5568627715110779));
    armorPositionHead = new AMVector2(get(CATEGORY_UI, KEY_ArmorPositionHeadX, 0.004166666883975267).getDouble(0.004166666883975267), get(CATEGORY_UI, KEY_ArmorPositionHeadY, 0.5176470875740051).getDouble(0.5176470875740051));
    armorPositionLegs = new AMVector2(get(CATEGORY_UI, KEY_ArmorPositionLegsX, 0.004166666883975267).getDouble(0.004166666883975267), get(CATEGORY_UI, KEY_ArmorPositionLegsY, 0.5960784554481506).getDouble(0.5960784554481506));
    armorPositionBoots = new AMVector2(get(CATEGORY_UI, KEY_ArmorPositionBootsX, 0.004166666883975267).getDouble(0.004166666883975267), get(CATEGORY_UI, KEY_ArmorPositionBootsY, 0.6352941393852234).getDouble(0.6352941393852234));
    xpBarPosition = new AMVector2(get(CATEGORY_UI, KEY_XPBarPositionX, 0.31041666865348816).getDouble(0.31041666865348816), get(CATEGORY_UI, KEY_XPBarPositionY, 0.7843137383460999).getDouble(0.7843137383460999));
    contingencyPosition = new AMVector2(get(CATEGORY_UI, KEY_ContingencyPositionX, 0.0020833334419876337).getDouble(0.0020833334419876337), get(CATEGORY_UI, KEY_ContingencyPositionY, 0.9333333373069763).getDouble(0.9333333373069763));
    manaNumericPosition = new AMVector2(get(CATEGORY_UI, KEY_ManaNumericPositionX, 0.7437499761581421).getDouble(0.7437499761581421), get(CATEGORY_UI, KEY_ManaNumericPositionY, 0.8941176533699036).getDouble(0.8941176533699036));
    burnoutNumericPosition = new AMVector2(get(CATEGORY_UI, KEY_BurnoutNumericPositionX, 0.21041665971279144).getDouble(0.21041665971279144), get(CATEGORY_UI, KEY_BurnoutNumericPositionY, 0.9058823585510254).getDouble(0.9058823585510254));
    XPNumericPosition = new AMVector2(get(CATEGORY_UI, KEY_XPNumericPositionX, 0.47083333134651184).getDouble(0.47083333134651184), get(CATEGORY_UI, KEY_XPNumericPositionY, 0.7450980544090271).getDouble(0.7450980544090271));
    SpellBookPosition = new AMVector2(get(CATEGORY_UI, KEY_SpellBookPositionX, 0.0).getDouble(0.0), get(CATEGORY_UI, KEY_SpellBookPositionY, 0.0).getDouble(0.0));
    showHudMinimally = get(CATEGORY_UI, KEY_ShowHudMinimally, false, "Set this to true to only show the AM HUD when a spell is equipped").getBoolean(false);
    showArmorUI = get(CATEGORY_UI, KEY_ShowArmorUI, true).getBoolean(true);
    showBuffs = get(CATEGORY_UI, KEY_ShowBuffs, true).getBoolean(true);
    showNumerics = get(CATEGORY_UI, KEY_ShowNumerics, false).getBoolean(false);
    showXPAlways = get(CATEGORY_UI, KEY_ShowXPAlways, false).getBoolean(false);
    showHudBars = get(CATEGORY_UI, KEY_ShowHUDBars, true).getBoolean(true);
    witchwoodForestID = get(CATEGORY_GENERAL, KEY_WitchwoodForestBiomeID, 100, "The biome ID for Witchwood Forests. Change this if you run into issues with other mods that add biomes.").getInt();
    witchwoodLeafParticles = get(CATEGORY_GENERAL, KEY_witchwoodLeavesFall, true, "Disable this if you experience low FPS in witchwood forests").getBoolean(true);
    enableWitchwoodForest = get(CATEGORY_GENERAL, KEY_EnableWitchwoodForest, true, "Disable this if you prefer the witchwood forest to not generate").getBoolean(true);
    witchwoodForestRarity = get(CATEGORY_GENERAL, KEY_WitchwoodForestRarity, 6, "Sets how rare witchwood forests are.  Lower is more rare.").getInt();
    allowCreativeTargets = get(CATEGORY_GENERAL, KEY_allowCreativeTargets, true, "Disable this to prevent spell effects on creative players").getBoolean(true);
    moonstoneMeteorsDestroyTerrain = get(CATEGORY_GENERAL, KEY_moonstoneMeteorsDestroyTerrain, true, "Should moonstone meteors destroy terrain when landing?  Keep in mind they will never land on anything other than grass.").getBoolean(true);
    suggestSpellNames = get(CATEGORY_GENERAL, KEY_moonstoneMeteorsDestroyTerrain, true, "Set this to true to allow AM2 to get random spell names from Seventh Sanctum, and suggest them when naming spells.  Naturally, an internet connection is required.  Keep in mind, while I try to keep things family friendly, it's possible that not all names generated are so.").getBoolean(true);
    forgeSmeltsVillagers = get(CATEGORY_GENERAL, KEY_ForgeSmeltsVillagers, true, "Set this to true to have the forge component smelt villagers into emeralds.  This counts as an attack and lowers your reputation.").getBoolean(true);
    everstoneRepairRate = get(CATEGORY_GENERAL, KEY_EverstoneRepairRate, 180, "The time taken, in ticks, for an everstone to repair after breaking.").getInt();
    stagedCompendium = get(CATEGORY_GENERAL, KEY_StagedCompendium, true, "Set this to false to have the compendium show everything, and not unlock as you go.").getBoolean(true);
    colourblindMode = get(CATEGORY_GENERAL, KEY_ColourblindMode, false, "Set this to true to have AM2 list out colours for skill points and essence types rather than showing them as a colour.").getBoolean(false);
    candlesAreRovingLights = get(CATEGORY_GENERAL, KEY_CandlesAreRovingLights, true, "Set this to false to disable candles being able to act as roving lights, which improves performance.").getBoolean(true);
    allowCompendiumUpdates = get(CATEGORY_GENERAL, KEY_AllowCompendiumUpdates, true, "If true, AM2 will automatically download compendium updates when available for your mod version.").getBoolean(true);
    allowVersionChecks = get(CATEGORY_GENERAL, KEY_AllowVersionChecks, true, "If true, AM2 will notify you via the compendium when new versions are available.  It will not spam chat on login.  You will not be notified of updates that are not for your current Minecraft version.").getBoolean(true);
    meteorMinSpawnLevel = get(CATEGORY_GENERAL, KEY_MeteorMinSpawnLevel, 10, "You must reach this magic level before Moonstone meteors will fall near you.").getInt();
    hazardousGateways = get(CATEGORY_GENERAL, KEY_HazardousGateways, true, "Set this to false in order to disable gateways sending you partial distances if you don't have enough power.").getBoolean(true);
    ArmorXPInfusionFactor = get(CATEGORY_GENERAL, KEY_ArmorXPInfusionFactor, 1.0, "Alter this to change the rate at which armor XP infuses.").getDouble();
    disarmAffectsPlayers = get(CATEGORY_GENERAL, KEY_DisarmAffectsPlayers, true, "If false, disarm won't work on players.").getBoolean(true);
    manaCap = get(CATEGORY_GENERAL, KEY_ManaCap, 0, "Sets the maximum mana a player can have (0 for no cap)").getDouble(0);
    digBreaksTileEntities = get(CATEGORY_GENERAL, KEY_DigBreaksTEs, true, "Can the dig component break blocks that have a tile entity?").getBoolean(true);
    savePowerOnWorldSave = get(CATEGORY_GENERAL, KEY_SavePowerOnWorldSave, true, "Set this to false if you are experiencing tick lage due to AM2 saving power data alongside the world save.  This will instead cache the power data in memory to be saved later.  This comes with more risk in the event of a crash, and a larger memory footprint, but increased performance. Can be used alongside chunk unload save config. Power data is still always saved at world unload (server shutdown).").getBoolean(true);
    canDryadsDespawn = get(CATEGORY_MOBS, KEY_CanDryadsDespawn, true, "Set this to false if you don't want dryads to despawn.").getBoolean(true);
    witchwoodFrequency = get(CATEGORY_GENERAL, KEY_WitchwoodFrequency, 35, "The chance of a witchwood tree generating. Lower numbers give more trees.").getInt(35);
    poolFrequency = get(CATEGORY_GENERAL, KEY_EssenceLakeFrequency, 25, "The chance of an etherium pool generating. Lower numbers give more pools.").getInt(25);
    wakebloomFrequency = get(CATEGORY_GENERAL, KEY_WakebloomFrequency, 10, "The chance of a wakebloom generating. Lower numbers give more wakeblooms, and anything less than 7 will attempt to generate in every ocean chunk.").getInt(10);
    flowerGenAttempts = get(CATEGORY_GENERAL, KEY_FlowerGenAttempts, 8, "The number of flower generation attempts made per chunk. Higher numbers give more flowers, but can slow worldgen.").getInt(8);
    vinteumMinHeight = get(CATEGORY_GENERAL, KEY_VinteumMin, 10, "The minimum height for vinteum to generate.").getInt(10);
    vinteumMaxHeight = get(CATEGORY_GENERAL, KEY_VinteumMax, 45, "The maximum height for vinteum to generate.").getInt(45);
    vinteumVeinSize = get(CATEGORY_GENERAL, KEY_VinteumVein, 4, "The number of blocks in a vein of vinteum.").getInt(4);
    vinteumFrequency = get(CATEGORY_GENERAL, KEY_VinteumFreq, 6, "The number of vinteum veins generated per chunk.").getInt(6);
    chimeriteMinHeight = get(CATEGORY_GENERAL, KEY_ChimeriteMin, 10, "The minimum height for chimerite to generate.").getInt(10);
    chimeriteMaxHeight = get(CATEGORY_GENERAL, KEY_ChimeriteMax, 80, "The maximum height for chimerite to generate.").getInt(80);
    chimeriteVeinSize = get(CATEGORY_GENERAL, KEY_ChimeriteVein, 6, "The number of blocks in a vein of chimerite.").getInt(6);
    chimeriteFrequency = get(CATEGORY_GENERAL, KEY_ChimeriteFreq, 8, "The number of chimerite veins generated per chunk.").getInt(6);
    topazMinHeight = get(CATEGORY_GENERAL, KEY_TopazMin, 10, "The minimum height for topaz to generate.").getInt(10);
    topazMaxHeight = get(CATEGORY_GENERAL, KEY_TopazMax, 80, "The maximum height for topaz to generate.").getInt(80);
    topazVeinSize = get(CATEGORY_GENERAL, KEY_TopazVein, 6, "The number of blocks in a vein of topaz.").getInt(6);
    topazFrequency = get(CATEGORY_GENERAL, KEY_TopazFreq, 8, "The number of topaz veins generated per chunk.").getInt(8);
    sunstoneMinHeight = get(CATEGORY_GENERAL, KEY_SunstoneMin, 5, "The minimum height for sunstone to generate.").getInt(5);
    sunstoneMaxHeight = get(CATEGORY_GENERAL, KEY_SunstoneMax, 120, "The maximum height for sunstone to generate.").getInt(120);
    sunstoneVeinSize = get(CATEGORY_GENERAL, KEY_SunstoneVein, 3, "The number of blocks in a vein of sunstone.").getInt(3);
    sunstoneFrequency = get(CATEGORY_GENERAL, KEY_SunstoneFreq, 20, "The number of sunstone veins generated per chunk.").getInt(20);
    enderAffinityAbilityCooldown = get(CATEGORY_GENERAL, KEY_EnderAffinityAbilityCooldown, 100, "Set this to the number of ticks between ender affinity teleports.").getInt();
    String digBlacklistString = get(CATEGORY_GENERAL, KEY_DigDisabledBlocks, "", "Comma-separated list of block IDs that dig cannot break.  If a block is flagged as unbreackable in code, Dig will already be unable to break it.  There is no need to set it here (eg, bedrock, etc.).  Dig also makes use of Forge block harvest checks.  This is mainly for fine-tuning.").getString();
    digBlacklist = digBlacklistString.split(",");
    String worldgenBlackList = get(CATEGORY_GENERAL, KEY_WorldgenBlacklist, "-27,-28,-29", "Comma-separated list of dimension IDs that AM should *not* do worldgen in.").getString();
    String[] split = worldgenBlackList.split(",");
    worldgenBlacklist = new int[split.length];
    int count = 0;
    for (String s : split) {
        if (s.equals(""))
            continue;
        try {
            worldgenBlacklist[count] = Integer.parseInt(s.trim());
        } catch (Throwable t) {
            LogHelper.info("Malformed item in worldgen blacklist (%s).  Skipping.", s);
            t.printStackTrace();
            worldgenBlacklist[count] = -1;
        } finally {
            count++;
        }
    }
    String apBlockBL = get(CATEGORY_GENERAL, KEY_Appropriation_Block_Blacklist, "", "Comma-separated list of block IDs that appropriation cannot pick up.").getString();
    appropriationBlockBlacklist = apBlockBL.split(",");
    String apEntBL = get(CATEGORY_GENERAL, KEY_Appropriation_Mob_Blacklist, "", "Comma-separated list of *fully qualified* Entity class names that appropriation cannot pick up - example, am2.entities.EntityDryad.  They are case sensitive.").getString();
    split = apEntBL.split(",");
    appropriationMobBlacklist = new Class[split.length];
    count = 0;
    for (String s : split) {
        if (s.equals(""))
            continue;
        try {
            appropriationMobBlacklist[count] = Class.forName(s);
        } catch (Throwable t) {
            LogHelper.info("Malformed item in appropriation entity blacklist (%s).  Skipping.", s);
            t.printStackTrace();
            appropriationMobBlacklist[count] = null;
        } finally {
            count++;
        }
    }
    initDirectProperties();
    save();
}
Also used : AMVector2(am2.api.math.AMVector2) Property(net.minecraftforge.common.config.Property)

Aggregations

Affinity (am2.api.spell.enums.Affinity)27 AffinityData (am2.playerextensions.AffinityData)6 ItemStack (net.minecraft.item.ItemStack)6 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 TileEntity (net.minecraft.tileentity.TileEntity)4 ArrayList (java.util.ArrayList)3 AMVector2 (am2.api.math.AMVector2)2 AMVector3 (am2.api.math.AMVector3)2 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)2 AMParticle (am2.particles.AMParticle)2 Colour (am2.spell.modifiers.Colour)2 HashMap (java.util.HashMap)2 Block (net.minecraft.block.Block)2 WrongUsageException (net.minecraft.command.WrongUsageException)2 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 ChatComponentText (net.minecraft.util.ChatComponentText)2 AffinityChangingEvent (am2.api.events.AffinityChangingEvent)1 ManaCostEvent (am2.api.events.ManaCostEvent)1 SpellRecipeItemsEvent (am2.api.events.SpellRecipeItemsEvent)1