use of am2.api.math.AMVector2 in project ArsMagica2 by Mithion.
the class GuiInscriptionTable method initGui.
@Override
public void initGui() {
super.initGui();
searchFieldPosition = new AMVector2(39, 59);
searchFieldDimensions = new AMVector2(141, 12);
searchBar = new GuiTextField(Minecraft.getMinecraft().fontRenderer, searchFieldPosition.iX, searchFieldPosition.iY, searchFieldDimensions.iX, searchFieldDimensions.iY);
nameFieldPosition = new AMVector2(39, 93);
nameFieldDimensions = new AMVector2(141, 12);
nameBar = new GuiTextField(Minecraft.getMinecraft().fontRenderer, nameFieldPosition.iX, nameFieldPosition.iY, nameFieldDimensions.iX, nameFieldDimensions.iY);
int l = (width - xSize) / 2;
int i1 = (height - ySize) / 2;
createSpellButton = new GuiButtonVariableDims(0, l - 65, i1, StatCollector.translateToLocal("am2.gui.makeSpell"));
createSpellButton.setDimensions(60, 20);
resetSpellButton = new GuiButtonVariableDims(1, l + 120, i1 + 72, StatCollector.translateToLocal("am2.gui.resetSpell"));
resetSpellButton.setDimensions(60, 20);
resetSpellButton.visible = false;
if (usingPlayer.capabilities.isCreativeMode) {
this.buttonList.add(createSpellButton);
}
this.buttonList.add(resetSpellButton);
nameBar.setText(((ContainerInscriptionTable) this.inventorySlots).getSpellName());
if (nameBar.getText().equals("")) {
nameBar.setText(defaultNameLabel);
}
searchBar.setText(defaultSearchLabel);
result = ((ContainerInscriptionTable) this.inventorySlots).validateCurrentDefinition();
}
use of am2.api.math.AMVector2 in project ArsMagica2 by Mithion.
the class GuiStatedImageButton method drawButtonFromState.
private void drawButtonFromState(States state) {
AMVector2 vec = this.stateImages.get(state);
if (vec == null)
vec = this.stateImages.get(States.IDLE);
drawTexturedModalRect(this.xPosition, this.yPosition, vec.iX, vec.iY, width, height);
}
use of am2.api.math.AMVector2 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();
}
use of am2.api.math.AMVector2 in project ArsMagica2 by Mithion.
the class ExtendedProperties method setEntityReference.
// =======================================================================================
// Utility Methods
// =======================================================================================
public void setEntityReference(EntityLivingBase entity) {
this.entity = entity;
setOriginalSize(new AMVector2(entity.width, entity.height));
hasInitialized = true;
isCritical = entity instanceof EntityPlayerMP;
yOffsetOrig = entity.yOffset;
if (isCritical)
ticksToRegen = 5;
else
ticksToRegen = 20;
if (isCritical) {
if (armorProcCooldowns[3] > 0) {
AMCore.instance.proxy.blackoutArmorPiece((EntityPlayerMP) entity, 3, armorProcCooldowns[3]);
}
if (armorProcCooldowns[1] > 0) {
AMCore.instance.proxy.blackoutArmorPiece((EntityPlayerMP) entity, 1, armorProcCooldowns[1]);
}
if (armorProcCooldowns[2] > 0) {
AMCore.instance.proxy.blackoutArmorPiece((EntityPlayerMP) entity, 2, armorProcCooldowns[2]);
}
if (armorProcCooldowns[0] > 0) {
AMCore.instance.proxy.blackoutArmorPiece((EntityPlayerMP) entity, 0, armorProcCooldowns[0]);
}
}
if (entity.worldObj != null && entity.worldObj.isRemote && entity instanceof EntityPlayer && AMCore.proxy.playerTracker.hasAA((EntityPlayer) entity)) {
EntityLivingBase localPlayer = AMCore.instance.proxy.getLocalPlayer();
if (entity != localPlayer)
AMNetHandler.INSTANCE.requestAuras((EntityPlayer) entity);
}
}
use of am2.api.math.AMVector2 in project ArsMagica2 by Mithion.
the class AMIngameGUI method RenderBuffs.
public void RenderBuffs(int i, int j) {
if (!AMCore.config.getShowBuffs()) {
return;
}
int barWidth = i / 8;
AMVector2 posBuffStart = getShiftedVector(AMCore.config.getPositiveBuffsPosition(), i, j);
AMVector2 negBuffStart = getShiftedVector(AMCore.config.getNegativeBuffsPosition(), i, j);
int positive_buff_x = posBuffStart.iX;
int positive_buff_y = posBuffStart.iY;
int negative_buff_x = negBuffStart.iX;
int negative_buff_y = negBuffStart.iY;
for (PotionEffect pe : getPotionEffectsByTimeRemaining()) {
this.mc.renderEngine.bindTexture(inventory);
int potionID = pe.getPotionID();
if (potionID < 0 || potionID >= Potion.potionTypes.length)
continue;
Potion potion = Potion.potionTypes[potionID];
if (potion == null)
continue;
if (potion.isBadEffect()) {
if (potion.hasStatusIcon()) {
int l = potion.getStatusIconIndex();
if (pe.getDuration() < 100) {
GL11.glColor4f(1.0f, 1.0f, 1.0f, AMGuiHelper.instance.fastFlashAlpha);
} else if (pe.getDuration() < 200) {
GL11.glColor4f(1.0f, 1.0f, 1.0f, AMGuiHelper.instance.slowFlashAlpha);
}
this.drawTexturedModalRect_Classic(negative_buff_x, negative_buff_y, 0 + l % 8 * 18, 198 + l / 8 * 18, 10, 10, 18, 18);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
negative_buff_x -= 12;
if (negative_buff_x <= negBuffStart.iX - 48) {
negative_buff_x = negBuffStart.iX;
negative_buff_y += 12;
}
}
} else {
this.mc.renderEngine.bindTexture(inventory);
if (potion.hasStatusIcon()) {
int l = potion.getStatusIconIndex();
if (pe.getDuration() < 100) {
GL11.glColor4f(1.0f, 1.0f, 1.0f, AMGuiHelper.instance.fastFlashAlpha);
} else if (pe.getDuration() < 200) {
GL11.glColor4f(1.0f, 1.0f, 1.0f, AMGuiHelper.instance.slowFlashAlpha);
}
this.drawTexturedModalRect_Classic(positive_buff_x, positive_buff_y, 0 + l % 8 * 18, 198 + l / 8 * 18, 10, 10, 18, 18);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
positive_buff_x += 12;
if (positive_buff_x >= posBuffStart.iX + 48) {
positive_buff_x = posBuffStart.iX;
positive_buff_y += 12;
}
}
}
}
}
Aggregations