From 0bdd81399535cb4c54997ea3eab31ea3d3cf3388 Mon Sep 17 00:00:00 2001 From: "Jean-Marie S." Date: Wed, 31 Dec 2014 23:41:50 +0100 Subject: [PATCH 01/19] Update fr_FR.lang Update + Massive Overhaul... at last \o/ (I guess it's complete, tell me if it's not :3) OH AND HAPPY NEW YEAR \o/ --- .../assets/alchemicalwizardry/lang/fr_FR.lang | 192 ++++++++++++------ 1 file changed, 127 insertions(+), 65 deletions(-) diff --git a/src/main/resources/assets/alchemicalwizardry/lang/fr_FR.lang b/src/main/resources/assets/alchemicalwizardry/lang/fr_FR.lang index 1073ef3d..5a957bdf 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/fr_FR.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/fr_FR.lang @@ -4,6 +4,8 @@ tile.bloodRune.blank.name=Rune de Sang tile.bloodRune.fill.name=Rune de Capacité Augmentée tile.bloodRune.empty.name=Rune de Dislocation tile.bloodRune.test.name=Rune de l’Orbe +tile.bloodRune.betterCapacity.name=Rune de la Capacité Supérieure +tile.bloodRune.acceleration.name=Rune d'Accélération tile.speedRune.name=Rune de Vitesse tile.efficiencyRune.name=Rune d’Efficacité tile.runeOfSacrifice.name=Rune du Sacrifice @@ -17,60 +19,68 @@ tile.emptySocket.name=Poche Vide tile.bloodStoneBrick.name=Brique de Roche-Sang tile.largeBloodStoneBrick.name=Brique Large de Roche-Sang tile.blockWritingTable.name=Matériel d’Alchimie -tile.blockHomHeart.name=Table à Sortilège +tile.blockHomHeart.name=Table des Maléfices tile.bloodPedestal.name=Piédéstal Arcanique tile.bloodPlinth.name=Socle Arcanique tile.bloodTeleposer.name=Téléposeur -tile.blockConduit.name=Conduit à Sortilège +tile.blockConduit.name=Conduit des Maléfices tile.blockSpellParadigm.projectile.name=Générateur de Particule tile.blockSpellParadigm.self.name=Auto-Augmenteur -tile.blockSpellParadigm.melee.name=Assembleur à Mêlée -tile.blockSpellEnhancement.power1.name=Renforcement Instable à Sortilège -tile.blockSpellEnhancement.power2.name=Renforcement Standard à Sortilège -tile.blockSpellEnhancement.power3.name=Renforcement Renforcé à Sortilège -tile.blockSpellEnhancement.power4.name=Renforcement Imprégné à Sortilège -tile.blockSpellEnhancement.power5.name=Renforcement Démoniaque à Sortilège -tile.blockSpellEnhancement.cost1.name=Atténuation Instable à Sortilège -tile.blockSpellEnhancement.cost2.name=Atténuation Standard à Sortilège -tile.blockSpellEnhancement.cost3.name=Atténuation Renforcée à Sortilège -tile.blockSpellEnhancement.cost4.name=Atténuation Imprégnée à Sortilège -tile.blockSpellEnhancement.cost5.name=Atténuation Démoniaque à Sortilège -tile.blockSpellEnhancement.potency1.name=Amélioration Instable à Sortilège -tile.blockSpellEnhancement.potency2.name=Amélioration Standard à Sortilège -tile.blockSpellEnhancement.potency3.name=Amélioration Renforcée à Sortilège -tile.blockSpellEnhancement.potency4.name=Amélioration Imprégnée à Sortilège -tile.blockSpellEnhancement.potency5.name=Amélioration Démoniaque à Sortilège -tile.blockSpellModifier.default.name=Modification Basique à Sortilège -tile.blockSpellModifier.offensive.name= Modification Offensive à Sortilège -tile.blockSpellModifier.defensive.name= Modification Défensive à Sortilège -tile.blockSpellModifier.environmental.name=Modification Environnementale à Sortilège +tile.blockSpellParadigm.melee.name=Agrégation à la Mêlée +tile.blockSpellParadigm.tool.name=Forgeron Outilleur +tile.blockSpellEnhancement.power1.name=Renforcement Instable des Maléfices +tile.blockSpellEnhancement.power2.name=Renforcement Standard des Maléfices +tile.blockSpellEnhancement.power3.name=Renforcement Renforcé des Maléfices +tile.blockSpellEnhancement.power4.name=Renforcement Imprégné des Maléfices +tile.blockSpellEnhancement.power5.name=Renforcement Diabolo des Maléfices +tile.blockSpellEnhancement.cost1.name=Ristourne Instable des Maléfices +tile.blockSpellEnhancement.cost2.name=Ristourne Standard des Maléfices +tile.blockSpellEnhancement.cost3.name=Ristourne Renforcée des Maléfices +tile.blockSpellEnhancement.cost4.name=Ristourne Imprégnée des Maléfices +tile.blockSpellEnhancement.cost5.name=Ristourne Démoniaque des Maléfices +tile.blockSpellEnhancement.potency1.name=Amélioration Instable des Maléfices +tile.blockSpellEnhancement.potency2.name=Amélioration Standard des Maléfices +tile.blockSpellEnhancement.potency3.name=Amélioration Renforcée des Maléfices +tile.blockSpellEnhancement.potency4.name=Amélioration Imprégnée des Maléfices +tile.blockSpellEnhancement.potency5.name=Amélioration Diabolo des Maléfices +tile.blockSpellModifier.default.name=Modification Basique des Maléfices +tile.blockSpellModifier.offensive.name= Modification Offensive des Maléfices +tile.blockSpellModifier.defensive.name= Modification Défensive des Maléfices +tile.blockSpellModifier.environmental.name=Modification Environnementale des Maléfices tile.blockSpellEffect.fire.name=Creuset des Flammes -tile.blockSpellEffect.ice.name=Source des Glaces +tile.blockSpellEffect.ice.name=Geyser de Glace tile.blockSpellEffect.wind.name=Jaillissement des Vents tile.blockSpellEffect.earth.name=Assembleur des Terres +tile.alchemicCalcinator.name=Calcinateur Alchimique +tile.crystalBelljar.name=Cloche de Cristal +tile.blockReagentConduit.name=Relais Alchimique +tile.lifeEssenceFluidBlock.name=Extrait de Vitalité +tile.crystalBlock.fullCrystal.name=Fragments de Cristaux +tile.crystalBlock.crystalBrick.name=Briques de Fragments de Cristaux +tile.demonPortal.name=Portail Diabolo #Item Localization item.weakBloodOrb.name=Orbe Sanguinaire Affaiblie item.apprenticeBloodOrb.name=Orbe Sanguinaire de l’Apprenti item.magicianBloodOrb.name=Orbe Sanguinaire du Magicien item.masterBloodOrb.name=Orbe Sanguinaire du Maître -item.archmageBloodOrb.name=Orbe Sanguinaire de l’Archmage +item.archmageBloodOrb.name=Orbe Sanguinaire de l'Enchanteur item.energyBlast.name=Blaster à Energie -item.energySword.name=Lame Liée +item.energySword.name=Lame Sacrificielle item.lavaCrystal.name=Cristal de Lave -item.waterSigil.name=Symbole de l’Eau -item.lavaSigil.name=Symbole de la Lave -item.voidSigil.name=Symbole du Vide +item.waterSigil.name=Emblème de l’Eau +item.lavaSigil.name=Emblème de la Lave +item.voidSigil.name=Emblème du Vide item.blankSlate.name=Tablette Vierge item.reinforcedSlate.name=Tablette Renforcée item.sacrificialDagger.name=Couteau Sacrificiel item.daggerOfSacrifice.name=Dague des Sacrifices -item.airSigil.name=Symbole de l’Air -item.sigilOfTheFastMiner.name=Symbole du Mineur Prompt -item.sigilOfElementalAffinity.name=Symbole d’Affinité Elémentaire -item.sigilOfHaste.name=Symbole de Célérité -item.sigilOfHolding.name=Symbole de l’Emprise -item.divinationSigil.name=Symbole de Divination +item.airSigil.name=Emblème Stratos +item.sigilOfTheFastMiner.name=Emblème Spelunk +item.sigilOfElementalAffinity.name=Emblème d’Affinité Elémentaire +item.sigilOfHaste.name=Emblème de Célérité +item.sigilOfHolding.name=Emblème Possessif +item.divinationSigil.name=Emblème des Pythies item.waterScribeTool.name=Craie d’Inscription Elémentaire: Eau item.fireScribeTool.name=Craie d’Inscription Elémentaire: Feu item.earthScribeTool.name=Craie d’Inscription Elémentaire: Terre @@ -78,24 +88,25 @@ item.airScribeTool.name=Craie d’Inscription Elémentaire: Air item.duskScribeTool.name=Craie d’Inscription Elémentaire: Crépuscule item.activationCrystalWeak.name=Cristal d’Activation Affaibli item.activationCrystalAwakened.name=Cristal d’Activation Eveillé -item.boundPickaxe.name=Pioche Liée -item.boundAxe.name=Hâche Liée -item.boundShovel.name=Pelle Liée -item.boundHelmet.name=Casque Lié -item.boundPlate.name=Plastron Lié -item.boundLeggings.name=Jambières Liées -item.boundBoots.name=Bottes Liées +item.activationCrystalCreative.name=Cristal d'Activation Créatif +item.boundPickaxe.name=Pioche Sacrificielle +item.boundAxe.name=Hâche Sacrificielle +item.boundShovel.name=Pelle Sacrificielle +item.boundHelmet.name=Casque Sacrificiel +item.boundPlate.name=Plastron Sacrificiel +item.boundLeggings.name=Jambières Sacrificielles +item.boundBoots.name=Bottes Sacrificielles item.weakBloodShard.name=Eclat Sanguinaire Affaibli -item.growthSigil.name=Symbole du Bosquet Vert +item.growthSigil.name=Emblème du item.blankSpell.name=Cristal Délié item.alchemyFlask.name=Fiole à Potion -item.standardBindingAgent.name=Agent de Liaison Standard +item.standardBindingAgent.name=Agent Sacrificiel Standard item.mundanePowerCatalyst.name=Cristal de Puissance Commun item.averagePowerCatalyst.name=Cristal de Puissance Moyen item.greaterPowerCatalyst.name=Cristal de Puissance Supérieur -item.mundaneLengtheningCatalyst.name=Catalyseur d’Allongement Commun -item.averageLengtheningCatalyst.name=Catalyseur d’Allongement Moyen -item.greaterLengtheningCatalyst.name=Catalyseur d’Allongement Supérieur +item.mundaneLengtheningCatalyst.name=Catalyseur d'Extension Commun +item.averageLengtheningCatalyst.name=Catalyseur d’Extension Moyen +item.greaterLengtheningCatalyst.name=Catalyseur d’Extension Supérieur item.incendium.name=Incendium item.magicales.name=Magicales item.sanctus.name=Sanctus @@ -106,41 +117,44 @@ item.crystallos.name=Crystallos item.terrae.name=Terrae item.aquasalus.name=Aquasalus item.tennebrae.name=Tenebrae -item.demonBloodShard.name=Eclat Sanguinaire du Démon -item.sigilOfWind.name=Symbole du Tourbillon +item.demonBloodShard.name=Eclat Sanguinaire Diabolo +item.sigilOfWind.name=Emblème Mistral item.telepositionFocus.name=Focus de Téléposition item.enhancedTelepositionFocus.name= Focus de Téléposition Amélioré item.reinforcedTelepositionFocus.name=Focus de Téléposition Renforcé -item.demonicTelepositionFocus.name= Focus de Téléposition Démoniaque +item.demonicTelepositionFocus.name= Focus de Téléposition Diabolo item.imbuedSlate.name=Tablette Imprégnée -item.demonicSlate.name=Tablette Démoniaque -item.sigilOfTheBridge.name=Symbole du Pont Fantôme +item.demonicSlate.name=Tablette Diabolo +item.sigilOfTheBridge.name=Emblème du Pont Fantôme item.armourInhibitor.name=Neutralisarmure item.cheatyItem.name=Orbe de Test item.weakFillingAgent.name=Agent de Remplissage Affaibli item.standardFillingAgent.name=Agent de Remplissage Standard item.enhancedFillingAgent.name=Agent de Remplissage Amélioré -item.weakBindingAgent.name=Agent de Liaison Affaibli +item.weakBindingAgent.name=Agent de Sacrifice Affaibli item.ritualDiviner.name=Sourcier à Rituel -item.sigilOfMagnetism.name=Symbole de Magnétisme -item.itemDiabloKey.name=Clé de Liaison +item.sigilOfMagnetism.name=Emblème Magnétique +item.itemDiabloKey.name=Clé Diabolo item.energyBazooka.name=Bazooka à Energie -item.bloodLightSigil.name=Symbole de la Lampe de Sang -item.itemComplexSpellCrystal.name=Cristal de Sortilège Complexe -item.bucketLive.name=Seau de Vie +item.bloodLightSigil.name=Emblème de la Lampe de Sang +item.itemComplexSpellCrystal.name=Cristal de Maléfice Complexe +item.itemSigilOfSupression.name=Emblème de Délétion +item.itemSigilOfEnderSeverance.name=Emblème of Ender Severance +item.bucketLive.name=Seau d'Extrait Vital item.bloodMagicBaseItem.quartzRod.name=Bâton de Quartz item.bloodMagicBaseItem.EmptyCore.name=Cœur Creux item.bloodMagicBaseItem.MagicalesCable.name=Câble de Magicales item.bloodMagicBaseItem.WoodBrace.name=Attelle de Bois item.bloodMagicBaseItem.StoneBrace.name=Attelle de Pierre item.bloodMagicBaseItem.ProjectileCore.name=Cœur de Projectile -item.bloodMagicBaseItem.SelfCore.name=Auto-Cœur +item.bloodMagicBaseItem.SelfCore.name=Cœur des Egotistes item.bloodMagicBaseItem.MeleeCore.name=Cœur de Mêlée +item.bloodMagicBaseItem.ToolCore.name=Cœur d'Outillage item.bloodMagicBaseItem.ParadigmBackPlate.name=Tablette du Paradigme -item.bloodMagicBaseItem.OutputCable.name=Câble de Sortie de Sortilège -item.bloodMagicBaseItem.InputCable.name=Câble d’Entrée de Sortilège -item.bloodMagicBaseItem.FlameCore.name=Cœur Ardent -item.bloodMagicBaseItem.IcyCore.name=Cœur Gêlé +item.bloodMagicBaseItem.OutputCable.name=Sortie Maléfique +item.bloodMagicBaseItem.InputCable.name=Entrée Maléfique +item.bloodMagicBaseItem.FlameCore.name=Cœur Incandescent +item.bloodMagicBaseItem.IcyCore.name=Cœur Figé item.bloodMagicBaseItem.GustCore.name=Cœur des Bourrasques item.bloodMagicBaseItem.EarthenCore.name=Cœur Téllurique item.bloodMagicBaseItem.CrackedRunicPlate.name=Tablette Runique Craquelée @@ -154,6 +168,11 @@ item.bloodMagicBaseItem.PowerCore.name=Cœur de Force item.bloodMagicBaseItem.CostCore.name=Cœur de Réduction item.bloodMagicBaseItem.PotencyCore.name=Cœur de Puissance item.bloodMagicBaseItem.ObsidianBrace.name=Attelle d’Obsidienne +item.bloodMagicBaseItem.EtherealSlate.name=Tablette Ethérale +item.bloodMagicBaseItem.LifeShard.name=Eclat de Vie +item.bloodMagicBaseItem.SoulShard.name=Eclat d'Esprit +item.bloodMagicBaseItem.LifeBrace.name=Attelle de Vie +item.bloodMagicBaseItem.SoulRunicPlate.name=Plaque Runique Spirituelle item.bloodMagicAlchemyItem.Offensa.name=Offensa item.bloodMagicAlchemyItem.Praesidium.name=Praesidium item.bloodMagicAlchemyItem.OrbisTerrae.name=Orbis Terrae @@ -163,12 +182,55 @@ item.bloodMagicAlchemyItem.FracturedBone.name=Os Fracturé item.bloodMagicAlchemyItem.Virtus.name=Virtus item.bloodMagicAlchemyItem.Reductus.name=Reductus item.bloodMagicAlchemyItem.Potentia.name=Potentia - - +item.sanguineHelmet.name=Casque Sanglant +item.itemSeerSigil.name=Emblème de la Vision +item.itemFluidSigil.name=Emblème Fluide +item.multiTool.name=Dynamasse +item.itemCombinationalCatalyst.name=Catalyseur Combinatoire +item.sanguineRobe.name=Robe Sanglante +item.sanguinePants.name=Jambières Sanglantes +item.sanguineBoots.name=Bottes Sanglantes +item.itemAttunedCrystal.name=Routeur Alchimique +item.itemTankSegmenter.name=Segment Alchimique +item.destinationClearer.name=Détergent Alchimique +item.demonPlacer.name=Cristal Diabolo +item.creativeDagger.name=Couteau Sacrificiel Créatif +item.itemBloodPack.name=Pack de la Lettre de Sang +item.itemHarvestSigil.name=Emblême Déméter +item.itemCompressionSigil.name=Emblême Compresseur +item.transcendentBloodOrb.name=Orbe Sanguinaire Transcendante #Creative Tab itemGroup.tabBloodMagic=Blood Magic #Extra Strings bm.string.consume=Exaction bm.string.drain=Ponction Veineuse -bm.string.tier=Tiers \ No newline at end of file +bm.string.tier=Tiers +bm.string.crafting.orb.shaped=Fabrication Orbée Formée +bm.string.crafting.orb.shapeless=Fabrication Orbée Déformée + +#Entities +entity.AWWayofTime.EarthElemental.name=Elémenterrestre +entity.AWWayofTime.FireElemental.name=Elémentaire de Feu +entity.AWWayofTime.HolyElemental.name=Elémentaire Sacré +entity.AWWayofTime.ShadeElemental.name=Elémentaire Nocturne +entity.AWWayofTime.WaterElemental.name=Elémentaire d'Eau +entity.AWWayofTime.AirElemental.name=Elémentaire d'Air +entity.AWWayofTime.Shade.name=Ombre +entity.AWWayofTime.BoulderFist.name=Poing de Pierre +entity.AWWayofTime.IceDemon.name=Diable Glacial +entity.AWWayofTime.SmallEarthGolem.name=Petit Golem de Terre +entity.AWWayofTime.WingedFireDemon.name=Démon de Feu Ailé +entity.AWWayofTime.BileDemon.name=Diabile +entity.AWWayofTime.LowerGuardian.name=Gardien Inférieur +entity.AWWayofTime.FallenAngel.name=Ange Déchu +entity.AWWayofTime.MinorDemonGruntGuardian.name=Gardien Démon +entity.AWWayofTime.MinorDemonGruntGuardianWind.name=Gardien Démon Aérien +entity.AWWayofTime.MinorDemonGruntGuardianFire.name=Gardien Démon de Feu +entity.AWWayofTime.MinorDemonGruntGuardianIce.name=Gardien Démon de Glace +entity.AWWayofTime.MinorDemonGruntGuardianEarth.name=Gardien Démon de Terre +entity.AWWayofTime.MinorDemonGruntWind.name=Soldat Démont Aérien +entity.AWWayofTime.MinorDemonGruntFire.name=Soldat Démon de Feu +entity.AWWayofTime.MinorDemonGruntIce.name=Soldat Démon de Glace +entity.AWWayofTime.MinorDemonGruntEarth.name=Soldat Démon de Terre +entity.AWWayofTime.MinorDemonGrunt.name=Soldat Démon From 9db5adc1606a06f65670695743bbb0e9a3e2c69f Mon Sep 17 00:00:00 2001 From: Patric Alexandre Date: Thu, 9 Apr 2015 18:41:04 -0300 Subject: [PATCH 02/19] Update en_US.lang Set a example of how the achievments should be localized, it was broken: http://i.imgur.com/p7uyvlW.png --- src/main/resources/assets/alchemicalwizardry/lang/en_US.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang index 672226d3..7121f648 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang @@ -440,4 +440,5 @@ message.tanksegmenter.tankssetto=tank(s) set to: message.routerfocus.limit=Focus' Item Limit set to: #Achievements -achievement.firstPrick=Your first prick! +achievement.alchemicalwizardy:firstPrick!=Your first prick! +achievement.alchemicalwizardy:firstPrick!.desc=The first drop of life in the Altar... From 74930a944580ad61714f3909ca0f69a9c762c2ef Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Fri, 10 Apr 2015 11:49:00 +0200 Subject: [PATCH 03/19] Fix formatting to use spaces instead --- .../common/tileEntity/TEInventory.java | 230 +++++++++--------- 1 file changed, 116 insertions(+), 114 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java index 27a9bbb3..856d154e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java @@ -10,144 +10,146 @@ import net.minecraftforge.common.util.Constants; /** * Base class for tile entities with inventory + * * @author ljfa-ag */ public abstract class TEInventory extends TileEntity implements IInventory { - protected ItemStack[] inv; - - public TEInventory(int size) - { - inv = new ItemStack[size]; - } + protected ItemStack[] inv; - @Override - public int getSizeInventory() - { - return inv.length; - } + public TEInventory(int size) + { + inv = new ItemStack[size]; + } - public ItemStack[] getSlots() - { - return inv; - } + @Override + public int getSizeInventory() + { + return inv.length; + } - @Override - public ItemStack getStackInSlot(int slot) - { - return inv[slot]; - } + public ItemStack[] getSlots() + { + return inv; + } - @Override - public ItemStack decrStackSize(int slot, int amt) - { - ItemStack stack = getStackInSlot(slot); - if (stack != null) - { - if (stack.stackSize <= amt) - setInventorySlotContents(slot, null); - else - { - stack = stack.splitStack(amt); - if (stack.stackSize == 0) - setInventorySlotContents(slot, null); - } - } - return stack; - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inv[slot]; + } - @Override - public ItemStack getStackInSlotOnClosing(int slot) - { - ItemStack stack = getStackInSlot(slot); - if (stack != null) - setInventorySlotContents(slot, null); - return stack; - } + @Override + public ItemStack decrStackSize(int slot, int amt) + { + ItemStack stack = getStackInSlot(slot); + if (stack != null) + { + if (stack.stackSize <= amt) + setInventorySlotContents(slot, null); + else + { + stack = stack.splitStack(amt); + if (stack.stackSize == 0) + setInventorySlotContents(slot, null); + } + } + return stack; + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) - { - inv[slot] = stack; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - if (stack != null && stack.stackSize > getInventoryStackLimit()) - stack.stackSize = getInventoryStackLimit(); - } + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + if (stack != null) + setInventorySlotContents(slot, null); + return stack; + } - @Override - public abstract String getInventoryName(); + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inv[slot] = stack; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if (stack != null && stack.stackSize > getInventoryStackLimit()) + stack.stackSize = getInventoryStackLimit(); + } - @Override - public boolean hasCustomInventoryName() - { - return false; - } + @Override + public abstract String getInventoryName(); - @Override - public int getInventoryStackLimit() - { - return 64; - } + @Override + public boolean hasCustomInventoryName() + { + return false; + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) - { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this - && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; - } + @Override + public int getInventoryStackLimit() + { + return 64; + } - @Override - public void openInventory() - { - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this + && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; + } - @Override - public void closeInventory() - { - } + @Override + public void openInventory() + { + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) - { - return true; - } + @Override + public void closeInventory() + { + } - @Override - public void writeToNBT(NBTTagCompound tag) - { - super.writeToNBT(tag); - NBTTagList invList = new NBTTagList(); - for (int i = 0; i < inv.length; i++) - { - if (inv[i] != null) - { - NBTTagCompound stackTag = new NBTTagCompound(); - stackTag.setByte("Slot", (byte) i); - inv[i].writeToNBT(stackTag); - invList.appendTag(stackTag); - } - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return true; + } - tag.setTag("Inventory", invList); - } - - @Override - public void readFromNBT(NBTTagCompound tag) - { - super.readFromNBT(tag); - NBTTagList invList = tag.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); - for(int i = 0; i < invList.tagCount(); i++) + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + NBTTagList invList = new NBTTagList(); + for (int i = 0; i < inv.length; i++) + { + if (inv[i] != null) + { + NBTTagCompound stackTag = new NBTTagCompound(); + stackTag.setByte("Slot", (byte) i); + inv[i].writeToNBT(stackTag); + invList.appendTag(stackTag); + } + } + + tag.setTag("Inventory", invList); + } + + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + NBTTagList invList = tag.getTagList("Inventory", + Constants.NBT.TAG_COMPOUND); + for (int i = 0; i < invList.tagCount(); i++) { NBTTagCompound stackTag = invList.getCompoundTagAt(i); int slot = stackTag.getByte("Slot"); - - if(slot >= 0 && slot < inv.length) + + if (slot >= 0 && slot < inv.length) inv[slot] = ItemStack.loadItemStackFromNBT(stackTag); } - } - - public void clear() - { + } + + public void clear() + { inv = new ItemStack[inv.length]; } } From 3a77de84d9c3b5cffed03dea5f1d1fec9314c4ee Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Fri, 10 Apr 2015 15:48:43 +0200 Subject: [PATCH 04/19] Create ItemType --- .../alchemicalWizardry/common/ItemType.java | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java b/src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java new file mode 100644 index 00000000..912742c4 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java @@ -0,0 +1,87 @@ +package WayofTime.alchemicalWizardry.common; + +import java.util.Objects; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +/** + * Represents an item together with metadata and NBT tag. + * + * @author ljfa-ag + */ +public class ItemType +{ + public final Item item; + public final int meta; + public final NBTTagCompound nbtTag; + + public ItemType(Item item, int meta, NBTTagCompound nbtTag) + { + this.item = Objects.requireNonNull(item); + this.meta = meta; + this.nbtTag = nbtTag; + } + + public ItemType(Item item, int meta) + { + this(item, meta, null); + } + + public ItemType(Item item) + { + this(item, 0, null); + } + + public ItemType(Block block, int meta, NBTTagCompound nbtTag) + { + this(Item.getItemFromBlock(block), meta, nbtTag); + } + + public ItemType(Block block, int meta) + { + this(block, meta, null); + } + + public ItemType(Block block) + { + this(block, 0, null); + } + + public ItemStack createStack(int count) + { + ItemStack result = new ItemStack(item, count, meta); + result.stackTagCompound = nbtTag; + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null || getClass() != obj.getClass()) + return false; + ItemType other = (ItemType) obj; + return item == other.item && meta == other.meta && Objects.equals(nbtTag, other.nbtTag); + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + item.hashCode(); + result = prime * result + meta; + result = prime * result + ((nbtTag == null) ? 0 : nbtTag.hashCode()); + return result; + } + + public static ItemType fromStack(ItemStack stack) + { + return new ItemType(stack.getItem(), stack.getItemDamage(), stack.stackTagCompound); + } + +} From d800e06cb87a6e1c68ec68db8e0220cbfc10b342 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Fri, 10 Apr 2015 15:51:09 +0200 Subject: [PATCH 05/19] Refactor bound pickaxe item dropping --- .../common/items/BoundPickaxe.java | 54 ++++++++++++------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java index 9b7c7f93..f58bc716 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -1,10 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.EnchantmentHelper; @@ -20,9 +18,16 @@ import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.ItemType; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import java.util.ArrayList; -import java.util.List; +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Multiset; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BoundPickaxe extends ItemPickaxe implements IBindable { @@ -142,6 +147,8 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); + HashMultiset dropMultiset = HashMultiset.create(); + for (int i = -5; i <= 5; i++) { for (int j = -5; j <= 5; j++) @@ -159,25 +166,15 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable { if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) { - ItemStack droppedItem = new ItemStack(block, 1, meta); - - if (!par2World.isRemote) - { - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem)); - } + dropMultiset.add(new ItemType(block, meta)); } else { ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); if (itemDropList != null) { - for (ItemStack item : itemDropList) - { - if (!par2World.isRemote) - { - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item)); - } - } + for (ItemStack stack : itemDropList) + dropMultiset.add(ItemType.fromStack(stack), stack.stackSize); } } @@ -188,6 +185,23 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable } } + for (Multiset.Entry entry : dropMultiset.entrySet()) + { + int count = entry.getCount(); + ItemType type = entry.getElement(); + int maxStackSize = type.item.getItemStackLimit(type.createStack(1)); + + //Drop in groups of maximum size + while (count >= maxStackSize) + { + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, type.createStack(maxStackSize))); + count -= maxStackSize; + } + //Drop remainder + if (count > 0) + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, type.createStack(count))); + } + return par1ItemStack; } From 1887df3d1ec468e4aa940f009c998b03043f7ce6 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Fri, 10 Apr 2015 20:30:52 +0200 Subject: [PATCH 06/19] Apply to shovel and axe as well --- .../common/items/BoundAxe.java | 25 ++++++++----------- .../common/items/BoundPickaxe.java | 15 +++++++---- .../common/items/BoundShovel.java | 22 +++++++--------- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java index c4077953..350b5a9a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -25,6 +26,8 @@ import net.minecraftforge.common.ForgeHooks; import java.util.ArrayList; import java.util.List; +import com.google.common.collect.HashMultiset; + public class BoundAxe extends ItemAxe implements IBindable { public float efficiencyOnProperMaterial = 12.0F; @@ -135,6 +138,8 @@ public class BoundAxe extends ItemAxe implements IBindable boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); + HashMultiset dropMultiset = HashMultiset.create(); + for (int i = -5; i <= 5; i++) { for (int j = 0; j <= 10; j++) @@ -152,27 +157,18 @@ public class BoundAxe extends ItemAxe implements IBindable { if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) { - ItemStack droppedItem = new ItemStack(block, 1, meta); - - if (!par2World.isRemote) - { - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem)); - } + dropMultiset.add(new ItemType(block, meta)); } else { ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); if (itemDropList != null) { - for (ItemStack item : itemDropList) - { - if (!par2World.isRemote) - { - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item)); - } - } + for (ItemStack stack : itemDropList) + dropMultiset.add(ItemType.fromStack(stack), stack.stackSize); } } + par2World.setBlockToAir(posX + i, posY + j, posZ + k); } } @@ -180,7 +176,8 @@ public class BoundAxe extends ItemAxe implements IBindable } } - + BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); + return par1ItemStack; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java index f58bc716..cc47270f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -184,7 +184,14 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable } } } - + + dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); + + return par1ItemStack; + } + + public static void dropMultisetStacks(Multiset dropMultiset, World world, double x, double y, double z) + { for (Multiset.Entry entry : dropMultiset.entrySet()) { int count = entry.getCount(); @@ -194,15 +201,13 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable //Drop in groups of maximum size while (count >= maxStackSize) { - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, type.createStack(maxStackSize))); + world.spawnEntityInWorld(new EntityItem(world, x, y, z, type.createStack(maxStackSize))); count -= maxStackSize; } //Drop remainder if (count > 0) - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, type.createStack(count))); + world.spawnEntityInWorld(new EntityItem(world, x, y, z, type.createStack(count))); } - - return par1ItemStack; } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java index 82969790..d3a7777f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -2,8 +2,10 @@ package WayofTime.alchemicalWizardry.common.items; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import com.google.common.collect.HashMultiset; import com.google.common.collect.Multimap; import cpw.mods.fml.relauncher.Side; @@ -141,6 +143,8 @@ public class BoundShovel extends ItemSpade implements IBindable boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); + HashMultiset dropMultiset = HashMultiset.create(); + for (int i = -5; i <= 5; i++) { for (int j = 0; j <= 10; j++) @@ -158,25 +162,15 @@ public class BoundShovel extends ItemSpade implements IBindable { if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) { - ItemStack droppedItem = new ItemStack(block, 1, meta); - - if (!par2World.isRemote) - { - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem)); - } + dropMultiset.add(new ItemType(block, meta)); } else { ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); if (itemDropList != null) { - for (ItemStack item : itemDropList) - { - if (!par2World.isRemote) - { - par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item)); - } - } + for (ItemStack stack : itemDropList) + dropMultiset.add(ItemType.fromStack(stack), stack.stackSize); } } @@ -186,6 +180,8 @@ public class BoundShovel extends ItemSpade implements IBindable } } } + + BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); return par1ItemStack; } From a17de943c47beb57d0b57d0fc4801eaca6d636df Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Fri, 10 Apr 2015 20:32:09 +0200 Subject: [PATCH 07/19] Fix client-side ghost items --- .../alchemicalWizardry/common/items/BoundAxe.java | 5 +++++ .../alchemicalWizardry/common/items/BoundPickaxe.java | 10 +++++----- .../alchemicalWizardry/common/items/BoundShovel.java | 5 +++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java index 350b5a9a..299060b9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -115,6 +115,11 @@ public class BoundAxe extends ItemAxe implements IBindable par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); return par1ItemStack; } + + if (par2World.isRemote) + { + return par1ItemStack; + } if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java index cc47270f..300ab966 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -119,6 +119,11 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); return par1ItemStack; } + + if (par2World.isRemote) + { + return par1ItemStack; + } if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) { @@ -129,11 +134,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable { return par1ItemStack; } - - if (par2World.isRemote) - { - return par1ItemStack; - } if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java index d3a7777f..2681e9ac 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -120,6 +120,11 @@ public class BoundShovel extends ItemSpade implements IBindable par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); return par1ItemStack; } + + if (par2World.isRemote) + { + return par1ItemStack; + } if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) { From 7d0450cc63da0fc4e8be79e0377513718d70749a Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 10 Apr 2015 17:07:27 -0400 Subject: [PATCH 08/19] Not much of anything --- .../common/bloodAltarUpgrade/UpgradedAltars.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java index f36c0b3c..23d0845b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java @@ -303,7 +303,7 @@ public class UpgradedAltars fifthTierAltar.addAll(fourthTierAltar); fifthTierAltar.add(new AltarComponent(-8, -3, 8, Blocks.beacon, 0, false, false)); fifthTierAltar.add(new AltarComponent(-8, -3, -8, Blocks.beacon, 0, false, false)); - fifthTierAltar.add(new AltarComponent(8, -3, 8, Blocks.beacon, 0, false, false)); + fifthTierAltar.add(new AltarComponent(8, -3, -8, Blocks.beacon, 0, false, false)); fifthTierAltar.add(new AltarComponent(8, -3, 8, Blocks.beacon, 0, false, false)); for (int i = -6; i <= 6; i++) From 80fab2df1245ba2279c60c231af738e710141ad7 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 10 Apr 2015 17:11:09 -0400 Subject: [PATCH 09/19] Fixed some @Arcaratus derps :D --- .../rituals/RitualEffectAutoAlchemy.java | 4 +-- .../rituals/RitualEffectLifeConduit.java | 27 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java index 3c2a187a..9cfae056 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java @@ -44,13 +44,13 @@ public class RitualEffectAutoAlchemy extends RitualEffect int flag = 0; TileEntity topEntity = world.getTileEntity(x, y + 1, z); - if (!(topEntity instanceof IBloodAltar)) + if (!(topEntity instanceof IBloodAltar) || !(topEntity instanceof IBloodAltar)) { return; } IBloodAltar altar = (IBloodAltar) topEntity; - ItemStack targetStack = altar.getStackInSlot(0); + ItemStack targetStack = ((IInventory)altar).getStackInSlot(0); if (targetStack == null) { return; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java index cedfd89e..23f39955 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java @@ -1,19 +1,20 @@ package WayofTime.alchemicalWizardry.common.rituals; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; - -import java.util.ArrayList; -import java.util.List; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class RitualEffectLifeConduit extends RitualEffect { @@ -50,6 +51,12 @@ public class RitualEffectLifeConduit extends RitualEffect { return; } + + if(!(tileAltar instanceof IFluidHandler)) + { + return; + } + int d0 = 15; int vertRange = 20; @@ -69,10 +76,10 @@ public class RitualEffectLifeConduit extends RitualEffect return; } - int fillAmount = Math.min(currentEssence / 2, tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 10000), false)); + int fillAmount = Math.min(currentEssence / 2, ((IFluidHandler)tileAltar).fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 10000), false)); { - tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, fillAmount), true); + ((IFluidHandler)tileAltar).fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, fillAmount), true); if (entityOwner.getHealth() > 2.0f && fillAmount != 0) { entityOwner.setHealth(2.0f); From 275d26be2092c3a89965d8108562f2da72792b28 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 10 Apr 2015 17:15:06 -0400 Subject: [PATCH 10/19] Fixed the funky item rendering for fast graphics when viewing the altar and chemistry sets. --- .../common/renderer/block/RenderWritingTable.java | 4 +++- .../common/renderer/block/TEAltarRenderer.java | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java index 69920b1a..dec51680 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.block; import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -13,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; public class RenderWritingTable extends TileEntitySpecialRenderer @@ -57,7 +59,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer if (tileAltar.getStackInSlot(i) != null) { float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i)); - float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java index 1a0dfc88..054e1201 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -10,8 +9,12 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; + public class TEAltarRenderer extends TileEntitySpecialRenderer { private ModelBloodAltar modelBloodAltar = new ModelBloodAltar(); @@ -44,7 +47,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer if (tileAltar.getStackInSlot(0) != null) { float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); - float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); From b725f7b81494cb61d37b6c6550e0341382f5e51b Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sat, 11 Apr 2015 15:43:06 -0400 Subject: [PATCH 11/19] Added the method to create the Omega armours, though it wasn't a secret for a while! :D Added the ability to enchant omega armour in such a way that there won't be a single best method A bunch of other stuff I can't remember. Fun times! --- .../api/aspects/IEssentiaContainerItem.java | 1 - .../AlchemicalWizardry.java | 10 +- .../alchemicalWizardry/ModBlocks.java | 8 +- .../api/soulNetwork/SoulNetworkHandler.java | 2 +- .../client/ClientEventHandler.java | 14 +-- .../client/ClientProxy.java | 2 +- .../client/KeyBindings.java | 10 +- .../common/AlchemicalWizardryEventHooks.java | 1 - .../common/block/BlockEnchantmentGlyph.java | 69 ++++++++++- .../common/block/BlockStabilityGlyph.java | 73 ++++++++++++ .../common/commands/CommandBind.java | 9 +- .../common/items/BoundAxe.java | 20 ++-- .../common/items/BoundShovel.java | 39 +++--- .../common/items/DaggerOfSacrifice.java | 2 - .../items/ItemEnchantmentGlyphBlock.java | 42 +++++++ .../common/items/ItemStabilityGlyphBlock.java | 38 ++++++ .../common/items/armour/BoundArmour.java | 11 +- .../common/items/armour/OmegaArmour.java | 36 +++++- .../common/omega/IEnchantmentGlyph.java | 4 +- .../common/omega/IStabilityGlyph.java | 8 ++ .../common/omega/OmegaParadigm.java | 14 ++- .../common/omega/OmegaStructureHandler.java | 19 +-- .../omega/OmegaStructureParameters.java | 4 +- .../common/rituals/RitualEffectOmegaTest.java | 112 ++++++++++++++++-- .../common/tileEntity/TEAltar.java | 3 - .../common/tileEntity/TEPedestal.java | 9 +- .../common/tileEntity/TEPlinth.java | 20 ++-- .../common/tileEntity/TESocket.java | 9 +- .../common/tileEntity/TETeleposer.java | 25 ++-- .../common/tileEntity/TEWritingTable.java | 5 - .../assets/alchemicalwizardry/lang/en_US.lang | 4 + .../textures/blocks/GlyphEnchantability.png | Bin 0 -> 667 bytes .../textures/blocks/GlyphEnchantmentLevel.png | Bin 0 -> 699 bytes .../textures/blocks/GlyphStability1.png | Bin 0 -> 572 bytes 34 files changed, 477 insertions(+), 146 deletions(-) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java create mode 100644 src/main/resources/assets/alchemicalwizardry/textures/blocks/GlyphEnchantability.png create mode 100644 src/main/resources/assets/alchemicalwizardry/textures/blocks/GlyphEnchantmentLevel.png create mode 100644 src/main/resources/assets/alchemicalwizardry/textures/blocks/GlyphStability1.png diff --git a/src/api/java/thaumcraft/api/aspects/IEssentiaContainerItem.java b/src/api/java/thaumcraft/api/aspects/IEssentiaContainerItem.java index 6a82c0e6..f92a7de4 100644 --- a/src/api/java/thaumcraft/api/aspects/IEssentiaContainerItem.java +++ b/src/api/java/thaumcraft/api/aspects/IEssentiaContainerItem.java @@ -1,7 +1,6 @@ package thaumcraft.api.aspects; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; /** * diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index c5b7b13d..28f553dd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -284,7 +284,7 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; -@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.1", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") +@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.2", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") public class AlchemicalWizardry { @@ -731,6 +731,7 @@ public class AlchemicalWizardry customPotionAmphibian = (new PotionAmphibian(customPotionAmphibianID, false, 0).setIconIndex(0, 0).setPotionName("Amphibian")); ItemStack masterBloodOrbStack = new ItemStack(ModItems.masterBloodOrb); + ItemStack transcendentBloodOrbStack = new ItemStack(ModItems.transcendentBloodOrb); // ModBlocks.blockLifeEssence.setUnlocalizedName("lifeEssenceBlock"); FluidContainerRegistry.registerFluidContainer(lifeEssenceFluid, new ItemStack(ModItems.bucketLife), FluidContainerRegistry.EMPTY_BUCKET); @@ -1071,7 +1072,10 @@ public class AlchemicalWizardry GameRegistry.addRecipe(new ItemStack(ModItems.outputRoutingFocus, 1, 3), "sgs", "geg", "sgs", 'e', enderShardStack, 's', stickStack, 'g', obsidianStack); GameRegistry.addRecipe(new ItemStack(ModItems.outputRoutingFocus, 1, 4), "sgs", "geg", "sgs", 'e', enderShardStack, 's', stickStack, 'g', stringStack); - + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockStabilityGlyph), "1s1", "grg", "bob", 'o', transcendentBloodOrbStack, 'r', bloodRuneStack, '1', crepitousStack, 'g', etherealSlateStack, 'b', praesidiumStack, 's', magicalesStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockEnchantmentGlyph, 1, 0), "1s1", "grg", "bob", 'o', transcendentBloodOrbStack, 'r', bloodRuneStack, 'g', etherealSlateStack, 'b', magicalesStack, '1', offensaStack, 's', lifeShardStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockEnchantmentGlyph, 1, 1), "1s1", "grg", "bob", 'o', transcendentBloodOrbStack, 'r', bloodRuneStack, 'g', etherealSlateStack, 'b', magicalesStack, '1', virtusStack, 's', soulShardStack); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.flint, 2, 0), 1, new ItemStack[]{new ItemStack(Blocks.gravel), new ItemStack(Items.flint)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.grass), 2, new ItemStack[]{new ItemStack(Blocks.dirt), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.wheat_seeds), new ItemStack(Items.wheat_seeds)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.leather, 3, 0), 2, new ItemStack[]{new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), waterBucketStack, new ItemStack(Items.flint)}, 1); @@ -1086,6 +1090,8 @@ public class AlchemicalWizardry AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.soul_sand, 3, 0), 3, new ItemStack[]{new ItemStack(Blocks.sand), new ItemStack(Blocks.sand), new ItemStack(Blocks.sand), waterBucketStack, weakBloodShardStack}, 3); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.mycelium, 1, 0), 5, new ItemStack[]{new ItemStack(Blocks.grass), new ItemStack(Blocks.brown_mushroom), new ItemStack(Blocks.red_mushroom)}, 2); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.ice), 2, new ItemStack[]{waterBucketStack, new ItemStack(Items.snowball)}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.potionitem, 1, 0), 1, new ItemStack[]{new ItemStack(Items.glass_bottle), new ItemStack(Blocks.cactus)}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.glass_bottle, 3), 1, new ItemStack[]{glassStack, glassStack, glassStack}, 1); } @EventHandler diff --git a/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java b/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java index 35ff732d..f451d5ad 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java @@ -22,6 +22,7 @@ import WayofTime.alchemicalWizardry.common.block.BlockSpellEffect; import WayofTime.alchemicalWizardry.common.block.BlockSpellEnhancement; import WayofTime.alchemicalWizardry.common.block.BlockSpellModifier; import WayofTime.alchemicalWizardry.common.block.BlockSpellParadigm; +import WayofTime.alchemicalWizardry.common.block.BlockStabilityGlyph; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; import WayofTime.alchemicalWizardry.common.block.BlockWritingTable; import WayofTime.alchemicalWizardry.common.block.BloodRune; @@ -41,10 +42,12 @@ import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.BlockDemonChe import WayofTime.alchemicalWizardry.common.items.ItemBlockCrystalBelljar; import WayofTime.alchemicalWizardry.common.items.ItemBloodRuneBlock; import WayofTime.alchemicalWizardry.common.items.ItemCrystalBlock; +import WayofTime.alchemicalWizardry.common.items.ItemEnchantmentGlyphBlock; import WayofTime.alchemicalWizardry.common.items.ItemSpellEffectBlock; import WayofTime.alchemicalWizardry.common.items.ItemSpellEnhancementBlock; import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock; import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock; +import WayofTime.alchemicalWizardry.common.items.ItemStabilityGlyphBlock; import cpw.mods.fml.common.registry.GameRegistry; /** @@ -94,6 +97,7 @@ public class ModBlocks public static Block blockCrystal; public static Block blockMimic; public static Block blockEnchantmentGlyph; + public static Block blockStabilityGlyph; public static void init() @@ -136,6 +140,7 @@ public class ModBlocks blockLifeEssence = new LifeEssenceBlock(); blockEnchantmentGlyph = new BlockEnchantmentGlyph(); + blockStabilityGlyph = new BlockStabilityGlyph(); } public static void registerBlocksInPre() @@ -179,7 +184,8 @@ public class ModBlocks GameRegistry.registerBlock(ModBlocks.blockDemonChest, "blockDemonChest"); GameRegistry.registerBlock(ModBlocks.blockCrystal, ItemCrystalBlock.class, "blockCrystal"); GameRegistry.registerBlock(ModBlocks.blockMimic, "blockMimic"); - GameRegistry.registerBlock(ModBlocks.blockEnchantmentGlyph, "blockEnchantmentGlyph"); + GameRegistry.registerBlock(ModBlocks.blockEnchantmentGlyph, ItemEnchantmentGlyphBlock.class, "blockEnchantmentGlyph"); + GameRegistry.registerBlock(ModBlocks.blockStabilityGlyph, ItemStabilityGlyphBlock.class, "blockStabilityGlyph"); } public static void registerBlocksInInit() diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java index 973d293a..a2060b4f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java @@ -417,7 +417,7 @@ public class SoulNetworkHandler public static String getUsername(EntityPlayer player) { - return player.getDisplayName(); + return player.getCommandSenderName(); } public static EntityPlayer getPlayerForUsername(String str) diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java index a3e0a531..23984f27 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java @@ -7,8 +7,6 @@ import net.minecraftforge.client.event.sound.SoundEvent; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.client.renderer.RenderHelper; -import WayofTime.alchemicalWizardry.common.ClientToServerPacketHandler; -import WayofTime.alchemicalWizardry.common.MessageKeyPressed; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -23,12 +21,12 @@ public class ClientEventHandler @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { - if(KeyBindings.omegaTest.isPressed()) - { - System.out.println("ping"); -// NewPacketHandler.INSTANCE.sendToServer(NewPacketHandler.getKeyboardPressPacket((byte)2)); - ClientToServerPacketHandler.INSTANCE.sendToServer(new MessageKeyPressed(MessageKeyPressed.Key.OMEGA_ACTIVE)); - } +// if(KeyBindings.omegaTest.isPressed()) +// { +// System.out.println("ping"); +//// NewPacketHandler.INSTANCE.sendToServer(NewPacketHandler.getKeyboardPressPacket((byte)2)); +// ClientToServerPacketHandler.INSTANCE.sendToServer(new MessageKeyPressed(MessageKeyPressed.Key.OMEGA_ACTIVE)); +// } } @SubscribeEvent diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java index c7129aeb..5b21ce24 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java @@ -110,7 +110,7 @@ public class ClientProxy extends CommonProxy public void registerPostSideObjects() { BUEntries entries = new BUEntries(); - entries.postInit(); +// entries.postInit(); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/KeyBindings.java b/src/main/java/WayofTime/alchemicalWizardry/client/KeyBindings.java index 26943f9b..b616b662 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/KeyBindings.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/KeyBindings.java @@ -2,18 +2,14 @@ package WayofTime.alchemicalWizardry.client; import net.minecraft.client.settings.KeyBinding; -import org.lwjgl.input.Keyboard; - -import cpw.mods.fml.client.registry.ClientRegistry; - public class KeyBindings { public static KeyBinding omegaTest; public static void init() { - omegaTest = new KeyBinding("key.ping", Keyboard.KEY_O, "key.categories.alchemicalwizardry"); - - ClientRegistry.registerKeyBinding(omegaTest); +// omegaTest = new KeyBinding("key.ping", Keyboard.KEY_O, "key.categories.alchemicalwizardry"); +// +// ClientRegistry.registerKeyBinding(omegaTest); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index 20e77f78..a719a5d9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -150,7 +150,6 @@ public class AlchemicalWizardryEventHooks System.out.println("HP: " + hp); APISpellHelper.setCurrentAdditionalHP(player, Math.max(0, hp)); NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(Math.max(0, hp), APISpellHelper.getCurrentAdditionalMaxHP(player)), (EntityPlayerMP)player); - } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java index b0b02ab5..b408f01c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java @@ -1,8 +1,14 @@ package WayofTime.alchemicalWizardry.common.block; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.omega.IEnchantmentGlyph; @@ -11,13 +17,16 @@ import cpw.mods.fml.relauncher.SideOnly; public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph { + public IIcon enchantability; + public IIcon enchantmentLevel; + public BlockEnchantmentGlyph() { super(Material.iron); setHardness(2.0F); setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - this.setBlockName("enchantmentGlypg"); + this.setBlockName("enchantmentGlyph"); } @Override @@ -25,17 +34,69 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick"); + this.enchantability = iconRegister.registerIcon("AlchemicalWizardry:GlyphEnchantability"); + this.enchantmentLevel = iconRegister.registerIcon("AlchemicalWizardry:GlyphEnchantmentLevel"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (meta) + { + case 0: + return enchantability; + case 1: + return enchantmentLevel; + default: + return this.blockIcon; + } } @Override - public int getSubtractedStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount) + public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount) { - return faceCount * 20; + switch(meta) + { + case 0: + return -faceCount * 10; + case 1: + return -faceCount * 20; + default: + return -faceCount * 20; + } } @Override public int getEnchantability(World world, int x, int y, int z, int meta) { - return 1; + switch(meta) + { + case 0: + return 1; + default: + return 0; + } } + + @Override + public int getEnchantmentLevel(World world, int x, int y, int z, int meta) + { + switch(meta) + { + case 1: + return 1; + default: + return 0; + } + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + for(int i=0; i<2; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java new file mode 100644 index 00000000..dd7b8048 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java @@ -0,0 +1,73 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.omega.IStabilityGlyph; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockStabilityGlyph extends Block implements IStabilityGlyph +{ + public IIcon stability1; + + public BlockStabilityGlyph() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("stabilityGlyph"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick"); + this.stability1 = iconRegister.registerIcon("AlchemicalWizardry:GlyphStability1"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (meta) + { + case 0: + return stability1; + default: + return this.blockIcon; + } + } + + @Override + public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount) + { + switch(meta) + { + case 0: + return faceCount * 2; + default: + return faceCount; + } + } + + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + for(int i=0; i<1; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java index 6a2c5a1f..42970190 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java @@ -1,16 +1,15 @@ package WayofTime.alchemicalWizardry.common.commands; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import java.util.List; + import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; - -import java.util.List; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; public class CommandBind extends CommandBase { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java index 299060b9..77596f93 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -1,18 +1,14 @@ package WayofTime.alchemicalWizardry.common.items; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.common.ItemType; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockLeavesBase; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; @@ -22,12 +18,16 @@ import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; - -import java.util.ArrayList; -import java.util.List; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.ItemType; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import com.google.common.collect.HashMultiset; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BoundAxe extends ItemAxe implements IBindable { public float efficiencyOnProperMaterial = 12.0F; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java index 2681e9ac..1364d64e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -1,5 +1,24 @@ package WayofTime.alchemicalWizardry.common.items; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.common.ItemType; @@ -10,26 +29,6 @@ import com.google.common.collect.Multimap; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemSpade; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeHooks; - -import java.util.ArrayList; -import java.util.List; public class BoundShovel extends ItemSpade implements IBindable { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java index f4b38f3d..c5a8cb5f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java @@ -8,8 +8,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.boss.EntityDragon; -import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.monster.EntitySlime; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java new file mode 100644 index 00000000..a50bc6c3 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java @@ -0,0 +1,42 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemEnchantmentGlyphBlock extends ItemBlock +{ + public ItemEnchantmentGlyphBlock(Block block) + { + super(block); + setHasSubtypes(true); + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + name = "enchantability"; + break; + + case 1: + name = "enchantmentLevel"; + break; + + default: + name = "broken"; + } + + return getUnlocalizedName() + "." + name; + } + + @Override + public int getMetadata(int par1) + { + return par1; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java new file mode 100644 index 00000000..209de15c --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java @@ -0,0 +1,38 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemStabilityGlyphBlock extends ItemBlock +{ + public ItemStabilityGlyphBlock(Block block) + { + super(block); + setHasSubtypes(true); + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + name = "stability1"; + break; + + default: + name = "broken"; + } + + return getUnlocalizedName() + "." + name; + } + + @Override + public int getMetadata(int par1) + { + return par1; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java index 56018258..ff3adbec 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java @@ -373,7 +373,14 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA this.setIsInvisible(itemStack, player.isPotionActive(Potion.invisibility.id)); - if (itemStack.getItemDamage() > 0) + this.repairArmour(world, player, itemStack); + + return; + } + + public void repairArmour(World world, EntityPlayer player, ItemStack itemStack) + { + if (itemStack.getItemDamage() > 0) { EnergyItems.checkAndSetItemOwner(itemStack, player); @@ -385,8 +392,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA } } } - - return; } public void tickInternalInventory(ItemStack par1ItemStack, World par2World, EntityPlayer par3Entity, int par4, boolean par5) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java index 813d7e77..ca6020ee 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java @@ -23,6 +23,8 @@ import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -36,6 +38,8 @@ public abstract class OmegaArmour extends BoundArmour protected boolean storeYLevel = false; protected boolean storeSeesSky = false; + public float reagentDrainPerDamage = 0.1f; + public OmegaArmour(int armorType) { super(armorType); @@ -94,13 +98,34 @@ public abstract class OmegaArmour extends BoundArmour } } + @Override + public void repairArmour(World world, EntityPlayer player, ItemStack itemStack) + { + if (itemStack.getItemDamage() > 0) + { + if (!player.capabilities.isCreativeMode) + { + if(EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75)) + { + Reagent reagent = APISpellHelper.getPlayerReagentType(player); + float reagentAmount = APISpellHelper.getPlayerCurrentReagentAmount(player); + + reagentAmount -= itemStack.getItemDamage() * reagentDrainPerDamage; + APISpellHelper.setPlayerCurrentReagentAmount(player, Math.max(0, reagentAmount)); + + itemStack.setItemDamage(0); + } + } + } + } + public void revertArmour(EntityPlayer player, ItemStack itemStack) { ItemStack stack = this.getContainedArmourStack(itemStack); player.inventory.armorInventory[3-this.armorType] = stack; } - public ItemStack getSubstituteStack(ItemStack boundStack, int stability, int affinity, int enchantability, Random rand) + public ItemStack getSubstituteStack(ItemStack boundStack, int stability, int affinity, int enchantability, int enchantmentLevel, Random rand) { ItemStack omegaStack = new ItemStack(this); if(boundStack != null && boundStack.hasTagCompound()) @@ -110,13 +135,16 @@ public abstract class OmegaArmour extends BoundArmour } this.setContainedArmourStack(omegaStack, boundStack); SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack)); - this.setItemEnchantability(omegaStack, 70); + this.setItemEnchantability(omegaStack, Math.min(enchantability, 70)); List enchantList = new ArrayList(); - for(int i=0; i<100; i++) + int adjustedEnchantLevel = Math.min(enchantmentLevel, 30); + int additionalPasses = enchantmentLevel - adjustedEnchantLevel; + + for(int i=0; i<1+additionalPasses; i++) { - List lst = EnchantmentHelper.buildEnchantmentList(rand, omegaStack, 30); + List lst = EnchantmentHelper.buildEnchantmentList(rand, omegaStack, adjustedEnchantLevel); if(lst != null) { enchantList.addAll(lst); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java index 113024f5..5c189f92 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java @@ -2,8 +2,8 @@ package WayofTime.alchemicalWizardry.common.omega; import net.minecraft.world.World; -public interface IEnchantmentGlyph +public interface IEnchantmentGlyph extends IStabilityGlyph { - public int getSubtractedStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount); public int getEnchantability(World world, int x, int y, int z, int meta); + public int getEnchantmentLevel(World world, int x, int y, int z, int meta); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java new file mode 100644 index 00000000..50252a94 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java @@ -0,0 +1,8 @@ +package WayofTime.alchemicalWizardry.common.omega; + +import net.minecraft.world.World; + +public interface IStabilityGlyph +{ + public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount); +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java index ee86b10e..8e0fe922 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java @@ -38,7 +38,7 @@ public class OmegaParadigm this.config = new ReagentRegenConfiguration(20, 10, 1); } - public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity, int enchantability) + public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity, int enchantability, int enchantmentLevel) { ItemStack[] armours = player.inventory.armorInventory; @@ -49,12 +49,14 @@ public class OmegaParadigm if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundPlate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots) { + System.out.println("Enchantability: " + enchantability); + long worldSeed = player.worldObj.getSeed(); - Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z - 1623451*enchantability); - ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, enchantability, rand); - ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack, stability, affinity, enchantability, rand); - ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack, stability, affinity, enchantability, rand); - ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack, stability, affinity, enchantability, rand); + Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z - 1623451*enchantability + 2 * enchantmentLevel); + ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, enchantability, enchantmentLevel, rand); + ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack, stability, affinity, enchantability, enchantmentLevel, rand); + ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack, stability, affinity, enchantability, enchantmentLevel, rand); + ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack, stability, affinity, enchantability, enchantmentLevel, rand); armours[3] = omegaHelmetStack; armours[2] = omegaChestStack; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java index 7aa32d6b..7289c491 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java @@ -7,7 +7,7 @@ import WayofTime.alchemicalWizardry.api.Int3; public class OmegaStructureHandler { - public static final OmegaStructureParameters emptyParam = new OmegaStructureParameters(0, 0); + public static final OmegaStructureParameters emptyParam = new OmegaStructureParameters(0, 0, 0); public static boolean isStructureIntact(World world, int x, int y, int z) { @@ -155,6 +155,7 @@ public class OmegaStructureHandler int tally = 0; int enchantability = 0; + int enchantmentLevel = 0; for (int i = 0; i < 2 * range + 1; i++) { @@ -198,23 +199,27 @@ public class OmegaStructureHandler { indTally++; } - + Block block = world.getBlock(x - range + i, y - range + j, z - range + k); - int meta = 0; + int meta = world.getBlockMetadata(x - range + i, y - range + j, z - range + k); + if(block instanceof IEnchantmentGlyph) { - tally -= ((IEnchantmentGlyph)block).getSubtractedStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally); + tally += ((IEnchantmentGlyph)block).getAdditionalStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally); enchantability += ((IEnchantmentGlyph)block).getEnchantability(world, x-range+i, y-range+j, z-range+k, meta); + enchantmentLevel += ((IEnchantmentGlyph)block).getEnchantmentLevel(world, x-range+i, y-range+j, z-range+k, meta); + }else if(block instanceof IStabilityGlyph) + { + tally += ((IStabilityGlyph)block).getAdditionalStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally); }else { tally += indTally; - } + } } } } - - return new OmegaStructureParameters(tally, enchantability); + return new OmegaStructureParameters(tally, enchantability, enchantmentLevel); } public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureParameters.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureParameters.java index 2b42bd47..2ecd32c4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureParameters.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureParameters.java @@ -4,10 +4,12 @@ public class OmegaStructureParameters { public final int stability; public final int enchantability; + public final int enchantmentLevel; - public OmegaStructureParameters(int stability, int enchantability) + public OmegaStructureParameters(int stability, int enchantability, int enchantmentLevel) { this.stability = stability; this.enchantability = enchantability; + this.enchantmentLevel = enchantmentLevel; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java index 2dc7129a..6fe397c3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java @@ -1,14 +1,21 @@ package WayofTime.alchemicalWizardry.common.rituals; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.Int3; +import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; @@ -23,7 +30,9 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class RitualEffectOmegaTest extends RitualEffect { - public static final int tickDuration = 1 * 60 * 20; + public static final boolean isTesting = true; + public static final int drainTotal = 32 * 1000; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -43,27 +52,106 @@ public class RitualEffectOmegaTest extends RitualEffect OmegaStructureParameters param = OmegaStructureHandler.getStructureStabilityFactor(world, x, y, z, 5, new Int3(0,1,0)); int stab = param.stability; int enchantability = param.enchantability; + int enchantmentLevel = param.enchantmentLevel; - System.out.println("Stability: " + stab); + System.out.println("Stability: " + stab + ", Enchantability: " + enchantability + ", Enchantment Level: " + enchantmentLevel); double range = 0.5; List playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 1.5, z + 0.5, range, range); + Reagent reagent = null; + + Map reagentMap = new HashMap(); + for(int i=0; i<4; i++) + { + Int3 jarLoc = this.getJarLocation(i); + TileEntity tile = world.getTileEntity(x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord); + if(tile instanceof IReagentHandler) + { + IReagentHandler container = (IReagentHandler)tile; + ReagentContainerInfo[] containerInfoArray = container.getContainerInfo(ForgeDirection.UP); + if(containerInfoArray == null) + { + continue; + } + + for(ReagentContainerInfo containerInfo : containerInfoArray) + { + ReagentStack containedReagent = containerInfo.reagent; + if(containedReagent == null) + { + continue; + } + Reagent rea = containedReagent.reagent; + int amt = containedReagent.amount; + if(reagentMap.containsKey(rea)) + { + reagentMap.put(rea, reagentMap.get(rea) + amt); + }else + { + reagentMap.put(rea, amt); + } + } + } + } + + for(Entry entry : reagentMap.entrySet()) + { + if(entry.getValue() >= drainTotal) + { + reagent = entry.getKey(); + break; + } + } + + if(reagent == null) + { + return; + } + + int tickDuration = isTesting ? 20 * 30 : 15 * 20 * 60 + (int)((15 * 20 * 60) * Math.sqrt(stab / 700)); + + int affinity = 0; + for(EntityPlayer player : playerList) { - Reagent reagent = ReagentRegistry.aetherReagent; - - int affinity = 0; - OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(reagent); - if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, x, y, z, stab, affinity, enchantability)) + if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, x, y, z, stab, affinity, enchantability, enchantmentLevel)) { APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration); APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration); APISpellHelper.setPlayerReagentType(player, reagent); APISpellHelper.setCurrentAdditionalMaxHP(player, waterParadigm.getMaxAdditionalHealth()); NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(reagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player); + + if(!isTesting) + { + int drainLeft = this.drainTotal; + for(int i = 0; i < 4; i++) + { + if(drainLeft <= 0) + { + break; + } + Int3 jarLoc = this.getJarLocation(i); + TileEntity tile = world.getTileEntity(x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord); + if(tile instanceof IReagentHandler) + { + IReagentHandler container = (IReagentHandler)tile; + ReagentStack drained = container.drain(ForgeDirection.UP, new ReagentStack(reagent, drainLeft), true); + if(drained != null) + { + drainLeft -= drained.amount; + world.markBlockForUpdate(x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord); + } + } + } + + ritualStone.setActive(false); + } + + break; } } } @@ -102,13 +190,13 @@ public class RitualEffectOmegaTest extends RitualEffect switch(i) { case 0: - return new Int3(-3,1,0); + return new Int3(-3,0,0); case 1: - return new Int3(3,1,0); + return new Int3(3,0,0); case 2: - return new Int3(0,1,-3); + return new Int3(0,0,-3); case 3: - return new Int3(0,1,3); + return new Int3(0,0,3); default: return new Int3(0,0,0); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index 13a18fbf..b614c2cf 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -4,18 +4,15 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java index dcb522f3..6d0a7b0a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java @@ -1,17 +1,12 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class TEPedestal extends TEInventory { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java index 138e12db..af245293 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java @@ -1,14 +1,9 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; -import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistryComponent; -import WayofTime.alchemicalWizardry.common.IDemon; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.PlinthComponent; -import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -18,9 +13,12 @@ import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; import net.minecraftforge.oredict.OreDictionary; - -import java.util.ArrayList; -import java.util.List; +import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; +import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistryComponent; +import WayofTime.alchemicalWizardry.common.IDemon; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.PlinthComponent; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; public class TEPlinth extends TEInventory { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java index b4047d94..ef3cf992 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java @@ -1,16 +1,11 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; public class TESocket extends TEInventory { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java index 7be849ae..8043a587 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java @@ -1,24 +1,19 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.util.Constants; - -import java.util.Iterator; -import java.util.List; public class TETeleposer extends TEInventory { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java index 628d8171..5bed0af1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java @@ -1,15 +1,10 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.ModItems; diff --git a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang index 7121f648..e365140f 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang @@ -59,6 +59,9 @@ tile.crystalBlock.fullCrystal.name=Crystal Cluster tile.crystalBlock.crystalBrick.name=Crystal Cluster Brick tile.demonPortal.name=Demon Portal tile.demonChest.name=Demon's Chest +tile.enchantmentGlyph.enchantability.name=Glyph of the Adept Enchanter +tile.enchantmentGlyph.enchantmentLevel.name=Glyph of Arcane Potential +tile.stabilityGlyph.stability1.name=Glyph of Rigid Stability #Item Localization item.weakBloodOrb.name=Weak Blood Orb @@ -203,6 +206,7 @@ item.itemAssassinSigil.name=Sigil of the Assassin item.transcendentBloodOrb.name=Transcendent Blood Orb item.itemMailCatalogue.name=Mail Order Catalogue item.inputRoutingFocus.name=Input Routing Focus +item.bloodMagicBaseItem.EnderShard.name=Ender Shard item.outputRoutingFocus.default.name=Default Output Routing Focus item.outputRoutingFocus.modItem.name=Output Routing Focus (ModItem) item.outputRoutingFocus.ignMeta.name=Output Routing Focus (Ignore Meta) diff --git a/src/main/resources/assets/alchemicalwizardry/textures/blocks/GlyphEnchantability.png b/src/main/resources/assets/alchemicalwizardry/textures/blocks/GlyphEnchantability.png new file mode 100644 index 0000000000000000000000000000000000000000..9b7a925cfd7ba69e6818d452260a572accf3f043 GIT binary patch literal 667 zcmV;M0%ZM(P)%YEF}JlQ%o|MGiOGg zJh~t%?gWu)1JHRu-R@DF@_Lg3~6&YHZ%maulF@*h#G>5>dg5TfH*zbDs5PNd{{|Uc}iv~ zbc(1bwcK9L?nhoG=1bS#iy#7sjhGjof!@d_#(Hx(r<#Dni)$-QpzT6>N+1yds7keQ zuV!|*hy;~v4iN&w&r7AHp;bnkS$GE^0uYt3_@ew<<=O}|dJjYcL8FDvN|D)cI#HD} zvP74o4@>G2;SNu*rht%4t9y5n*QM1CPF;Qrgb2W_migx?)!89H3_>cw*6gdCT`~$D zgOMdVopcABqGHb9+g%YfJ1+r*fSe%$;ACkL)gaaGT>=hfx-qK=zArhww7ORXB5SM_dd_eFuLrfUGRyjiJ}t( zhZKp#5EruXLo{s{jWiOeFvwUC8vlF^_AK2JHKK7+eR<#ax%YN4bkVas$vHXs<;dpR z52E581Wju|Cu`jp0Q9=4Ka=@S$0ujGZtT*f?z^+EnpH*I0V}PQVrG#PO{z&n_;6NF zD%3nqKYZ==JJ!adt9wmds;Z=%QqunAo+kZ$?yr$*gsfF^bGr-SFM$Hv^a1Z`7K{cdl@B626^PA;tj3W!L+%8P|!cJJU8fJivMUfKQm z$L)Y$u8w}Y_N=Z$gbaie5swFBkj?phAgP+i^3K59*jYVV-nv2H0wfu&&%U43Uq08R zEl-Ds%g+WmC)H%(-jvPZ3yT1jpWGB>Qj!AUkrEN%5H4o&Xs}oP(>z%^T-_Z2ceZYh zRt{8&AOj+*N!+mrE4De@PY~ftTXS_l1aNn}s7c`>AYtU3GBR5Edv$w|yGplne%|)` z$<2HHBuEe!lsp1rdtrZRXV6p8#QC?js@j~js_gFWd<2i@#}QmmYR;RD8{@@4=TI%J zZQtIv;x1t&0u(gqy@T7+|H){5_W0!ESK%XBF2MGWG002ovPDHLkV1l-sMD+jw literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/alchemicalwizardry/textures/blocks/GlyphStability1.png b/src/main/resources/assets/alchemicalwizardry/textures/blocks/GlyphStability1.png new file mode 100644 index 0000000000000000000000000000000000000000..4d3a8245551422ec5bfbbc4031c148c7db79f2fb GIT binary patch literal 572 zcmV-C0>k}@P)pR=GHC5ISN?PkFx;avc~P2{GU&sAM-ft-MjV6 z Date: Sat, 11 Apr 2015 17:56:42 -0400 Subject: [PATCH 12/19] Added the final recipes required. Also added the Ritual Diviner that can place Dawn stones --- .../AlchemicalWizardry.java | 5 + .../common/AlchemicalWizardryEventHooks.java | 1 - .../common/items/ItemRitualDiviner.java | 18 +++- .../common/omega/OmegaParadigm.java | 4 +- .../rituals/RitualEffectOmegaStalling.java | 5 +- .../common/rituals/RitualEffectOmegaTest.java | 93 +++++++++++++++---- .../assets/alchemicalwizardry/lang/en_US.lang | 1 + 7 files changed, 96 insertions(+), 31 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 28f553dd..732e5d9e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -643,6 +643,8 @@ public class AlchemicalWizardry ItemStack simpleCatalystStack = new ItemStack(ModItems.simpleCatalyst); ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner); ((ItemRitualDiviner) duskRitualDivinerStack.getItem()).setMaxRuneDisplacement(duskRitualDivinerStack, 1); + ItemStack dawnRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner); + ((ItemRitualDiviner) dawnRitualDivinerStack.getItem()).setMaxRuneDisplacement(dawnRitualDivinerStack, 2); waterSigilStackCrafted.setItemDamage(waterSigilStackCrafted.getMaxDamage()); lavaSigilStackCrafted.setItemDamage(lavaSigilStackCrafted.getMaxDamage()); voidSigilStackCrafted.setItemDamage(voidSigilStackCrafted.getMaxDamage()); @@ -1076,6 +1078,8 @@ public class AlchemicalWizardry GameRegistry.addRecipe(new ItemStack(ModBlocks.blockEnchantmentGlyph, 1, 0), "1s1", "grg", "bob", 'o', transcendentBloodOrbStack, 'r', bloodRuneStack, 'g', etherealSlateStack, 'b', magicalesStack, '1', offensaStack, 's', lifeShardStack); GameRegistry.addRecipe(new ItemStack(ModBlocks.blockEnchantmentGlyph, 1, 1), "1s1", "grg", "bob", 'o', transcendentBloodOrbStack, 'r', bloodRuneStack, 'g', etherealSlateStack, 'b', magicalesStack, '1', virtusStack, 's', soulShardStack); + GameRegistry.addRecipe(dawnRitualDivinerStack, " d ", "srs", " d ", 'd', new ItemStack(ModItems.dawnScribeTool), 's', etherealSlateStack, 'r', duskRitualDivinerStack); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.flint, 2, 0), 1, new ItemStack[]{new ItemStack(Blocks.gravel), new ItemStack(Items.flint)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.grass), 2, new ItemStack[]{new ItemStack(Blocks.dirt), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.wheat_seeds), new ItemStack(Items.wheat_seeds)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.leather, 3, 0), 2, new ItemStack[]{new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), waterBucketStack, new ItemStack(Items.flint)}, 1); @@ -1342,6 +1346,7 @@ public class AlchemicalWizardry AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.alchemyFlask), new ItemStack(Items.glass_bottle), 2, 2000, 5, 5, false); AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.reinforcedSlate), new ItemStack(ModItems.blankSlate), 2, 2000, 5, 5, false); AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.bucketLife), new ItemStack(Items.bucket), 1, 1000, 5, 0, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.dawnScribeTool), new ItemStack(Blocks.glowstone), 6, 20000, 50, 35, false); } public static void initRituals() diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index a719a5d9..c66afeb2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -147,7 +147,6 @@ public class AlchemicalWizardryEventHooks APISpellHelper.setCurrentAdditionalHP((EntityPlayer)event.entityLiving, Math.max(0, hp)); - System.out.println("HP: " + hp); APISpellHelper.setCurrentAdditionalHP(player, Math.max(0, hp)); NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(Math.max(0, hp), APISpellHelper.getCurrentAdditionalMaxHP(player)), (EntityPlayerMP)player); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java index 3b00b926..9d074747 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java @@ -21,7 +21,6 @@ import org.lwjgl.input.Keyboard; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.items.interfaces.IRitualDiviner; import WayofTime.alchemicalWizardry.api.rituals.IRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; @@ -59,7 +58,11 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner if (this.getMaxRuneDisplacement(par1ItemStack) == 1) { par3List.add(StatCollector.translateToLocal("tooltip.ritualdiviner.canplace")); - } else + }else if (this.getMaxRuneDisplacement(par1ItemStack) >= 2) + { + par3List.add(StatCollector.translateToLocal("tooltip.ritualdiviner.canplacedawn")); + + }else { par3List.add(StatCollector.translateToLocal("tooltip.ritualdiviner.cannotplace")); } @@ -358,10 +361,15 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner @SideOnly(Side.CLIENT) public void getSubItems(Item id, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(ModItems.itemRitualDiviner)); - ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner); - ((ItemRitualDiviner) duskRitualDivinerStack.getItem()).setMaxRuneDisplacement(duskRitualDivinerStack, 1); + list.add(new ItemStack(id)); + + ItemStack duskRitualDivinerStack = new ItemStack(id); + this.setMaxRuneDisplacement(duskRitualDivinerStack, 1); list.add(duskRitualDivinerStack); + + ItemStack dawnRitualDivinerStack = new ItemStack(id); + this.setMaxRuneDisplacement(dawnRitualDivinerStack, 2); + list.add(dawnRitualDivinerStack); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java index 8e0fe922..40ad85d1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java @@ -48,9 +48,7 @@ public class OmegaParadigm ItemStack bootsStack = armours[0]; if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundPlate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots) - { - System.out.println("Enchantability: " + enchantability); - + { long worldSeed = player.worldObj.getSeed(); Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z - 1623451*enchantability + 2 * enchantmentLevel); ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, enchantability, enchantmentLevel, rand); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java index ff97dc0c..15abe3e3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java @@ -54,8 +54,9 @@ public class RitualEffectOmegaStalling extends RitualEffect OmegaParadigm parad = OmegaRegistry.getParadigmForReagent(reagent); if(parad != null) { + float costOffset = parad.getCostPerTickOfUse(player); parad.setOmegaStalling(player, 100); - SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + SoulNetworkHandler.syphonFromNetwork(owner, (int)(getCostPerRefresh() * Math.min(costOffset, 1))); } } } @@ -86,7 +87,7 @@ public class RitualEffectOmegaStalling extends RitualEffect this.addParallelRunes(omegaRitual, 4, 4, RitualComponent.WATER); this.addParallelRunes(omegaRitual, 3, 5, RitualComponent.BLANK); this.addParallelRunes(omegaRitual, 2, 5, RitualComponent.FIRE); - this.addParallelRunes(omegaRitual, 1, 5, RitualComponent.DUSK); + this.addParallelRunes(omegaRitual, 1, 5, RitualComponent.DAWN); this.addOffsetRunes(omegaRitual, 5, 3, 1, RitualComponent.WATER); this.addOffsetRunes(omegaRitual, 6, 3, 1, RitualComponent.DUSK); this.addOffsetRunes(omegaRitual, 6, 4, 1, RitualComponent.FIRE); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java index 6fe397c3..2fe3fd4f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.tileentity.TileEntity; @@ -30,7 +31,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class RitualEffectOmegaTest extends RitualEffect { - public static final boolean isTesting = true; + public static final boolean isTesting = false; public static final int drainTotal = 32 * 1000; @Override @@ -54,7 +55,12 @@ public class RitualEffectOmegaTest extends RitualEffect int enchantability = param.enchantability; int enchantmentLevel = param.enchantmentLevel; - System.out.println("Stability: " + stab + ", Enchantability: " + enchantability + ", Enchantment Level: " + enchantmentLevel); + if(stab <= 0) + { + return; + } + +// System.out.println("Stability: " + stab + ", Enchantability: " + enchantability + ", Enchantment Level: " + enchantmentLevel); double range = 0.5; @@ -144,6 +150,7 @@ public class RitualEffectOmegaTest extends RitualEffect { drainLeft -= drained.amount; world.markBlockForUpdate(x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord); + world.addWeatherEffect(new EntityLightningBolt(world, x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord)); } } } @@ -165,24 +172,70 @@ public class RitualEffectOmegaTest extends RitualEffect @Override public List getRitualComponentList() { - ArrayList animalGrowthRitual = new ArrayList(); - animalGrowthRitual.add(new RitualComponent(0, 0, 2, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(2, 0, 0, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(0, 0, -2, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(0, 0, 1, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(1, 0, 0, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(0, 0, -1, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(1, 0, 2, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(1, 0, -2, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.WATER)); - animalGrowthRitual.add(new RitualComponent(2, 0, 1, RitualComponent.AIR)); - animalGrowthRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR)); - animalGrowthRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR)); - animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); - return animalGrowthRitual; + ArrayList omegaRitual = new ArrayList(); + this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.DUSK); + this.addCornerRunes(omegaRitual, 2, 0, RitualComponent.DUSK); + this.addCornerRunes(omegaRitual, 3, 0, RitualComponent.BLANK); + this.addCornerRunes(omegaRitual, 4, 0, RitualComponent.DUSK); + this.addCornerRunes(omegaRitual, 5, 0, RitualComponent.BLANK); + this.addParallelRunes(omegaRitual, 1, 0, RitualComponent.DAWN); + this.addParallelRunes(omegaRitual, 2, 0, RitualComponent.BLANK); + this.addParallelRunes(omegaRitual, 4, 0, RitualComponent.BLANK); + this.addParallelRunes(omegaRitual, 5, 0, RitualComponent.DAWN); + this.addOffsetRunes(omegaRitual, 1, 3, 0, RitualComponent.DUSK); + this.addOffsetRunes(omegaRitual, 1, 5, 0, RitualComponent.DUSK); + + for(int i=2; i<=4; i++) + { + omegaRitual.add(new RitualComponent(-5, 0, i, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(-5, 0, -i, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(5, 0, i, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(5, 0, -i, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(i, 0, -5, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(-i, 0, -5, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(i, 0, 5, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(-i, 0, 5, RitualComponent.AIR)); + } + + for(int i=2; i<=3; i++) + { + omegaRitual.add(new RitualComponent(4, 0, i, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(4, 0, -i, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(-4, 0, i, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(-4, 0, -i, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(i, 0, 4, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(-i, 0, 4, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(i, 0, -4, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(-i, 0, -4, RitualComponent.AIR)); + } + + omegaRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(-4, 0, 1, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(-4, 0, -1, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(2, 0, 1, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(2, 0, -1, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(4, 0, 1, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(4, 0, -1, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(1, 0, 2, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(1, 0, 4, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(-1, 0, 4, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(1, 0, -2, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(1, 0, -4, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(-1, 0, -4, RitualComponent.WATER)); + + omegaRitual.add(new RitualComponent(-3, 0, 2, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(-3, 0, -2, RitualComponent.FIRE)); + omegaRitual.add(new RitualComponent(3, 0, 2, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(3, 0, -2, RitualComponent.WATER)); + omegaRitual.add(new RitualComponent(-2, 0, -3, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(2, 0, -3, RitualComponent.AIR)); + omegaRitual.add(new RitualComponent(-2, 0, 3, RitualComponent.EARTH)); + omegaRitual.add(new RitualComponent(2, 0, 3, RitualComponent.EARTH)); + + return omegaRitual; } public Int3 getJarLocation(int i) diff --git a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang index e365140f..0978790f 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang @@ -364,6 +364,7 @@ tooltip.ritualdiviner.airstones=Air Stones: tooltip.ritualdiviner.blankstones=Blank Stones: tooltip.ritualdiviner.cannotplace=Can not place Dusk runes tooltip.ritualdiviner.canplace=Can place Dusk runes +tooltip.ritualdiviner.canplacedawn=Can place Dusk and Dawn runes tooltip.ritualdiviner.desc=Used to explore new types of rituals tooltip.ritualdiviner.duskstones=Dusk Stones: tooltip.ritualdiviner.earthstones=Earth Stones: From 19d768bbfb0196cab8e007127764dc0429f5520f Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sat, 11 Apr 2015 18:08:30 -0400 Subject: [PATCH 13/19] Created 1.3.2Beta for testing --- build.properties | 6 +++--- .../WayofTime/alchemicalWizardry/AlchemicalWizardry.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.properties b/build.properties index 1a774896..9653268d 100644 --- a/build.properties +++ b/build.properties @@ -1,12 +1,12 @@ # -#Wed Mar 04 17:54:09 EST 2015 +#Sat Apr 11 18:01:40 EDT 2015 mod_name=BloodMagic forge_version=10.13.2.1232 ccc_version=1.0.4.29 nei_version=1.0.3.64 //=Dependency Information package_group=com.wayoftime.bloodmagic -mod_version=1.3.1 +mod_version=1.3.2Beta minetweaker_version=Dev-1.7.10-3.0.9B +build_number=2 mc_version=1.7.10 -build_number=8 diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 732e5d9e..1efb8141 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -1382,8 +1382,8 @@ public class AlchemicalWizardry Rituals.registerRitual("AW029VeilOfEvil", 1, 150000, new RitualEffectVeilOfEvil(), "Veil of Evil", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); Rituals.registerRitual("AW030FullStomach", 1, 100000, new RitualEffectFullStomach(), "Requiem of the Satiated Stomach", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); Rituals.registerRitual("AW031Convocation",isDemonRitualCreativeOnly ? 10 : 2, 15000000, new RitualEffectDemonPortal(), "Convocation of the Damned", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleDemon.png"), 220, 22, 22, 255, 0, 0.501, 0.501, 0, 5, false)); - Rituals.registerRitual("AW032", 1, 100, new RitualEffectOmegaTest(), "Symmetry of the Omega"); - Rituals.registerRitual("AW033", 2, 100, new RitualEffectOmegaStalling(), "Omega Stalling"); + Rituals.registerRitual("AW032Symmetry", 2, 15000000, new RitualEffectOmegaTest(), "Symmetry of the Omega"); + Rituals.registerRitual("AW033Stalling", 2, 15000000, new RitualEffectOmegaStalling(), "Omega Stalling"); // Rituals.registerRitual("AW034", 2, 100, new RitualEffectAlphaPact(), "Alpha Pact"); Rituals.registerRitual("AW035", 1, 10000, new RitualEffectItemRouting(), "Orchestra of the Phantom Hands"); //Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); From efa5d89539f0eab41228975b9f4b9ccf17dde583 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sun, 12 Apr 2015 10:59:41 -0400 Subject: [PATCH 14/19] Added several environmental-based abilities to the Wind and Fire armours. Tweaked the base armour penetration protection on the Omega armour to be a bit more balanced. Made the extra HP bar more fancy! :) --- .../common/AlchemicalWizardryEventHooks.java | 11 +++ .../common/items/armour/BoundArmour.java | 19 +++- .../common/items/armour/OmegaArmour.java | 68 ++++++++++---- .../common/items/armour/OmegaArmourFire.java | 83 ++++++++++++++---- .../common/items/armour/OmegaArmourWind.java | 13 ++- .../common/omega/OmegaParadigmFire.java | 29 +++++- .../common/omega/OmegaParadigmWind.java | 11 ++- .../textures/gui/HPBar1.png | Bin 513 -> 737 bytes 8 files changed, 192 insertions(+), 42 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index c66afeb2..9361c7e2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -67,6 +68,8 @@ public class AlchemicalWizardryEventHooks public static Map> respawnMap = new HashMap(); public static Map> forceSpawnMap = new HashMap(); + + public static Random rand = new Random(); @SubscribeEvent public void onEntityInteractEvent(EntityInteractEvent event) @@ -149,6 +152,14 @@ public class AlchemicalWizardryEventHooks APISpellHelper.setCurrentAdditionalHP(player, Math.max(0, hp)); NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(Math.max(0, hp), APISpellHelper.getCurrentAdditionalMaxHP(player)), (EntityPlayerMP)player); + + if(event.ammount <= 0.3) + { + if(rand.nextInt(10) == 0) + { + event.ammount++; + } + } } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java index ff3adbec..7b0ec6b0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java @@ -168,6 +168,21 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA return false; } + public boolean isAffectedBySoulHarden() + { + return true; + } + + public double getBaseArmourReduction() + { + return 0.9; + } + + public double getArmourPenetrationReduction() + { + return 0.9; + } + @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { @@ -188,7 +203,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA h = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulHarden).getAmplifier() + 1; } - armourReduction = 1 - 0.1 * Math.pow(1.0/3.0, Math.max(0, h - f)) - 0.1 * Math.max(0, f-h); + armourReduction = isAffectedBySoulHarden() ? 1 - (1 - this.getBaseArmourReduction()) * Math.pow(1.0/3.0, Math.max(0, h - f)) - 0.1 * Math.max(0, f-h) : getBaseArmourReduction(); damageAmount *= (armourReduction); @@ -224,7 +239,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA { if (source.isUnblockable()) { - return new ArmorProperties(-1, damageAmount * 0.9d, maxAbsorption); + return new ArmorProperties(-1, damageAmount * getArmourPenetrationReduction(), maxAbsorption); } return new ArmorProperties(-1, damageAmount, maxAbsorption); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java index ca6020ee..ca77e14b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -38,6 +39,8 @@ public abstract class OmegaArmour extends BoundArmour protected boolean storeYLevel = false; protected boolean storeSeesSky = false; + protected List illegalEnchantmentList = new LinkedList(); + public float reagentDrainPerDamage = 0.1f; public OmegaArmour(int armorType) @@ -60,31 +63,52 @@ public abstract class OmegaArmour extends BoundArmour this.reagent = reagent; } + @Override + public boolean isAffectedBySoulHarden() + { + return false; + } + + @Override + public double getBaseArmourReduction() + { + return 0.9; + } + + @Override + public double getArmourPenetrationReduction() + { + return 0.5; + } + @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { super.onArmorTick(world, player, itemStack); - if(this.storeBiomeID()) + if(world.getWorldTime() % 50 == 0) { - int xCoord = (int) Math.floor(player.posX); - int zCoord = (int) Math.floor(player.posZ); - - BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); - if(biome != null) + if(this.storeBiomeID()) { - this.setBiomeIDStored(itemStack, biome.biomeID); + int xCoord = (int) Math.floor(player.posX); + int zCoord = (int) Math.floor(player.posZ); + + BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); + if(biome != null) + { + this.setBiomeIDStored(itemStack, biome.biomeID); + } + } + + if(this.storeDimensionID()) + { + this.setDimensionIDStored(itemStack, world.provider.dimensionId); + } + + if(this.storeYLevel()) + { + this.setYLevelStored(itemStack, (int) Math.floor(player.posY)); } - } - - if(this.storeDimensionID()) - { - this.setDimensionIDStored(itemStack, world.provider.dimensionId); - } - - if(this.storeYLevel()) - { - this.setYLevelStored(itemStack, (int) Math.floor(player.posY)); } if(this.armorType == 1) @@ -172,9 +196,17 @@ public abstract class OmegaArmour extends BoundArmour } } + for(Enchantment ench : this.illegalEnchantmentList) + { + if(map.containsKey(ench)) + { + map.remove(ench); + } + } + List newEnchantList = new ArrayList(); - for(Entry> entry : map.entrySet()) //Assume enchant # 0 is level 1 enchant + for(Entry> entry : map.entrySet()) { Enchantment ench = entry.getKey(); Map numMap = entry.getValue(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java index 644ca704..0d060d57 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java @@ -1,10 +1,19 @@ package WayofTime.alchemicalWizardry.common.items.armour; +import java.util.UUID; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import net.minecraft.world.biome.BiomeGenBase; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire; import cpw.mods.fml.relauncher.Side; @@ -20,7 +29,8 @@ public class OmegaArmourFire extends OmegaArmour public OmegaArmourFire(int armorType) { super(armorType); -// this.storeYLevel = true; + this.storeBiomeID = true; + this.illegalEnchantmentList.add(Enchantment.fireProtection); } @Override @@ -81,17 +91,21 @@ public class OmegaArmourFire extends OmegaArmour return this.itemIcon; } -// @Override -// public Multimap getAttributeModifiers(ItemStack stack) -// { -// Multimap map = HashMultimap.create(); -// -//// map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212 /** Random number **/, armorType), "Armor modifier" + armorType, getDefaultHealthBoost()*getHealthBoostModifierForLevel(yLevel), 0)); -// -// return map; -// } + @Override + public Multimap getAttributeModifiers(ItemStack stack) + { + Multimap map = HashMultimap.create(); + int biomeID = this.getBiomeIDStored(stack); + BiomeGenBase biome = BiomeGenBase.getBiome(biomeID); + if(biome != null) + { + map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForBiome(biome), 1)); + map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(196312 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForBiome(biome), 1)); + } + return map; + } - public float getDefaultHealthBoost() + public float getDefaultArmourBoost() { switch(this.armorType) { @@ -107,8 +121,47 @@ public class OmegaArmourFire extends OmegaArmour return 0.25f; } -// public float getHealthBoostModifierForLevel(int yLevel) -// { -// return (float)Math.sqrt(((float)yLevel)/64f) * 1.5f - 1; -// } + public float getHealthBoostModifierForBiome(BiomeGenBase biome) + { + float modifier = 0.05f; + + if(biome.isEqualTo(BiomeGenBase.hell)) + { + return modifier * 2.0f; + } + + if(biome.isEqualTo(BiomeGenBase.ocean)) + { + return modifier * -0.5f; + } + + if(biome.temperature >= 1) + { + return modifier * 1.5f; + } + + return modifier * 0.5f; + } + + public float getDamageModifierForBiome(BiomeGenBase biome) + { + float modifier = 0.03f; + + if(biome.isEqualTo(BiomeGenBase.hell)) + { + return modifier * 2.0f; + } + + if(biome.isEqualTo(BiomeGenBase.ocean)) + { + return modifier * -0.5f; + } + + if(biome.temperature >= 1) + { + return modifier * 1.5f; + } + + return modifier * 0.5f; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java index ad504314..40f090de 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java @@ -94,13 +94,13 @@ public class OmegaArmourWind extends OmegaArmour { Multimap map = HashMultimap.create(); int yLevel = this.getYLevelStored(stack); - - map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212 /** Random number **/, armorType), "Armor modifier" + armorType, getDefaultHealthBoost()*getHealthBoostModifierForLevel(yLevel), 0)); + map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForLevel(yLevel), 1)); + map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(86212 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForLevel(yLevel), 2)); return map; } - public float getDefaultHealthBoost() + public float getDefaultArmourBoost() { switch(this.armorType) { @@ -118,6 +118,11 @@ public class OmegaArmourWind extends OmegaArmour public float getHealthBoostModifierForLevel(int yLevel) { - return (float)Math.sqrt(((float)yLevel)/64f) * 1.5f - 1; + return 0.05f * ((((float)yLevel)/64f) * 1.5f - 1); + } + + public float getDamageModifierForLevel(int yLevel) + { + return 0.02f * ((((float)yLevel)/64f) * 1.5f - 1); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java index b1efe91d..70477d72 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java @@ -1,8 +1,11 @@ package WayofTime.alchemicalWizardry.common.omega; +import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; @@ -23,7 +26,31 @@ public class OmegaParadigmFire extends OmegaParadigm @Override public void onUpdate(World world, EntityPlayer player, ItemStack stack) { - + if(world.getWorldTime() % 100 == 0 && !world.isRemote) + { + boolean isInLava = player.isInsideOfMaterial(Material.lava); + if(player.isBurning() && player.getHealth() < player.getMaxHealth()) + { + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, isInLava ? 1 : 0, true)); + } + + if(player.isBurning()) + { + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, isInLava ? 400 : 200, isInLava ? 1 : 0, true)); + } + + if(player.isInWater()) + { + player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200, 2, true)); + player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2, true)); + player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 1, true)); + } + } + + if(player.isBurning()) + { + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 200, 0, true)); + } } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java index f994b549..1276863c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java @@ -3,6 +3,8 @@ package WayofTime.alchemicalWizardry.common.omega; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; @@ -11,7 +13,7 @@ public class OmegaParadigmWind extends OmegaParadigm { public OmegaParadigmWind(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots) { - super(ReagentRegistry.aetherReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 10, 100)); + super(ReagentRegistry.aetherReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 1, 10)); } @Override @@ -29,7 +31,12 @@ public class OmegaParadigmWind extends OmegaParadigm @Override public void onUpdate(World world, EntityPlayer player, ItemStack stack) { - + if(world.getWorldTime() % 100 == 0 && !world.isRemote && player.posY > 128 && player.getHealth() < player.getMaxHealth()) + { + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, player.posY > 128 + 64 ? 1 : 0, true)); + } + + player.fallDistance = 0; } @Override diff --git a/src/main/resources/assets/alchemicalwizardry/textures/gui/HPBar1.png b/src/main/resources/assets/alchemicalwizardry/textures/gui/HPBar1.png index ac9881c1de85b2bf825eb8c75605071c1e0abe21..e26194011dc65e4f7d7f53fe39ceaff0ca5e8d30 100644 GIT binary patch delta 667 zcmV;M0%ZMx1mOjcDlrrQ4FHcB{D7Aq&l?6O;tTPuG8MM*?KR9M69md|SwQ4q&JlW4oXYNb+)AjN|xbC5>rp#`DG z+KX5JnjZEa@UIX&s$kZhTJ&Z@>jqq*M+;&>{D~oIldp&DE}QMvCLs2*0}qxr^JYHt z-kW)Ak~mGNaLQ5wlmI2bsRNvu#CY2bfXkpmpcXj*KGeGmfUkdG0IL%;H_Lazj#)Z! zQ?h*U8t4G*M&!g&tZc*Ede;C^0I_4HLHxax@i}q??ZD`msTMhE&QXip2uvcsflHu+ zdKcQm;CuBhaquIuYo@D_W5GEVB1hXy?Z8HNpePW)uO_y1S4Vc|6PO;tln2x2V0I4P zFOx#7X0mJt2J3&LZ~}hBb{58qp7{QW=XGymgT%Ji>*0Cci2hEje>sM)+p#SnND`9p zeLwxqj$}Rr7xLU2!@AuP-)tcZEnk072^cgtJ74v+q3}43$UZ0WFJOJZ0}bw@YuBA-XPovH zQ4-t(OS)es!2UW~i5x4=u^c(3y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2j2k-6f_fA+H?z%TPuG7Wl2OqR9M69md{GVKoEz&O)8WYQ4zt57f;Elmp+5gK9tCU zK8hfC5X3Eb@y|su1usf_^cn1-5lp6snAX-LCiT#RyRb0q%>MFiW@lI>BCK*ataw-e z3t#~(zz=|aPnB+sg9jyVFXiL2v{l-QQ>WL3p-G(Wj;K7bn^S)!8#_>M!1^}qdHJzL z+O;$w8YGUPfzg7_0^Zto$%3TeV7=5 zK|}-*L2Es=zt6n&z#vaoNZI(s^}rx=097}SK*aN8QKPI*CO}z%z#y+A5P?Ce{ynX= zOaYeJoI?CHg-d;3!Z?oUwvT9T!o}S&Q4}q836+S Date: Mon, 13 Apr 2015 13:10:10 -0400 Subject: [PATCH 15/19] Added WoS reagent use, general touch ups. --- build.properties | 4 +- .../AlchemicalWizardry.java | 4 ++ .../common/AlchemicalWizardryEventHooks.java | 22 ++++++- .../common/items/armour/OmegaArmourEarth.java | 35 ++++++++++- .../common/items/armour/OmegaArmourWater.java | 38 +++++++++--- .../common/omega/OmegaParadigm.java | 2 +- .../common/omega/OmegaParadigmEarth.java | 60 ++++++++++++++++--- .../common/omega/OmegaParadigmFire.java | 6 +- .../common/omega/OmegaParadigmWater.java | 10 +++- .../rituals/RitualEffectWellOfSuffering.java | 8 ++- .../spell/complex/effect/SpellHelper.java | 4 +- 11 files changed, 166 insertions(+), 27 deletions(-) diff --git a/build.properties b/build.properties index 9653268d..d3454967 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ # -#Sat Apr 11 18:01:40 EDT 2015 +#Sun Apr 12 20:13:33 EDT 2015 mod_name=BloodMagic forge_version=10.13.2.1232 ccc_version=1.0.4.29 @@ -8,5 +8,5 @@ nei_version=1.0.3.64 package_group=com.wayoftime.bloodmagic mod_version=1.3.2Beta minetweaker_version=Dev-1.7.10-3.0.9B -build_number=2 mc_version=1.7.10 +build_number=3 diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 1efb8141..1bd352b4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -1095,7 +1095,11 @@ public class AlchemicalWizardry AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.mycelium, 1, 0), 5, new ItemStack[]{new ItemStack(Blocks.grass), new ItemStack(Blocks.brown_mushroom), new ItemStack(Blocks.red_mushroom)}, 2); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.ice), 2, new ItemStack[]{waterBucketStack, new ItemStack(Items.snowball)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.potionitem, 1, 0), 1, new ItemStack[]{new ItemStack(Items.glass_bottle), new ItemStack(Blocks.cactus)}, 1); + AlchemyRecipeRegistry.registerRecipe(waterBucketStack, 1, new ItemStack[]{emptyBucketStack, new ItemStack(Blocks.cactus)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.glass_bottle, 3), 1, new ItemStack[]{glassStack, glassStack, glassStack}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.ghast_tear, 2), 100, new ItemStack[]{ghastTearStack, concentratedCatalystStack, weakBloodShardStack, new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.soul_sand)}, 5); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.coal, 5), 1, new ItemStack[]{new ItemStack(Items.coal, 1, 1), new ItemStack(Items.coal, 1, 1), new ItemStack(Items.coal, 1, 1), new ItemStack(Items.coal, 1, 1), new ItemStack(Items.coal, 1, 1)}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.clay_ball, 4), 5, new ItemStack[]{new ItemStack(Blocks.sand), waterBucketStack}, 2); } @EventHandler diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index 9361c7e2..fcd4cf20 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -105,8 +105,13 @@ public class AlchemicalWizardryEventHooks @SubscribeEvent(priority=EventPriority.HIGHEST) public void onLivingHurtEvent(LivingHurtEvent event) { + System.out.println("IsRemote: " + event.entity.worldObj.isRemote); if(!event.isCanceled() && event.entityLiving instanceof EntityPlayer && !event.entityLiving.worldObj.isRemote) { + if(event.entityLiving.getHealth() > event.entityLiving.getMaxHealth()) + { + event.entityLiving.setHealth(event.entityLiving.getMaxHealth()); + } EntityPlayer player = (EntityPlayer)event.entityLiving; float prevHp = APISpellHelper.getCurrentAdditionalHP((EntityPlayer)event.entityLiving); @@ -155,7 +160,7 @@ public class AlchemicalWizardryEventHooks if(event.ammount <= 0.3) { - if(rand.nextInt(10) == 0) +// if(rand.nextInt(10) == 0) { event.ammount++; } @@ -216,6 +221,13 @@ public class AlchemicalWizardryEventHooks } } } + }else + { + reagentAmount = 0; + APISpellHelper.setPlayerMaxReagentAmount(player, 0); + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(null, 0, 0), (EntityPlayerMP)player); + APISpellHelper.setCurrentAdditionalHP(player, 0); + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(0, 0), (EntityPlayerMP)player); } //Consumes the amount float costPerTick = parad.getCostPerTickOfUse(player); @@ -238,14 +250,22 @@ public class AlchemicalWizardryEventHooks if(reagentAmount <= 0) { + boolean hasRevertedArmour = false; ItemStack[] armourInventory = player.inventory.armorInventory; for(ItemStack stack : armourInventory) { if(stack != null && stack.getItem() instanceof OmegaArmour) { ((OmegaArmour)stack.getItem()).revertArmour(player, stack); + hasRevertedArmour = true; } } + + if(hasRevertedArmour) + { + APISpellHelper.setCurrentAdditionalHP(player, 0); + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(0, 0), (EntityPlayerMP)player); + } } if(player instanceof EntityPlayerMP) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java index d858ca18..c3723384 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java @@ -28,6 +28,7 @@ public class OmegaArmourEarth extends OmegaArmour public OmegaArmourEarth(int armorType) { super(armorType); + this.storeYLevel = true; } @Override @@ -89,10 +90,14 @@ public class OmegaArmourEarth extends OmegaArmour } @Override - public Multimap getItemAttributeModifiers() + public Multimap getAttributeModifiers(ItemStack stack) { Multimap map = HashMultimap.create(); - map.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(179618 /** Random number **/, armorType), "Armor modifier" + armorType, getKnockbackResist(), 0)); + int yLevel = this.getYLevelStored(stack); + map.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(179618 /** Random number **/, armorType), "Knockback modifier" + armorType, getKnockbackResist(), 0)); + map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(80532 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForLevel(yLevel), 1)); + map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85112 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForLevel(yLevel), 2)); + return map; } @@ -100,4 +105,30 @@ public class OmegaArmourEarth extends OmegaArmour { return 0.25f; } + + public float getDefaultArmourBoost() + { + switch(this.armorType) + { + case 0: + return 2.5f; + case 1: + return 4; + case 2: + return 3.5f; + case 3: + return 2; + } + return 0.25f; + } + + public float getHealthBoostModifierForLevel(int yLevel) + { + return (float) (0.05 * Math.max(-0.5, -((float)yLevel)/64f * 1.5f + 5.5f)); + } + + public float getDamageModifierForLevel(int yLevel) + { + return 0.02f * ((((float)yLevel)/64f) * 1.5f - 1); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java index 1532cf70..11e0e127 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java @@ -97,12 +97,13 @@ public class OmegaArmourWater extends OmegaArmour BiomeGenBase biome = BiomeGenBase.getBiome(biomeID); if(biome != null) { - map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85312 /** Random number **/, armorType), "Armor modifier" + armorType, getDefaultHealthBoost()*getHealthBoostModifierForBiome(biome), 0)); + map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85312 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForBiome(biome), 2)); + map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85432 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForBiome(biome), 2)); } return map; } - public float getDefaultHealthBoost() + public float getDefaultArmourBoost() { switch(this.armorType) { @@ -120,21 +121,44 @@ public class OmegaArmourWater extends OmegaArmour public float getHealthBoostModifierForBiome(BiomeGenBase biome) { + float modifier = 0.05f; if(biome.isEqualTo(BiomeGenBase.hell)) { - return -0.5f; + return modifier * -0.5f; } - if(biome.isEqualTo(BiomeGenBase.ocean)) + if(biome.isEqualTo(BiomeGenBase.ocean) || biome.isEqualTo(BiomeGenBase.river)) { - return 2.0f; + return modifier * 2.0f; } if(biome.isHighHumidity()) { - return 1.5f; + return modifier * 1.5f; } - return 0.5f; + return modifier * 0.5f; + } + + public float getDamageModifierForBiome(BiomeGenBase biome) + { + float modifier = 0.03f; + + if(biome.isEqualTo(BiomeGenBase.hell)) + { + return modifier * -0.5f; + } + + if(biome.isEqualTo(BiomeGenBase.ocean) || biome.isEqualTo(BiomeGenBase.river)) + { + return modifier * 2.0f; + } + + if(biome.isHighHumidity()) + { + return modifier * 1.5f; + } + + return modifier * 0.5f; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java index 40ad85d1..d90b989f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java @@ -74,7 +74,7 @@ public class OmegaParadigm public int getMaxAdditionalHealth() { - return 50; + return 20; } public boolean setOmegaStalling(EntityPlayer player, int duration) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java index e722bd91..794271f8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java @@ -1,5 +1,13 @@ package WayofTime.alchemicalWizardry.common.omega; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; @@ -7,18 +15,52 @@ public class OmegaParadigmEarth extends OmegaParadigm { public OmegaParadigmEarth(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots) { - super(ReagentRegistry.terraeReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 10, 100)); + super(ReagentRegistry.terraeReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 1, 10)); } -// @Override -// public float getCostPerTickOfUse(EntityPlayer player) -// { -// if(player.isInWater()) + @Override + public float getCostPerTickOfUse(EntityPlayer player) + { +// if(player.isBurning()) // { // return 0.5f; -// }else -// { -// return 1; // } -// } + return 1; + } + + @Override + public void onUpdate(World world, EntityPlayer player, ItemStack stack) + { + if(world.getWorldTime() % 100 == 0 && !world.isRemote) + { + if(player.posY < 50 && player.getHealth() < player.getMaxHealth()) + { + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true)); + } + +// if(player.isInWater()) +// { +// player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200, 2, true)); +// player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2, true)); +// player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 1, true)); +// } + } + + if(player.posY > 100) + { + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, 200, 0, true)); + } + } + + @Override + public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z) + { + return true; + } + + @Override + public void onOmegaKeyPressed(EntityPlayer player, ItemStack stack) + { + + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java index 70477d72..4802841f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java @@ -14,12 +14,16 @@ public class OmegaParadigmFire extends OmegaParadigm { public OmegaParadigmFire(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots) { - super(ReagentRegistry.incendiumReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 10, 100)); + super(ReagentRegistry.incendiumReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 1, 10)); } @Override public float getCostPerTickOfUse(EntityPlayer player) { + if(player.isBurning()) + { + return 0.5f; + } return 1; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java index 60e0a26c..941f82cd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java @@ -17,7 +17,7 @@ public class OmegaParadigmWater extends OmegaParadigm { public OmegaParadigmWater(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots) { - super(ReagentRegistry.aquasalusReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 10, 100)); + super(ReagentRegistry.aquasalusReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 1, 10)); } @Override @@ -37,6 +37,14 @@ public class OmegaParadigmWater extends OmegaParadigm { player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 3, 0, true)); player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionAmphibian.id, 3, 0, true)); + + if(world.getWorldTime() % 100 == 0 && !world.isRemote) + { + if(player.isInWater() && player.getHealth() < player.getMaxHealth()) + { + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true)); + } + } } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java index e2176079..b6fe5c99 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java @@ -1,6 +1,7 @@ package WayofTime.alchemicalWizardry.common.rituals; import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; @@ -19,6 +20,8 @@ public class RitualEffectWellOfSuffering extends RitualEffect { public static final int timeDelay = 25; public static final int amount = 10; + + private static final int tennebraeDrain = 5; @Override public void performEffect(IMasterRitualStone ritualStone) @@ -65,6 +68,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); int entityCount = 0; + boolean hasTennebrae = this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tennebraeDrain, false); if (currentEssence < this.getCostPerRefresh() * list.size()) { @@ -80,8 +84,10 @@ public class RitualEffectWellOfSuffering extends RitualEffect if (livingEntity.attackEntityFrom(DamageSource.outOfWorld, 1)) { + hasTennebrae = hasTennebrae && this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tennebraeDrain, true); + entityCount++; - tileAltar.sacrificialDaggerCall(this.amount, true); + tileAltar.sacrificialDaggerCall(this.amount * (hasTennebrae ? 2 : 1), true); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java index 45db03ff..0b4afd33 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java @@ -547,13 +547,13 @@ public class SpellHelper int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal()); for(int in : array) { - canBeInserted[in] = ((ISidedInventory)inventory).canInsertItem(in, stack, dir.ordinal()); + canBeInserted[in] = inventory.isItemValidForSlot(in, stack) && ((ISidedInventory)inventory).canInsertItem(in, stack, dir.ordinal()); } }else { for(int i=0; i Date: Thu, 16 Apr 2015 09:02:19 -0400 Subject: [PATCH 16/19] Added an auto-crafting ritual Fixed Blood Light sigil glitches Fixed some issues with the Reagent HP bar not draining correctly - what was I thinking?!? --- build.properties | 4 +- .../AlchemicalWizardry.java | 7 +- .../api/spell/APISpellHelper.java | 17 + .../common/AlchemicalWizardryEventHooks.java | 101 ++++-- .../common/block/BlockEnchantmentGlyph.java | 6 + .../common/items/armour/OmegaArmour.java | 2 + .../common/items/armour/OmegaArmourEarth.java | 4 +- .../items/sigil/ItemBloodLightSigil.java | 3 +- .../common/omega/OmegaParadigm.java | 2 +- .../common/omega/OmegaParadigmEarth.java | 7 - .../common/rituals/RitualEffectCrafting.java | 309 ++++++++++++++++++ .../common/rituals/RitualEffectSoulBound.java | 6 +- .../spell/complex/effect/SpellHelper.java | 90 ++++- 13 files changed, 503 insertions(+), 55 deletions(-) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java diff --git a/build.properties b/build.properties index d3454967..478beec6 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ # -#Sun Apr 12 20:13:33 EDT 2015 +#Wed Apr 15 20:03:49 EDT 2015 mod_name=BloodMagic forge_version=10.13.2.1232 ccc_version=1.0.4.29 @@ -9,4 +9,4 @@ package_group=com.wayoftime.bloodmagic mod_version=1.3.2Beta minetweaker_version=Dev-1.7.10-3.0.9B mc_version=1.7.10 -build_number=3 +build_number=9 diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 1bd352b4..031de44d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -139,6 +139,7 @@ import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAnimalGrowth; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAutoAlchemy; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectBiomeChanger; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectContainment; +import WayofTime.alchemicalWizardry.common.rituals.RitualEffectCrafting; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectCrushing; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectDemonPortal; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectEllipsoid; @@ -1387,8 +1388,10 @@ public class AlchemicalWizardry Rituals.registerRitual("AW030FullStomach", 1, 100000, new RitualEffectFullStomach(), "Requiem of the Satiated Stomach", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); Rituals.registerRitual("AW031Convocation",isDemonRitualCreativeOnly ? 10 : 2, 15000000, new RitualEffectDemonPortal(), "Convocation of the Damned", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleDemon.png"), 220, 22, 22, 255, 0, 0.501, 0.501, 0, 5, false)); Rituals.registerRitual("AW032Symmetry", 2, 15000000, new RitualEffectOmegaTest(), "Symmetry of the Omega"); - Rituals.registerRitual("AW033Stalling", 2, 15000000, new RitualEffectOmegaStalling(), "Omega Stalling"); -// Rituals.registerRitual("AW034", 2, 100, new RitualEffectAlphaPact(), "Alpha Pact"); + Rituals.registerRitual("AW033Stalling", 2, 15000000, new RitualEffectOmegaStalling(), "Duet of the Fused Souls"); + + Rituals.registerRitual("AW034", 2, 100, new RitualEffectCrafting(), "Ritual of Teh Crafts"); + Rituals.registerRitual("AW035", 1, 10000, new RitualEffectItemRouting(), "Orchestra of the Phantom Hands"); //Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java index bab2963e..19a324c9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java @@ -164,6 +164,23 @@ public class APISpellHelper data.setFloat("BM:MaxAddedHP", maxHP); } + public static int getPlayerReagentRegenCooldownTag(EntityPlayer player) + { + NBTTagCompound data = APISpellHelper.getPersistentDataTag(player); + if(data.hasKey("BM:ReagentRegenCooldown")) + { + return data.getInteger("BM:ReagentRegenCooldown"); + } + + return 0; + } + + public static void setPlayerReagentRegenCooldownTag(EntityPlayer player, int amount) + { + NBTTagCompound data = APISpellHelper.getPersistentDataTag(player); + data.setInteger("BM:ReagentRegenCooldown", amount); + } + public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range) { float f = 1.0F; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index fcd4cf20..d0108cae 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -105,21 +105,24 @@ public class AlchemicalWizardryEventHooks @SubscribeEvent(priority=EventPriority.HIGHEST) public void onLivingHurtEvent(LivingHurtEvent event) { - System.out.println("IsRemote: " + event.entity.worldObj.isRemote); if(!event.isCanceled() && event.entityLiving instanceof EntityPlayer && !event.entityLiving.worldObj.isRemote) { - if(event.entityLiving.getHealth() > event.entityLiving.getMaxHealth()) - { - event.entityLiving.setHealth(event.entityLiving.getMaxHealth()); - } EntityPlayer player = (EntityPlayer)event.entityLiving; + if(APISpellHelper.getCurrentAdditionalMaxHP(player) > 0) + { + APISpellHelper.setPlayerReagentRegenCooldownTag(player, 20 * 20); + } + float prevHp = APISpellHelper.getCurrentAdditionalHP((EntityPlayer)event.entityLiving); if(prevHp > 0) { + double originalDamage = event.ammount; + double initialReagentHp = prevHp; + float recalculatedAmount = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, event.source, event.ammount); if (recalculatedAmount <= 0) return; - recalculatedAmount = SpellHelper.applyPotionDamageCalculations(player, event.source, recalculatedAmount); + recalculatedAmount = SpellHelper.applyPotionDamageCalculations(player, event.source, recalculatedAmount); //Recalculated damage float ratio = recalculatedAmount / event.ammount; @@ -129,43 +132,43 @@ public class AlchemicalWizardryEventHooks if(prevHp > recalculatedAmount) { - float hp = (prevHp - recalculatedAmount); - - if(hp > 0) - { - event.ammount = 0; - }else - { - event.ammount -= hp / ratio; - Reagent reagent = APISpellHelper.getPlayerReagentType(player); - OmegaParadigm paradigm = OmegaRegistry.getParadigmForReagent(reagent); - if(paradigm != null) - { - ItemStack chestStack = player.inventory.armorInventory[2]; + float hp = (prevHp - recalculatedAmount); //New HP - this is obviously > 0... - if(chestStack != null && chestStack.getItem() instanceof OmegaArmour) +// event.setCanceled(true); + event.ammount = 0; + Reagent reagent = APISpellHelper.getPlayerReagentType(player); + OmegaParadigm paradigm = OmegaRegistry.getParadigmForReagent(reagent); + if(paradigm != null) + { + ItemStack chestStack = player.inventory.armorInventory[2]; + + if(chestStack != null && chestStack.getItem() instanceof OmegaArmour) + { + if(((OmegaArmour)chestStack.getItem()).paradigm == paradigm) { - if(((OmegaArmour)chestStack.getItem()).paradigm == paradigm) - { - paradigm.onHPBarDepleted(player, chestStack); - } + paradigm.onHPBarDepleted(player, chestStack); } } } - - APISpellHelper.setCurrentAdditionalHP((EntityPlayer)event.entityLiving, Math.max(0, hp)); - APISpellHelper.setCurrentAdditionalHP(player, Math.max(0, hp)); - NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(Math.max(0, hp), APISpellHelper.getCurrentAdditionalMaxHP(player)), (EntityPlayerMP)player); + APISpellHelper.setCurrentAdditionalHP(player, hp); + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(hp, APISpellHelper.getCurrentAdditionalMaxHP(player)), (EntityPlayerMP)player); - if(event.ammount <= 0.3) +// if(event.ammount <= 0.3) +// { +// event.ammount++; +// } + }else + { + APISpellHelper.setCurrentAdditionalHP(player, 0); + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(0, APISpellHelper.getCurrentAdditionalMaxHP(player)), (EntityPlayerMP)player); + + event.ammount -= prevHp / ratio; + if(event.ammount < 0) { -// if(rand.nextInt(10) == 0) - { - event.ammount++; - } + event.ammount = 0; } - } + } } } } @@ -183,12 +186,40 @@ public class AlchemicalWizardryEventHooks if(reagentAmount > 0 && OmegaRegistry.hasParadigm(reagent)) { + int cooldown = APISpellHelper.getPlayerReagentRegenCooldownTag(player); + if(cooldown > 0) + { + float extra = 0; + if(player.isPotionActive(AlchemicalWizardry.customPotionSoulHarden)) + { + extra += 0.25f * (1 + player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulHarden).getAmplifier()); + } + + if(player.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) + { + extra -= 0.25f * (1 + player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulFray).getAmplifier()); + } + + int deduction = - 1 - (extra >= 0 ? (rand.nextFloat() < extra ? 1 : 0) : (rand.nextFloat() < -extra/2 ? -1 : 0)); + + APISpellHelper.setPlayerReagentRegenCooldownTag(player, Math.max(cooldown + deduction, 0)); + return; + } OmegaParadigm parad = OmegaRegistry.getParadigmForReagent(reagent); ReagentRegenConfiguration config = parad.getRegenConfig(player); if(parad.isPlayerWearingFullSet(player)) { - if(event.entityLiving.worldObj.getWorldTime() % config.tickRate == 0) + int tickRate = config.tickRate; + + if(player.isPotionActive(Potion.regeneration)) + { + int i = player.getActivePotionEffect(Potion.regeneration).getAmplifier(); + double factor = Math.pow(1.5, i+1); + tickRate = Math.max((int)(tickRate / factor), 1); + } + + if(event.entityLiving.worldObj.getWorldTime() % tickRate == 0) { boolean hasHealthChanged = false; int maxHealth = parad.getMaxAdditionalHealth(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java index b408f01c..561b7a29 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java @@ -99,4 +99,10 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph par3List.add(new ItemStack(par1, 1, i)); } } + + @Override + public int damageDropped(int metadata) + { + return metadata; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java index ca77e14b..139387b4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java @@ -161,6 +161,8 @@ public abstract class OmegaArmour extends BoundArmour SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack)); this.setItemEnchantability(omegaStack, Math.min(enchantability, 70)); + EnchantmentHelper.setEnchantments(new HashMap(), omegaStack); + List enchantList = new ArrayList(); int adjustedEnchantLevel = Math.min(enchantmentLevel, 30); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java index c3723384..de5cc181 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java @@ -124,11 +124,11 @@ public class OmegaArmourEarth extends OmegaArmour public float getHealthBoostModifierForLevel(int yLevel) { - return (float) (0.05 * Math.max(-0.5, -((float)yLevel)/64f * 1.5f + 5.5f)); + return 0.05f * (yLevel <= 50 ? 1.5f : yLevel >= 100 ? -0.5f : 0.5f); } public float getDamageModifierForLevel(int yLevel) { - return 0.02f * ((((float)yLevel)/64f) * 1.5f - 1); + return 0.03f * (yLevel <= 50 ? 1.5f : yLevel >= 100 ? -0.5f : 0.5f); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java index 514f5a1e..af0f3754 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java @@ -49,7 +49,6 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - System.out.println("Being called"); if(!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer) || !EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed())) { return true; @@ -96,7 +95,7 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java index d90b989f..c60b30d2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java @@ -35,7 +35,7 @@ public class OmegaParadigm this.leggings.setReagent(reagent); this.boots.setReagent(reagent); - this.config = new ReagentRegenConfiguration(20, 10, 1); + this.config = new ReagentRegenConfiguration(100, 1, 10); } public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity, int enchantability, int enchantmentLevel) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java index 794271f8..65283945 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java @@ -37,13 +37,6 @@ public class OmegaParadigmEarth extends OmegaParadigm { player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true)); } - -// if(player.isInWater()) -// { -// player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200, 2, true)); -// player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2, true)); -// player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 1, true)); -// } } if(player.posY > 100) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java new file mode 100644 index 00000000..1e7a9fc2 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java @@ -0,0 +1,309 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.oredict.OreDictionary; +import WayofTime.alchemicalWizardry.api.Int3; +import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; +import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class RitualEffectCrafting extends RitualEffect +{ + public static final boolean isTesting = false; + public static final boolean limitToSingleStack = false; + public static final int potentiaDrain = 2; + + @Override + public void performEffect(IMasterRitualStone ritualStone) + { + String owner = ritualStone.getOwner(); + + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + + if(world.getWorldTime() % 1 != 0) + { + return; + } + + if (currentEssence < this.getCostPerRefresh()) + { + SoulNetworkHandler.causeNauseaToPlayer(owner); + } else + { + int slotDesignation = 0; + int direction = ritualStone.getDirection(); + + boolean canContinue = false; + + ItemStack[] recipe = new ItemStack[9]; + InventoryCrafting inventory = new InventoryCrafting(new Container() + { + public boolean canInteractWith(EntityPlayer player) + { + return false; + } + }, 3, 3); + + for(int i=-1; i<=1; i++) + { + for(int j=-1; j<=1; j++) + { + TileEntity inv = world.getTileEntity(x + j, y + 2, z + i); + if(inv instanceof IInventory) + { + int gridSpace = (i+1)*3 + (j+1); + if(((IInventory) inv).getSizeInventory() < slotDesignation || !((IInventory) inv).isItemValidForSlot(slotDesignation, ((IInventory) inv).getStackInSlot(slotDesignation))) + { + continue; + }else + { + ItemStack invStack = ((IInventory) inv).getStackInSlot(slotDesignation); + if(invStack != null) + { + inventory.setInventorySlotContents(gridSpace, invStack); + recipe[gridSpace] = invStack; + canContinue = true; + } + } + } + } + } + + if(!canContinue) + { + return; + } + + ItemStack returnStack = CraftingManager.getInstance().findMatchingRecipe(inventory, world); + + if (returnStack != null) + { + IInventory outputInv = null; + + List invList = new ArrayList(); + + TileEntity northEntity = world.getTileEntity(x, y-1, z - 2); + TileEntity southEntity = world.getTileEntity(x, y-1, z + 2); + TileEntity eastEntity = world.getTileEntity(x + 2, y-1, z); + TileEntity westEntity = world.getTileEntity(x - 2, y-1, z); + + if(southEntity instanceof IInventory) + { + outputInv = (IInventory)southEntity; + } + + if(northEntity instanceof IInventory) + { + invList.add((IInventory)northEntity); + } + + if (outputInv != null && (!limitToSingleStack ? SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN) : SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN, true, returnStack.getMaxStackSize()))) + { + Map> syphonMap = new HashMap(); //Inventory, Slot, how much claimed + + for(int n = 0; n < recipe.length; n++) //Look for the correct items + { + ItemStack recipeStack = recipe[n]; + if(recipeStack == null) + { + continue; + } + + boolean isItemTaken = false; + + for(int i = 0; i < invList.size(); i++) + { + if(isItemTaken) + { + break; + } + IInventory inputInv = invList.get(i); + if(inputInv == null) + { + continue; + } + + for(int j = 0; j < inputInv.getSizeInventory(); j++) + { + if(!inputInv.isItemValidForSlot(j, recipeStack)) + { + continue; + } + + ItemStack invItem = inputInv.getStackInSlot(j); + if(invItem == null) + { + continue; + } + + if(this.areItemsEqualForCrafting(recipeStack, invItem)) + { + System.out.println("Item is equal and valid"); + //TODO + inventory.setInventorySlotContents(n, invItem); + ItemStack returnedStack = CraftingManager.getInstance().findMatchingRecipe(inventory, world); + if(returnedStack == null || returnedStack.getItem() == null || returnedStack.getItem() != returnStack.getItem()) + { + continue; + } + Map slotMap = syphonMap.get(i); + if(slotMap == null) + { + slotMap = new HashMap(); + syphonMap.put(i, slotMap); + } + + if(slotMap.containsKey(j)) + { + int syphoned = slotMap.get(j); + if(invItem.stackSize - syphoned > 0) + { + slotMap.put(j, syphoned + 1); + isItemTaken = true; + break; + } + }else + { + slotMap.put(j, 1); + isItemTaken = true; + break; + } + } + } + } + + if(!isItemTaken) + { +// System.out.println("Item is not available!"); + return; + } + } + + /* The recipe is valid and the items have been found */ + + System.out.println("Valid!"); + + SpellHelper.insertStackIntoInventory(CraftingManager.getInstance().findMatchingRecipe(inventory, world), outputInv, ForgeDirection.DOWN); + + for(Entry> entry1 : syphonMap.entrySet()) + { + IInventory inputInv = invList.get(entry1.getKey()); + for(Entry entry2 : entry1.getValue().entrySet()) + { + ItemStack drainedStack = inputInv.getStackInSlot(entry2.getKey()); + Item item = drainedStack.getItem(); + if(item.hasContainerItem(drainedStack)) + { + inputInv.setInventorySlotContents(entry2.getKey(), item.getContainerItem(drainedStack)); + }else + { + drainedStack.stackSize -= entry2.getValue(); + if(drainedStack.stackSize <= 0) + { + inputInv.setInventorySlotContents(entry2.getKey(), null); + } + } + + } + } + + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); + + world.markBlockForUpdate(x, y-1, z + 2); + world.markBlockForUpdate(x, y-1, z - 2); + world.markBlockForUpdate(x + 2, y-1, z); + world.markBlockForUpdate(x - 2, y-1, z); + } + } + } + } + + @Override + public int getCostPerRefresh() + { + return 0; + } + + @Override + public List getRitualComponentList() + { + ArrayList autoCraftingRitual = new ArrayList(); + + this.addCornerRunes(autoCraftingRitual, 1, 1, RitualComponent.EARTH); + this.addParallelRunes(autoCraftingRitual, 1, 1, RitualComponent.EARTH); + autoCraftingRitual.add(new RitualComponent(0, 1, 0, RitualComponent.AIR)); + this.addOffsetRunes(autoCraftingRitual, 1, 2, -1, RitualComponent.FIRE); + this.addCornerRunes(autoCraftingRitual, 1, -1, RitualComponent.FIRE); + autoCraftingRitual.add(new RitualComponent(-1, -1, 0, RitualComponent.EARTH)); + autoCraftingRitual.add(new RitualComponent(1, -1, 0, RitualComponent.EARTH)); + autoCraftingRitual.add(new RitualComponent(0, -1, -1, RitualComponent.EARTH)); + autoCraftingRitual.add(new RitualComponent(0, -1, 0, RitualComponent.FIRE)); + autoCraftingRitual.add(new RitualComponent(0, -1, 1, RitualComponent.WATER)); + + return autoCraftingRitual; + } + + public boolean areItemsEqualForCrafting(ItemStack stack1, ItemStack stack2) + { + if (stack1 == null) + { + return false; + } + + if (stack2 == null) + { + return true; + } + + if (stack1.isItemStackDamageable() ^ stack2.isItemStackDamageable()) + { + return false; + } + + return stack1.getItem() == stack2.getItem() && (stack1.getItem().getHasSubtypes() ? stack1.getItemDamage() == stack2.getItemDamage() : true); + } + + public boolean areItemStacksEqualWithWildcard(ItemStack recipeStack, ItemStack comparedStack) + { + return recipeStack.isItemEqual(comparedStack) || (recipeStack.getItemDamage() == OreDictionary.WILDCARD_VALUE && recipeStack.getItem() == comparedStack.getItem()); + } + + public Int3 getSlotPositionForDirection(int slot, int direction) + { + int x = slot % 3 - 1; + int z = slot / 3 - 1; + switch(direction) + { + case 1: //NORTH-facing + return new Int3(x, 2, z); + case 2: //EAST-facing + return new Int3(-z, 2, x); + case 3: //SOUTH-facing + return new Int3(-x, 2, -z); + case 4: //WEST-facing + return new Int3(z, 2, -x); + } + return new Int3(0,0,0); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java index 820b9d69..2b407074 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java @@ -66,9 +66,13 @@ public class RitualEffectSoulBound extends RitualEffect if (BindingRegistry.isRequiredItemValid(itemStack)) { ritualStone.setVar1(BindingRegistry.getIndexForItem(itemStack) + 1); + itemStack.stackSize--; world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); ritualStone.setCooldown(ritualStone.getCooldown() - 1); - item.setDead(); + if(itemStack.stackSize <= 0) + { + item.setDead(); + } break; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java index 0b4afd33..cb221efb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java @@ -466,9 +466,7 @@ public class SpellHelper return false; } - boolean tagsEqual = ItemStack.areItemStackTagsEqual(stack1, stack2); - - return stack1.getItem() == stack2.getItem() && tagsEqual && stack1.getItemDamage() == stack2.getItemDamage(); + return stack1.getItem() == stack2.getItem() && stack1.getItemDamage() == stack2.getItemDamage() && ItemStack.areItemStackTagsEqual(stack1, stack2); } /** @@ -577,6 +575,92 @@ public class SpellHelper return stack; } + + public static boolean canInsertStackFullyIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir) + { + return canInsertStackFullyIntoInventory(stack, inventory, dir, false, 0); + } + + public static boolean canInsertStackFullyIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir, boolean fillToLimit, int limit) + { + if (stack == null) + { + return true; + } + + int itemsLeft = stack.stackSize; + + boolean[] canBeInserted = new boolean[inventory.getSizeInventory()]; + + if(inventory instanceof ISidedInventory) + { + int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal()); + for(int in : array) + { + canBeInserted[in] = inventory.isItemValidForSlot(in, stack) && ((ISidedInventory)inventory).canInsertItem(in, stack, dir.ordinal()); + } + }else + { + for(int i=0; i Date: Thu, 16 Apr 2015 17:02:47 +0200 Subject: [PATCH 17/19] Fix phantom bridge blocks being one block too high on the client Fixes #301 --- .../common/items/sigil/SigilOfTheBridge.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java index 9871a4ac..9240e032 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java @@ -257,6 +257,11 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade { verticalOffset--; } + + if (world.isRemote) + { + verticalOffset--; + } int posX = (int) Math.round(player.posX - 0.5f); int posY = (int) player.posY; From 02c25f0bb0428df735712fe6897aa768207b204e Mon Sep 17 00:00:00 2001 From: WayofTime Date: Thu, 16 Apr 2015 16:18:27 -0400 Subject: [PATCH 18/19] 1.3.2-1 --- build.properties | 6 +- .../AlchemicalWizardry.java | 2 +- .../common/AlchemicalWizardryEventHooks.java | 72 +++--- .../common/block/BlockOrientable.java | 114 --------- .../items/energy/ItemTankSegmenter.java | 2 +- .../common/rituals/RitualEffectCrafting.java | 219 ++++++++++++++---- .../rituals/RitualEffectWellOfSuffering.java | 21 +- 7 files changed, 240 insertions(+), 196 deletions(-) diff --git a/build.properties b/build.properties index 478beec6..2b172ecc 100644 --- a/build.properties +++ b/build.properties @@ -1,12 +1,12 @@ # -#Wed Apr 15 20:03:49 EDT 2015 +#Thu Apr 16 11:30:08 EDT 2015 mod_name=BloodMagic forge_version=10.13.2.1232 ccc_version=1.0.4.29 nei_version=1.0.3.64 //=Dependency Information package_group=com.wayoftime.bloodmagic -mod_version=1.3.2Beta +mod_version=1.3.2 minetweaker_version=Dev-1.7.10-3.0.9B +build_number=1 mc_version=1.7.10 -build_number=9 diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 031de44d..a98d16e2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -1390,7 +1390,7 @@ public class AlchemicalWizardry Rituals.registerRitual("AW032Symmetry", 2, 15000000, new RitualEffectOmegaTest(), "Symmetry of the Omega"); Rituals.registerRitual("AW033Stalling", 2, 15000000, new RitualEffectOmegaStalling(), "Duet of the Fused Souls"); - Rituals.registerRitual("AW034", 2, 100, new RitualEffectCrafting(), "Ritual of Teh Crafts"); + Rituals.registerRitual("AW034Crafting", 1, 15000, new RitualEffectCrafting(), "Rhythm of the Beating Anvil"); Rituals.registerRitual("AW035", 1, 10000, new RitualEffectItemRouting(), "Orchestra of the Phantom Hands"); //Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index d0108cae..3d809346 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -187,6 +187,7 @@ public class AlchemicalWizardryEventHooks if(reagentAmount > 0 && OmegaRegistry.hasParadigm(reagent)) { int cooldown = APISpellHelper.getPlayerReagentRegenCooldownTag(player); + boolean canHealHPBar = true; if(cooldown > 0) { float extra = 0; @@ -203,55 +204,60 @@ public class AlchemicalWizardryEventHooks int deduction = - 1 - (extra >= 0 ? (rand.nextFloat() < extra ? 1 : 0) : (rand.nextFloat() < -extra/2 ? -1 : 0)); APISpellHelper.setPlayerReagentRegenCooldownTag(player, Math.max(cooldown + deduction, 0)); - return; + canHealHPBar = false; } + OmegaParadigm parad = OmegaRegistry.getParadigmForReagent(reagent); ReagentRegenConfiguration config = parad.getRegenConfig(player); if(parad.isPlayerWearingFullSet(player)) { - int tickRate = config.tickRate; - - if(player.isPotionActive(Potion.regeneration)) + if(canHealHPBar) { - int i = player.getActivePotionEffect(Potion.regeneration).getAmplifier(); - double factor = Math.pow(1.5, i+1); - tickRate = Math.max((int)(tickRate / factor), 1); - } - - if(event.entityLiving.worldObj.getWorldTime() % tickRate == 0) - { - boolean hasHealthChanged = false; - int maxHealth = parad.getMaxAdditionalHealth(); + int tickRate = config.tickRate; - float health = APISpellHelper.getCurrentAdditionalHP(player); - - if(health > maxHealth) + if(player.isPotionActive(Potion.regeneration)) { - health = maxHealth; - hasHealthChanged = true; - }else if(health < maxHealth) - { - float addedAmount = Math.min(Math.min((reagentAmount / config.costPerPoint), config.healPerTick), maxHealth - health); - float drain = addedAmount * config.costPerPoint; - - reagentAmount -= drain; - hasReagentChanged = true; - - health += addedAmount; - - hasHealthChanged = true; + int i = player.getActivePotionEffect(Potion.regeneration).getAmplifier(); + double factor = Math.pow(1.5, i+1); + tickRate = Math.max((int)(tickRate / factor), 1); } - if(player instanceof EntityPlayerMP) + if(event.entityLiving.worldObj.getWorldTime() % tickRate == 0) { - if(hasHealthChanged) + boolean hasHealthChanged = false; + int maxHealth = parad.getMaxAdditionalHealth(); + + float health = APISpellHelper.getCurrentAdditionalHP(player); + + if(health > maxHealth) { - APISpellHelper.setCurrentAdditionalHP(player, health); - NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(health, maxHealth), (EntityPlayerMP)player); + health = maxHealth; + hasHealthChanged = true; + }else if(health < maxHealth) + { + float addedAmount = Math.min(Math.min((reagentAmount / config.costPerPoint), config.healPerTick), maxHealth - health); + float drain = addedAmount * config.costPerPoint; + + reagentAmount -= drain; + hasReagentChanged = true; + + health += addedAmount; + + hasHealthChanged = true; + } + + if(player instanceof EntityPlayerMP) + { + if(hasHealthChanged) + { + APISpellHelper.setCurrentAdditionalHP(player, health); + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(health, maxHealth), (EntityPlayerMP)player); + } } } } + }else { reagentAmount = 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java index 5350fa63..16ac3581 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java @@ -83,123 +83,9 @@ public class BlockOrientable extends BlockContainer return true; } - public int getTextureIndexForSideAndOrientation(int side, ForgeDirection input, ForgeDirection output) - { - if (ForgeDirection.getOrientation(side) == input) - { - return 0; - } - if (ForgeDirection.getOrientation(side) == output) - { - return 1; - } - if (ForgeDirection.getOrientation(side) == output.getOpposite()) - { - return 6; - } - - switch (side) - { - case 0: //BOTTOM - switch (output) - { - case NORTH: - return 2; //UP - case SOUTH: - return 3; //DOWN - case EAST: - return 4; //LEFT - case WEST: - return 5; //RIGHT - default: - break; - } - break; - case 1: //TOP - switch (output) - { - case NORTH: - return 2; //UP - case SOUTH: - return 3; //DOWN - case EAST: - return 5; - case WEST: - return 4; - default: - break; - } - break; - case 2: //NORTH - switch (output) - { - case DOWN: - return 3; - case UP: - return 2; - case EAST: - return 4; - case WEST: - return 5; - default: - break; - } - break; - case 3: //SOUTH - switch (output) - { - case DOWN: - return 3; - case UP: - return 2; - case EAST: - return 5; - case WEST: - return 4; - default: - break; - } - break; - case 4: //WEST - switch (output) - { - case DOWN: - return 3; - case UP: - return 2; - case NORTH: - return 5; - case SOUTH: - return 4; - default: - break; - } - break; - case 5: //EAST - switch (output) - { - case DOWN: - return 3; - case UP: - return 2; - case NORTH: - return 4; - case SOUTH: - return 5; - default: - break; - } - break; - } - - return 0; - } - @Override public int damageDropped(int metadata) { return metadata; } - - } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java index 08e0d294..2faf341b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java @@ -213,7 +213,7 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator numberAssigned = 0; } - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.tanksegmenter.nowhas") + " " + numberAssigned + " " + "message.tanksegmenter.tankssetto" + " " + reagent.name)); + player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.tanksegmenter.nowhas") + " " + numberAssigned + " " + StatCollector.translateToLocal("message.tanksegmenter.tankssetto") + " " + reagent.name)); reagentHandler.setTanksTunedToReagent(reagent, numberAssigned); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java index 1e7a9fc2..4e86f944 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java @@ -13,11 +13,13 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.api.Int3; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; @@ -27,12 +29,15 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class RitualEffectCrafting extends RitualEffect { public static final boolean isTesting = false; - public static final boolean limitToSingleStack = false; + public static final boolean limitToSingleStack = true; public static final int potentiaDrain = 2; + public static final int virtusDrain = 2; @Override public void performEffect(IMasterRitualStone ritualStone) { +// long startTime = System.nanoTime(); + String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); @@ -41,7 +46,9 @@ public class RitualEffectCrafting extends RitualEffect int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - if(world.getWorldTime() % 1 != 0) + boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); + + if(world.getWorldTime() % (hasPotentia ? 1 : 4) != 0) { return; } @@ -51,7 +58,23 @@ public class RitualEffectCrafting extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - int slotDesignation = 0; + NBTTagCompound tag = ritualStone.getCustomRitualTag(); + + if(tag == null) + { + ritualStone.setCustomRitualTag(new NBTTagCompound()); + tag = ritualStone.getCustomRitualTag(); + } + + boolean lastFailed = tag.getBoolean("didLastCraftFail"); + + int slotDesignation = tag.getInteger("slotDesignation"); + if(lastFailed) + { + slotDesignation++; + tag.setInteger("slotDesignation", slotDesignation); + tag.setBoolean("didLastCraftFail", false); + } int direction = ritualStone.getDirection(); boolean canContinue = false; @@ -69,11 +92,13 @@ public class RitualEffectCrafting extends RitualEffect { for(int j=-1; j<=1; j++) { - TileEntity inv = world.getTileEntity(x + j, y + 2, z + i); + int gridSpace = (i+1)*3 + (j+1); + + Int3 pos = this.getSlotPositionForDirection(gridSpace, direction); + TileEntity inv = world.getTileEntity(x + pos.xCoord, y + pos.yCoord, z + pos.zCoord); if(inv instanceof IInventory) { - int gridSpace = (i+1)*3 + (j+1); - if(((IInventory) inv).getSizeInventory() < slotDesignation || !((IInventory) inv).isItemValidForSlot(slotDesignation, ((IInventory) inv).getStackInSlot(slotDesignation))) + if(((IInventory) inv).getSizeInventory() <= slotDesignation || !((IInventory) inv).isItemValidForSlot(slotDesignation, ((IInventory) inv).getStackInSlot(slotDesignation))) { continue; }else @@ -92,13 +117,21 @@ public class RitualEffectCrafting extends RitualEffect if(!canContinue) { + tag.setInteger("slotDesignation", 0); return; } ItemStack returnStack = CraftingManager.getInstance().findMatchingRecipe(inventory, world); - if (returnStack != null) + if (returnStack == null) { + tag.setBoolean("didLastCraftFail", true); + return; + }else + { + boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); + boolean addOutputToInputs = hasVirtus; + IInventory outputInv = null; List invList = new ArrayList(); @@ -107,19 +140,119 @@ public class RitualEffectCrafting extends RitualEffect TileEntity southEntity = world.getTileEntity(x, y-1, z + 2); TileEntity eastEntity = world.getTileEntity(x + 2, y-1, z); TileEntity westEntity = world.getTileEntity(x - 2, y-1, z); - - if(southEntity instanceof IInventory) - { - outputInv = (IInventory)southEntity; - } - if(northEntity instanceof IInventory) + switch(direction) { - invList.add((IInventory)northEntity); + case 1: + if(southEntity instanceof IInventory) + { + outputInv = (IInventory)southEntity; + }else + { + return; + } + + if(northEntity instanceof IInventory) + { + invList.add((IInventory)northEntity); + } + if(eastEntity instanceof IInventory) + { + invList.add((IInventory)eastEntity); + } + if(westEntity instanceof IInventory) + { + invList.add((IInventory)westEntity); + } + + break; + + case 2: + if(westEntity instanceof IInventory) + { + outputInv = (IInventory)westEntity; + }else + { + return; + } + + if(northEntity instanceof IInventory) + { + invList.add((IInventory)northEntity); + } + if(eastEntity instanceof IInventory) + { + invList.add((IInventory)eastEntity); + } + if(southEntity instanceof IInventory) + { + invList.add((IInventory)southEntity); + } + + break; + + case 3: + if(northEntity instanceof IInventory) + { + outputInv = (IInventory)northEntity; + }else + { + return; + } + + if(eastEntity instanceof IInventory) + { + invList.add((IInventory)eastEntity); + } + if(southEntity instanceof IInventory) + { + invList.add((IInventory)southEntity); + } + if(westEntity instanceof IInventory) + { + invList.add((IInventory)westEntity); + } + + break; + + case 4: + if(eastEntity instanceof IInventory) + { + outputInv = (IInventory)eastEntity; + }else + { + return; + } + + if(northEntity instanceof IInventory) + { + invList.add((IInventory)northEntity); + } + if(southEntity instanceof IInventory) + { + invList.add((IInventory)southEntity); + } + if(westEntity instanceof IInventory) + { + invList.add((IInventory)westEntity); + } + + break; } - if (outputInv != null && (!limitToSingleStack ? SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN) : SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN, true, returnStack.getMaxStackSize()))) + if (outputInv != null) { + if(!(!limitToSingleStack ? SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN) : SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN, true, returnStack.getMaxStackSize()))) + { + tag.setBoolean("didLastCraftFail", true); + return; + } + + if(addOutputToInputs) + { + invList.add(outputInv); + } + Map> syphonMap = new HashMap(); //Inventory, Slot, how much claimed for(int n = 0; n < recipe.length; n++) //Look for the correct items @@ -159,14 +292,13 @@ public class RitualEffectCrafting extends RitualEffect if(this.areItemsEqualForCrafting(recipeStack, invItem)) { - System.out.println("Item is equal and valid"); //TODO inventory.setInventorySlotContents(n, invItem); - ItemStack returnedStack = CraftingManager.getInstance().findMatchingRecipe(inventory, world); - if(returnedStack == null || returnedStack.getItem() == null || returnedStack.getItem() != returnStack.getItem()) - { - continue; - } +// ItemStack returnedStack = CraftingManager.getInstance().findMatchingRecipe(inventory, world); +// if(returnedStack == null || returnedStack.getItem() == null || returnedStack.getItem() != returnStack.getItem()) +// { +// continue; +// } Map slotMap = syphonMap.get(i); if(slotMap == null) { @@ -195,15 +327,13 @@ public class RitualEffectCrafting extends RitualEffect if(!isItemTaken) { -// System.out.println("Item is not available!"); + tag.setBoolean("didLastCraftFail", true); return; } } /* The recipe is valid and the items have been found */ - - System.out.println("Valid!"); - + SpellHelper.insertStackIntoInventory(CraftingManager.getInstance().findMatchingRecipe(inventory, world), outputInv, ForgeDirection.DOWN); for(Entry> entry1 : syphonMap.entrySet()) @@ -224,16 +354,30 @@ public class RitualEffectCrafting extends RitualEffect inputInv.setInventorySlotContents(entry2.getKey(), null); } } - } } + + if(addOutputToInputs && syphonMap.containsKey(invList.size())) + { + this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); + } SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); + if(hasPotentia) + { + this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); + } + world.markBlockForUpdate(x, y-1, z + 2); world.markBlockForUpdate(x, y-1, z - 2); world.markBlockForUpdate(x + 2, y-1, z); world.markBlockForUpdate(x - 2, y-1, z); + +// long endTime = System.nanoTime(); +// +// long duration = (endTime - startTime); //divide by 1000000 to get milliseconds. +// System.out.println("(Total) method time in ms: " + (float)(duration)/1000000.0); } } } @@ -242,7 +386,7 @@ public class RitualEffectCrafting extends RitualEffect @Override public int getCostPerRefresh() { - return 0; + return 10; } @Override @@ -266,20 +410,15 @@ public class RitualEffectCrafting extends RitualEffect public boolean areItemsEqualForCrafting(ItemStack stack1, ItemStack stack2) { - if (stack1 == null) - { - return false; - } - - if (stack2 == null) - { - return true; - } - - if (stack1.isItemStackDamageable() ^ stack2.isItemStackDamageable()) + if (stack1 == null || stack2 == null) { return false; } +// +// if (stack1.isItemStackDamageable() ^ stack2.isItemStackDamageable()) +// { +// return false; +// } return stack1.getItem() == stack2.getItem() && (stack1.getItem().getHasSubtypes() ? stack1.getItemDamage() == stack2.getItemDamage() : true); } @@ -298,11 +437,11 @@ public class RitualEffectCrafting extends RitualEffect case 1: //NORTH-facing return new Int3(x, 2, z); case 2: //EAST-facing - return new Int3(-z, 2, x); + return new Int3(z, 2, -x); case 3: //SOUTH-facing return new Int3(-x, 2, -z); case 4: //WEST-facing - return new Int3(z, 2, -x); + return new Int3(-z, 2, x); } return new Int3(0,0,0); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java index b6fe5c99..f7ef0e5b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java @@ -22,6 +22,8 @@ public class RitualEffectWellOfSuffering extends RitualEffect public static final int amount = 10; private static final int tennebraeDrain = 5; + private static final int potentiaDrain = 10; + private static final int offensaDrain = 3; @Override public void performEffect(IMasterRitualStone ritualStone) @@ -61,14 +63,17 @@ public class RitualEffectWellOfSuffering extends RitualEffect { return; } + + boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); int d0 = 10; - int vertRange = 10; + int vertRange = hasPotentia ? 20 : 10; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(d0, vertRange, d0); List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); int entityCount = 0; boolean hasTennebrae = this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tennebraeDrain, false); + boolean hasOffensa = this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false); if (currentEssence < this.getCostPerRefresh() * list.size()) { @@ -82,16 +87,24 @@ public class RitualEffectWellOfSuffering extends RitualEffect continue; } - if (livingEntity.attackEntityFrom(DamageSource.outOfWorld, 1)) + hasOffensa = hasOffensa && this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true); + + if (livingEntity.attackEntityFrom(DamageSource.outOfWorld, hasOffensa ? 2 : 1)) { hasTennebrae = hasTennebrae && this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tennebraeDrain, true); - + + entityCount++; - tileAltar.sacrificialDaggerCall(this.amount * (hasTennebrae ? 2 : 1), true); + tileAltar.sacrificialDaggerCall(this.amount * (hasTennebrae ? 2 : 1) * (hasOffensa ? 2 : 1), true); } } SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * entityCount); + + if(hasPotentia) + { + this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); + } } } From 45b8c0bd162dba69079593bc99b755da2227c92d Mon Sep 17 00:00:00 2001 From: Patric Alexandre Date: Fri, 17 Apr 2015 20:23:18 -0300 Subject: [PATCH 19/19] Update en_US.lang Thank to @ljafa-ag for pointing my failure, I'm not used to english grammar :p --- src/main/resources/assets/alchemicalwizardry/lang/en_US.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang index 0978790f..f2fd124b 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang @@ -445,5 +445,5 @@ message.tanksegmenter.tankssetto=tank(s) set to: message.routerfocus.limit=Focus' Item Limit set to: #Achievements -achievement.alchemicalwizardy:firstPrick!=Your first prick! -achievement.alchemicalwizardy:firstPrick!.desc=The first drop of life in the Altar... +achievement.alchemicalwizardy:achievement.firstPrick=Your first prick! +achievement.alchemicalwizardy:achievement.firstPrick.desc=The first drop of life in the Altar...