From dea1f870786274b831c02b33153bf3a0c0ac1beb Mon Sep 17 00:00:00 2001 From: Tombenpotter Date: Mon, 13 Oct 2014 22:33:20 +0200 Subject: [PATCH] Anti-comments sweep! --- .../AlchemicalWizardry.java | 937 +++---- .../BloodMagicConfiguration.java | 102 +- .../alchemicalWizardry/ModBlocks.java | 77 +- .../alchemicalWizardry/ModItems.java | 108 +- .../api/ColourAndCoords.java | 78 +- .../AlchemicalPotionCreationHandler.java | 4 +- .../api/alchemy/AlchemyRecipe.java | 6 +- .../api/alchemy/AlchemyRecipeRegistry.java | 6 +- .../api/alchemy/energy/IAlchemyGoggles.java | 4 +- .../api/alchemy/energy/IReagentContainer.java | 8 +- .../api/alchemy/energy/IReagentHandler.java | 2 +- .../energy/ISegmentedReagentHandler.java | 14 +- .../api/alchemy/energy/Reagent.java | 98 +- .../api/alchemy/energy/ReagentContainer.java | 33 +- .../alchemy/energy/ReagentContainerInfo.java | 3 - .../api/alchemy/energy/ReagentRegistry.java | 364 +-- .../api/alchemy/energy/ReagentStack.java | 105 +- .../alchemy/energy/TileReagentHandler.java | 4 +- .../energy/TileSegmentedReagentHandler.java | 372 +-- .../api/altarRecipeRegistry/AltarRecipe.java | 128 +- .../AltarRecipeRegistry.java | 106 +- .../api/bindingRegistry/BindingRecipe.java | 58 +- .../api/bindingRegistry/BindingRegistry.java | 118 +- .../api/harvest/HarvestRegistry.java | 52 +- .../api/harvest/IHarvestHandler.java | 29 +- .../api/items/ShapedBloodOrbRecipe.java | 418 +-- .../api/items/ShapelessBloodOrbRecipe.java | 254 +- .../api/items/interfaces/IBloodOrb.java | 8 +- .../api/items/interfaces/IHolding.java | 2 +- .../items/interfaces/IReagentManipulator.java | 2 +- .../api/rituals/IMasterRitualStone.java | 18 +- .../api/rituals/IRitualStone.java | 2 +- .../api/rituals/RitualEffect.java | 60 +- .../api/rituals/Rituals.java | 371 ++- .../api/soulNetwork/SoulNetworkHandler.java | 209 +- .../summoningRegistry/SummoningHelper.java | 2 +- .../client/ClientEventHandler.java | 45 +- .../client/ClientProxy.java | 105 +- .../client/renderer/ColourThreshold.java | 3 +- .../client/renderer/HUDElement.java | 82 +- .../client/renderer/HUDUtils.java | 149 +- .../client/renderer/RenderHelper.java | 157 +- .../common/AlchemicalWizardryEventHooks.java | 445 ++-- .../common/AlchemicalWizardryFuelHandler.java | 20 +- .../common/AlchemicalWizardryTickHandler.java | 47 - .../common/CommonProxy.java | 19 +- .../common/CoordAndRange.java | 42 +- .../common/EntityAIFly.java | 5 - .../common/EntityAirElemental.java | 9 +- .../alchemicalWizardry/common/Int3.java | 62 +- .../common/LifeBucketHandler.java | 10 +- .../common/LifeEssence.java | 3 - .../common/ModLivingDropsEvent.java | 4 +- .../common/NewPacketHandler.java | 1806 +++++++------ .../common/PacketHandler.java | 966 ------- .../alchemy/CombinedPotionComponent.java | 42 +- .../alchemy/CombinedPotionRegistry.java | 350 +-- .../alchemy/ICombinationalCatalyst.java | 3 +- .../common/block/ArmourForge.java | 28 +- .../common/block/BlockAlchemicCalcinator.java | 99 +- .../common/block/BlockAltar.java | 113 +- .../common/block/BlockBelljar.java | 164 +- .../common/block/BlockBloodLightSource.java | 12 +- .../common/block/BlockConduit.java | 16 +- .../common/block/BlockDemonPortal.java | 47 +- .../common/block/BlockHomHeart.java | 16 +- .../common/block/BlockMasterStone.java | 27 +- .../common/block/BlockOrientable.java | 303 ++- .../common/block/BlockPedestal.java | 26 +- .../common/block/BlockPlinth.java | 26 +- .../common/block/BlockReagentConduit.java | 104 +- .../common/block/BlockSchematicSaver.java | 47 +- .../common/block/BlockSocket.java | 28 +- .../common/block/BlockSpectralContainer.java | 49 +- .../common/block/BlockSpellEffect.java | 40 +- .../common/block/BlockSpellEnhancement.java | 42 +- .../common/block/BlockSpellModifier.java | 73 +- .../common/block/BlockSpellParadigm.java | 102 +- .../common/block/BlockTeleposer.java | 44 +- .../common/block/BlockWritingTable.java | 20 +- .../common/block/BloodRune.java | 22 +- .../common/block/BloodStoneBrick.java | 6 +- .../common/block/EfficiencyRune.java | 2 +- .../common/block/EmptySocket.java | 7 +- .../common/block/ImperfectRitualStone.java | 52 +- .../common/block/LargeBloodStoneBrick.java | 6 +- .../common/block/LifeEssenceBlock.java | 9 +- .../common/block/RitualStone.java | 10 +- .../common/block/RuneOfSacrifice.java | 2 +- .../common/block/RuneOfSelfSacrifice.java | 2 +- .../common/block/SpectralBlock.java | 35 +- .../common/block/SpeedRune.java | 2 +- .../AltarUpgradeComponent.java | 8 +- .../bloodAltarUpgrade/UpgradedAltars.java | 17 +- .../common/demonVillage/BlockSet.java | 370 +-- .../demonVillage/BuildingSchematic.java | 349 ++- .../common/demonVillage/DemonBuilding.java | 226 +- .../common/demonVillage/DemonCrosspath.java | 32 +- .../common/demonVillage/DemonVillagePath.java | 252 +- .../common/demonVillage/GridSpace.java | 142 +- .../common/demonVillage/GridSpaceHolder.java | 598 ++--- .../common/demonVillage/TileBlockSet.java | 2 +- .../common/entity/mob/EntityBileDemon.java | 35 +- .../common/entity/mob/EntityBoulderFist.java | 21 +- .../common/entity/mob/EntityDemon.java | 18 +- .../common/entity/mob/EntityElemental.java | 31 +- .../common/entity/mob/EntityFallenAngel.java | 46 +- .../common/entity/mob/EntityIceDemon.java | 61 +- .../entity/mob/EntityLowerGuardian.java | 22 +- .../common/entity/mob/EntityShade.java | 26 +- .../entity/mob/EntitySmallEarthGolem.java | 49 +- .../entity/mob/EntityWingedFireDemon.java | 47 +- .../projectile/EnergyBlastProjectile.java | 50 +- .../entity/projectile/EntityBeamParticle.java | 12 +- .../EntityBloodLightProjectile.java | 12 +- .../EntityEnergyBazookaMainProjectile.java | 1 - ...ntityEnergyBazookaSecondaryProjectile.java | 4 - .../entity/projectile/EntityMeteor.java | 12 +- .../entity/projectile/EntityParticleBeam.java | 92 +- .../projectile/ExplosionProjectile.java | 21 - .../entity/projectile/FireProjectile.java | 7 - .../entity/projectile/HolyProjectile.java | 23 +- .../entity/projectile/IceProjectile.java | 26 +- .../projectile/LightningBoltProjectile.java | 18 +- .../entity/projectile/MudProjectile.java | 19 +- .../entity/projectile/TeleportProjectile.java | 57 +- .../entity/projectile/WaterProjectile.java | 21 +- .../entity/projectile/WindGustProjectile.java | 30 +- .../harvest/BloodMagicHarvestHandler.java | 222 +- .../harvest/CactusReedHarvestHandler.java | 51 +- ...GenericPamSeedlessFruitHarvestHandler.java | 119 +- .../harvest/GenericSeededHarvestHandler.java | 244 +- .../common/harvest/GourdHarvestHandler.java | 43 +- .../harvest/PamHarvestCompatRegistry.java | 236 +- .../common/items/AWBaseItems.java | 8 +- .../common/items/ActivationCrystal.java | 14 +- .../common/items/AirScribeTool.java | 2 +- .../common/items/ApprenticeBloodOrb.java | 2 +- .../common/items/ArchmageBloodOrb.java | 2 +- .../common/items/ArmourInhibitor.java | 72 +- .../common/items/BlankSpell.java | 19 +- .../common/items/BloodShard.java | 18 +- .../common/items/BloodboundSword.java | 26 +- .../common/items/BoundArmour.java | 368 ++- .../common/items/BoundAxe.java | 90 +- .../common/items/BoundPickaxe.java | 87 +- .../common/items/BoundShovel.java | 75 +- .../common/items/CheatyItem.java | 85 +- .../common/items/DaggerOfSacrifice.java | 25 +- .../common/items/DemonPlacer.java | 101 +- .../items/DemonicTelepositionFocus.java | 10 +- .../common/items/DuskScribeTool.java | 2 +- .../common/items/EarthScribeTool.java | 2 +- .../common/items/EnergyBattery.java | 74 +- .../common/items/EnergyBazooka.java | 20 +- .../common/items/EnergyBlast.java | 21 +- .../common/items/EnergyItems.java | 83 +- .../common/items/EnergySword.java | 31 +- .../items/EnhancedTelepositionFocus.java | 10 +- .../common/items/FireScribeTool.java | 2 +- .../common/items/ItemAlchemyBase.java | 17 +- .../common/items/ItemBlockCrystalBelljar.java | 94 +- .../common/items/ItemBloodRuneBlock.java | 7 +- .../common/items/ItemComplexSpellCrystal.java | 19 +- .../common/items/ItemComponents.java | 15 +- .../common/items/ItemDiabloKey.java | 22 +- .../common/items/ItemRitualDiviner.java | 52 +- .../common/items/ItemSpellEffectBlock.java | 4 - .../items/ItemSpellEnhancementBlock.java | 27 +- .../common/items/ItemSpellModifierBlock.java | 5 +- .../common/items/ItemSpellParadigmBlock.java | 8 +- .../common/items/LavaCrystal.java | 26 +- .../common/items/LifeBucket.java | 5 +- .../common/items/MagicianBloodOrb.java | 2 +- .../common/items/MasterBloodOrb.java | 2 +- .../common/items/OrbOfTesting.java | 6 +- .../items/ReinforcedTelepositionFocus.java | 10 +- .../common/items/SacrificialDagger.java | 63 +- .../common/items/TelepositionFocus.java | 17 +- .../common/items/WaterScribeTool.java | 2 +- .../items/energy/ItemAttunedCrystal.java | 662 +++-- .../items/energy/ItemDestinationClearer.java | 76 +- .../items/energy/ItemTankSegmenter.java | 421 ++- .../common/items/forestry/ItemBloodFrame.java | 172 +- .../common/items/potion/AlchemyFlask.java | 55 +- .../common/items/potion/AlchemyReagent.java | 28 +- .../potion/AverageLengtheningCatalyst.java | 2 +- .../items/potion/AveragePowerCatalyst.java | 2 +- .../items/potion/CombinationalCatalyst.java | 18 +- .../items/potion/EnhancedFillingAgent.java | 9 +- .../potion/GreaterLengtheningCatalyst.java | 2 +- .../items/potion/GreaterPowerCatalyst.java | 2 +- .../items/potion/LengtheningCatalyst.java | 2 - .../potion/MundaneLengtheningCatalyst.java | 2 +- .../items/potion/MundanePowerCatalyst.java | 2 +- .../common/items/potion/PowerCatalyst.java | 1 - .../items/potion/StandardBindingAgent.java | 18 +- .../items/potion/StandardFillingAgent.java | 3 +- .../common/items/potion/WeakBindingAgent.java | 3 +- .../common/items/potion/WeakFillingAgent.java | 20 +- .../common/items/sigil/AirSigil.java | 14 +- .../common/items/sigil/DivinationSigil.java | 67 +- .../items/sigil/ItemBloodLightSigil.java | 18 +- .../common/items/sigil/ItemFluidSigil.java | 858 +++--- .../common/items/sigil/ItemSeerSigil.java | 51 +- .../sigil/ItemSigilOfEnderSeverance.java | 28 +- .../items/sigil/ItemSigilOfSupression.java | 141 +- .../common/items/sigil/LavaSigil.java | 182 +- .../items/sigil/SigilOfElementalAffinity.java | 16 +- .../common/items/sigil/SigilOfGrowth.java | 47 +- .../common/items/sigil/SigilOfHaste.java | 28 +- .../common/items/sigil/SigilOfHolding.java | 29 +- .../common/items/sigil/SigilOfMagnetism.java | 36 +- .../common/items/sigil/SigilOfTheBridge.java | 103 +- .../items/sigil/SigilOfTheFastMiner.java | 21 +- .../common/items/sigil/SigilOfWind.java | 24 +- .../common/items/sigil/VoidSigil.java | 47 +- .../common/items/sigil/WaterSigil.java | 87 +- .../items/spell/ItemSpellMultiTool.java | 1311 +++++---- .../items/thaumcraft/ItemSanguineArmour.java | 139 +- .../alchemicalWizardry/common/mcmod.info | 22 - .../common/potion/PotionFlameCloak.java | 4 +- .../common/potion/PotionIceCloak.java | 4 +- .../renderer/AlchemyCircleRenderer.java | 119 +- .../common/renderer/BeamRenderer.java | 207 +- .../common/renderer/MRSRenderer.java | 11 +- .../block/RenderAlchemicCalcinator.java | 214 +- .../common/renderer/block/RenderConduit.java | 6 - .../renderer/block/RenderCrystalBelljar.java | 208 +- .../renderer/block/RenderMasterStone.java | 23 +- .../common/renderer/block/RenderPedestal.java | 54 +- .../common/renderer/block/RenderPlinth.java | 17 +- .../renderer/block/RenderReagentConduit.java | 90 +- .../block/RenderSpellEffectBlock.java | 21 +- .../block/RenderSpellEnhancementBlock.java | 21 +- .../block/RenderSpellModifierBlock.java | 21 +- .../block/RenderSpellParadigmBlock.java | 21 +- .../renderer/block/RenderWritingTable.java | 18 +- .../common/renderer/block/ShaderHelper.java | 300 ++- .../renderer/block/TEAltarRenderer.java | 17 +- .../TEAlchemicalCalcinatorItemRenderer.java | 127 +- .../block/itemRender/TEAltarItemRenderer.java | 33 +- .../itemRender/TEBellJarItemRenderer.java | 311 ++- .../itemRender/TEConduitItemRenderer.java | 119 +- .../TESpellEffectBlockItemRenderer.java | 152 +- .../TESpellEnhancementBlockItemRenderer.java | 162 +- .../TESpellModifierBlockItemRenderer.java | 148 +- .../TESpellParadigmBlockItemRenderer.java | 145 +- .../TEWritingTableItemRenderer.java | 12 +- .../common/renderer/mob/RenderBileDemon.java | 2 +- .../renderer/mob/RenderBoulderFist.java | 2 +- .../common/renderer/mob/RenderElemental.java | 2 +- .../renderer/mob/RenderFallenAngel.java | 2 +- .../common/renderer/mob/RenderIceDemon.java | 2 +- .../renderer/mob/RenderLowerGuardian.java | 2 +- .../common/renderer/mob/RenderShade.java | 2 +- .../renderer/mob/RenderSmallEarthGolem.java | 2 +- .../renderer/mob/RenderWingedFireDemon.java | 2 +- .../model/ModelAlchemicalCalcinator.java | 234 +- .../renderer/model/ModelBloodAltar.java | 6 +- .../renderer/model/ModelCrystalBelljar.java | 202 +- .../renderer/model/ModelOmegaArmour.java | 1339 +++++----- .../renderer/model/ModelSpellEffectBlock.java | 566 ++-- .../model/ModelSpellEnhancementBlock.java | 568 ++-- .../model/ModelSpellModifierBlock.java | 516 ++-- .../model/ModelSpellParadigmBlock.java | 397 ++- .../RenderEnergyBazookaMainProjectile.java | 3 +- .../RenderEnergyBlastProjectile.java | 15 +- .../renderer/projectile/RenderMeteor.java | 4 +- .../rituals/RitualEffectAnimalGrowth.java | 157 +- .../rituals/RitualEffectApiaryOverclock.java | 70 +- .../rituals/RitualEffectAutoAlchemy.java | 749 +++--- .../rituals/RitualEffectBiomeChanger.java | 46 +- .../rituals/RitualEffectContainment.java | 96 +- .../common/rituals/RitualEffectCrushing.java | 413 ++- .../common/rituals/RitualEffectEllipsoid.java | 203 +- .../rituals/RitualEffectEvaporation.java | 256 +- .../common/rituals/RitualEffectExpulsion.java | 279 +- .../rituals/RitualEffectFeatheredEarth.java | 114 +- .../rituals/RitualEffectFeatheredKnife.java | 93 +- .../common/rituals/RitualEffectFlight.java | 229 +- .../rituals/RitualEffectFullStomach.java | 136 +- .../common/rituals/RitualEffectGrowth.java | 136 +- .../common/rituals/RitualEffectHarvest.java | 167 +- .../common/rituals/RitualEffectHealing.java | 121 +- .../rituals/RitualEffectInterdiction.java | 121 +- .../rituals/RitualEffectItemSuction.java | 142 +- .../common/rituals/RitualEffectJumping.java | 82 +- .../common/rituals/RitualEffectLava.java | 148 +- .../common/rituals/RitualEffectLeap.java | 128 +- .../rituals/RitualEffectLifeConduit.java | 200 +- .../common/rituals/RitualEffectMagnetic.java | 109 +- .../common/rituals/RitualEffectSoulBound.java | 52 +- .../common/rituals/RitualEffectSpawnWard.java | 155 +- .../rituals/RitualEffectSummonMeteor.java | 54 +- .../rituals/RitualEffectSupression.java | 216 +- .../common/rituals/RitualEffectUnbinding.java | 75 +- .../rituals/RitualEffectVeilOfEvil.java | 161 +- .../common/rituals/RitualEffectWater.java | 271 +- .../rituals/RitualEffectWellOfSuffering.java | 36 +- .../spell/complex/EntitySpellProjectile.java | 933 +++---- .../common/spell/complex/SpellModifier.java | 34 +- .../spell/complex/SpellModifierDefault.java | 10 +- .../spell/complex/SpellModifierDefensive.java | 10 +- .../complex/SpellModifierEnvironmental.java | 10 +- .../spell/complex/SpellModifierOffensive.java | 10 +- .../common/spell/complex/SpellParadigm.java | 306 ++- .../spell/complex/SpellParadigmMelee.java | 118 +- .../complex/SpellParadigmProjectile.java | 177 +- .../spell/complex/SpellParadigmSelf.java | 87 +- .../spell/complex/SpellParadigmTool.java | 955 ++++--- .../spell/complex/effect/SpellEffect.java | 565 ++-- .../complex/effect/SpellEffectEarth.java | 427 ++- .../spell/complex/effect/SpellEffectFire.java | 354 ++- .../spell/complex/effect/SpellEffectIce.java | 351 ++- .../spell/complex/effect/SpellEffectWind.java | 391 ++- .../spell/complex/effect/SpellHelper.java | 937 +++---- .../ExtrapolatedMeleeEntityEffect.java | 117 +- .../IMeleeSpellEntityEffect.java | 4 +- .../impactEffects/IMeleeSpellWorldEffect.java | 5 +- .../IProjectileImpactEffect.java | 7 +- .../IProjectileUpdateEffect.java | 4 +- .../impactEffects/ISelfSpellEffect.java | 4 +- .../MeleeSpellCenteredWorldEffect.java | 46 +- .../impactEffects/MeleeSpellWorldEffect.java | 26 +- .../impactEffects/ProjectileImpactEffect.java | 20 +- .../impactEffects/ProjectileUpdateEffect.java | 20 +- .../effect/impactEffects/SelfSpellEffect.java | 23 +- .../earth/MeleeDefaultEarth.java | 68 +- .../earth/MeleeDefensiveEarth.java | 54 +- .../earth/MeleeEnvironmentalEarth.java | 73 +- .../earth/MeleeOffensiveEarth.java | 48 +- .../earth/ProjectileDefaultEarth.java | 86 +- .../earth/ProjectileDefensiveEarth.java | 102 +- .../earth/ProjectileEnvironmentalEarth.java | 134 +- .../earth/ProjectileOffensiveEarth.java | 126 +- .../impactEffects/earth/SelfDefaultEarth.java | 81 +- .../earth/SelfDefensiveEarth.java | 30 +- .../earth/SelfEnvironmentalEarth.java | 48 +- .../earth/SelfOffensiveEarth.java | 64 +- .../earth/ToolEnvironmentalEarth.java | 148 +- .../earth/ToolOffensiveEarth.java | 71 +- .../impactEffects/fire/MeleeDefaultFire.java | 40 +- .../fire/MeleeDefensiveFire.java | 74 +- .../fire/MeleeEnvironmentalFire.java | 46 +- .../fire/MeleeOffensiveFire.java | 42 +- .../fire/ProjectileDefaultFire.java | 114 +- .../fire/ProjectileDefensiveFire.java | 71 +- .../fire/ProjectileEnvironmentalFire.java | 72 +- .../fire/ProjectileOffensiveFire.java | 108 +- .../impactEffects/fire/SelfDefaultFire.java | 21 +- .../impactEffects/fire/SelfDefensiveFire.java | 65 +- .../fire/SelfEnvironmentalFire.java | 78 +- .../impactEffects/fire/SelfOffensiveFire.java | 24 +- .../impactEffects/fire/ToolDefaultFire.java | 54 +- .../fire/ToolEnvironmentalFire.java | 68 +- .../impactEffects/fire/ToolOffensiveFire.java | 24 +- .../impactEffects/ice/MeleeDefaultIce.java | 39 +- .../impactEffects/ice/MeleeDefensiveIce.java | 74 +- .../ice/MeleeEnvironmentalIce.java | 58 +- .../impactEffects/ice/MeleeOffensiveIce.java | 68 +- .../ice/ProjectileDefaultIce.java | 56 +- .../ice/ProjectileDefensiveIce.java | 76 +- .../ice/ProjectileEnvironmentalIce.java | 60 +- .../ice/ProjectileOffensiveIce.java | 38 +- .../impactEffects/ice/SelfDefaultIce.java | 60 +- .../impactEffects/ice/SelfDefensiveIce.java | 24 +- .../ice/SelfEnvironmentalIce.java | 68 +- .../impactEffects/ice/SelfOffensiveIce.java | 78 +- .../impactEffects/ice/ToolDefaultIce.java | 24 +- .../impactEffects/ice/ToolDefensiveIce.java | 90 +- .../impactEffects/tool/DigAreaEffect.java | 138 +- .../impactEffects/tool/DigAreaTunnel.java | 318 +-- .../impactEffects/tool/IDigAreaEffect.java | 6 +- .../impactEffects/tool/IItemManipulator.java | 8 +- .../impactEffects/tool/ILeftClickEffect.java | 6 +- .../impactEffects/tool/IOnBanishTool.java | 4 +- .../impactEffects/tool/IOnBreakBlock.java | 4 +- .../impactEffects/tool/IOnSummonTool.java | 4 +- .../impactEffects/tool/IRightClickEffect.java | 12 +- .../tool/ISpecialDamageEffect.java | 8 +- .../impactEffects/tool/IToolUpdateEffect.java | 4 +- .../impactEffects/tool/ItemManipulator.java | 30 +- .../impactEffects/tool/LeftClickEffect.java | 26 +- .../tool/OnBreakBlockEffect.java | 26 +- .../impactEffects/tool/RightClickEffect.java | 20 +- .../impactEffects/tool/RightClickTunnel.java | 324 +-- .../impactEffects/tool/SummonToolEffect.java | 20 +- .../impactEffects/wind/MeleeDefaultWind.java | 58 +- .../wind/MeleeDefensiveWind.java | 42 +- .../wind/MeleeEnvironmentalWind.java | 50 +- .../wind/MeleeOffensiveWind.java | 58 +- .../wind/ProjectileDefaultWind.java | 41 +- .../wind/ProjectileEnvironmentalWind.java | 86 +- .../wind/ProjectileOffensiveWind.java | 38 +- .../impactEffects/wind/SelfDefaultWind.java | 31 +- .../impactEffects/wind/SelfDefensiveWind.java | 54 +- .../wind/SelfEnvironmentalWind.java | 68 +- .../impactEffects/wind/SelfOffensiveWind.java | 34 +- .../impactEffects/wind/ToolDefensiveWind.java | 42 +- .../wind/ToolEnvironmentalWind.java | 54 +- .../impactEffects/wind/ToolOffensiveWind.java | 27 +- .../complex/enhancement/SpellEnhancement.java | 32 +- .../enhancement/SpellEnhancementCost.java | 10 +- .../enhancement/SpellEnhancementPotency.java | 10 +- .../enhancement/SpellEnhancementPower.java | 10 +- .../common/spell/simple/HomSpellRegistry.java | 6 +- .../common/spell/simple/SpellEarthBender.java | 14 +- .../common/spell/simple/SpellExplosions.java | 4 - .../common/spell/simple/SpellFireBurst.java | 29 +- .../common/spell/simple/SpellFrozenWater.java | 19 +- .../common/spell/simple/SpellHolyBlast.java | 26 +- .../spell/simple/SpellLightningBolt.java | 16 +- .../common/spell/simple/SpellTeleport.java | 29 +- .../common/spell/simple/SpellWateryGrave.java | 20 +- .../common/spell/simple/SpellWindGust.java | 39 +- .../summoning/SummoningFallenAngel.java | 1 - .../common/summoning/SummoningHelperAW.java | 22 +- .../summoning/meteor/MeteorParadigm.java | 140 +- .../summoning/meteor/MeteorRegistry.java | 2 +- .../tileEntity/TEAlchemicCalcinator.java | 494 ++-- .../common/tileEntity/TEAltar.java | 380 +-- .../common/tileEntity/TEBellJar.java | 245 +- .../common/tileEntity/TEConduit.java | 14 +- .../common/tileEntity/TEDemonPortal.java | 2347 ++++++++--------- .../common/tileEntity/TEHomHeart.java | 6 +- .../tileEntity/TEImperfectRitualStone.java | 1 - .../common/tileEntity/TEMasterStone.java | 661 +++-- .../common/tileEntity/TEOrientable.java | 29 +- .../common/tileEntity/TEPedestal.java | 8 +- .../common/tileEntity/TEPlinth.java | 40 +- .../common/tileEntity/TEReagentConduit.java | 1027 ++++---- .../common/tileEntity/TESchematicSaver.java | 292 +- .../common/tileEntity/TESocket.java | 9 +- .../common/tileEntity/TESpectralBlock.java | 76 +- .../tileEntity/TESpectralContainer.java | 122 +- .../common/tileEntity/TESpellBlock.java | 82 +- .../common/tileEntity/TESpellEffectBlock.java | 72 +- .../tileEntity/TESpellEnhancementBlock.java | 296 ++- .../tileEntity/TESpellModifierBlock.java | 73 +- .../tileEntity/TESpellParadigmBlock.java | 143 +- .../common/tileEntity/TETeleposer.java | 30 +- .../common/tileEntity/TEWritingTable.java | 175 +- .../tileEntity/container/ContainerAltar.java | 5 - .../container/ContainerTeleposer.java | 14 - .../container/ContainerWritingTable.java | 20 +- .../common/tileEntity/gui/GuiTeleposer.java | 9 +- .../tileEntity/gui/GuiWritingTable.java | 2 - .../assets/alchemicalwizardry/bloodaltar.obj | 262 ++ .../assets/alchemicalwizardry/bloodlevel.obj | 64 + .../assets/alchemicalwizardry/lang/en_US.lang | 1 + .../models/bloodaltar-fixeUV.obj | 262 ++ .../alchemicalwizardry/models/bloodaltar.obj | 262 ++ .../alchemicalwizardry/models/bloodlevel.obj | 64 + 454 files changed, 23594 insertions(+), 26739 deletions(-) delete mode 100644 1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryTickHandler.java delete mode 100644 1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAIFly.java delete mode 100644 1.7.10/main/java/WayofTime/alchemicalWizardry/common/PacketHandler.java delete mode 100644 1.7.10/main/java/WayofTime/alchemicalWizardry/common/mcmod.info create mode 100644 1.7.10/main/resources/assets/alchemicalwizardry/bloodaltar.obj create mode 100644 1.7.10/main/resources/assets/alchemicalwizardry/bloodlevel.obj create mode 100644 1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar-fixeUV.obj create mode 100644 1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar.obj create mode 100644 1.7.10/main/resources/assets/alchemicalwizardry/models/bloodlevel.obj diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 0bf14f74..3ecb2b2f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -1,14 +1,45 @@ package WayofTime.alchemicalWizardry; -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - +import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; +import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; +import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; +import WayofTime.alchemicalWizardry.api.rituals.Rituals; +import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; +import WayofTime.alchemicalWizardry.common.*; +import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry; +import WayofTime.alchemicalWizardry.common.block.ArmourForge; +import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; +import WayofTime.alchemicalWizardry.common.entity.mob.*; +import WayofTime.alchemicalWizardry.common.harvest.BloodMagicHarvestHandler; +import WayofTime.alchemicalWizardry.common.harvest.CactusReedHarvestHandler; +import WayofTime.alchemicalWizardry.common.harvest.GourdHarvestHandler; +import WayofTime.alchemicalWizardry.common.harvest.PamHarvestCompatRegistry; +import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; +import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; +import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; +import WayofTime.alchemicalWizardry.common.potion.*; +import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer; +import WayofTime.alchemicalWizardry.common.rituals.*; +import WayofTime.alchemicalWizardry.common.spell.simple.*; +import WayofTime.alchemicalWizardry.common.summoning.SummoningHelperAW; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; +import WayofTime.alchemicalWizardry.common.tileEntity.*; +import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; import joshie.alchemicalWizardy.ShapedBloodOrbRecipe; import joshie.alchemicalWizardy.ShapelessBloodOrbRecipe; import net.minecraft.creativetab.CreativeTabs; @@ -34,140 +65,17 @@ import thaumcraft.api.ItemApi; import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; -import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; -import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; -import WayofTime.alchemicalWizardry.api.rituals.Rituals; -import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; -import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks; -import WayofTime.alchemicalWizardry.common.AlchemicalWizardryFuelHandler; -import WayofTime.alchemicalWizardry.common.CommonProxy; -import WayofTime.alchemicalWizardry.common.EntityAirElemental; -import WayofTime.alchemicalWizardry.common.LifeBucketHandler; -import WayofTime.alchemicalWizardry.common.LifeEssence; -import WayofTime.alchemicalWizardry.common.ModLivingDropsEvent; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry; -import WayofTime.alchemicalWizardry.common.block.ArmourForge; -import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon; -import WayofTime.alchemicalWizardry.common.harvest.BloodMagicHarvestHandler; -import WayofTime.alchemicalWizardry.common.harvest.CactusReedHarvestHandler; -import WayofTime.alchemicalWizardry.common.harvest.GourdHarvestHandler; -import WayofTime.alchemicalWizardry.common.harvest.PamHarvestCompatRegistry; -import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; -import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; -import WayofTime.alchemicalWizardry.common.potion.PotionBoost; -import WayofTime.alchemicalWizardry.common.potion.PotionDeaf; -import WayofTime.alchemicalWizardry.common.potion.PotionDrowning; -import WayofTime.alchemicalWizardry.common.potion.PotionFeatherFall; -import WayofTime.alchemicalWizardry.common.potion.PotionFireFuse; -import WayofTime.alchemicalWizardry.common.potion.PotionFlameCloak; -import WayofTime.alchemicalWizardry.common.potion.PotionFlight; -import WayofTime.alchemicalWizardry.common.potion.PotionHeavyHeart; -import WayofTime.alchemicalWizardry.common.potion.PotionIceCloak; -import WayofTime.alchemicalWizardry.common.potion.PotionInhibit; -import WayofTime.alchemicalWizardry.common.potion.PotionPlanarBinding; -import WayofTime.alchemicalWizardry.common.potion.PotionProjectileProtect; -import WayofTime.alchemicalWizardry.common.potion.PotionReciprocation; -import WayofTime.alchemicalWizardry.common.potion.PotionSoulFray; -import WayofTime.alchemicalWizardry.common.potion.PotionSoulHarden; -import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer; -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.RitualEffectCrushing; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectEllipsoid; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectEvaporation; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectExpulsion; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredEarth; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredKnife; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFlight; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFullStomach; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectGrowth; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHarvest; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHealing; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectInterdiction; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemSuction; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectJumping; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLava; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLeap; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLifeConduit; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectMagnetic; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSoulBound; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSpawnWard; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSummonMeteor; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSupression; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectUnbinding; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectVeilOfEvil; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectWater; -import WayofTime.alchemicalWizardry.common.rituals.RitualEffectWellOfSuffering; -import WayofTime.alchemicalWizardry.common.spell.simple.HomSpellRegistry; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellEarthBender; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellExplosions; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellFireBurst; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellFrozenWater; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellHolyBlast; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellLightningBolt; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellWateryGrave; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellWindGust; -import WayofTime.alchemicalWizardry.common.summoning.SummoningHelperAW; -import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; -import WayofTime.alchemicalWizardry.common.tileEntity.TEDemonPortal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; -import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; -import WayofTime.alchemicalWizardry.common.tileEntity.TESchematicSaver; -import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; -import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; @Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.2.0") -//@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"BloodAltar", "particle", "SetLifeEssence", "GetLifeEssence", "Ritual", "GetAltarEssence", "TESocket", "TEWritingTable", "CustomParticle", "SetPlayerVel", "SetPlayerPos", "TEPedestal", "TEPlinth", "TETeleposer", "InfiniteLPPath", "TEOrientor"}, packetHandler = PacketHandler.class) public class AlchemicalWizardry { @@ -180,7 +88,7 @@ public class AlchemicalWizardry public static int ironBlockMeteorRadius; public static String[] netherStarMeteorArray; public static int netherStarMeteorRadius; - + public static String[] allowedCrushedOresArray; public static Potion customPotionDrowning; @@ -217,27 +125,27 @@ public class AlchemicalWizardry public static boolean isThaumcraftLoaded; public static boolean isForestryLoaded; - + public static boolean wimpySettings; public static boolean respawnWithDebuff; public static boolean lockdownAltar; public static boolean causeHungerWithRegen; - + public static List wellBlacklist; public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic") { - @Override + @Override public ItemStack getIconItemStack() { return new ItemStack(ModItems.weakBloodOrb, 1, 0); } - @Override - public Item getTabIconItem() - { - return ModItems.weakBloodOrb; - } + @Override + public Item getTabIconItem() + { + return ModItems.weakBloodOrb; + } }; public static ToolMaterial bloodBoundToolMaterial = EnumHelper.addToolMaterial("BoundBlood", 4, 1000, 12.0f, 8.0f, 50); @@ -268,7 +176,7 @@ public class AlchemicalWizardry public static int entityShadeElementalID = 32; public static int entityHolyElementalID = 33; - + public static Fluid lifeEssenceFluid; // The instance of your mod that Forge uses. @@ -282,57 +190,53 @@ public class AlchemicalWizardry @EventHandler public void preInit(FMLPreInitializationEvent event) { - File bmDirectory = new File("config/BloodMagic/schematics"); - - if(!bmDirectory.exists() && bmDirectory.mkdirs()) - { - try - { - InputStream in = AlchemicalWizardry.class.getResourceAsStream("/assets/alchemicalwizardry/schematics/building/buildings.zip"); - System.out.println("none yet!"); - if(in != null) - { - System.out.println("I have found a zip!"); - ZipInputStream zipStream = new ZipInputStream(in); - ZipEntry entry = null; - - int extractCount = 0; - - while((entry = zipStream.getNextEntry()) != null) - { - File file = new File(bmDirectory, entry.getName()); - if(file.exists() && file.length() > 3L) - { - continue; - } - FileOutputStream out = new FileOutputStream(file); - - byte[] buffer = new byte[8192]; - int len; - while((len = zipStream.read(buffer)) != -1) - { - out.write(buffer, 0, len); - } - out.close(); - - extractCount++; - } - } - } - catch(Exception e) - { - - } - } + File bmDirectory = new File("config/BloodMagic/schematics"); + + if (!bmDirectory.exists() && bmDirectory.mkdirs()) + { + try + { + InputStream in = AlchemicalWizardry.class.getResourceAsStream("/assets/alchemicalwizardry/schematics/building/buildings.zip"); + System.out.println("none yet!"); + if (in != null) + { + System.out.println("I have found a zip!"); + ZipInputStream zipStream = new ZipInputStream(in); + ZipEntry entry = null; + + int extractCount = 0; + + while ((entry = zipStream.getNextEntry()) != null) + { + File file = new File(bmDirectory, entry.getName()); + if (file.exists() && file.length() > 3L) + { + continue; + } + FileOutputStream out = new FileOutputStream(file); + + byte[] buffer = new byte[8192]; + int len; + while ((len = zipStream.read(buffer)) != -1) + { + out.write(buffer, 0, len); + } + out.close(); + + extractCount++; + } + } + } catch (Exception e) + { + } + } TEDemonPortal.loadBuildingList(); - + MinecraftForge.EVENT_BUS.register(new LifeBucketHandler()); BloodMagicConfiguration.init(new File(event.getModConfigurationDirectory(), "AWWayofTime.cfg")); //Custom config stuff goes here - - Potion[] potionTypes = null; for (Field f : Potion.class.getDeclaredFields()) @@ -359,19 +263,15 @@ public class AlchemicalWizardry } AlchemicalWizardry.lifeEssenceFluid = new LifeEssence("Life Essence"); FluidRegistry.registerFluid(lifeEssenceFluid); - + ModBlocks.init(); - - ModBlocks.registerBlocksInPre(); - ModItems.init(); - ModItems.registerItems(); - + RecipeSorter.INSTANCE.register("AWWayofTime:shapedorb", ShapedBloodOrbRecipe.class, Category.SHAPED, "before:minecraft:shapeless"); RecipeSorter.INSTANCE.register("AWWayofTime:shapelessorb", ShapelessBloodOrbRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless"); - + Object eventHook = new AlchemicalWizardryEventHooks(); FMLCommonHandler.instance().bus().register(eventHook); MinecraftForge.EVENT_BUS.register(eventHook); @@ -382,17 +282,17 @@ public class AlchemicalWizardry public void load(FMLInitializationEvent event) { int craftingConstant = OreDictionary.WILDCARD_VALUE; - //TickRegistry.registerTickHandler(new AlchemicalWizardryTickHandler(), Side.SERVER); - + ModBlocks.registerBlocksInInit(); //blocks - + proxy.registerRenderers(); proxy.registerEntities(); proxy.registerEntityTrackers(); proxy.registerEvents(); + //ItemStacks used for crafting go here - ItemStack lapisStack = new ItemStack(Items.dye,1,4); + ItemStack lapisStack = new ItemStack(Items.dye, 1, 4); ItemStack lavaBucketStack = new ItemStack(Items.lava_bucket); ItemStack cobblestoneStack = new ItemStack(Blocks.cobblestone, 1, craftingConstant); ItemStack glassStack = new ItemStack(Blocks.glass, 1, craftingConstant); @@ -423,9 +323,7 @@ public class AlchemicalWizardry ItemStack saplingStack = new ItemStack(Blocks.sapling); ItemStack reedStack = new ItemStack(Items.reeds); ItemStack blankSlateStack = new ItemStack(ModItems.blankSlate, 1, craftingConstant); - //ItemStack glassShardStack = new ItemStack(glassShard); ItemStack weakBloodOrbStackCrafted = new ItemStack(ModItems.weakBloodOrb); - //ItemStack bloodiedShardStack = new ItemStack(bloodiedShard); ItemStack reinforcedSlateStack = new ItemStack(ModItems.reinforcedSlate, 1, craftingConstant); ItemStack weakBloodOrbStack = new ItemStack(ModItems.weakBloodOrb, 1, craftingConstant); ItemStack imbuedSlateStack = new ItemStack(ModItems.imbuedSlate, 1, craftingConstant); @@ -441,7 +339,7 @@ public class AlchemicalWizardry ItemStack energySwordStack = new ItemStack(ModItems.energySword); ItemStack energyBlasterStack = new ItemStack(ModItems.energyBlaster); ItemStack sacrificialDaggerStack = new ItemStack(ModItems.sacrificialDagger); - ItemStack bloodAltarStack = new ItemStack(ModBlocks.blockAltar,1,0); + ItemStack bloodAltarStack = new ItemStack(ModBlocks.blockAltar, 1, 0); ItemStack bloodRuneCraftedStack = new ItemStack(ModBlocks.bloodRune, 1); ItemStack bloodRuneStack = new ItemStack(ModBlocks.bloodRune); ItemStack speedRuneStack = new ItemStack(ModBlocks.speedRune); @@ -451,10 +349,6 @@ public class AlchemicalWizardry ItemStack miningSigilStackCrafted = new ItemStack(ModItems.sigilOfTheFastMiner); ItemStack divinationSigilStackCrafted = new ItemStack(ModItems.divinationSigil); ItemStack seerSigilStackCrafted = new ItemStack(ModItems.itemSeerSigil); -// ItemStack elementalInkWaterStack = new ItemStack(elementalInkWater); -// ItemStack elementalInkFireStack = new ItemStack(elementalInkFire); -// ItemStack elementalInkEarthStack = new ItemStack(elementalInkEarth); -// ItemStack elementalInkAirStack = new ItemStack(elementalInkAir); ItemStack waterScribeToolStack = new ItemStack(ModItems.waterScribeTool); ItemStack fireScribeToolStack = new ItemStack(ModItems.fireScribeTool); ItemStack earthScribeToolStack = new ItemStack(ModItems.earthScribeTool); @@ -481,7 +375,6 @@ public class AlchemicalWizardry ItemStack simpleCatalystStack = new ItemStack(ModItems.simpleCatalyst); ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner); ((ItemRitualDiviner) duskRitualDivinerStack.getItem()).setMaxRuneDisplacement(duskRitualDivinerStack, 1); - //weakBloodOrbStackCrafted.setItemDamage(weakBloodOrbStackCrafted.getMaxDamage()); waterSigilStackCrafted.setItemDamage(waterSigilStackCrafted.getMaxDamage()); lavaSigilStackCrafted.setItemDamage(lavaSigilStackCrafted.getMaxDamage()); voidSigilStackCrafted.setItemDamage(voidSigilStackCrafted.getMaxDamage()); @@ -499,37 +392,24 @@ public class AlchemicalWizardry ItemStack crepitousStack = new ItemStack(ModItems.crepitous); ItemStack magicalesStack = new ItemStack(ModItems.magicales); //All crafting goes here - // GameRegistry.addRecipe(orbOfTestingStack, "x x", " ", "x x", 'x', cobblestoneStack); - //GameRegistry.addRecipe(glassShardStack, " x", "y ", 'x', ironIngotStack, 'y', glassStack); - //GameRegistry.addRecipe(weakBloodOrbStackCrafted, "xxx", "xdx", "www", 'x', bloodiedShardStack, 'd', diamondStack, 'w', woolStack); GameRegistry.addRecipe(sacrificialDaggerStack, "ggg", " dg", "i g", 'g', glassStack, 'd', goldIngotStack, 'i', ironIngotStack); - //GameRegistry.addRecipe(blankSlateStack, "sgs", "gig", "sgs", 's', stoneStack, 'g', goldNuggetStack, 'i', ironIngotStack); - //GameRegistry.addRecipe(reinforcedSlateStack, "rir", "ibi", "gig", 'r', redstoneStack, 'i', ironIngotStack, 'b', blankSlateStack, 'g', glowstoneBlockStack); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(lavaCrystalStackCrafted, "glg", "lbl", "odo", 'g', glassStack, 'l', lavaBucketStack, 'b', weakBloodOrbStack, 'd', diamondStack, 'o', obsidianStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(waterSigilStackCrafted, "www", "wbw", "wow", 'w', waterBucketStack, 'b', blankSlateStack, 'o', weakBloodOrbStack)); GameRegistry.addRecipe(lavaSigilStackCrafted, "lml", "lbl", "lcl", 'l', lavaBucketStack, 'b', blankSlateStack, 'm', magmaCreamStack, 'c', lavaCrystalStack); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(voidSigilStackCrafted, "ese", "ere", "eoe", 'e', emptyBucketStack, 'r', reinforcedSlateStack, 'o', apprenticeBloodOrbStack, 's', stringStack)); GameRegistry.addRecipe(bloodAltarStack, "s s", "scs", "gdg", 's', stoneStack, 'c', furnaceStack, 'd', diamondStack, 'g', goldIngotStack); - //GameRegistry.addRecipe(energySwordStack, " o ", " o ", " s ", 'o', weakBloodOrbStack, 's', diamondSwordStack); - //GameRegistry.addRecipe(energyBlasterStack, "oi ", "gdi", " rd", 'o', weakBloodOrbStack, 'i', ironIngotStack, 'd', diamondStack, 'r', reinforcedSlateStack, 'g', goldIngotStack); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(bloodRuneCraftedStack, "sss", "ror", "sss", 's', stoneStack, 'o', weakBloodOrbStack, 'r', blankSlateStack)); GameRegistry.addRecipe(speedRuneStack, "sbs", "uru", "sbs", 'u', sugarStack, 's', stoneStack, 'r', bloodRuneStack, 'b', blankSlateStack); - //GameRegistry.addRecipe(efficiencyRuneStack, "sbs", "rur", "sbs", 'r', redstoneStack, 's', stoneStack, 'u', bloodRuneStack,'b',blankSlateStack); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.bloodRune, 1, 1), "sbs", "bob", "srs", 's', stoneStack, 'o', magicianBloodOrbStack, 'b', emptyBucketStack, 'r', new ItemStack(ModItems.imbuedSlate))); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.bloodRune, 1, 2), "sbs", "bob", "srs", 's', stoneStack, 'o', magicianBloodOrbStack, 'b', waterBucketStack, 'r', new ItemStack(ModItems.imbuedSlate))); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.bloodRune, 1, 3), "sws", "ror", "sws", 's', stoneStack, 'o', new ItemStack(ModItems.masterBloodOrb), 'w', weakBloodOrbStack, 'r', new ItemStack(ModItems.demonicSlate))); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.bloodRune, 1, 4), "srs", "beb", "sos", 's', obsidianStack, 'o', new ItemStack(ModItems.masterBloodOrb), 'r', new ItemStack(ModItems.demonicSlate), 'b', emptyBucketStack,'e',new ItemStack(ModBlocks.bloodRune, 1, 1))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.bloodRune, 1, 4), "srs", "beb", "sos", 's', obsidianStack, 'o', new ItemStack(ModItems.masterBloodOrb), 'r', new ItemStack(ModItems.demonicSlate), 'b', emptyBucketStack, 'e', new ItemStack(ModBlocks.bloodRune, 1, 1))); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(airSigilStack, "fgf", "fsf", "fof", 'f', featherStack, 'g', ghastTearStack, 's', reinforcedSlateStack, 'o', apprenticeBloodOrbStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(miningSigilStackCrafted, "sps", "hra", "sos", 'o', apprenticeBloodOrbStack, 's', stoneStack, 'p', ironPickaxeStack, 'h', ironShovelStack, 'a', ironAxeStack, 'r', reinforcedSlateStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(runeOfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', goldIngotStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(runeOfSelfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', glowstoneDustStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(divinationSigilStackCrafted, "ggg", "gsg", "gog", 'g', glassStack, 's', blankSlateStack, 'o', weakBloodOrbStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(seerSigilStackCrafted, "gbg", "gsg", "gog", 'g', glassStack, 's', divinationSigilStackCrafted, 'o', apprenticeBloodOrbStack, 'b', new ItemStack(ModItems.bucketLife))); - -// GameRegistry.addRecipe(waterScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkWaterStack); -// GameRegistry.addRecipe(fireScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkFireStack); -// GameRegistry.addRecipe(earthScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkEarthStack); -// GameRegistry.addRecipe(airScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkAirStack); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(ritualStoneStackCrafted, "srs", "ror", "srs", 's', obsidianStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(masterRitualStoneStack, "brb", "ror", "brb", 'b', obsidianStack, 'o', magicianBloodOrbStack, 'r', ritualStoneStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(imperfectRitualStoneStack, "bsb", "sos", "bsb", 's', stoneStack, 'b', obsidianStack, 'o', weakBloodOrbStack)); @@ -568,32 +448,22 @@ public class AlchemicalWizardry customPotionInhibit = (new PotionInhibit(customPotionInhibitID, false, 0)).setIconIndex(0, 0).setPotionName("Inhibit"); customPotionFlight = (new PotionFlight(customPotionFlightID, false, 0)).setIconIndex(0, 0).setPotionName("Flight"); customPotionReciprocation = (new PotionReciprocation(customPotionReciprocationID, false, 0xFFFFFF)).setIconIndex(0, 0).setPotionName("Reciprocation"); - customPotionFlameCloak = (new PotionFlameCloak(customPotionFlameCloakID,false,0).setIconIndex(0,0).setPotionName("Flame Cloak")); - customPotionIceCloak = (new PotionIceCloak(customPotionIceCloakID,false,0).setIconIndex(0,0).setPotionName("Ice Cloak")); - customPotionHeavyHeart = (new PotionHeavyHeart(customPotionHeavyHeartID,true,0).setIconIndex(0, 0).setPotionName("Heavy Heart")); - customPotionFireFuse = (new PotionFireFuse(customPotionFireFuseID,true,0).setIconIndex(0, 0).setPotionName("Fire Fuse")); - customPotionPlanarBinding = (new PotionPlanarBinding(customPotionPlanarBindingID,true,0).setIconIndex(0,0).setPotionName("Planar Binding")); - customPotionSoulFray = (new PotionSoulFray(customPotionSoulFrayID,true,0).setIconIndex(0,0).setPotionName("Soul Fray")); - customPotionSoulHarden = (new PotionSoulHarden(customPotionSoulHardenID,false,0).setIconIndex(0,0).setPotionName("Soul Harden")); - customPotionDeaf = (new PotionDeaf(customPotionDeafID,true,0).setIconIndex(0,0).setPotionName("Deafness")); - customPotionFeatherFall = (new PotionFeatherFall(customPotionFeatherFallID,false,0).setIconIndex(0,0).setPotionName("Feather Fall")); - + customPotionFlameCloak = (new PotionFlameCloak(customPotionFlameCloakID, false, 0).setIconIndex(0, 0).setPotionName("Flame Cloak")); + customPotionIceCloak = (new PotionIceCloak(customPotionIceCloakID, false, 0).setIconIndex(0, 0).setPotionName("Ice Cloak")); + customPotionHeavyHeart = (new PotionHeavyHeart(customPotionHeavyHeartID, true, 0).setIconIndex(0, 0).setPotionName("Heavy Heart")); + customPotionFireFuse = (new PotionFireFuse(customPotionFireFuseID, true, 0).setIconIndex(0, 0).setPotionName("Fire Fuse")); + customPotionPlanarBinding = (new PotionPlanarBinding(customPotionPlanarBindingID, true, 0).setIconIndex(0, 0).setPotionName("Planar Binding")); + customPotionSoulFray = (new PotionSoulFray(customPotionSoulFrayID, true, 0).setIconIndex(0, 0).setPotionName("Soul Fray")); + customPotionSoulHarden = (new PotionSoulHarden(customPotionSoulHardenID, false, 0).setIconIndex(0, 0).setPotionName("Soul Harden")); + customPotionDeaf = (new PotionDeaf(customPotionDeafID, true, 0).setIconIndex(0, 0).setPotionName("Deafness")); + customPotionFeatherFall = (new PotionFeatherFall(customPotionFeatherFallID, false, 0).setIconIndex(0, 0).setPotionName("Feather Fall")); + ItemStack masterBloodOrbStack = new ItemStack(ModItems.masterBloodOrb); - - //FluidStack lifeEssenceFluidStack = new FluidStack(lifeEssenceFluid, 1); - //LiquidStack lifeEssence = new LiquidStack(lifeEssenceFlowing, 1); - //LiquidDictionary.getOrCreateLiquid("Life Essence", lifeEssence); - // ModBlocks.blockLifeEssence.setUnlocalizedName("lifeEssenceBlock"); FluidContainerRegistry.registerFluidContainer(lifeEssenceFluid, new ItemStack(ModItems.bucketLife), FluidContainerRegistry.EMPTY_BUCKET); - - //lifeEssenceFluid.setUnlocalizedName("lifeEssence"); - //LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getLiquid("Life Essence", LiquidContainerRegistry.BUCKET_VOLUME), new ItemStack(AlchemicalWizardry.bucketLife), new ItemStack(Items.bucketEmpty))); - //GameRegistry.registerBlock(testingBlock, "testingBlock"); - //LanguageRegistry.addName(testingBlock, "Testing Block"); - //(testingBlock, "pickaxe", 0); ModBlocks.blockAltar.setHarvestLevel("pickaxe", 1); + //Register Tile Entity GameRegistry.registerTileEntity(TEAltar.class, "containerAltar"); GameRegistry.registerTileEntity(TEMasterStone.class, "containerMasterStone"); @@ -609,14 +479,13 @@ public class AlchemicalWizardry GameRegistry.registerTileEntity(TESpellEffectBlock.class, "containerSpellEffectBlock"); GameRegistry.registerTileEntity(TESpellModifierBlock.class, "containerSpellModifierBlock"); GameRegistry.registerTileEntity(TESpellEnhancementBlock.class, "containerSpellEnhancementBlock"); - GameRegistry.registerTileEntity(TESpectralContainer.class,"spectralContainerTileEntity"); + GameRegistry.registerTileEntity(TESpectralContainer.class, "spectralContainerTileEntity"); GameRegistry.registerTileEntity(TEDemonPortal.class, "containerDemonPortal"); GameRegistry.registerTileEntity(TESchematicSaver.class, "containerSchematicSaver"); GameRegistry.registerTileEntity(TESpectralBlock.class, "containerSpectralBlock"); GameRegistry.registerTileEntity(TEReagentConduit.class, "containerReagentConduit"); GameRegistry.registerTileEntity(TEBellJar.class, "containerBellJar"); GameRegistry.registerTileEntity(TEAlchemicCalcinator.class, "containerAlchemicCalcinator"); - //GameRegistry.registerBlock(ModBlocks.blockSpellEffect,"blockSpellEffect"); ModBlocks.bloodRune.setHarvestLevel("pickaxe", 2); ModBlocks.speedRune.setHarvestLevel("pickaxe", 2); ModBlocks.efficiencyRune.setHarvestLevel("pickaxe", 2); @@ -635,53 +504,42 @@ public class AlchemicalWizardry ModBlocks.blockPedestal.setHarvestLevel("pickaxe", 2); ModBlocks.blockPlinth.setHarvestLevel("pickaxe", 2); ModBlocks.blockTeleposer.setHarvestLevel("pickaxe", 2); + //Fuel handler GameRegistry.registerFuelHandler(new AlchemicalWizardryFuelHandler()); - //EntityRegistry.registerModEntity(EnergyBlastProjectile.class, "BlasterProj", 0, this, 128, 5, true); - + //Gui registration - // NetworkRegistry.instance().registerGuiHandler(this, new GuiHandlerAltar()); UpgradedAltars.loadAltars(); SigilOfHolding.initiateSigilOfHolding(); ArmourForge.initializeRecipes(); TEPlinth.initialize(); - + this.initAlchemyPotionRecipes(); this.initAltarRecipes(); this.initRituals(); - this.initBindingRecipes(); + this.initBindingRecipes(); this.initHarvestRegistry(); this.initCombinedAlchemyPotionRecipes(); ReagentRegistry.initReagents(); - - //MinecraftForge.setToolClass(ModItems.boundPickaxe, "pickaxe", 5); - //MinecraftForge.setToolClass(ModItems.boundAxe, "axe", 5); - //MinecraftForge.setToolClass(ModItems.boundShovel, "shovel", 5); + MinecraftForge.EVENT_BUS.register(new ModLivingDropsEvent()); proxy.InitRendering(); NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); -// ItemStack[] comp = new ItemStack[5]; -// for(int i=0;i<5;i++) -// { -// comp[i] = redstoneStack; -// } -// AlchemyRecipeRegistry.registerRecipe(glowstoneDustStack, 2, comp, 2); - + ItemStack gunpowderStack = new ItemStack(Items.gunpowder); - - ItemStack offensaStack = new ItemStack(ModItems.baseAlchemyItems,1,0); - ItemStack praesidiumStack = new ItemStack(ModItems.baseAlchemyItems,1,1); - ItemStack orbisTerraeStack = new ItemStack(ModItems.baseAlchemyItems,1,2); - ItemStack strengthenedCatalystStack = new ItemStack(ModItems.baseAlchemyItems,1,3); - ItemStack concentratedCatalystStack = new ItemStack(ModItems.baseAlchemyItems,1,4); - ItemStack fracturedBoneStack = new ItemStack(ModItems.baseAlchemyItems,1,5); - ItemStack virtusStack = new ItemStack(ModItems.baseAlchemyItems,1,6); - ItemStack reductusStack = new ItemStack(ModItems.baseAlchemyItems,1,7); - ItemStack potentiaStack = new ItemStack(ModItems.baseAlchemyItems,1,8); - - ItemStack strengthenedCatalystStackCrafted = new ItemStack(ModItems.baseAlchemyItems,2,3); - ItemStack fracturedBoneStackCrafted = new ItemStack(ModItems.baseAlchemyItems,4,5); - + ItemStack offensaStack = new ItemStack(ModItems.baseAlchemyItems, 1, 0); + ItemStack praesidiumStack = new ItemStack(ModItems.baseAlchemyItems, 1, 1); + ItemStack orbisTerraeStack = new ItemStack(ModItems.baseAlchemyItems, 1, 2); + ItemStack strengthenedCatalystStack = new ItemStack(ModItems.baseAlchemyItems, 1, 3); + ItemStack concentratedCatalystStack = new ItemStack(ModItems.baseAlchemyItems, 1, 4); + ItemStack fracturedBoneStack = new ItemStack(ModItems.baseAlchemyItems, 1, 5); + ItemStack virtusStack = new ItemStack(ModItems.baseAlchemyItems, 1, 6); + ItemStack reductusStack = new ItemStack(ModItems.baseAlchemyItems, 1, 7); + ItemStack potentiaStack = new ItemStack(ModItems.baseAlchemyItems, 1, 8); + + ItemStack strengthenedCatalystStackCrafted = new ItemStack(ModItems.baseAlchemyItems, 2, 3); + ItemStack fracturedBoneStackCrafted = new ItemStack(ModItems.baseAlchemyItems, 4, 5); + //TODO NEW RECIPES! AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.weakBindingAgent), 10, new ItemStack[]{simpleCatalystStack, simpleCatalystStack, new ItemStack(Items.clay_ball)}, 2); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.standardBindingAgent), 15, new ItemStack[]{new ItemStack(ModItems.weakBindingAgent), sanctusStack, new ItemStack(ModItems.crystallos)}, 3); @@ -706,21 +564,21 @@ public class AlchemicalWizardry AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.enhancedFillingAgent), 25, new ItemStack[]{new ItemStack(ModItems.standardFillingAgent), new ItemStack(ModItems.aquasalus), new ItemStack(ModItems.magicales)}, 4); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.activationCrystal, 1, 1), 100, new ItemStack[]{new ItemStack(ModItems.activationCrystal, 1, 0), new ItemStack(ModItems.demonBloodShard), incendiumStack, aquasalusStack, aetherStack}, 4); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.activationCrystal, 1, 1), 100, new ItemStack[]{new ItemStack(ModItems.activationCrystal, 1, 0), new ItemStack(Items.nether_star), incendiumStack, aquasalusStack, aetherStack}, 4); - - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.web),2,new ItemStack[]{new ItemStack(Items.string),new ItemStack(Items.string),new ItemStack(Items.string),new ItemStack(Items.string),new ItemStack(Items.string)},1); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.gunpowder,2,0), 2, new ItemStack[]{gunpowderStack, new ItemStack(Items.coal), new ItemStack(Blocks.sand)}, 1); - - AlchemyRecipeRegistry.registerRecipe(strengthenedCatalystStackCrafted, 10, new ItemStack[]{simpleCatalystStack, simpleCatalystStack, new ItemStack(Items.dye,1,15), new ItemStack(Items.nether_wart)}, 3); - AlchemyRecipeRegistry.registerRecipe(offensaStack,10, new ItemStack[]{strengthenedCatalystStack,incendiumStack, new ItemStack(Items.arrow), new ItemStack(Items.flint), new ItemStack(Items.arrow)},3); - AlchemyRecipeRegistry.registerRecipe(praesidiumStack, 10, new ItemStack[]{strengthenedCatalystStack,tennebraeStack,ironIngotStack,new ItemStack(Blocks.web),redstoneStack}, 3); - AlchemyRecipeRegistry.registerRecipe(orbisTerraeStack, 10, new ItemStack[]{strengthenedCatalystStack,terraeStack, gunpowderStack, new ItemStack(Blocks.netherrack), new ItemStack(Blocks.sand)}, 3); - AlchemyRecipeRegistry.registerRecipe(concentratedCatalystStack,10,new ItemStack[]{strengthenedCatalystStack,fracturedBoneStack,goldNuggetStack},4); - AlchemyRecipeRegistry.registerRecipe(fracturedBoneStackCrafted, 2, new ItemStack[]{new ItemStack(Items.bone), new ItemStack(Items.bone),new ItemStack(Items.bone),new ItemStack(Items.bone), gunpowderStack},1); - AlchemyRecipeRegistry.registerRecipe(virtusStack,20, new ItemStack[]{redstoneStack, new ItemStack(Items.coal),strengthenedCatalystStack,redstoneStack,gunpowderStack}, 3); - AlchemyRecipeRegistry.registerRecipe(reductusStack,20,new ItemStack[]{redstoneStack, goldIngotStack, strengthenedCatalystStack,new ItemStack(Blocks.soul_sand), new ItemStack(Items.carrot)},3); - AlchemyRecipeRegistry.registerRecipe(potentiaStack,20, new ItemStack[]{glowstoneDustStack,strengthenedCatalystStack,lapisStack,lapisStack,new ItemStack(Items.quartz)}, 3); - - + + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.web), 2, new ItemStack[]{new ItemStack(Items.string), new ItemStack(Items.string), new ItemStack(Items.string), new ItemStack(Items.string), new ItemStack(Items.string)}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.gunpowder, 2, 0), 2, new ItemStack[]{gunpowderStack, new ItemStack(Items.coal), new ItemStack(Blocks.sand)}, 1); + + AlchemyRecipeRegistry.registerRecipe(strengthenedCatalystStackCrafted, 10, new ItemStack[]{simpleCatalystStack, simpleCatalystStack, new ItemStack(Items.dye, 1, 15), new ItemStack(Items.nether_wart)}, 3); + AlchemyRecipeRegistry.registerRecipe(offensaStack, 10, new ItemStack[]{strengthenedCatalystStack, incendiumStack, new ItemStack(Items.arrow), new ItemStack(Items.flint), new ItemStack(Items.arrow)}, 3); + AlchemyRecipeRegistry.registerRecipe(praesidiumStack, 10, new ItemStack[]{strengthenedCatalystStack, tennebraeStack, ironIngotStack, new ItemStack(Blocks.web), redstoneStack}, 3); + AlchemyRecipeRegistry.registerRecipe(orbisTerraeStack, 10, new ItemStack[]{strengthenedCatalystStack, terraeStack, gunpowderStack, new ItemStack(Blocks.netherrack), new ItemStack(Blocks.sand)}, 3); + AlchemyRecipeRegistry.registerRecipe(concentratedCatalystStack, 10, new ItemStack[]{strengthenedCatalystStack, fracturedBoneStack, goldNuggetStack}, 4); + AlchemyRecipeRegistry.registerRecipe(fracturedBoneStackCrafted, 2, new ItemStack[]{new ItemStack(Items.bone), new ItemStack(Items.bone), new ItemStack(Items.bone), new ItemStack(Items.bone), gunpowderStack}, 1); + AlchemyRecipeRegistry.registerRecipe(virtusStack, 20, new ItemStack[]{redstoneStack, new ItemStack(Items.coal), strengthenedCatalystStack, redstoneStack, gunpowderStack}, 3); + AlchemyRecipeRegistry.registerRecipe(reductusStack, 20, new ItemStack[]{redstoneStack, goldIngotStack, strengthenedCatalystStack, new ItemStack(Blocks.soul_sand), new ItemStack(Items.carrot)}, 3); + AlchemyRecipeRegistry.registerRecipe(potentiaStack, 20, new ItemStack[]{glowstoneDustStack, strengthenedCatalystStack, lapisStack, lapisStack, new ItemStack(Items.quartz)}, 3); + + HomSpellRegistry.registerBasicSpell(new ItemStack(Items.flint_and_steel), new SpellFireBurst()); HomSpellRegistry.registerBasicSpell(new ItemStack(Blocks.ice), new SpellFrozenWater()); HomSpellRegistry.registerBasicSpell(new ItemStack(Blocks.tnt), new SpellExplosions()); @@ -742,8 +600,9 @@ public class AlchemicalWizardry SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityWaterElementalID), new ItemStack[]{aquasalusStack, aquasalusStack, aquasalusStack, aquasalusStack, aquasalusStack, aquasalusStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityEarthElementalID), new ItemStack[]{terraeStack, terraeStack, terraeStack, terraeStack, terraeStack, terraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityFireElementalID), new ItemStack[]{incendiumStack, incendiumStack, incendiumStack, incendiumStack, incendiumStack, incendiumStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); - SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityShadeElementalID), new ItemStack[]{tennebraeStack,tennebraeStack,tennebraeStack,tennebraeStack,tennebraeStack,tennebraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityShadeElementalID), new ItemStack[]{tennebraeStack, tennebraeStack, tennebraeStack, tennebraeStack, tennebraeStack, tennebraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); SummoningRegistry.registerSummon(new SummoningHelperAW(this.entityHolyElementalID), new ItemStack[]{sanctusStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + //Custom mobs EntityRegistry.registerModEntity(EntityFallenAngel.class, "FallenAngel", this.entityFallenAngelID, this, 80, 3, true); EntityRegistry.registerModEntity(EntityLowerGuardian.class, "LowerGuardian", this.entityLowerGuardianID, this, 80, 3, true); @@ -759,7 +618,7 @@ public class AlchemicalWizardry EntityRegistry.registerModEntity(EntityFireElemental.class, "FireElemental", this.entityFireElementalID, this, 120, 3, true); EntityRegistry.registerModEntity(EntityShadeElemental.class, "ShadeElemental", this.entityShadeElementalID, this, 120, 3, true); EntityRegistry.registerModEntity(EntityHolyElemental.class, "HolyElemental", this.entityHolyElementalID, this, 120, 3, true); - //EntityRegistry.addSpawn(EntityFallenAngel.class, 5, 1, 5, EnumCreatureType.creature, BiomeGenBase.biomeList); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.standardBindingAgent), 1, 3, this.standardBindingAgentDungeonChance)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.mundanePowerCatalyst), 1, 1, this.mundanePowerCatalystDungeonChance)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.mundaneLengtheningCatalyst), 1, 1, this.mundaneLengtheningCatalystDungeonChance)); @@ -767,137 +626,138 @@ public class AlchemicalWizardry ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.averageLengtheningCatalyst), 1, 1, this.averageLengtheningCatalystDungeonChance)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.greaterPowerCatalyst), 1, 1, this.greaterPowerCatalystDungeonChance)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.greaterLengtheningCatalyst), 1, 1, this.greaterLengtheningCatalystDungeonChance)); + //Ore Dictionary Registration OreDictionary.registerOre("oreCoal", Blocks.coal_ore); MeteorRegistry.registerMeteorParadigm(diamondStack, diamondMeteorArray, diamondMeteorRadius); MeteorRegistry.registerMeteorParadigm(stoneStack, this.stoneMeteorArray, this.stoneMeteorRadius); MeteorRegistry.registerMeteorParadigm(ironBlockStack, this.ironBlockMeteorArray, this.ironBlockMeteorRadius); MeteorRegistry.registerMeteorParadigm(new ItemStack(Items.nether_star), this.netherStarMeteorArray, this.netherStarMeteorRadius); - + //Register spell component recipes ItemStack complexSpellCrystalStack = new ItemStack(ModItems.itemComplexSpellCrystal); - ItemStack quartzRodStack = new ItemStack(ModItems.baseItems,1,0); - ItemStack emptyCoreStack = new ItemStack(ModItems.baseItems,1,1); - ItemStack magicalesCableStack = new ItemStack(ModItems.baseItems,1,2); - ItemStack woodBraceStack = new ItemStack(ModItems.baseItems,1,3); - ItemStack stoneBraceStack = new ItemStack(ModItems.baseItems,1,4); - ItemStack projectileCoreStack = new ItemStack(ModItems.baseItems,1,5); - ItemStack selfCoreStack = new ItemStack(ModItems.baseItems,1,6); - ItemStack meleeCoreStack = new ItemStack(ModItems.baseItems,1,7); - ItemStack toolCoreStack = new ItemStack(ModItems.baseItems,1,26); - ItemStack paradigmBackPlateStack = new ItemStack(ModItems.baseItems,1,8); - ItemStack outputCableStack = new ItemStack(ModItems.baseItems,1,9); - ItemStack flameCoreStack = new ItemStack(ModItems.baseItems,1,10); - ItemStack iceCoreStack = new ItemStack(ModItems.baseItems,1,11); - ItemStack windCoreStack = new ItemStack(ModItems.baseItems,1,12); - ItemStack earthCoreStack = new ItemStack(ModItems.baseItems,1,13); - ItemStack inputCableStack = new ItemStack(ModItems.baseItems,1,14); - ItemStack crackedRunicPlateStack = new ItemStack(ModItems.baseItems,1,15); - ItemStack runicPlateStack = new ItemStack(ModItems.baseItems,1,16); - ItemStack imbuedRunicPlateStack = new ItemStack(ModItems.baseItems,1,17); - ItemStack defaultCoreStack = new ItemStack(ModItems.baseItems,1,18); - ItemStack offenseCoreStack = new ItemStack(ModItems.baseItems,1,19); - ItemStack defensiveCoreStack = new ItemStack(ModItems.baseItems,1,20); - ItemStack environmentalCoreStack = new ItemStack(ModItems.baseItems,1,21); - ItemStack powerCoreStack = new ItemStack(ModItems.baseItems,1,22); - ItemStack costCoreStack = new ItemStack(ModItems.baseItems,1,23); - ItemStack potencyCoreStack = new ItemStack(ModItems.baseItems,1,24); - ItemStack obsidianBraceStack = new ItemStack(ModItems.baseItems,1,25); - - ItemStack magicalesCraftedCableStack = new ItemStack(ModItems.baseItems,5,2); - ItemStack crackedRunicPlateStackCrafted = new ItemStack(ModItems.baseItems,2,15); - ItemStack runicPlateStackCrafted = new ItemStack(ModItems.baseItems,2,16); - + ItemStack quartzRodStack = new ItemStack(ModItems.baseItems, 1, 0); + ItemStack emptyCoreStack = new ItemStack(ModItems.baseItems, 1, 1); + ItemStack magicalesCableStack = new ItemStack(ModItems.baseItems, 1, 2); + ItemStack woodBraceStack = new ItemStack(ModItems.baseItems, 1, 3); + ItemStack stoneBraceStack = new ItemStack(ModItems.baseItems, 1, 4); + ItemStack projectileCoreStack = new ItemStack(ModItems.baseItems, 1, 5); + ItemStack selfCoreStack = new ItemStack(ModItems.baseItems, 1, 6); + ItemStack meleeCoreStack = new ItemStack(ModItems.baseItems, 1, 7); + ItemStack toolCoreStack = new ItemStack(ModItems.baseItems, 1, 26); + ItemStack paradigmBackPlateStack = new ItemStack(ModItems.baseItems, 1, 8); + ItemStack outputCableStack = new ItemStack(ModItems.baseItems, 1, 9); + ItemStack flameCoreStack = new ItemStack(ModItems.baseItems, 1, 10); + ItemStack iceCoreStack = new ItemStack(ModItems.baseItems, 1, 11); + ItemStack windCoreStack = new ItemStack(ModItems.baseItems, 1, 12); + ItemStack earthCoreStack = new ItemStack(ModItems.baseItems, 1, 13); + ItemStack inputCableStack = new ItemStack(ModItems.baseItems, 1, 14); + ItemStack crackedRunicPlateStack = new ItemStack(ModItems.baseItems, 1, 15); + ItemStack runicPlateStack = new ItemStack(ModItems.baseItems, 1, 16); + ItemStack imbuedRunicPlateStack = new ItemStack(ModItems.baseItems, 1, 17); + ItemStack defaultCoreStack = new ItemStack(ModItems.baseItems, 1, 18); + ItemStack offenseCoreStack = new ItemStack(ModItems.baseItems, 1, 19); + ItemStack defensiveCoreStack = new ItemStack(ModItems.baseItems, 1, 20); + ItemStack environmentalCoreStack = new ItemStack(ModItems.baseItems, 1, 21); + ItemStack powerCoreStack = new ItemStack(ModItems.baseItems, 1, 22); + ItemStack costCoreStack = new ItemStack(ModItems.baseItems, 1, 23); + ItemStack potencyCoreStack = new ItemStack(ModItems.baseItems, 1, 24); + ItemStack obsidianBraceStack = new ItemStack(ModItems.baseItems, 1, 25); + + ItemStack magicalesCraftedCableStack = new ItemStack(ModItems.baseItems, 5, 2); + ItemStack crackedRunicPlateStackCrafted = new ItemStack(ModItems.baseItems, 2, 15); + ItemStack runicPlateStackCrafted = new ItemStack(ModItems.baseItems, 2, 16); + GameRegistry.addRecipe(quartzRodStack, "qqq", 'q', new ItemStack(Items.quartz)); - GameRegistry.addRecipe(emptyCoreStack,"gig","nrn","gig",'n',goldIngotStack,'i',ironIngotStack,'g',glassStack,'r',simpleCatalystStack); - GameRegistry.addRecipe(magicalesCraftedCableStack,"sss","mmm","sss",'s',new ItemStack(Items.string),'m',magicalesStack); - GameRegistry.addRecipe(woodBraceStack," il","ili","li ",'l', new ItemStack(Blocks.log,1,craftingConstant),'i',new ItemStack(Items.string)); - GameRegistry.addRecipe(stoneBraceStack," is","isi","si ",'i', ironIngotStack,'s',reinforcedSlateStack); - GameRegistry.addRecipe(obsidianBraceStack," is","ibi","si ",'i', obsidianStack,'s',reinforcedSlateStack,'b',stoneBraceStack); - - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(projectileCoreStack, "mbm","aca","mom",'c', emptyCoreStack,'b',weakBloodShardStack,'m', magicalesStack,'o', magicianBloodOrbStack,'a',new ItemStack(Items.arrow))); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(selfCoreStack,"sbs","ncn","sos",'c', emptyCoreStack, 's',sanctusStack,'b', weakBloodShardStack,'o', magicianBloodOrbStack,'n',glowstoneDustStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(meleeCoreStack,"sbs","ncn","sos",'c', emptyCoreStack, 's',incendiumStack,'b', weakBloodShardStack,'o', magicianBloodOrbStack,'n',new ItemStack(Items.fire_charge))); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(toolCoreStack,"sbs","ncn","sos",'c', emptyCoreStack, 's',terraeStack,'b', weakBloodShardStack,'o', magicianBloodOrbStack,'n',new ItemStack(Blocks.obsidian))); + GameRegistry.addRecipe(emptyCoreStack, "gig", "nrn", "gig", 'n', goldIngotStack, 'i', ironIngotStack, 'g', glassStack, 'r', simpleCatalystStack); + GameRegistry.addRecipe(magicalesCraftedCableStack, "sss", "mmm", "sss", 's', new ItemStack(Items.string), 'm', magicalesStack); + GameRegistry.addRecipe(woodBraceStack, " il", "ili", "li ", 'l', new ItemStack(Blocks.log, 1, craftingConstant), 'i', new ItemStack(Items.string)); + GameRegistry.addRecipe(stoneBraceStack, " is", "isi", "si ", 'i', ironIngotStack, 's', reinforcedSlateStack); + GameRegistry.addRecipe(obsidianBraceStack, " is", "ibi", "si ", 'i', obsidianStack, 's', reinforcedSlateStack, 'b', stoneBraceStack); - GameRegistry.addRecipe(paradigmBackPlateStack,"isi","rgr","isi",'i',ironIngotStack,'r',stoneStack,'g',goldIngotStack,'s',reinforcedSlateStack); - GameRegistry.addRecipe(outputCableStack, " si","s c"," si",'s',stoneStack,'i',ironIngotStack,'c',simpleCatalystStack); - - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(flameCoreStack,"mdm","scs","mom",'m',incendiumStack,'c',emptyCoreStack,'o',magicianBloodOrbStack,'d',diamondStack,'s',weakBloodShardStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(iceCoreStack,"mdm","scs","mom",'m',crystallosStack,'c',emptyCoreStack,'o',magicianBloodOrbStack,'d',diamondStack,'s',weakBloodShardStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(windCoreStack,"mdm","scs","mom",'m',aetherStack,'c',emptyCoreStack,'o',magicianBloodOrbStack,'d',diamondStack,'s',weakBloodShardStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(earthCoreStack,"mdm","scs","mom",'m',terraeStack,'c',emptyCoreStack,'o',magicianBloodOrbStack,'d',diamondStack,'s',weakBloodShardStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(projectileCoreStack, "mbm", "aca", "mom", 'c', emptyCoreStack, 'b', weakBloodShardStack, 'm', magicalesStack, 'o', magicianBloodOrbStack, 'a', new ItemStack(Items.arrow))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(selfCoreStack, "sbs", "ncn", "sos", 'c', emptyCoreStack, 's', sanctusStack, 'b', weakBloodShardStack, 'o', magicianBloodOrbStack, 'n', glowstoneDustStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(meleeCoreStack, "sbs", "ncn", "sos", 'c', emptyCoreStack, 's', incendiumStack, 'b', weakBloodShardStack, 'o', magicianBloodOrbStack, 'n', new ItemStack(Items.fire_charge))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(toolCoreStack, "sbs", "ncn", "sos", 'c', emptyCoreStack, 's', terraeStack, 'b', weakBloodShardStack, 'o', magicianBloodOrbStack, 'n', new ItemStack(Blocks.obsidian))); - GameRegistry.addRecipe(inputCableStack, "ws ","rcs","ws ",'w',blankSlateStack,'s',stoneStack,'r',imbuedSlateStack,'c',simpleCatalystStack); - - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(defaultCoreStack,"msm","geg","mom",'m', strengthenedCatalystStack,'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's',weakBloodShardStack, 'g', goldIngotStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(offenseCoreStack,"msm","geg","mom",'m', offensaStack,'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's',weakBloodShardStack, 'g', goldIngotStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(defensiveCoreStack,"msm","geg","mom",'m', praesidiumStack,'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's',weakBloodShardStack, 'g', goldIngotStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(environmentalCoreStack,"msm","geg","mom",'m', orbisTerraeStack,'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's',weakBloodShardStack, 'g', goldIngotStack)); - - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(powerCoreStack,"msm","geg","mom",'m', virtusStack,'e', emptyCoreStack, 'o', masterBloodOrbStack, 's',weakBloodShardStack, 'g', goldIngotStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(costCoreStack,"msm","geg","mom",'m', reductusStack,'e', emptyCoreStack, 'o', masterBloodOrbStack, 's',weakBloodShardStack, 'g', goldIngotStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(potencyCoreStack,"msm","geg","mom",'m', potentiaStack,'e', emptyCoreStack, 'o', masterBloodOrbStack, 's',weakBloodShardStack, 'g', goldIngotStack)); - - AlchemyRecipeRegistry.registerRecipe(crackedRunicPlateStackCrafted, 10, new ItemStack[]{imbuedSlateStack,imbuedSlateStack,concentratedCatalystStack}, 4); - AlchemyRecipeRegistry.registerRecipe(runicPlateStack, 30, new ItemStack[]{crackedRunicPlateStack,terraeStack}, 5); - AlchemyRecipeRegistry.registerRecipe(imbuedRunicPlateStack, 100, new ItemStack[]{magicalesStack,incendiumStack,runicPlateStack, runicPlateStack,aquasalusStack}, 5); - AlchemyRecipeRegistry.registerRecipe(complexSpellCrystalStack,50,new ItemStack[]{new ItemStack(ModItems.blankSpell), weakBloodShardStack, weakBloodShardStack, diamondStack,goldIngotStack},3); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockConduit,1,0),"q q","ccc","q q",'q', quartzRodStack,'c', magicalesCableStack); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm,1,0),"gb ","pcw","gb ",'p',paradigmBackPlateStack,'c', projectileCoreStack,'g',goldIngotStack,'b',stoneBraceStack,'w',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm,1,1),"gb ","pcw","gb ",'p',paradigmBackPlateStack,'c', selfCoreStack,'g',goldIngotStack,'b',stoneBraceStack,'w',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm,1,2),"gb ","pcw","gb ",'p',paradigmBackPlateStack,'c', meleeCoreStack,'g',goldIngotStack,'b',stoneBraceStack,'w',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm,1,3),"gb ","pcw","gb ",'p',paradigmBackPlateStack,'c', toolCoreStack,'g',goldIngotStack,'b',stoneBraceStack,'w',outputCableStack); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect,1,0),"bgb","ico","bgb",'c',flameCoreStack,'b',stoneBraceStack,'g',goldIngotStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect,1,1),"bgb","ico","bgb",'c',iceCoreStack,'b',stoneBraceStack,'g',goldIngotStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect,1,2),"bgb","ico","bgb",'c',windCoreStack,'b',stoneBraceStack,'g',goldIngotStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect,1,3),"bgb","ico","bgb",'c',earthCoreStack,'b',stoneBraceStack,'g',goldIngotStack,'i',inputCableStack,'o',outputCableStack); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier,1,0),"bgb","ico","bgb",'c',defaultCoreStack,'i',inputCableStack,'o',outputCableStack,'b',stoneBraceStack,'g',ironIngotStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier,1,1),"bgb","ico","bgb",'c',offenseCoreStack,'i',inputCableStack,'o',outputCableStack,'b',stoneBraceStack,'g',ironIngotStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier,1,2),"bgb","ico","bgb",'c',defensiveCoreStack,'i',inputCableStack,'o',outputCableStack,'b',stoneBraceStack,'g',ironIngotStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier,1,3),"bgb","ico","bgb",'c',environmentalCoreStack,'i',inputCableStack,'o',outputCableStack,'b',stoneBraceStack,'g',ironIngotStack); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,0),"bpb","ico","bpb",'c', powerCoreStack,'b',woodBraceStack,'p',crackedRunicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,1),"bpb","ico","bpb",'c', powerCoreStack,'b',stoneBraceStack,'p',runicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,2),"bpb","ico","bpb",'c', powerCoreStack,'b',obsidianBraceStack,'p',imbuedRunicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,5),"bpb","ico","bpb",'c', costCoreStack,'b',woodBraceStack,'p',crackedRunicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,6),"bpb","ico","bpb",'c', costCoreStack,'b',stoneBraceStack,'p',runicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,7),"bpb","ico","bpb",'c', costCoreStack,'b',obsidianBraceStack,'p',imbuedRunicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,10),"bpb","ico","bpb",'c', potencyCoreStack,'b',woodBraceStack,'p',crackedRunicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,11),"bpb","ico","bpb",'c', potencyCoreStack,'b',stoneBraceStack,'p',runicPlateStack,'i',inputCableStack,'o',outputCableStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,12),"bpb","ico","bpb",'c', potencyCoreStack,'b',obsidianBraceStack,'p',imbuedRunicPlateStack,'i',inputCableStack,'o',outputCableStack); - - GameRegistry.addRecipe(new ItemStack(ModItems.itemAttunedCrystal), "Sr ", " ar", "s S", 'r', quartzRodStack, 's', new ItemStack(Items.stick,1,craftingConstant), 'a', strengthenedCatalystStack, 'S', stoneStack); + GameRegistry.addRecipe(paradigmBackPlateStack, "isi", "rgr", "isi", 'i', ironIngotStack, 'r', stoneStack, 'g', goldIngotStack, 's', reinforcedSlateStack); + GameRegistry.addRecipe(outputCableStack, " si", "s c", " si", 's', stoneStack, 'i', ironIngotStack, 'c', simpleCatalystStack); + + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(flameCoreStack, "mdm", "scs", "mom", 'm', incendiumStack, 'c', emptyCoreStack, 'o', magicianBloodOrbStack, 'd', diamondStack, 's', weakBloodShardStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(iceCoreStack, "mdm", "scs", "mom", 'm', crystallosStack, 'c', emptyCoreStack, 'o', magicianBloodOrbStack, 'd', diamondStack, 's', weakBloodShardStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(windCoreStack, "mdm", "scs", "mom", 'm', aetherStack, 'c', emptyCoreStack, 'o', magicianBloodOrbStack, 'd', diamondStack, 's', weakBloodShardStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(earthCoreStack, "mdm", "scs", "mom", 'm', terraeStack, 'c', emptyCoreStack, 'o', magicianBloodOrbStack, 'd', diamondStack, 's', weakBloodShardStack)); + + GameRegistry.addRecipe(inputCableStack, "ws ", "rcs", "ws ", 'w', blankSlateStack, 's', stoneStack, 'r', imbuedSlateStack, 'c', simpleCatalystStack); + + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(defaultCoreStack, "msm", "geg", "mom", 'm', strengthenedCatalystStack, 'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's', weakBloodShardStack, 'g', goldIngotStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(offenseCoreStack, "msm", "geg", "mom", 'm', offensaStack, 'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's', weakBloodShardStack, 'g', goldIngotStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(defensiveCoreStack, "msm", "geg", "mom", 'm', praesidiumStack, 'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's', weakBloodShardStack, 'g', goldIngotStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(environmentalCoreStack, "msm", "geg", "mom", 'm', orbisTerraeStack, 'e', emptyCoreStack, 'o', magicianBloodOrbStack, 's', weakBloodShardStack, 'g', goldIngotStack)); + + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(powerCoreStack, "msm", "geg", "mom", 'm', virtusStack, 'e', emptyCoreStack, 'o', masterBloodOrbStack, 's', weakBloodShardStack, 'g', goldIngotStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(costCoreStack, "msm", "geg", "mom", 'm', reductusStack, 'e', emptyCoreStack, 'o', masterBloodOrbStack, 's', weakBloodShardStack, 'g', goldIngotStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(potencyCoreStack, "msm", "geg", "mom", 'm', potentiaStack, 'e', emptyCoreStack, 'o', masterBloodOrbStack, 's', weakBloodShardStack, 'g', goldIngotStack)); + + AlchemyRecipeRegistry.registerRecipe(crackedRunicPlateStackCrafted, 10, new ItemStack[]{imbuedSlateStack, imbuedSlateStack, concentratedCatalystStack}, 4); + AlchemyRecipeRegistry.registerRecipe(runicPlateStack, 30, new ItemStack[]{crackedRunicPlateStack, terraeStack}, 5); + AlchemyRecipeRegistry.registerRecipe(imbuedRunicPlateStack, 100, new ItemStack[]{magicalesStack, incendiumStack, runicPlateStack, runicPlateStack, aquasalusStack}, 5); + AlchemyRecipeRegistry.registerRecipe(complexSpellCrystalStack, 50, new ItemStack[]{new ItemStack(ModItems.blankSpell), weakBloodShardStack, weakBloodShardStack, diamondStack, goldIngotStack}, 3); + + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockConduit, 1, 0), "q q", "ccc", "q q", 'q', quartzRodStack, 'c', magicalesCableStack); + + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm, 1, 0), "gb ", "pcw", "gb ", 'p', paradigmBackPlateStack, 'c', projectileCoreStack, 'g', goldIngotStack, 'b', stoneBraceStack, 'w', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm, 1, 1), "gb ", "pcw", "gb ", 'p', paradigmBackPlateStack, 'c', selfCoreStack, 'g', goldIngotStack, 'b', stoneBraceStack, 'w', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm, 1, 2), "gb ", "pcw", "gb ", 'p', paradigmBackPlateStack, 'c', meleeCoreStack, 'g', goldIngotStack, 'b', stoneBraceStack, 'w', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellParadigm, 1, 3), "gb ", "pcw", "gb ", 'p', paradigmBackPlateStack, 'c', toolCoreStack, 'g', goldIngotStack, 'b', stoneBraceStack, 'w', outputCableStack); + + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect, 1, 0), "bgb", "ico", "bgb", 'c', flameCoreStack, 'b', stoneBraceStack, 'g', goldIngotStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect, 1, 1), "bgb", "ico", "bgb", 'c', iceCoreStack, 'b', stoneBraceStack, 'g', goldIngotStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect, 1, 2), "bgb", "ico", "bgb", 'c', windCoreStack, 'b', stoneBraceStack, 'g', goldIngotStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEffect, 1, 3), "bgb", "ico", "bgb", 'c', earthCoreStack, 'b', stoneBraceStack, 'g', goldIngotStack, 'i', inputCableStack, 'o', outputCableStack); + + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier, 1, 0), "bgb", "ico", "bgb", 'c', defaultCoreStack, 'i', inputCableStack, 'o', outputCableStack, 'b', stoneBraceStack, 'g', ironIngotStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier, 1, 1), "bgb", "ico", "bgb", 'c', offenseCoreStack, 'i', inputCableStack, 'o', outputCableStack, 'b', stoneBraceStack, 'g', ironIngotStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier, 1, 2), "bgb", "ico", "bgb", 'c', defensiveCoreStack, 'i', inputCableStack, 'o', outputCableStack, 'b', stoneBraceStack, 'g', ironIngotStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier, 1, 3), "bgb", "ico", "bgb", 'c', environmentalCoreStack, 'i', inputCableStack, 'o', outputCableStack, 'b', stoneBraceStack, 'g', ironIngotStack); + + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 0), "bpb", "ico", "bpb", 'c', powerCoreStack, 'b', woodBraceStack, 'p', crackedRunicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 1), "bpb", "ico", "bpb", 'c', powerCoreStack, 'b', stoneBraceStack, 'p', runicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 2), "bpb", "ico", "bpb", 'c', powerCoreStack, 'b', obsidianBraceStack, 'p', imbuedRunicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 5), "bpb", "ico", "bpb", 'c', costCoreStack, 'b', woodBraceStack, 'p', crackedRunicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 6), "bpb", "ico", "bpb", 'c', costCoreStack, 'b', stoneBraceStack, 'p', runicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 7), "bpb", "ico", "bpb", 'c', costCoreStack, 'b', obsidianBraceStack, 'p', imbuedRunicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 10), "bpb", "ico", "bpb", 'c', potencyCoreStack, 'b', woodBraceStack, 'p', crackedRunicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 11), "bpb", "ico", "bpb", 'c', potencyCoreStack, 'b', stoneBraceStack, 'p', runicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 12), "bpb", "ico", "bpb", 'c', potencyCoreStack, 'b', obsidianBraceStack, 'p', imbuedRunicPlateStack, 'i', inputCableStack, 'o', outputCableStack); + + GameRegistry.addRecipe(new ItemStack(ModItems.itemAttunedCrystal), "Sr ", " ar", "s S", 'r', quartzRodStack, 's', new ItemStack(Items.stick, 1, craftingConstant), 'a', strengthenedCatalystStack, 'S', stoneStack); GameRegistry.addRecipe(new ItemStack(ModItems.itemTankSegmenter), "gqi", " rq", "q g", 'q', quartzRodStack, 'i', ironIngotStack, 'r', strengthenedCatalystStack, 'g', goldIngotStack); GameRegistry.addRecipe(new ItemStack(ModItems.itemDestinationClearer), "qcq", "c c", "qcq", 'q', quartzRodStack, 'c', simpleCatalystStack); GameRegistry.addRecipe(new ItemStack(ModBlocks.blockAlchemicCalcinator), "pgp", "gsg", "ccc", 'p', crackedRunicPlateStack, 'g', glassStack, 's', strengthenedCatalystStack, 'c', cobblestoneStack); - GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrystalBelljar), "GGG", "GcG", "www", 'G', glassStack, 'c', concentratedCatalystStack, 'w', new ItemStack(Blocks.wooden_slab,1,craftingConstant)); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrystalBelljar), "GGG", "GcG", "www", 'G', glassStack, 'c', concentratedCatalystStack, 'w', new ItemStack(Blocks.wooden_slab, 1, craftingConstant)); GameRegistry.addRecipe(new ItemStack(ModBlocks.blockReagentConduit), "isi", "scs", "isi", 'c', concentratedCatalystStack, 's', stringStack, 'i', ironIngotStack); - - GameRegistry.addShapelessRecipe(new ItemStack(Items.dye,5,15),fracturedBoneStack); - - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfSupression),"wtl","wvl","wol",'v',new ItemStack(ModItems.voidSigil),'t',new ItemStack(ModBlocks.blockTeleposer),'o',masterBloodOrbStack,'l',lavaBucketStack,'w',waterBucketStack)); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfEnderSeverance),"ptp","ese","pop",'s',new ItemStack(ModItems.demonicSlate),'t',weakBloodShardStack,'o',masterBloodOrbStack,'e',new ItemStack(Items.ender_eye),'p', new ItemStack(Items.ender_pearl))); - - 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); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.bread), 1, new ItemStack[]{new ItemStack(Items.wheat),new ItemStack(Items.sugar)}, 1); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.fire_charge,5,0), 3, new ItemStack[]{new ItemStack(Items.coal),new ItemStack(Items.blaze_powder),gunpowderStack}, 1); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.sand,2,0), 1, new ItemStack[]{new ItemStack(Blocks.cobblestone),gunpowderStack}, 1); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.clay,4,0), 2, new ItemStack[]{new ItemStack(Blocks.hardened_clay,1,craftingConstant),new ItemStack(Blocks.hardened_clay,1,craftingConstant),new ItemStack(Blocks.hardened_clay,1,craftingConstant),new ItemStack(Blocks.hardened_clay,1,craftingConstant),waterBucketStack}, 1); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.string,4,0), 1, new ItemStack[]{new ItemStack(Blocks.wool,1,craftingConstant),new ItemStack(Items.flint)}, 1); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.gravel,2,0), 1, new ItemStack[]{new ItemStack(Blocks.stone),gunpowderStack}, 1); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.obsidian), 1, new ItemStack[]{waterBucketStack,lavaBucketStack}, 1); + + GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 5, 15), fracturedBoneStack); + + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfSupression), "wtl", "wvl", "wol", 'v', new ItemStack(ModItems.voidSigil), 't', new ItemStack(ModBlocks.blockTeleposer), 'o', masterBloodOrbStack, 'l', lavaBucketStack, 'w', waterBucketStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfEnderSeverance), "ptp", "ese", "pop", 's', new ItemStack(ModItems.demonicSlate), 't', weakBloodShardStack, 'o', masterBloodOrbStack, 'e', new ItemStack(Items.ender_eye), 'p', new ItemStack(Items.ender_pearl))); + + 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); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.bread), 1, new ItemStack[]{new ItemStack(Items.wheat), new ItemStack(Items.sugar)}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.fire_charge, 5, 0), 3, new ItemStack[]{new ItemStack(Items.coal), new ItemStack(Items.blaze_powder), gunpowderStack}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.sand, 2, 0), 1, new ItemStack[]{new ItemStack(Blocks.cobblestone), gunpowderStack}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.clay, 4, 0), 2, new ItemStack[]{new ItemStack(Blocks.hardened_clay, 1, craftingConstant), new ItemStack(Blocks.hardened_clay, 1, craftingConstant), new ItemStack(Blocks.hardened_clay, 1, craftingConstant), new ItemStack(Blocks.hardened_clay, 1, craftingConstant), waterBucketStack}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.string, 4, 0), 1, new ItemStack[]{new ItemStack(Blocks.wool, 1, craftingConstant), new ItemStack(Items.flint)}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.gravel, 2, 0), 1, new ItemStack[]{new ItemStack(Blocks.stone), gunpowderStack}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.obsidian), 1, new ItemStack[]{waterBucketStack, lavaBucketStack}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.paper), 1, new ItemStack[]{new ItemStack(Items.reeds)}, 1); - 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(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); } @EventHandler @@ -918,41 +778,40 @@ public class AlchemicalWizardry GameRegistry.registerItem(ModItems.sanguineHelmet, "sanguineHelmet"); GameRegistry.registerItem(ModItems.sanguineRobe, "sanguineRobe"); GameRegistry.registerItem(ModItems.sanguinePants, "sanguinePants"); - GameRegistry.registerItem(ModItems.sanguineBoots, "sanguineBoots"); + GameRegistry.registerItem(ModItems.sanguineBoots, "sanguineBoots"); ItemStack itemGoggles = ItemApi.getItem("itemGoggles", 0); Item itemThaumChest = GameRegistry.findItem("Thaumcraft", "ItemChestplateThaumium"); Item itemThaumLeggings = GameRegistry.findItem("Thaumcraft", "ItemLeggingsThaumium"); Item itemThaumBoots = GameRegistry.findItem("Thaumcraft", "ItemBootsThaumium"); - + AspectList aspectList = new AspectList(); aspectList.add(Aspect.ARMOR, 5).add(Aspect.MAGIC, 5); - + ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.sanguineHelmet), aspectList); ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.sanguineRobe), aspectList); ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.sanguinePants), aspectList); ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.sanguineBoots), aspectList); - if (itemGoggles != null) { - BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineHelmet), itemGoggles); + BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineHelmet), itemGoggles); } - - if(itemThaumChest != null) + + if (itemThaumChest != null) { - BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineRobe), new ItemStack(itemThaumChest)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineRobe), new ItemStack(itemThaumChest)); } - - if(itemThaumLeggings != null) + + if (itemThaumLeggings != null) { - BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguinePants), new ItemStack(itemThaumLeggings)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguinePants), new ItemStack(itemThaumLeggings)); } - - if(itemThaumBoots != null) + + if (itemThaumBoots != null) { - BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineBoots), new ItemStack(itemThaumBoots)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineBoots), new ItemStack(itemThaumBoots)); } //LogHelper.log(Level.INFO, "Loaded RP2 World addon"); @@ -965,11 +824,11 @@ public class AlchemicalWizardry { this.isThaumcraftLoaded = false; } - - if(Loader.isModLoaded("Forestry")) + + if (Loader.isModLoaded("Forestry")) { - this.isForestryLoaded = true; - + this.isForestryLoaded = true; + // ModItems.itemBloodFrame = new ItemBloodFrame(this.itemBloodFrameItemID).setUnlocalizedName("bloodFrame"); // // ItemStack provenFrame = GameRegistry.findItemStack("Forestry", "frameImpregnated", 1); @@ -978,137 +837,137 @@ public class AlchemicalWizardry // { // AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.itemBloodFrame), provenFrame, 3, 30000, 20, 20, false); // } - }else + } else { - this.isForestryLoaded = false; - } - - if(Loader.isModLoaded("harvestcraft")) - { - PamHarvestCompatRegistry.registerPamHandlers(); - System.out.println("Loaded Harvestcraft Handlers!"); + this.isForestryLoaded = false; } - + + if (Loader.isModLoaded("harvestcraft")) + { + PamHarvestCompatRegistry.registerPamHandlers(); + System.out.println("Loaded Harvestcraft Handlers!"); + } + BloodMagicConfiguration.loadBlacklist(); } - + public static void initAlchemyPotionRecipes() { - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.ghast_tear), Potion.regeneration.id, 450); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.golden_carrot), Potion.nightVision.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.magma_cream), Potion.fireResistance.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.water_bucket), Potion.waterBreathing.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.sugar), Potion.moveSpeed.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.speckled_melon), Potion.heal.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.spider_eye), Potion.poison.id, 450); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.dye,1,0), Potion.blindness.id, 450); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.fermented_spider_eye), Potion.weakness.id, 450); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.blaze_powder), Potion.damageBoost.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.aether), Potion.jump.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.clay_ball), Potion.moveSlowdown.id, 450); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.redstone), Potion.digSpeed.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.potionitem, 1, 0), AlchemicalWizardry.customPotionDrowning.id, 450); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.ghast_tear), Potion.regeneration.id, 450); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.golden_carrot), Potion.nightVision.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.magma_cream), Potion.fireResistance.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.water_bucket), Potion.waterBreathing.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.sugar), Potion.moveSpeed.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.speckled_melon), Potion.heal.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.spider_eye), Potion.poison.id, 450); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.dye, 1, 0), Potion.blindness.id, 450); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.fermented_spider_eye), Potion.weakness.id, 450); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.blaze_powder), Potion.damageBoost.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.aether), Potion.jump.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.clay_ball), Potion.moveSlowdown.id, 450); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.redstone), Potion.digSpeed.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.potionitem, 1, 0), AlchemicalWizardry.customPotionDrowning.id, 450); //AlchemicalPotionCreationHandler.addPotion(new ItemStack(Item.goldenCarrot),Potion.nightVision.id,2*60*20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.glass_bottle), Potion.invisibility.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.diamond), Potion.resistance.id, 2 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.poisonous_potato), Potion.field_76443_y.id, 2); //saturation - AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.demonBloodShard), Potion.field_76434_w.id, 4 * 60 * 20); //health boost - AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.weakBloodShard), Potion.field_76444_x.id, 4 * 60 * 20); //Absorption - AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.terrae), AlchemicalWizardry.customPotionBoost.id, 1 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.feather), AlchemicalWizardry.customPotionFlight.id, 1 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.arrow), AlchemicalWizardry.customPotionReciprocation.id, 1 * 60 * 20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.ender_pearl),AlchemicalWizardry.customPotionPlanarBinding.id,1*60*20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Blocks.soul_sand),AlchemicalWizardry.customPotionSoulFray.id,60*20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.baseItems,1,16),AlchemicalWizardry.customPotionSoulHarden.id,60*20); - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.slime_ball),AlchemicalWizardry.customPotionDeaf.id,60*20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.glass_bottle), Potion.invisibility.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.diamond), Potion.resistance.id, 2 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.poisonous_potato), Potion.field_76443_y.id, 2); //saturation + AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.demonBloodShard), Potion.field_76434_w.id, 4 * 60 * 20); //health boost + AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.weakBloodShard), Potion.field_76444_x.id, 4 * 60 * 20); //Absorption + AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.terrae), AlchemicalWizardry.customPotionBoost.id, 1 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.feather), AlchemicalWizardry.customPotionFlight.id, 1 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.arrow), AlchemicalWizardry.customPotionReciprocation.id, 1 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.ender_pearl), AlchemicalWizardry.customPotionPlanarBinding.id, 1 * 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Blocks.soul_sand), AlchemicalWizardry.customPotionSoulFray.id, 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.baseItems, 1, 16), AlchemicalWizardry.customPotionSoulHarden.id, 60 * 20); + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.slime_ball), AlchemicalWizardry.customPotionDeaf.id, 60 * 20); } - + public static void initAltarRecipes() { - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.weakBloodOrb), new ItemStack(Items.diamond),1,2000,2,1,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.apprenticeBloodOrb), new ItemStack(Items.emerald),2,5000,5,5,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.magicianBloodOrb), new ItemStack(Blocks.gold_block),3,25000,20,20,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.masterBloodOrb), new ItemStack(ModItems.weakBloodShard),4,40000,30,50,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.archmageBloodOrb), new ItemStack(ModItems.demonBloodShard),5,75000,50,100,false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.weakBloodOrb), new ItemStack(Items.diamond), 1, 2000, 2, 1, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.apprenticeBloodOrb), new ItemStack(Items.emerald), 2, 5000, 5, 5, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.magicianBloodOrb), new ItemStack(Blocks.gold_block), 3, 25000, 20, 20, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.masterBloodOrb), new ItemStack(ModItems.weakBloodShard), 4, 40000, 30, 50, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.archmageBloodOrb), new ItemStack(ModItems.demonBloodShard), 5, 75000, 50, 100, false); - AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.weakBloodOrb),1,2); - AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.apprenticeBloodOrb),2,5); - AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.magicianBloodOrb),3,15); - AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.masterBloodOrb),4,25); - AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.archmageBloodOrb),5,50); - - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.telepositionFocus), new ItemStack(Items.ender_pearl),4,2000,10,10,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.enhancedTelepositionFocus), new ItemStack(ModItems.telepositionFocus),4,10000,25,15,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.demonicSlate), new ItemStack(ModItems.imbuedSlate),4,15000,20,20,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.duskScribeTool), new ItemStack(Blocks.coal_block),4,2000,20,10,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.bloodSocket), new ItemStack(ModBlocks.emptySocket),3,30000,40,10,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.earthScribeTool), new ItemStack(Blocks.obsidian),3,1000,5,5,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.waterScribeTool), new ItemStack(Blocks.lapis_block),3,1000,5,5,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blankSpell), new ItemStack(Blocks.glass),2,1000,5,5,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blankSlate), new ItemStack(Blocks.stone),1,1000,5,5,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.activationCrystal), new ItemStack(ModItems.lavaCrystal),3,10000,20,10,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.fireScribeTool), new ItemStack(Items.magma_cream),3,1000,5,5,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.airScribeTool), new ItemStack(Items.ghast_tear),3,1000,5,5,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.imbuedSlate), new ItemStack(ModItems.reinforcedSlate),3,5000,15,10,false); - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.daggerOfSacrifice), new ItemStack(Items.iron_sword),2,3000,5,5,false); - 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.registerAltarOrbRecipe(new ItemStack(ModItems.weakBloodOrb), 1, 2); + AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.apprenticeBloodOrb), 2, 5); + AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.magicianBloodOrb), 3, 15); + AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.masterBloodOrb), 4, 25); + AltarRecipeRegistry.registerAltarOrbRecipe(new ItemStack(ModItems.archmageBloodOrb), 5, 50); + + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.telepositionFocus), new ItemStack(Items.ender_pearl), 4, 2000, 10, 10, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.enhancedTelepositionFocus), new ItemStack(ModItems.telepositionFocus), 4, 10000, 25, 15, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.demonicSlate), new ItemStack(ModItems.imbuedSlate), 4, 15000, 20, 20, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.duskScribeTool), new ItemStack(Blocks.coal_block), 4, 2000, 20, 10, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.bloodSocket), new ItemStack(ModBlocks.emptySocket), 3, 30000, 40, 10, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.earthScribeTool), new ItemStack(Blocks.obsidian), 3, 1000, 5, 5, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.waterScribeTool), new ItemStack(Blocks.lapis_block), 3, 1000, 5, 5, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blankSpell), new ItemStack(Blocks.glass), 2, 1000, 5, 5, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blankSlate), new ItemStack(Blocks.stone), 1, 1000, 5, 5, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.activationCrystal), new ItemStack(ModItems.lavaCrystal), 3, 10000, 20, 10, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.fireScribeTool), new ItemStack(Items.magma_cream), 3, 1000, 5, 5, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.airScribeTool), new ItemStack(Items.ghast_tear), 3, 1000, 5, 5, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.imbuedSlate), new ItemStack(ModItems.reinforcedSlate), 3, 5000, 15, 10, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.daggerOfSacrifice), new ItemStack(Items.iron_sword), 2, 3000, 5, 5, false); + 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); } - + public static void initRituals() { - Rituals.registerRitual("AW001Water", 1, 500, new RitualEffectWater(), "Ritual of the Full Spring", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,30,255,255,0,0.501,0.8,0, 1.5, false)); - Rituals.registerRitual("AW002Lava", 1, 10000, new RitualEffectLava(), "Serenade of the Nether", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),255,0,0,255,0,0.501,0.8,0, 1.5, false)); - Rituals.registerRitual("AW003GreenGrove", 1, 1000, new RitualEffectGrowth(), "Ritual of the Green Grove", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),244,164,96,255,0,1.0,1.6,0, 1.5, false)); - Rituals.registerRitual("AW004Interdiction", 1, 1000, new RitualEffectInterdiction(), "Interdiction Ritual", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),27,227,206,255,0,0.501,0.8, 0, 1.5, false)); - Rituals.registerRitual("AW005Containment", 1, 2000, new RitualEffectContainment(), "Ritual of Containment", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),186,21,21,255,0,2.5, 2.5, 0, 2.5, false)); - Rituals.registerRitual("AW006Binding", 1, 5000, new RitualEffectSoulBound(), "Ritual of Binding", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleBinding.png"),193,7,7,255,0,0.501,1.0,0, 2.5, true)); - Rituals.registerRitual("AW007Unbinding", 1, 30000, new RitualEffectUnbinding(), "Ritual of Unbinding", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),193,7,7,255, 0, 0.5, 0.8, 0, 2.5, false)); - Rituals.registerRitual("AW008HighJump", 1, 1000, new RitualEffectJumping(), "Ritual of the High Jump", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),10,183,173,255, 0, 0.501, 1.501, 0, 1.5, false)); - Rituals.registerRitual("AW009Magnetism", 1, 5000, new RitualEffectMagnetic(), "Ritual of Magnetism", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),126,39,0,255, 0, 0.501, 2.0, 0, 1.5, false)); - Rituals.registerRitual("AW010Crusher", 1, 2500, new RitualEffectCrushing(), "Ritual of the Crusher", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW011Speed", 1, 1000, new RitualEffectLeap(), "Ritual of Speed", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW012AnimalGrowth", 1, 10000, new RitualEffectAnimalGrowth(), "Ritual of the Shepherd", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW013Suffering", 1, 50000, new RitualEffectWellOfSuffering(), "Well of Suffering", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleSuffering.png"),0,0,0,255,0,0.501,0.8,0, 2.5, true)); - Rituals.registerRitual("AW014Regen", 1, 25000, new RitualEffectHealing(), "Ritual of Regeneration", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW015FeatheredKnife", 1, 50000, new RitualEffectFeatheredKnife(), "Ritual of the Feathered Knife", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW016FeatheredEarth", 2, 100000, new RitualEffectFeatheredEarth(), "Ritual of the Feathered Earth", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW017Gaia", 2, 1000000, new RitualEffectBiomeChanger(), "Ritual of Gaia's Transformation", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW018Condor", 2, 1000000, new RitualEffectFlight(), "Reverence of the Condor", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW019FallingTower", 2, 1000000, new RitualEffectSummonMeteor(), "Mark of the Falling Tower", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW020BalladOfAlchemy", 1, 20000, new RitualEffectAutoAlchemy(), "Ballad of Alchemy", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW021Expulsion", 1, 1000000, new RitualEffectExpulsion(), "Aura of Expulsion", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW022Supression", 1, 10000, new RitualEffectSupression(), "Dome of Supression", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW023Zephyr", 1, 25000, new RitualEffectItemSuction(),"Call of the Zephyr", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW024Harvest", 1, 20000, new RitualEffectHarvest(), "Reap of the Harvest Moon", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW025Conduit", 2, 2000000, new RitualEffectLifeConduit(), "Cry of the Eternal Soul", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW026Ellipsoid", 1, 25000, new RitualEffectEllipsoid(), "Focus of the Ellipsoid", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW027Evaporation", 1, 20000, new RitualEffectEvaporation(), "Song of Evaporation", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - Rituals.registerRitual("AW028SpawnWard", 1, 150000, new RitualEffectSpawnWard(), "Ward of Sacrosanctity", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,0,255, 0, 0.501, 0.501, 0, 1.5, false)); - 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("AW001Water", 1, 500, new RitualEffectWater(), "Ritual of the Full Spring", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 30, 255, 255, 0, 0.501, 0.8, 0, 1.5, false)); + Rituals.registerRitual("AW002Lava", 1, 10000, new RitualEffectLava(), "Serenade of the Nether", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 255, 0, 0, 255, 0, 0.501, 0.8, 0, 1.5, false)); + Rituals.registerRitual("AW003GreenGrove", 1, 1000, new RitualEffectGrowth(), "Ritual of the Green Grove", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 244, 164, 96, 255, 0, 1.0, 1.6, 0, 1.5, false)); + Rituals.registerRitual("AW004Interdiction", 1, 1000, new RitualEffectInterdiction(), "Interdiction Ritual", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 27, 227, 206, 255, 0, 0.501, 0.8, 0, 1.5, false)); + Rituals.registerRitual("AW005Containment", 1, 2000, new RitualEffectContainment(), "Ritual of Containment", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 186, 21, 21, 255, 0, 2.5, 2.5, 0, 2.5, false)); + Rituals.registerRitual("AW006Binding", 1, 5000, new RitualEffectSoulBound(), "Ritual of Binding", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleBinding.png"), 193, 7, 7, 255, 0, 0.501, 1.0, 0, 2.5, true)); + Rituals.registerRitual("AW007Unbinding", 1, 30000, new RitualEffectUnbinding(), "Ritual of Unbinding", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 193, 7, 7, 255, 0, 0.5, 0.8, 0, 2.5, false)); + Rituals.registerRitual("AW008HighJump", 1, 1000, new RitualEffectJumping(), "Ritual of the High Jump", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 10, 183, 173, 255, 0, 0.501, 1.501, 0, 1.5, false)); + Rituals.registerRitual("AW009Magnetism", 1, 5000, new RitualEffectMagnetic(), "Ritual of Magnetism", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 126, 39, 0, 255, 0, 0.501, 2.0, 0, 1.5, false)); + Rituals.registerRitual("AW010Crusher", 1, 2500, new RitualEffectCrushing(), "Ritual of the Crusher", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW011Speed", 1, 1000, new RitualEffectLeap(), "Ritual of Speed", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW012AnimalGrowth", 1, 10000, new RitualEffectAnimalGrowth(), "Ritual of the Shepherd", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW013Suffering", 1, 50000, new RitualEffectWellOfSuffering(), "Well of Suffering", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleSuffering.png"), 0, 0, 0, 255, 0, 0.501, 0.8, 0, 2.5, true)); + Rituals.registerRitual("AW014Regen", 1, 25000, new RitualEffectHealing(), "Ritual of Regeneration", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW015FeatheredKnife", 1, 50000, new RitualEffectFeatheredKnife(), "Ritual of the Feathered Knife", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW016FeatheredEarth", 2, 100000, new RitualEffectFeatheredEarth(), "Ritual of the Feathered Earth", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW017Gaia", 2, 1000000, new RitualEffectBiomeChanger(), "Ritual of Gaia's Transformation", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW018Condor", 2, 1000000, new RitualEffectFlight(), "Reverence of the Condor", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW019FallingTower", 2, 1000000, new RitualEffectSummonMeteor(), "Mark of the Falling Tower", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW020BalladOfAlchemy", 1, 20000, new RitualEffectAutoAlchemy(), "Ballad of Alchemy", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW021Expulsion", 1, 1000000, new RitualEffectExpulsion(), "Aura of Expulsion", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW022Supression", 1, 10000, new RitualEffectSupression(), "Dome of Supression", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW023Zephyr", 1, 25000, new RitualEffectItemSuction(), "Call of the Zephyr", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW024Harvest", 1, 20000, new RitualEffectHarvest(), "Reap of the Harvest Moon", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW025Conduit", 2, 2000000, new RitualEffectLifeConduit(), "Cry of the Eternal Soul", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW026Ellipsoid", 1, 25000, new RitualEffectEllipsoid(), "Focus of the Ellipsoid", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW027Evaporation", 1, 20000, new RitualEffectEvaporation(), "Song of Evaporation", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + Rituals.registerRitual("AW028SpawnWard", 1, 150000, new RitualEffectSpawnWard(), "Ward of Sacrosanctity", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); + 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(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); } - + public static void initBindingRecipes() { - BindingRegistry.registerRecipe(new ItemStack(ModItems.boundPickaxe), new ItemStack(Items.diamond_pickaxe)); - BindingRegistry.registerRecipe(new ItemStack(ModItems.boundAxe), new ItemStack(Items.diamond_axe)); - BindingRegistry.registerRecipe(new ItemStack(ModItems.boundShovel), new ItemStack(Items.diamond_shovel)); - BindingRegistry.registerRecipe(new ItemStack(ModItems.energySword), new ItemStack(Items.diamond_sword)); - BindingRegistry.registerRecipe(new ItemStack(ModItems.energyBlaster), new ItemStack(ModItems.apprenticeBloodOrb)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.boundPickaxe), new ItemStack(Items.diamond_pickaxe)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.boundAxe), new ItemStack(Items.diamond_axe)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.boundShovel), new ItemStack(Items.diamond_shovel)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.energySword), new ItemStack(Items.diamond_sword)); + BindingRegistry.registerRecipe(new ItemStack(ModItems.energyBlaster), new ItemStack(ModItems.apprenticeBloodOrb)); } - + public static void initHarvestRegistry() { - HarvestRegistry.registerHarvestHandler(new BloodMagicHarvestHandler()); - HarvestRegistry.registerHarvestHandler(new GourdHarvestHandler()); - HarvestRegistry.registerHarvestHandler(new CactusReedHarvestHandler()); + HarvestRegistry.registerHarvestHandler(new BloodMagicHarvestHandler()); + HarvestRegistry.registerHarvestHandler(new GourdHarvestHandler()); + HarvestRegistry.registerHarvestHandler(new CactusReedHarvestHandler()); } - + public static void initCombinedAlchemyPotionRecipes() { - CombinedPotionRegistry.registerCombinedPotionRecipe(customPotionFlameCloak, Potion.moveSpeed, Potion.regeneration); + CombinedPotionRegistry.registerCombinedPotionRecipe(customPotionFlameCloak, Potion.moveSpeed, Potion.regeneration); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java index 4e581591..2f2ff607 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java @@ -1,20 +1,20 @@ package WayofTime.alchemicalWizardry; +import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold; +import WayofTime.alchemicalWizardry.client.renderer.RenderHelper; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraftforge.common.config.Configuration; + import java.io.File; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold; -import WayofTime.alchemicalWizardry.client.renderer.RenderHelper; -import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; - /** * Created with IntelliJ IDEA. * User: Pokefenn @@ -23,8 +23,8 @@ import cpw.mods.fml.relauncher.Side; */ public class BloodMagicConfiguration { - private static final String DEFAULT_COLOR_LIST = "100,f; 80,7; 60,e; 40,6; 25,c; 10,4"; - public static final List colorList = new ArrayList(); + private static final String DEFAULT_COLOR_LIST = "100,f; 80,7; 60,e; 40,6; 25,c; 10,4"; + public static final List colorList = new ArrayList(); public static Configuration config; public static final String CATEGORY_GAMEPLAY = "gameplay"; @@ -32,13 +32,13 @@ public class BloodMagicConfiguration public static void init(File configFile) { - for (String s : DEFAULT_COLOR_LIST.split(";")) - { - String[] ct = s.split(","); - colorList.add(new ColourThreshold(Integer.valueOf(ct[0].trim()), ct[1].trim())); - } + for (String s : DEFAULT_COLOR_LIST.split(";")) + { + String[] ct = s.split(","); + colorList.add(new ColourThreshold(Integer.valueOf(ct[0].trim()), ct[1].trim())); + } + - config = new Configuration(configFile); try @@ -59,16 +59,16 @@ public class BloodMagicConfiguration AlchemicalWizardry.customPotionInhibitID = config.get("Potion ID", "Inhibit", 103).getInt(); AlchemicalWizardry.customPotionFlightID = config.get("Potion ID", "Flight", 104).getInt(); AlchemicalWizardry.customPotionReciprocationID = config.get("Potion ID", "Reciprocation", 105).getInt(); - AlchemicalWizardry.customPotionFlameCloakID = config.get("Potion ID","FlameCloak",106).getInt(); - AlchemicalWizardry.customPotionIceCloakID = config.get("Potion ID","IceCloak",107).getInt(); - AlchemicalWizardry.customPotionHeavyHeartID = config.get("Potion ID","HeavyHeart",108).getInt(); - AlchemicalWizardry.customPotionFireFuseID = config.get("Potion ID","FireFuse",109).getInt(); - AlchemicalWizardry.customPotionPlanarBindingID = config.get("Potion ID","PlanarBinding",110).getInt(); - AlchemicalWizardry.customPotionSoulFrayID = config.get("Potion ID","SoulFray",111).getInt(); + AlchemicalWizardry.customPotionFlameCloakID = config.get("Potion ID", "FlameCloak", 106).getInt(); + AlchemicalWizardry.customPotionIceCloakID = config.get("Potion ID", "IceCloak", 107).getInt(); + AlchemicalWizardry.customPotionHeavyHeartID = config.get("Potion ID", "HeavyHeart", 108).getInt(); + AlchemicalWizardry.customPotionFireFuseID = config.get("Potion ID", "FireFuse", 109).getInt(); + AlchemicalWizardry.customPotionPlanarBindingID = config.get("Potion ID", "PlanarBinding", 110).getInt(); + AlchemicalWizardry.customPotionSoulFrayID = config.get("Potion ID", "SoulFray", 111).getInt(); AlchemicalWizardry.customPotionSoulHardenID = config.get("Potion ID", "SoulHarden", 112).getInt(); AlchemicalWizardry.customPotionDeafID = config.get("Potion ID", "Deaf", 113).getInt(); AlchemicalWizardry.customPotionFeatherFallID = config.get("Potion ID", "FeatherFall", 114).getInt(); - + MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt(); AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true); AlchemicalWizardry.diamondMeteorArray = config.get("meteor", "diamondMeteor", new String[]{"oreDiamond", "100", "oreEmerald", "75", "oreCinnabar", "200", "oreAmber", "200"}).getStringList(); @@ -80,27 +80,27 @@ public class BloodMagicConfiguration AlchemicalWizardry.netherStarMeteorArray = config.get("meteor", "netherStarMeteor", new String[]{"oreDiamond", "150", "oreEmerald", "100", "oreQuartz", "250", "oreSunstone", "5", "oreMoonstone", "50", "oreIridium", "5", "oreCertusQuartz", "150"}).getStringList(); AlchemicalWizardry.netherStarMeteorRadius = config.get("meteor", "netherStarMeteorRadius", 3).getInt(); - AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron","gold","copper","tin","lead","silver","osmium"}).getStringList(); - - AlchemicalWizardry.wimpySettings = config.get("WimpySettings","IDontLikeFun",false).getBoolean(false); + AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron", "gold", "copper", "tin", "lead", "silver", "osmium"}).getStringList(); + + AlchemicalWizardry.wimpySettings = config.get("WimpySettings", "IDontLikeFun", false).getBoolean(false); AlchemicalWizardry.respawnWithDebuff = config.get("WimpySettings", "RespawnWithDebuff", true).getBoolean(); AlchemicalWizardry.causeHungerWithRegen = config.get("WimpySettings", "causeHungerWithRegen", true).getBoolean(); // AlchemicalWizardry.lockdownAltar = config.get("WimpySettings", "LockdownAltarWithRegen", true).getBoolean(); AlchemicalWizardry.lockdownAltar = false; - + Side side = FMLCommonHandler.instance().getSide(); - if(side == Side.CLIENT) + if (side == Side.CLIENT) { RenderHelper.xOffset = config.get("ClientSettings", "AlchemyHUDxOffset", 50).getInt(); RenderHelper.yOffset = config.get("ClientSettings", "AlchemyHUDyOffset", 2).getInt(); } - + } catch (Exception e) { - //TODO Log - //FMLLog.log(Level.SEVERE, e, "Blood Magic" + " has had a problem loading its configuration, go ask on the forums :p"); + //TODO Log + //FMLLog.log(Level.SEVERE, e, "Blood Magic" + " has had a problem loading its configuration, go ask on the forums :p"); } finally { @@ -123,25 +123,25 @@ public class BloodMagicConfiguration } - - public static void loadBlacklist() - { - AlchemicalWizardry.wellBlacklist=new ArrayList(); - for( Object o : EntityList.stringToClassMapping.entrySet()) - { - Entry entry=(Entry) o; - Class curClass=(Class)entry.getValue(); - boolean valid=EntityLivingBase.class.isAssignableFrom(curClass) && !Modifier.isAbstract(curClass.getModifiers()); - if(valid) - { - boolean blacklisted=config.get("wellOfSufferingBlackList", entry.getKey().toString(), false).getBoolean(); - if(blacklisted) - AlchemicalWizardry.wellBlacklist.add(curClass); - } - - } - config.save(); - } + + public static void loadBlacklist() + { + AlchemicalWizardry.wellBlacklist = new ArrayList(); + for (Object o : EntityList.stringToClassMapping.entrySet()) + { + Entry entry = (Entry) o; + Class curClass = (Class) entry.getValue(); + boolean valid = EntityLivingBase.class.isAssignableFrom(curClass) && !Modifier.isAbstract(curClass.getModifiers()); + if (valid) + { + boolean blacklisted = config.get("wellOfSufferingBlackList", entry.getKey().toString(), false).getBoolean(); + if (blacklisted) + AlchemicalWizardry.wellBlacklist.add(curClass); + } + + } + config.save(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/ModBlocks.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/ModBlocks.java index 6c29b331..4719ff95 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/ModBlocks.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/ModBlocks.java @@ -1,46 +1,9 @@ package WayofTime.alchemicalWizardry; -import net.minecraft.block.Block; -import WayofTime.alchemicalWizardry.common.block.ArmourForge; -import WayofTime.alchemicalWizardry.common.block.BlockAlchemicCalcinator; -import WayofTime.alchemicalWizardry.common.block.BlockAltar; -import WayofTime.alchemicalWizardry.common.block.BlockBelljar; -import WayofTime.alchemicalWizardry.common.block.BlockBloodLightSource; -import WayofTime.alchemicalWizardry.common.block.BlockConduit; -import WayofTime.alchemicalWizardry.common.block.BlockDemonPortal; -import WayofTime.alchemicalWizardry.common.block.BlockHomHeart; -import WayofTime.alchemicalWizardry.common.block.BlockMasterStone; -import WayofTime.alchemicalWizardry.common.block.BlockPedestal; -import WayofTime.alchemicalWizardry.common.block.BlockPlinth; -import WayofTime.alchemicalWizardry.common.block.BlockReagentConduit; -import WayofTime.alchemicalWizardry.common.block.BlockSchematicSaver; -import WayofTime.alchemicalWizardry.common.block.BlockSocket; -import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer; -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.BlockTeleposer; -import WayofTime.alchemicalWizardry.common.block.BlockWritingTable; -import WayofTime.alchemicalWizardry.common.block.BloodRune; -import WayofTime.alchemicalWizardry.common.block.BloodStoneBrick; -import WayofTime.alchemicalWizardry.common.block.EfficiencyRune; -import WayofTime.alchemicalWizardry.common.block.EmptySocket; -import WayofTime.alchemicalWizardry.common.block.ImperfectRitualStone; -import WayofTime.alchemicalWizardry.common.block.LargeBloodStoneBrick; -import WayofTime.alchemicalWizardry.common.block.LifeEssenceBlock; -import WayofTime.alchemicalWizardry.common.block.RitualStone; -import WayofTime.alchemicalWizardry.common.block.RuneOfSacrifice; -import WayofTime.alchemicalWizardry.common.block.RuneOfSelfSacrifice; -import WayofTime.alchemicalWizardry.common.block.SpectralBlock; -import WayofTime.alchemicalWizardry.common.block.SpeedRune; -import WayofTime.alchemicalWizardry.common.items.ItemBlockCrystalBelljar; -import WayofTime.alchemicalWizardry.common.items.ItemBloodRuneBlock; -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.block.*; +import WayofTime.alchemicalWizardry.common.items.*; import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.block.Block; /** * Created with IntelliJ IDEA. @@ -54,8 +17,6 @@ public class ModBlocks public static Block testingBlock; public static Block bloodStoneBrick; public static Block largeBloodStoneBrick; - // public static Block lifeEssenceStill; -// public static Block lifeEssenceFlowing; public static BlockAltar blockAltar; public static BloodRune bloodRune; public static SpeedRune speedRune; @@ -96,7 +57,6 @@ public class ModBlocks efficiencyRune = new EfficiencyRune(); runeOfSacrifice = new RuneOfSacrifice(); runeOfSelfSacrifice = new RuneOfSelfSacrifice(); - blockTeleposer = new BlockTeleposer(); spectralBlock = new SpectralBlock(); ritualStone = new RitualStone(); @@ -123,14 +83,14 @@ public class ModBlocks blockReagentConduit = new BlockReagentConduit(); blockAlchemicCalcinator = new BlockAlchemicCalcinator(); blockCrystalBelljar = new BlockBelljar(); - + blockLifeEssence = new LifeEssenceBlock(); } - + public static void registerBlocksInPre() { - GameRegistry.registerBlock(ModBlocks.blockAltar, "Altar"); - GameRegistry.registerBlock(ModBlocks.bloodRune, ItemBloodRuneBlock.class, "AlchemicalWizardry" + (ModBlocks.bloodRune.getUnlocalizedName().substring(5))); + GameRegistry.registerBlock(ModBlocks.blockAltar, "Altar"); + GameRegistry.registerBlock(ModBlocks.bloodRune, ItemBloodRuneBlock.class, "AlchemicalWizardry" + (ModBlocks.bloodRune.getUnlocalizedName().substring(5))); GameRegistry.registerBlock(ModBlocks.blockLifeEssence, "lifeEssence"); GameRegistry.registerBlock(ModBlocks.speedRune, "speedRune"); GameRegistry.registerBlock(ModBlocks.efficiencyRune, "efficiencyRune"); @@ -139,9 +99,9 @@ public class ModBlocks GameRegistry.registerBlock(ModBlocks.ritualStone, "ritualStone"); GameRegistry.registerBlock(ModBlocks.blockMasterStone, "masterStone"); GameRegistry.registerBlock(ModBlocks.bloodSocket, "bloodSocket"); - GameRegistry.registerBlock(ModBlocks.imperfectRitualStone, "imperfectRitualStone"); - - GameRegistry.registerBlock(ModBlocks.armourForge, "armourForge"); + GameRegistry.registerBlock(ModBlocks.imperfectRitualStone, "imperfectRitualStone"); + + GameRegistry.registerBlock(ModBlocks.armourForge, "armourForge"); GameRegistry.registerBlock(ModBlocks.emptySocket, "emptySocket"); GameRegistry.registerBlock(ModBlocks.bloodStoneBrick, "bloodStoneBrick"); GameRegistry.registerBlock(ModBlocks.largeBloodStoneBrick, "largeBloodStoneBrick"); @@ -152,23 +112,22 @@ public class ModBlocks GameRegistry.registerBlock(ModBlocks.blockTeleposer, "blockTeleposer"); GameRegistry.registerBlock(ModBlocks.spectralBlock, "spectralBlock"); GameRegistry.registerBlock(ModBlocks.blockBloodLight, "bloodLight"); - - GameRegistry.registerBlock(ModBlocks.blockConduit,"blockConduit"); + + GameRegistry.registerBlock(ModBlocks.blockConduit, "blockConduit"); GameRegistry.registerBlock(ModBlocks.blockSpellParadigm, ItemSpellParadigmBlock.class, "AlchemicalWizardry" + (ModBlocks.blockSpellParadigm.getUnlocalizedName())); - GameRegistry.registerBlock(ModBlocks.blockSpellEnhancement, ItemSpellEnhancementBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellEnhancement.getUnlocalizedName())); - GameRegistry.registerBlock(ModBlocks.blockSpellModifier, ItemSpellModifierBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellModifier.getUnlocalizedName())); - GameRegistry.registerBlock(ModBlocks.blockSpellEffect, ItemSpellEffectBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellEffect.getUnlocalizedName())); - + GameRegistry.registerBlock(ModBlocks.blockSpellEnhancement, ItemSpellEnhancementBlock.class, "AlchemicalWizardry" + (ModBlocks.blockSpellEnhancement.getUnlocalizedName())); + GameRegistry.registerBlock(ModBlocks.blockSpellModifier, ItemSpellModifierBlock.class, "AlchemicalWizardry" + (ModBlocks.blockSpellModifier.getUnlocalizedName())); + GameRegistry.registerBlock(ModBlocks.blockSpellEffect, ItemSpellEffectBlock.class, "AlchemicalWizardry" + (ModBlocks.blockSpellEffect.getUnlocalizedName())); + GameRegistry.registerBlock(ModBlocks.blockSpectralContainer, "spectralContainer"); GameRegistry.registerBlock(ModBlocks.blockDemonPortal, "demonPortalMain"); GameRegistry.registerBlock(ModBlocks.blockBuildingSchematicSaver, "blockSchemSaver"); - GameRegistry.registerBlock(ModBlocks.blockReagentConduit, "blockReagentConduit"); + GameRegistry.registerBlock(ModBlocks.blockReagentConduit, "blockReagentConduit"); GameRegistry.registerBlock(ModBlocks.blockAlchemicCalcinator, "blockAlchemicCalcinator"); GameRegistry.registerBlock(ModBlocks.blockCrystalBelljar, ItemBlockCrystalBelljar.class, "blockCrystalBelljar"); } - + public static void registerBlocksInInit() { - //GameRegistry.registerBlock(ModBlocks.blockLifeEssence, "lifeEssence"); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/ModItems.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/ModItems.java index b7f2fcfa..9d2447bd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/ModItems.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/ModItems.java @@ -1,82 +1,16 @@ package WayofTime.alchemicalWizardry; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import WayofTime.alchemicalWizardry.common.items.AWBaseItems; -import WayofTime.alchemicalWizardry.common.items.ActivationCrystal; -import WayofTime.alchemicalWizardry.common.items.AirScribeTool; -import WayofTime.alchemicalWizardry.common.items.ApprenticeBloodOrb; -import WayofTime.alchemicalWizardry.common.items.ArchmageBloodOrb; -import WayofTime.alchemicalWizardry.common.items.ArmourInhibitor; -import WayofTime.alchemicalWizardry.common.items.BlankSpell; -import WayofTime.alchemicalWizardry.common.items.BloodShard; -import WayofTime.alchemicalWizardry.common.items.BoundArmour; -import WayofTime.alchemicalWizardry.common.items.BoundAxe; -import WayofTime.alchemicalWizardry.common.items.BoundPickaxe; -import WayofTime.alchemicalWizardry.common.items.BoundShovel; -import WayofTime.alchemicalWizardry.common.items.CheatyItem; -import WayofTime.alchemicalWizardry.common.items.DaggerOfSacrifice; -import WayofTime.alchemicalWizardry.common.items.DemonPlacer; -import WayofTime.alchemicalWizardry.common.items.DemonicTelepositionFocus; -import WayofTime.alchemicalWizardry.common.items.DuskScribeTool; -import WayofTime.alchemicalWizardry.common.items.EarthScribeTool; -import WayofTime.alchemicalWizardry.common.items.EnergyBattery; -import WayofTime.alchemicalWizardry.common.items.EnergyBazooka; -import WayofTime.alchemicalWizardry.common.items.EnergyBlast; -import WayofTime.alchemicalWizardry.common.items.EnergySword; -import WayofTime.alchemicalWizardry.common.items.EnhancedTelepositionFocus; -import WayofTime.alchemicalWizardry.common.items.FireScribeTool; -import WayofTime.alchemicalWizardry.common.items.ItemAlchemyBase; -import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal; -import WayofTime.alchemicalWizardry.common.items.ItemComponents; -import WayofTime.alchemicalWizardry.common.items.ItemDiabloKey; -import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; -import WayofTime.alchemicalWizardry.common.items.LavaCrystal; -import WayofTime.alchemicalWizardry.common.items.LifeBucket; -import WayofTime.alchemicalWizardry.common.items.MagicianBloodOrb; -import WayofTime.alchemicalWizardry.common.items.MasterBloodOrb; -import WayofTime.alchemicalWizardry.common.items.ReinforcedTelepositionFocus; -import WayofTime.alchemicalWizardry.common.items.SacrificialDagger; -import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; -import WayofTime.alchemicalWizardry.common.items.WaterScribeTool; +import WayofTime.alchemicalWizardry.common.items.*; import WayofTime.alchemicalWizardry.common.items.energy.ItemAttunedCrystal; import WayofTime.alchemicalWizardry.common.items.energy.ItemDestinationClearer; import WayofTime.alchemicalWizardry.common.items.energy.ItemTankSegmenter; -import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask; -import WayofTime.alchemicalWizardry.common.items.potion.AlchemyReagent; -import WayofTime.alchemicalWizardry.common.items.potion.AverageLengtheningCatalyst; -import WayofTime.alchemicalWizardry.common.items.potion.AveragePowerCatalyst; -import WayofTime.alchemicalWizardry.common.items.potion.CombinationalCatalyst; -import WayofTime.alchemicalWizardry.common.items.potion.EnhancedFillingAgent; -import WayofTime.alchemicalWizardry.common.items.potion.GreaterLengtheningCatalyst; -import WayofTime.alchemicalWizardry.common.items.potion.GreaterPowerCatalyst; -import WayofTime.alchemicalWizardry.common.items.potion.MundaneLengtheningCatalyst; -import WayofTime.alchemicalWizardry.common.items.potion.MundanePowerCatalyst; -import WayofTime.alchemicalWizardry.common.items.potion.StandardBindingAgent; -import WayofTime.alchemicalWizardry.common.items.potion.StandardFillingAgent; -import WayofTime.alchemicalWizardry.common.items.potion.WeakBindingAgent; -import WayofTime.alchemicalWizardry.common.items.potion.WeakFillingAgent; -import WayofTime.alchemicalWizardry.common.items.sigil.AirSigil; -import WayofTime.alchemicalWizardry.common.items.sigil.DivinationSigil; -import WayofTime.alchemicalWizardry.common.items.sigil.ItemBloodLightSigil; -import WayofTime.alchemicalWizardry.common.items.sigil.ItemFluidSigil; -import WayofTime.alchemicalWizardry.common.items.sigil.ItemSeerSigil; -import WayofTime.alchemicalWizardry.common.items.sigil.ItemSigilOfEnderSeverance; -import WayofTime.alchemicalWizardry.common.items.sigil.ItemSigilOfSupression; -import WayofTime.alchemicalWizardry.common.items.sigil.LavaSigil; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfElementalAffinity; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfGrowth; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHaste; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfMagnetism; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheBridge; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheFastMiner; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfWind; -import WayofTime.alchemicalWizardry.common.items.sigil.VoidSigil; -import WayofTime.alchemicalWizardry.common.items.sigil.WaterSigil; +import WayofTime.alchemicalWizardry.common.items.potion.*; +import WayofTime.alchemicalWizardry.common.items.sigil.*; import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; /** * Created with IntelliJ IDEA. @@ -153,7 +87,7 @@ public class ModItems public static Item armourInhibitor; public static Item creativeFiller; public static Item demonPlacer; - + public static Item baseItems; public static Item baseAlchemyItems; @@ -174,19 +108,19 @@ public class ModItems public static Item itemBloodLightSigil; public static Item itemComplexSpellCrystal; public static Item itemBloodFrame; - + public static Item itemSigilOfEnderSeverance; public static Item itemSigilOfSupression; public static Item itemFluidSigil; public static Item itemSeerSigil; public static Item itemCombinationalCatalyst; - + public static Item customTool; - + public static Item itemAttunedCrystal; public static Item itemTankSegmenter; public static Item itemDestinationClearer; - + public static Item bucketLife; public static void init() @@ -281,15 +215,15 @@ public class ModItems itemTankSegmenter = new ItemTankSegmenter().setUnlocalizedName("itemTankSegmenter"); itemDestinationClearer = new ItemDestinationClearer().setUnlocalizedName("destinationClearer"); } - + public static void registerItems() { - GameRegistry.registerItem(ModItems.weakBloodOrb, "weakBloodOrb"); - GameRegistry.registerItem(ModItems.apprenticeBloodOrb, "apprenticeBloodOrb"); - GameRegistry.registerItem(ModItems.magicianBloodOrb, "magicianBloodOrb"); - GameRegistry.registerItem(ModItems.energyBlaster, "energyBlaster"); + GameRegistry.registerItem(ModItems.weakBloodOrb, "weakBloodOrb"); + GameRegistry.registerItem(ModItems.apprenticeBloodOrb, "apprenticeBloodOrb"); + GameRegistry.registerItem(ModItems.magicianBloodOrb, "magicianBloodOrb"); + GameRegistry.registerItem(ModItems.energyBlaster, "energyBlaster"); - GameRegistry.registerItem(ModItems.energySword, "energySword"); + GameRegistry.registerItem(ModItems.energySword, "energySword"); GameRegistry.registerItem(ModItems.lavaCrystal, "lavaCrystal"); GameRegistry.registerItem(ModItems.waterSigil, "waterSigil"); GameRegistry.registerItem(ModItems.lavaSigil, "lavaSigil"); @@ -367,16 +301,16 @@ public class ModItems GameRegistry.registerItem(ModItems.itemSigilOfEnderSeverance, "sigilOfEnderSeverance"); GameRegistry.registerItem(ModItems.itemFluidSigil, "fluidSigil"); GameRegistry.registerItem(ModItems.itemSeerSigil, "seerSigil"); - + GameRegistry.registerItem(ModItems.customTool, "customTool"); - + GameRegistry.registerItem(ModItems.bucketLife, "bucketLife"); GameRegistry.registerItem(ModItems.itemCombinationalCatalyst, "itemCombinationalCatalyst"); - + GameRegistry.registerItem(ModItems.itemAttunedCrystal, "itemAttunedCrystal"); GameRegistry.registerItem(ModItems.itemTankSegmenter, "itemTankSegmenter"); GameRegistry.registerItem(ModItems.itemDestinationClearer, "itemDestinationClearer"); - + GameRegistry.registerItem(ModItems.baseItems, "bloodMagicBaseItems"); GameRegistry.registerItem(ModItems.baseAlchemyItems, "bloodMagicBaseAlchemyItems"); //GameRegistry.registerItem(ModItems.itemBloodFrame, "itemBloodFrame"); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/ColourAndCoords.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/ColourAndCoords.java index 08f71bff..d34dd413 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/ColourAndCoords.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/ColourAndCoords.java @@ -2,44 +2,44 @@ package WayofTime.alchemicalWizardry.api; import net.minecraft.nbt.NBTTagCompound; -public class ColourAndCoords +public class ColourAndCoords { - public int colourRed; - public int colourGreen; - public int colourBlue; - public int colourIntensity; - - public int xCoord; - public int yCoord; - public int zCoord; - - public ColourAndCoords(int red, int green, int blue, int intensity, int x, int y, int z) - { - this.colourRed = red; - this.colourGreen = green; - this.colourBlue = blue; - this.colourIntensity = intensity; - - this.xCoord = x; - this.yCoord = y; - this.zCoord = z; - } - - public static ColourAndCoords readFromNBT(NBTTagCompound tag) - { - return new ColourAndCoords(tag.getInteger("colourRed"), tag.getInteger("colourGreen"), tag.getInteger("colourBlue"), tag.getInteger("colourIntensity"), tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord")); - } - - public NBTTagCompound writeToNBT(NBTTagCompound tag) - { - tag.setInteger("colourRed", colourRed); - tag.setInteger("colourGreen", colourGreen); - tag.setInteger("colourBlue", colourBlue); - tag.setInteger("colourIntensity", colourIntensity); - tag.setInteger("xCoord", xCoord); - tag.setInteger("yCoord", yCoord); - tag.setInteger("zCoord", zCoord); - - return tag; - } + public int colourRed; + public int colourGreen; + public int colourBlue; + public int colourIntensity; + + public int xCoord; + public int yCoord; + public int zCoord; + + public ColourAndCoords(int red, int green, int blue, int intensity, int x, int y, int z) + { + this.colourRed = red; + this.colourGreen = green; + this.colourBlue = blue; + this.colourIntensity = intensity; + + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + } + + public static ColourAndCoords readFromNBT(NBTTagCompound tag) + { + return new ColourAndCoords(tag.getInteger("colourRed"), tag.getInteger("colourGreen"), tag.getInteger("colourBlue"), tag.getInteger("colourIntensity"), tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord")); + } + + public NBTTagCompound writeToNBT(NBTTagCompound tag) + { + tag.setInteger("colourRed", colourRed); + tag.setInteger("colourGreen", colourGreen); + tag.setInteger("colourBlue", colourBlue); + tag.setInteger("colourIntensity", colourIntensity); + tag.setInteger("xCoord", xCoord); + tag.setInteger("yCoord", yCoord); + tag.setInteger("zCoord", zCoord); + + return tag; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java index 4a4b40e0..6af04910 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.api.alchemy; -import java.util.ArrayList; - import net.minecraft.item.ItemStack; +import java.util.ArrayList; + public class AlchemicalPotionCreationHandler { public static ArrayList registeredPotionEffects = new ArrayList(); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipe.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipe.java index f773d063..aad27ee4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipe.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipe.java @@ -104,7 +104,7 @@ public class AlchemyRecipe continue; } - if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage() || OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage()) && checkedItemStack.getItem()==recipeItemStack.getItem()) + if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage() || OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage()) && checkedItemStack.getItem() == recipeItemStack.getItem()) { test = true; checkList[j] = true; @@ -135,9 +135,9 @@ public class AlchemyRecipe { return this.recipe; } - + public int getOrbLevel() { - return this.bloodOrbLevel; + return this.bloodOrbLevel; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java index 5753cff2..dfb24596 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.api.alchemy; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import net.minecraft.item.ItemStack; + import java.util.ArrayList; import java.util.List; -import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; - public class AlchemyRecipeRegistry { public static List recipes = new ArrayList(); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IAlchemyGoggles.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IAlchemyGoggles.java index 45eeaaa3..8b3e2274 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IAlchemyGoggles.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IAlchemyGoggles.java @@ -4,7 +4,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public interface IAlchemyGoggles +public interface IAlchemyGoggles { - public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player); + public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentContainer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentContainer.java index 91f93252..804fa728 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentContainer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentContainer.java @@ -1,10 +1,8 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; -import net.minecraftforge.fluids.FluidTankInfo; - -public interface IReagentContainer +public interface IReagentContainer { - public ReagentStack getReagent(); + public ReagentStack getReagent(); public int getReagentStackAmount(); @@ -13,6 +11,6 @@ public interface IReagentContainer public int fill(ReagentStack resource, boolean doFill); public ReagentStack drain(int maxDrain, boolean doDrain); - + public ReagentContainerInfo getInfo(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java index 37da7b69..165e9ab3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java @@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; import net.minecraftforge.common.util.ForgeDirection; -public interface IReagentHandler +public interface IReagentHandler { int fill(ForgeDirection from, ReagentStack resource, boolean doFill); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ISegmentedReagentHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ISegmentedReagentHandler.java index a6335d9e..14cb51c3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ISegmentedReagentHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ISegmentedReagentHandler.java @@ -4,11 +4,11 @@ import java.util.Map; public interface ISegmentedReagentHandler extends IReagentHandler { - public int getNumberOfTanks(); - - public int getTanksTunedToReagent(Reagent reagent); - - public void setTanksTunedToReagent(Reagent reagent, int total); - - public Map getAttunedTankMap(); + public int getNumberOfTanks(); + + public int getTanksTunedToReagent(Reagent reagent); + + public void setTanksTunedToReagent(Reagent reagent, int total); + + public Map getAttunedTankMap(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/Reagent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/Reagent.java index df4036b3..1abbc0b7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/Reagent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/Reagent.java @@ -1,54 +1,52 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; -import net.minecraft.item.ItemStack; - -public class Reagent +public class Reagent { - public final String name; - - public static final int REAGENT_SIZE = 1000; - - private int colourRed = 0; - private int colourGreen = 0; - private int colourBlue = 0; - private int colourIntensity = 255; - - public Reagent(String name) - { - this.name = name; - } - - public void setColour(int red, int green, int blue, int intensity) - { - this.colourRed = red; - this.colourGreen = green; - this.colourBlue = blue; - this.colourIntensity = intensity; - } - - public int getColourRed() - { - return colourRed; - } - - public int getColourGreen() - { - return colourGreen; - } - - public int getColourBlue() - { - return colourBlue; - } - - public int getColourIntensity() - { - return colourIntensity; - } - - @Override - public boolean equals(Object o) - { - return o instanceof Reagent ? this == o && name.equals(((Reagent)o).name) : false; - } + public final String name; + + public static final int REAGENT_SIZE = 1000; + + private int colourRed = 0; + private int colourGreen = 0; + private int colourBlue = 0; + private int colourIntensity = 255; + + public Reagent(String name) + { + this.name = name; + } + + public void setColour(int red, int green, int blue, int intensity) + { + this.colourRed = red; + this.colourGreen = green; + this.colourBlue = blue; + this.colourIntensity = intensity; + } + + public int getColourRed() + { + return colourRed; + } + + public int getColourGreen() + { + return colourGreen; + } + + public int getColourBlue() + { + return colourBlue; + } + + public int getColourIntensity() + { + return colourIntensity; + } + + @Override + public boolean equals(Object o) + { + return o instanceof Reagent ? this == o && name.equals(((Reagent) o).name) : false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainer.java index ea6d8306..c1352746 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainer.java @@ -1,17 +1,13 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; public class ReagentContainer implements IReagentContainer { - protected ReagentStack reagentStack; - protected int capacity; + protected ReagentStack reagentStack; + protected int capacity; - public ReagentContainer(int capacity) + public ReagentContainer(int capacity) { this(null, capacity); } @@ -31,13 +27,13 @@ public class ReagentContainer implements IReagentContainer { ReagentStack reagent = ReagentStack.loadReagentStackFromNBT(nbt); int capacity = nbt.getInteger("capacity"); - + if (reagent != null) { return new ReagentContainer(reagent, capacity); - }else + } else { - return new ReagentContainer(null, capacity); + return new ReagentContainer(null, capacity); } } @@ -47,12 +43,12 @@ public class ReagentContainer implements IReagentContainer { reagentStack.writeToNBT(nbt); } - + nbt.setInteger("capacity", capacity); return nbt; } - + @Override public ReagentStack getReagent() { @@ -115,8 +111,7 @@ public class ReagentContainer implements IReagentContainer { reagentStack.amount += resource.amount; filled = resource.amount; - } - else + } else { reagentStack.amount = capacity; } @@ -150,9 +145,9 @@ public class ReagentContainer implements IReagentContainer return stack; } - @Override - public ReagentContainerInfo getInfo() - { - return new ReagentContainerInfo(this); - } + @Override + public ReagentContainerInfo getInfo() + { + return new ReagentContainerInfo(this); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainerInfo.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainerInfo.java index 8dea2a50..99521dce 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainerInfo.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentContainerInfo.java @@ -1,8 +1,5 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidTank; - public final class ReagentContainerInfo { public final ReagentStack reagent; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java index 2120d9ef..696f09f4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java @@ -1,191 +1,191 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; +import WayofTime.alchemicalWizardry.ModItems; +import net.minecraft.item.ItemStack; + import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.ModItems; - -public class ReagentRegistry +public class ReagentRegistry { - public static Map reagentList = new HashMap(); - public static Map itemToReagentMap = new HashMap(); - - public static Reagent sanctusReagent; - public static Reagent incendiumReagent; - public static Reagent aquasalusReagent; - public static Reagent magicalesReagent; - public static Reagent aetherReagent; - public static Reagent crepitousReagent; - public static Reagent crystallosReagent; - public static Reagent terraeReagent; - public static Reagent tenebraeReagent; - - public static Reagent offensaReagent; - public static Reagent praesidiumReagent; - public static Reagent orbisTerraeReagent; - public static Reagent virtusReagent; - public static Reagent reductusReagent; - public static Reagent potentiaReagent; - - public static void initReagents() - { - sanctusReagent = new Reagent("sanctus"); - incendiumReagent = new Reagent("incendium"); - aquasalusReagent = new Reagent("aquasalus"); - magicalesReagent = new Reagent("magicales"); - aetherReagent = new Reagent("aether"); - crepitousReagent = new Reagent("crepitous"); - crystallosReagent = new Reagent("crystallos"); - terraeReagent = new Reagent("terrae"); - tenebraeReagent = new Reagent("tenebrae"); - offensaReagent = new Reagent("offensa"); - praesidiumReagent = new Reagent("praesidium"); - orbisTerraeReagent = new Reagent("orbisTerrae"); - virtusReagent = new Reagent("virtus"); - reductusReagent = new Reagent("reductus"); - potentiaReagent = new Reagent("potentia"); - - sanctusReagent.setColour(255, 255, 0, 255); - incendiumReagent.setColour(255, 0, 0, 255); - aquasalusReagent.setColour(47, 0, 196, 255); - magicalesReagent.setColour(150, 0, 146, 255); - aetherReagent.setColour(105, 223, 86, 255); - crepitousReagent.setColour(145, 145, 145, 255); - crystallosReagent.setColour(135, 255, 231, 255); - terraeReagent.setColour(147, 48, 13, 255); - tenebraeReagent.setColour(86, 86, 86, 255); - offensaReagent.setColour(126, 0, 0, 255); - praesidiumReagent.setColour(135, 135, 135, 255); - orbisTerraeReagent.setColour(32, 94, 14, 255); - virtusReagent.setColour(180, 0, 0, 255); - reductusReagent.setColour(20, 93, 2, 255); - potentiaReagent.setColour(64, 81, 208, 255); - - registerReagent("sanctus", sanctusReagent); - registerReagent("incendium", incendiumReagent); - registerReagent("aquasalus", aquasalusReagent); - registerReagent("magicales", magicalesReagent); - registerReagent("aether", aetherReagent); - registerReagent("crepitous", crepitousReagent); - registerReagent("crystallos", crystallosReagent); - registerReagent("terrae", terraeReagent); - registerReagent("tenebrae", tenebraeReagent); - registerReagent("offensa", offensaReagent); - registerReagent("praesidium", praesidiumReagent); - registerReagent("orbisTerrae", orbisTerraeReagent); - registerReagent("virtus", virtusReagent); - registerReagent("reductus", reductusReagent); - registerReagent("potentia", potentiaReagent); - - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.sanctus), new ReagentStack(sanctusReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.incendium), new ReagentStack(incendiumReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.aquasalus), new ReagentStack(aquasalusReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.magicales), new ReagentStack(magicalesReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.aether), new ReagentStack(aetherReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.crepitous), new ReagentStack(crepitousReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.crystallos), new ReagentStack(crystallosReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.terrae), new ReagentStack(terraeReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.tennebrae), new ReagentStack(tenebraeReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems,1,0), new ReagentStack(offensaReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems,1,1), new ReagentStack(praesidiumReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems,1,2), new ReagentStack(orbisTerraeReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems,1,6), new ReagentStack(virtusReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems,1,7), new ReagentStack(reductusReagent, 1000)); - ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems,1,8), new ReagentStack(potentiaReagent, 1000)); - } - - public static boolean registerReagent(String key, Reagent reagent) - { - if(reagentList.containsKey(key) || reagent == null) - { - return false; - } - - reagentList.put(key, reagent); - - return true; - } - - public static Reagent getReagentForKey(String key) - { - if(reagentList.containsKey(key)) - { - return reagentList.get(key); - } - - return null; - } - - public static String getKeyForReagent(Reagent reagent) - { - if(reagentList.containsValue(reagent)) - { - Set> set = reagentList.entrySet(); - for(Entry entry : set) - { - if(entry.getValue().equals(reagent)) - { - return entry.getKey(); - } - } - } - - return ""; - } - - public static void registerItemAndReagent(ItemStack stack, ReagentStack reagentStack) - { - itemToReagentMap.put(stack, reagentStack); - } - - public static ReagentStack getReagentStackForItem(ItemStack stack) - { - if(stack == null) - { - return null; - } - - for(Entry entry : itemToReagentMap.entrySet()) - { - if(entry.getKey() != null && entry.getKey().isItemEqual(stack)) - { - if(entry.getValue() == null) - { - return null; - }else - { - return entry.getValue().copy(); - } - } - } - - return null; - } - - public static ItemStack getItemForReagent(Reagent reagent) - { - if(reagent == null) - { - return null; - } - - for(Entry entry : itemToReagentMap.entrySet()) - { - if(entry.getValue() != null && entry.getValue().reagent == reagent) - { - if(entry.getKey() == null) - { - return null; - }else - { - return entry.getKey().copy(); - } - } - } - - return null; - } + public static Map reagentList = new HashMap(); + public static Map itemToReagentMap = new HashMap(); + + public static Reagent sanctusReagent; + public static Reagent incendiumReagent; + public static Reagent aquasalusReagent; + public static Reagent magicalesReagent; + public static Reagent aetherReagent; + public static Reagent crepitousReagent; + public static Reagent crystallosReagent; + public static Reagent terraeReagent; + public static Reagent tenebraeReagent; + + public static Reagent offensaReagent; + public static Reagent praesidiumReagent; + public static Reagent orbisTerraeReagent; + public static Reagent virtusReagent; + public static Reagent reductusReagent; + public static Reagent potentiaReagent; + + public static void initReagents() + { + sanctusReagent = new Reagent("sanctus"); + incendiumReagent = new Reagent("incendium"); + aquasalusReagent = new Reagent("aquasalus"); + magicalesReagent = new Reagent("magicales"); + aetherReagent = new Reagent("aether"); + crepitousReagent = new Reagent("crepitous"); + crystallosReagent = new Reagent("crystallos"); + terraeReagent = new Reagent("terrae"); + tenebraeReagent = new Reagent("tenebrae"); + offensaReagent = new Reagent("offensa"); + praesidiumReagent = new Reagent("praesidium"); + orbisTerraeReagent = new Reagent("orbisTerrae"); + virtusReagent = new Reagent("virtus"); + reductusReagent = new Reagent("reductus"); + potentiaReagent = new Reagent("potentia"); + + sanctusReagent.setColour(255, 255, 0, 255); + incendiumReagent.setColour(255, 0, 0, 255); + aquasalusReagent.setColour(47, 0, 196, 255); + magicalesReagent.setColour(150, 0, 146, 255); + aetherReagent.setColour(105, 223, 86, 255); + crepitousReagent.setColour(145, 145, 145, 255); + crystallosReagent.setColour(135, 255, 231, 255); + terraeReagent.setColour(147, 48, 13, 255); + tenebraeReagent.setColour(86, 86, 86, 255); + offensaReagent.setColour(126, 0, 0, 255); + praesidiumReagent.setColour(135, 135, 135, 255); + orbisTerraeReagent.setColour(32, 94, 14, 255); + virtusReagent.setColour(180, 0, 0, 255); + reductusReagent.setColour(20, 93, 2, 255); + potentiaReagent.setColour(64, 81, 208, 255); + + registerReagent("sanctus", sanctusReagent); + registerReagent("incendium", incendiumReagent); + registerReagent("aquasalus", aquasalusReagent); + registerReagent("magicales", magicalesReagent); + registerReagent("aether", aetherReagent); + registerReagent("crepitous", crepitousReagent); + registerReagent("crystallos", crystallosReagent); + registerReagent("terrae", terraeReagent); + registerReagent("tenebrae", tenebraeReagent); + registerReagent("offensa", offensaReagent); + registerReagent("praesidium", praesidiumReagent); + registerReagent("orbisTerrae", orbisTerraeReagent); + registerReagent("virtus", virtusReagent); + registerReagent("reductus", reductusReagent); + registerReagent("potentia", potentiaReagent); + + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.sanctus), new ReagentStack(sanctusReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.incendium), new ReagentStack(incendiumReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.aquasalus), new ReagentStack(aquasalusReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.magicales), new ReagentStack(magicalesReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.aether), new ReagentStack(aetherReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.crepitous), new ReagentStack(crepitousReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.crystallos), new ReagentStack(crystallosReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.terrae), new ReagentStack(terraeReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.tennebrae), new ReagentStack(tenebraeReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 0), new ReagentStack(offensaReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 1), new ReagentStack(praesidiumReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 2), new ReagentStack(orbisTerraeReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 6), new ReagentStack(virtusReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 7), new ReagentStack(reductusReagent, 1000)); + ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 8), new ReagentStack(potentiaReagent, 1000)); + } + + public static boolean registerReagent(String key, Reagent reagent) + { + if (reagentList.containsKey(key) || reagent == null) + { + return false; + } + + reagentList.put(key, reagent); + + return true; + } + + public static Reagent getReagentForKey(String key) + { + if (reagentList.containsKey(key)) + { + return reagentList.get(key); + } + + return null; + } + + public static String getKeyForReagent(Reagent reagent) + { + if (reagentList.containsValue(reagent)) + { + Set> set = reagentList.entrySet(); + for (Entry entry : set) + { + if (entry.getValue().equals(reagent)) + { + return entry.getKey(); + } + } + } + + return ""; + } + + public static void registerItemAndReagent(ItemStack stack, ReagentStack reagentStack) + { + itemToReagentMap.put(stack, reagentStack); + } + + public static ReagentStack getReagentStackForItem(ItemStack stack) + { + if (stack == null) + { + return null; + } + + for (Entry entry : itemToReagentMap.entrySet()) + { + if (entry.getKey() != null && entry.getKey().isItemEqual(stack)) + { + if (entry.getValue() == null) + { + return null; + } else + { + return entry.getValue().copy(); + } + } + } + + return null; + } + + public static ItemStack getItemForReagent(Reagent reagent) + { + if (reagent == null) + { + return null; + } + + for (Entry entry : itemToReagentMap.entrySet()) + { + if (entry.getValue() != null && entry.getValue().reagent == reagent) + { + if (entry.getKey() == null) + { + return null; + } else + { + return entry.getKey().copy(); + } + } + } + + return null; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java index f39b35ab..f8583970 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java @@ -1,63 +1,62 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -public class ReagentStack +public class ReagentStack { - public Reagent reagent; - public int amount; - - public ReagentStack(Reagent reagent, int amount) - { - this.reagent = reagent; - this.amount = amount; - } + public Reagent reagent; + public int amount; - public ReagentStack(ReagentStack reagentStack, int amount) - { - this(reagentStack.reagent,amount); - } + public ReagentStack(Reagent reagent, int amount) + { + this.reagent = reagent; + this.amount = amount; + } - public static ReagentStack loadReagentStackFromNBT(NBTTagCompound tag) - { - Reagent reagent = ReagentRegistry.getReagentForKey(tag.getString("Reagent")); - - if(reagent == null) - { - return null; - } - - int amount = tag.getInteger("amount"); - ReagentStack stack = new ReagentStack(reagent, amount); - - return stack; - } - - public NBTTagCompound writeToNBT(NBTTagCompound tag) - { - tag.setString("Reagent", ReagentRegistry.getKeyForReagent(this.reagent)); - tag.setInteger("amount", this.amount); - - return tag; - } - - public ReagentStack splitStack(int amount) - { - ReagentStack copyStack = this.copy(); - int splitAmount = Math.min(amount, this.amount); - copyStack.amount = splitAmount; - this.amount -= splitAmount; - - return copyStack; - } - - public ReagentStack copy() - { - return new ReagentStack(this.reagent, this.amount); - } - - public boolean isReagentEqual(ReagentStack other) + public ReagentStack(ReagentStack reagentStack, int amount) + { + this(reagentStack.reagent, amount); + } + + public static ReagentStack loadReagentStackFromNBT(NBTTagCompound tag) + { + Reagent reagent = ReagentRegistry.getReagentForKey(tag.getString("Reagent")); + + if (reagent == null) + { + return null; + } + + int amount = tag.getInteger("amount"); + ReagentStack stack = new ReagentStack(reagent, amount); + + return stack; + } + + public NBTTagCompound writeToNBT(NBTTagCompound tag) + { + tag.setString("Reagent", ReagentRegistry.getKeyForReagent(this.reagent)); + tag.setInteger("amount", this.amount); + + return tag; + } + + public ReagentStack splitStack(int amount) + { + ReagentStack copyStack = this.copy(); + int splitAmount = Math.min(amount, this.amount); + copyStack.amount = splitAmount; + this.amount -= splitAmount; + + return copyStack; + } + + public ReagentStack copy() + { + return new ReagentStack(this.reagent, this.amount); + } + + public boolean isReagentEqual(ReagentStack other) { return other != null && this.reagent == other.reagent; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java index 270efaa3..3e754648 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java @@ -4,8 +4,6 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.IFluidHandler; public class TileReagentHandler extends TileEntity implements IReagentHandler { @@ -63,6 +61,6 @@ public class TileReagentHandler extends TileEntity implements IReagentHandler @Override public ReagentContainerInfo[] getContainerInfo(ForgeDirection from) { - return new ReagentContainerInfo[] {tank.getInfo()}; + return new ReagentContainerInfo[]{tank.getInfo()}; } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java index 6cf25c04..a088b8a4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java @@ -1,16 +1,16 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - 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 java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + public class TileSegmentedReagentHandler extends TileEntity implements ISegmentedReagentHandler { protected ReagentContainer[] tanks; @@ -18,49 +18,49 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente public TileSegmentedReagentHandler() { - this(1); + this(1); } - + public TileSegmentedReagentHandler(int numberOfTanks) { - this(numberOfTanks, 1000); + this(numberOfTanks, 1000); } - + public TileSegmentedReagentHandler(int numberOfTanks, int tankSize) { - super(); - - this.attunedTankMap = new HashMap(); - this.tanks = new ReagentContainer[numberOfTanks]; - for(int i=0; i entry : this.attunedTankMap.entrySet()) + + for (Entry entry : this.attunedTankMap.entrySet()) { - NBTTagCompound savedTag = new NBTTagCompound(); - savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); - savedTag.setInteger("amount", entry.getValue()); - attunedTagList.appendTag(savedTag); + NBTTagCompound savedTag = new NBTTagCompound(); + savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); + savedTag.setInteger("amount", entry.getValue()); + attunedTagList.appendTag(savedTag); } - + tag.setTag("attunedTankMap", attunedTagList); } @@ -100,98 +100,98 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente @Override public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) { - int totalFill = 0; - - boolean useTankLimit = !this.attunedTankMap.isEmpty(); - - if(resource != null) - { - int totalTanksFillable = useTankLimit ? this.getTanksTunedToReagent(resource.reagent) : this.tanks.length; - int tanksFilled = 0; + int totalFill = 0; - int maxFill = resource.amount; - - for(int i=this.tanks.length-1; i>=0; i--) - { - ReagentStack remainingStack = resource.copy(); - remainingStack.amount = maxFill - totalFill; - - boolean doesReagentMatch = tanks[i].getReagent() == null ? false : tanks[i].getReagent().isReagentEqual(remainingStack); - - if(doesReagentMatch) - { - totalFill += tanks[i].fill(remainingStack, doFill); - tanksFilled++; - }else - { - continue; - } - - if(totalFill >= maxFill || tanksFilled >= totalTanksFillable) - { - return totalFill; - } - } - - if(tanksFilled >= totalTanksFillable) - { - return totalFill; - } - - for(int i=this.tanks.length-1; i>=0; i--) - { - ReagentStack remainingStack = resource.copy(); - remainingStack.amount = maxFill - totalFill; - - boolean isTankEmpty = tanks[i].getReagent() == null; - - if(isTankEmpty) - { - totalFill += tanks[i].fill(remainingStack, doFill); - tanksFilled++; - }else - { - continue; - } - - if(totalFill >= maxFill || tanksFilled >= totalTanksFillable) - { - return totalFill; - } - } - } + boolean useTankLimit = !this.attunedTankMap.isEmpty(); + + if (resource != null) + { + int totalTanksFillable = useTankLimit ? this.getTanksTunedToReagent(resource.reagent) : this.tanks.length; + int tanksFilled = 0; + + int maxFill = resource.amount; + + for (int i = this.tanks.length - 1; i >= 0; i--) + { + ReagentStack remainingStack = resource.copy(); + remainingStack.amount = maxFill - totalFill; + + boolean doesReagentMatch = tanks[i].getReagent() == null ? false : tanks[i].getReagent().isReagentEqual(remainingStack); + + if (doesReagentMatch) + { + totalFill += tanks[i].fill(remainingStack, doFill); + tanksFilled++; + } else + { + continue; + } + + if (totalFill >= maxFill || tanksFilled >= totalTanksFillable) + { + return totalFill; + } + } + + if (tanksFilled >= totalTanksFillable) + { + return totalFill; + } + + for (int i = this.tanks.length - 1; i >= 0; i--) + { + ReagentStack remainingStack = resource.copy(); + remainingStack.amount = maxFill - totalFill; + + boolean isTankEmpty = tanks[i].getReagent() == null; + + if (isTankEmpty) + { + totalFill += tanks[i].fill(remainingStack, doFill); + tanksFilled++; + } else + { + continue; + } + + if (totalFill >= maxFill || tanksFilled >= totalTanksFillable) + { + return totalFill; + } + } + } return totalFill; } @Override public ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain) { - if(resource == null) - { - return null; - } - - int maxDrain = resource.amount; - Reagent reagent = resource.reagent; - int drained = 0; - - for(int i=0; i= maxDrain) - { - break; - } - - if(resource.isReagentEqual(tanks[i].getReagent())) + if (resource == null) + { + return null; + } + + int maxDrain = resource.amount; + Reagent reagent = resource.reagent; + int drained = 0; + + for (int i = 0; i < tanks.length; i++) + { + if (drained >= maxDrain) { - ReagentStack drainStack = tanks[i].drain(maxDrain-drained, doDrain); - if(drainStack != null) - { - drained += drainStack.amount; - } + break; } - } - + + if (resource.isReagentEqual(tanks[i].getReagent())) + { + ReagentStack drainStack = tanks[i].drain(maxDrain - drained, doDrain); + if (drainStack != null) + { + drained += drainStack.amount; + } + } + } + return new ReagentStack(reagent, drained); } @@ -199,16 +199,16 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente @Override public ReagentStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - for(int i=0; i getAttunedTankMap() - { - return this.attunedTankMap; - } - - public boolean areTanksEmpty() - { - for(int i=0; i getAttunedTankMap() + { + return this.attunedTankMap; + } + + public boolean areTanksEmpty() + { + for (int i = 0; i < this.tanks.length; i++) + { + if (tanks[i] != null && tanks[i].reagentStack != null) + { + return false; + } + } + + return true; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java index 624f219b..4d80bdfa 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java @@ -2,69 +2,69 @@ package WayofTime.alchemicalWizardry.api.altarRecipeRegistry; import net.minecraft.item.ItemStack; -public class AltarRecipe +public class AltarRecipe { - public int minTier; - public int liquidRequired; - public boolean canBeFilled; //Tells the system that the item is an orb - public int consumptionRate; - public int drainRate; - public ItemStack requiredItem; - public ItemStack result; - - public AltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) - { - this.result = result; - this.requiredItem = requiredItem; - this.minTier = minTier; - this.liquidRequired = liquidRequired; - this.consumptionRate = consumptionRate; - this.drainRate = drainRate; - this.canBeFilled = canBeFilled; - } - - public ItemStack getResult() - { - return this.result; - } - - public ItemStack getRequiredItem() - { - return this.requiredItem; - } - - public boolean doesRequiredItemMatch(ItemStack comparedStack, int tierCheck) - { - if(comparedStack == null || this.requiredItem == null) - { - return false; - } - - return tierCheck>=minTier && this.requiredItem.isItemEqual(comparedStack); - } - - public int getMinTier() - { - return this.minTier; - } - - public int getLiquidRequired() - { - return this.liquidRequired; - } - - public int getConsumptionRate() - { - return this.consumptionRate; - } - - public int getDrainRate() - { - return this.drainRate; - } - - public boolean getCanBeFilled() - { - return this.canBeFilled; - } + public int minTier; + public int liquidRequired; + public boolean canBeFilled; //Tells the system that the item is an orb + public int consumptionRate; + public int drainRate; + public ItemStack requiredItem; + public ItemStack result; + + public AltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) + { + this.result = result; + this.requiredItem = requiredItem; + this.minTier = minTier; + this.liquidRequired = liquidRequired; + this.consumptionRate = consumptionRate; + this.drainRate = drainRate; + this.canBeFilled = canBeFilled; + } + + public ItemStack getResult() + { + return this.result; + } + + public ItemStack getRequiredItem() + { + return this.requiredItem; + } + + public boolean doesRequiredItemMatch(ItemStack comparedStack, int tierCheck) + { + if (comparedStack == null || this.requiredItem == null) + { + return false; + } + + return tierCheck >= minTier && this.requiredItem.isItemEqual(comparedStack); + } + + public int getMinTier() + { + return this.minTier; + } + + public int getLiquidRequired() + { + return this.liquidRequired; + } + + public int getConsumptionRate() + { + return this.consumptionRate; + } + + public int getDrainRate() + { + return this.drainRate; + } + + public boolean getCanBeFilled() + { + return this.canBeFilled; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java index 89c0be46..8e7f4556 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java @@ -1,60 +1,60 @@ package WayofTime.alchemicalWizardry.api.altarRecipeRegistry; +import net.minecraft.item.ItemStack; + import java.util.LinkedList; import java.util.List; -import net.minecraft.item.ItemStack; - -public class AltarRecipeRegistry +public class AltarRecipeRegistry { - public static List altarRecipes = new LinkedList(); - - public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) - { - altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled)); - } - - public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate) - { - registerAltarRecipe(null, orbStack, minTier, 0, consumptionRate, 0, true); - } - - public static boolean isRequiredItemValid(ItemStack testItem, int currentTierAltar) - { - for(AltarRecipe recipe : altarRecipes) - { - if(recipe.doesRequiredItemMatch(testItem, currentTierAltar)) - { - return true; - } - } - - return false; - } - - public static ItemStack getItemForItemAndTier(ItemStack testItem, int currentTierAltar) - { - for(AltarRecipe recipe : altarRecipes) - { - if(recipe.doesRequiredItemMatch(testItem, currentTierAltar)) - { - return ItemStack.copyItemStack(recipe.getResult()); - } - } - - return null; - } - - public static AltarRecipe getAltarRecipeForItemAndTier(ItemStack testItem, int currentTierAltar) - { - for(AltarRecipe recipe : altarRecipes) - { - if(recipe.doesRequiredItemMatch(testItem, currentTierAltar)) - { - return recipe; - } - } - - return null; - } + public static List altarRecipes = new LinkedList(); + + public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) + { + altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled)); + } + + public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate) + { + registerAltarRecipe(null, orbStack, minTier, 0, consumptionRate, 0, true); + } + + public static boolean isRequiredItemValid(ItemStack testItem, int currentTierAltar) + { + for (AltarRecipe recipe : altarRecipes) + { + if (recipe.doesRequiredItemMatch(testItem, currentTierAltar)) + { + return true; + } + } + + return false; + } + + public static ItemStack getItemForItemAndTier(ItemStack testItem, int currentTierAltar) + { + for (AltarRecipe recipe : altarRecipes) + { + if (recipe.doesRequiredItemMatch(testItem, currentTierAltar)) + { + return ItemStack.copyItemStack(recipe.getResult()); + } + } + + return null; + } + + public static AltarRecipe getAltarRecipeForItemAndTier(ItemStack testItem, int currentTierAltar) + { + for (AltarRecipe recipe : altarRecipes) + { + if (recipe.doesRequiredItemMatch(testItem, currentTierAltar)) + { + return recipe; + } + } + + return null; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRecipe.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRecipe.java index 111f585f..fc0ba2d7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRecipe.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRecipe.java @@ -2,34 +2,34 @@ package WayofTime.alchemicalWizardry.api.bindingRegistry; import net.minecraft.item.ItemStack; -public class BindingRecipe +public class BindingRecipe { - public ItemStack requiredItem; - public ItemStack outputItem; - - public BindingRecipe(ItemStack outputItem, ItemStack requiredItem) - { - this.requiredItem = requiredItem; - this.outputItem = outputItem; - } - - public boolean doesRequiredItemMatch(ItemStack testStack) - { - if(testStack == null || this.requiredItem == null) - { - return false; - } - - return this.requiredItem.isItemEqual(testStack); - } - - public ItemStack getResult(ItemStack inputItem) - { - return this.getResult(); - } - - public ItemStack getResult() - { - return this.outputItem; - } + public ItemStack requiredItem; + public ItemStack outputItem; + + public BindingRecipe(ItemStack outputItem, ItemStack requiredItem) + { + this.requiredItem = requiredItem; + this.outputItem = outputItem; + } + + public boolean doesRequiredItemMatch(ItemStack testStack) + { + if (testStack == null || this.requiredItem == null) + { + return false; + } + + return this.requiredItem.isItemEqual(testStack); + } + + public ItemStack getResult(ItemStack inputItem) + { + return this.getResult(); + } + + public ItemStack getResult() + { + return this.outputItem; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java index 636fb3f6..ba069118 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java @@ -1,67 +1,67 @@ package WayofTime.alchemicalWizardry.api.bindingRegistry; +import net.minecraft.item.ItemStack; + import java.util.LinkedList; import java.util.List; -import net.minecraft.item.ItemStack; - -public class BindingRegistry +public class BindingRegistry { - public static List bindingRecipes = new LinkedList(); + public static List bindingRecipes = new LinkedList(); - public static void registerRecipe(ItemStack output, ItemStack input) - { - bindingRecipes.add(new BindingRecipe(output, input)); - } - - public static boolean isRequiredItemValid(ItemStack testItem) - { - for(BindingRecipe recipe : bindingRecipes) - { - if(recipe.doesRequiredItemMatch(testItem)) - { - return true; - } - } - - return false; - } - - public static ItemStack getItemForItemAndTier(ItemStack testItem) - { - for(BindingRecipe recipe : bindingRecipes) - { - if(recipe.doesRequiredItemMatch(testItem)) - { - return recipe.getResult(testItem).copy(); - } - } - - return null; - } - - public static int getIndexForItem(ItemStack testItem) - { - int i=0; - for(BindingRecipe recipe : bindingRecipes) - { - if(recipe.doesRequiredItemMatch(testItem)) - { - return i; - } - i++; - } - - return -1; - } - - public static ItemStack getOutputForIndex(int index) - { - if(bindingRecipes.size()<=index) - { - return null; - } - - return bindingRecipes.get(index).getResult(); - } + public static void registerRecipe(ItemStack output, ItemStack input) + { + bindingRecipes.add(new BindingRecipe(output, input)); + } + + public static boolean isRequiredItemValid(ItemStack testItem) + { + for (BindingRecipe recipe : bindingRecipes) + { + if (recipe.doesRequiredItemMatch(testItem)) + { + return true; + } + } + + return false; + } + + public static ItemStack getItemForItemAndTier(ItemStack testItem) + { + for (BindingRecipe recipe : bindingRecipes) + { + if (recipe.doesRequiredItemMatch(testItem)) + { + return recipe.getResult(testItem).copy(); + } + } + + return null; + } + + public static int getIndexForItem(ItemStack testItem) + { + int i = 0; + for (BindingRecipe recipe : bindingRecipes) + { + if (recipe.doesRequiredItemMatch(testItem)) + { + return i; + } + i++; + } + + return -1; + } + + public static ItemStack getOutputForIndex(int index) + { + if (bindingRecipes.size() <= index) + { + return null; + } + + return bindingRecipes.get(index).getResult(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java index 244e227c..aac57f57 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java @@ -1,33 +1,33 @@ package WayofTime.alchemicalWizardry.api.harvest; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.world.World; -public class HarvestRegistry +import java.util.ArrayList; +import java.util.List; + +public class HarvestRegistry { - public static List handlerList = new ArrayList(); - - public static void registerHarvestHandler(IHarvestHandler handler) - { - handlerList.add(handler); - } - - public static boolean harvestBlock(World world, int xCoord, int yCoord, int zCoord) - { - Block block = world.getBlock(xCoord, yCoord, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord, zCoord); - - for(IHarvestHandler handler : handlerList) - { - if(handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta)) - { - return true; - } - } - - return false; - } + public static List handlerList = new ArrayList(); + + public static void registerHarvestHandler(IHarvestHandler handler) + { + handlerList.add(handler); + } + + public static boolean harvestBlock(World world, int xCoord, int yCoord, int zCoord) + { + Block block = world.getBlock(xCoord, yCoord, zCoord); + int meta = world.getBlockMetadata(xCoord, yCoord, zCoord); + + for (IHarvestHandler handler : handlerList) + { + if (handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta)) + { + return true; + } + } + + return false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java index 888dff58..d5e479d7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java @@ -2,20 +2,19 @@ package WayofTime.alchemicalWizardry.api.harvest; import net.minecraft.block.Block; import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; -public interface IHarvestHandler -{ - /** - * A handler that is used to harvest and replant the block at the specified location - * - * @param world - * @param xCoord - * @param yCoord - * @param zCoord - * @param block block at this given location - * @param meta meta at this given location - * @return true if successfully harvested, false if not - */ - public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta); +public interface IHarvestHandler +{ + /** + * A handler that is used to harvest and replant the block at the specified location + * + * @param world + * @param xCoord + * @param yCoord + * @param zCoord + * @param block block at this given location + * @param meta meta at this given location + * @return true if successfully harvested, false if not + */ + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapedBloodOrbRecipe.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapedBloodOrbRecipe.java index cdf82e6e..6e5b0f9b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapedBloodOrbRecipe.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapedBloodOrbRecipe.java @@ -1,11 +1,6 @@ package WayofTime.alchemicalWizardry.api.items; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; - +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; import net.minecraft.block.Block; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; @@ -14,214 +9,273 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -/** Shaped Blood Orb Recipe Handler by joshie **/ -public class ShapedBloodOrbRecipe implements IRecipe { - private static final int MAX_CRAFT_GRID_WIDTH = 3; - private static final int MAX_CRAFT_GRID_HEIGHT = 3; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; - private ItemStack output = null; - private Object[] input = null; - public int width = 0; - public int height = 0; - private boolean mirrored = true; +/** + * Shaped Blood Orb Recipe Handler by joshie * + */ +public class ShapedBloodOrbRecipe implements IRecipe +{ + private static final int MAX_CRAFT_GRID_WIDTH = 3; + private static final int MAX_CRAFT_GRID_HEIGHT = 3; - public ShapedBloodOrbRecipe(Block result, Object... recipe) { - this(new ItemStack(result), recipe); - } + private ItemStack output = null; + private Object[] input = null; + public int width = 0; + public int height = 0; + private boolean mirrored = true; - public ShapedBloodOrbRecipe(Item result, Object... recipe) { - this(new ItemStack(result), recipe); - } + public ShapedBloodOrbRecipe(Block result, Object... recipe) + { + this(new ItemStack(result), recipe); + } - public ShapedBloodOrbRecipe(ItemStack result, Object... recipe) { - output = result.copy(); + public ShapedBloodOrbRecipe(Item result, Object... recipe) + { + this(new ItemStack(result), recipe); + } - String shape = ""; - int idx = 0; + public ShapedBloodOrbRecipe(ItemStack result, Object... recipe) + { + output = result.copy(); - if (recipe[idx] instanceof Boolean) { - mirrored = (Boolean) recipe[idx]; - if (recipe[idx + 1] instanceof Object[]) { - recipe = (Object[]) recipe[idx + 1]; - } else { - idx = 1; - } - } + String shape = ""; + int idx = 0; - if (recipe[idx] instanceof String[]) { - String[] parts = ((String[]) recipe[idx++]); + if (recipe[idx] instanceof Boolean) + { + mirrored = (Boolean) recipe[idx]; + if (recipe[idx + 1] instanceof Object[]) + { + recipe = (Object[]) recipe[idx + 1]; + } else + { + idx = 1; + } + } - for (String s : parts) { - width = s.length(); - shape += s; - } + if (recipe[idx] instanceof String[]) + { + String[] parts = ((String[]) recipe[idx++]); - height = parts.length; - } else { - while (recipe[idx] instanceof String) { - String s = (String) recipe[idx++]; - shape += s; - width = s.length(); - height++; - } - } + for (String s : parts) + { + width = s.length(); + shape += s; + } - if (width * height != shape.length()) { - String ret = "Invalid shaped ore recipe: "; - for (Object tmp : recipe) { - ret += tmp + ", "; - } - ret += output; - throw new RuntimeException(ret); - } + height = parts.length; + } else + { + while (recipe[idx] instanceof String) + { + String s = (String) recipe[idx++]; + shape += s; + width = s.length(); + height++; + } + } - HashMap itemMap = new HashMap(); + if (width * height != shape.length()) + { + String ret = "Invalid shaped ore recipe: "; + for (Object tmp : recipe) + { + ret += tmp + ", "; + } + ret += output; + throw new RuntimeException(ret); + } - for (; idx < recipe.length; idx += 2) { - Character chr = (Character) recipe[idx]; - Object in = recipe[idx + 1]; + HashMap itemMap = new HashMap(); - if (in instanceof IBloodOrb || (in instanceof ItemStack && ((ItemStack)in).getItem() instanceof IBloodOrb)) { //If the item is an instanceof IBloodOrb then save the level of the orb - if(in instanceof ItemStack) itemMap.put(chr, (Integer)(((IBloodOrb)((ItemStack)in).getItem()).getOrbLevel())); - else itemMap.put(chr, (Integer)(((IBloodOrb)in).getOrbLevel())); - } else if (in instanceof ItemStack) { - itemMap.put(chr, ((ItemStack) in).copy()); - } else if (in instanceof Item) { - itemMap.put(chr, new ItemStack((Item) in)); - } else if (in instanceof Block) { - itemMap.put(chr, new ItemStack((Block) in, 1, OreDictionary.WILDCARD_VALUE)); - } else if (in instanceof String) { - itemMap.put(chr, OreDictionary.getOres((String) in)); - } else { - String ret = "Invalid shaped ore recipe: "; - for (Object tmp : recipe) { - ret += tmp + ", "; - } - ret += output; - throw new RuntimeException(ret); - } - } + for (; idx < recipe.length; idx += 2) + { + Character chr = (Character) recipe[idx]; + Object in = recipe[idx + 1]; - input = new Object[width * height]; - int x = 0; - for (char chr : shape.toCharArray()) { - input[x++] = itemMap.get(chr); - } - } + if (in instanceof IBloodOrb || (in instanceof ItemStack && ((ItemStack) in).getItem() instanceof IBloodOrb)) + { //If the item is an instanceof IBloodOrb then save the level of the orb + if (in instanceof ItemStack) + itemMap.put(chr, (Integer) (((IBloodOrb) ((ItemStack) in).getItem()).getOrbLevel())); + else itemMap.put(chr, (Integer) (((IBloodOrb) in).getOrbLevel())); + } else if (in instanceof ItemStack) + { + itemMap.put(chr, ((ItemStack) in).copy()); + } else if (in instanceof Item) + { + itemMap.put(chr, new ItemStack((Item) in)); + } else if (in instanceof Block) + { + itemMap.put(chr, new ItemStack((Block) in, 1, OreDictionary.WILDCARD_VALUE)); + } else if (in instanceof String) + { + itemMap.put(chr, OreDictionary.getOres((String) in)); + } else + { + String ret = "Invalid shaped ore recipe: "; + for (Object tmp : recipe) + { + ret += tmp + ", "; + } + ret += output; + throw new RuntimeException(ret); + } + } - ShapedBloodOrbRecipe(ShapedRecipes recipe, Map replacements) { - output = recipe.getRecipeOutput(); - width = recipe.recipeWidth; - height = recipe.recipeHeight; + input = new Object[width * height]; + int x = 0; + for (char chr : shape.toCharArray()) + { + input[x++] = itemMap.get(chr); + } + } - input = new Object[recipe.recipeItems.length]; + ShapedBloodOrbRecipe(ShapedRecipes recipe, Map replacements) + { + output = recipe.getRecipeOutput(); + width = recipe.recipeWidth; + height = recipe.recipeHeight; - for (int i = 0; i < input.length; i++) { - ItemStack ingred = recipe.recipeItems[i]; + input = new Object[recipe.recipeItems.length]; - if (ingred == null) - continue; + for (int i = 0; i < input.length; i++) + { + ItemStack ingred = recipe.recipeItems[i]; - input[i] = recipe.recipeItems[i]; + if (ingred == null) + continue; - for (Entry replace : replacements.entrySet()) { - if (OreDictionary.itemMatches(replace.getKey(), ingred, true)) { - input[i] = OreDictionary.getOres(replace.getValue()); - break; - } - } - } - } + input[i] = recipe.recipeItems[i]; - @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { - return output.copy(); - } + for (Entry replace : replacements.entrySet()) + { + if (OreDictionary.itemMatches(replace.getKey(), ingred, true)) + { + input[i] = OreDictionary.getOres(replace.getValue()); + break; + } + } + } + } - @Override - public int getRecipeSize() { - return input.length; - } + @Override + public ItemStack getCraftingResult(InventoryCrafting var1) + { + return output.copy(); + } - @Override - public ItemStack getRecipeOutput() { - return output; - } + @Override + public int getRecipeSize() + { + return input.length; + } - @Override - public boolean matches(InventoryCrafting inv, World world) { - for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++) { - for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y) { - if (checkMatch(inv, x, y, false)) { - return true; - } + @Override + public ItemStack getRecipeOutput() + { + return output; + } - if (mirrored && checkMatch(inv, x, y, true)) { - return true; - } - } - } + @Override + public boolean matches(InventoryCrafting inv, World world) + { + for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++) + { + for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y) + { + if (checkMatch(inv, x, y, false)) + { + return true; + } - return false; - } + if (mirrored && checkMatch(inv, x, y, true)) + { + return true; + } + } + } - @SuppressWarnings("unchecked") - private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror) { - for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++) { - for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++) { - int subX = x - startX; - int subY = y - startY; - Object target = null; + return false; + } - if (subX >= 0 && subY >= 0 && subX < width && subY < height) { - if (mirror) { - target = input[width - subX - 1 + subY * width]; - } else { - target = input[subX + subY * width]; - } - } - - ItemStack slot = inv.getStackInRowAndColumn(x, y); - //If target is integer, then we should be check the blood orb value of the item instead - if(target instanceof Integer) { - if(slot != null && slot.getItem() instanceof IBloodOrb) { - IBloodOrb orb = (IBloodOrb) slot.getItem(); - if(orb.getOrbLevel() < (Integer)target) { - return false; - } - } else return false; - } else if (target instanceof ItemStack) { - if (!OreDictionary.itemMatches((ItemStack) target, slot, false)) { - return false; - } - } else if (target instanceof ArrayList) { - boolean matched = false; + @SuppressWarnings("unchecked") + private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror) + { + for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++) + { + for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++) + { + int subX = x - startX; + int subY = y - startY; + Object target = null; - Iterator itr = ((ArrayList) target).iterator(); - while (itr.hasNext() && !matched) { - matched = OreDictionary.itemMatches(itr.next(), slot, false); - } + if (subX >= 0 && subY >= 0 && subX < width && subY < height) + { + if (mirror) + { + target = input[width - subX - 1 + subY * width]; + } else + { + target = input[subX + subY * width]; + } + } - if (!matched) { - return false; - } - } else if (target == null && slot != null) { - return false; - } - } - } + ItemStack slot = inv.getStackInRowAndColumn(x, y); + //If target is integer, then we should be check the blood orb value of the item instead + if (target instanceof Integer) + { + if (slot != null && slot.getItem() instanceof IBloodOrb) + { + IBloodOrb orb = (IBloodOrb) slot.getItem(); + if (orb.getOrbLevel() < (Integer) target) + { + return false; + } + } else return false; + } else if (target instanceof ItemStack) + { + if (!OreDictionary.itemMatches((ItemStack) target, slot, false)) + { + return false; + } + } else if (target instanceof ArrayList) + { + boolean matched = false; - return true; - } + Iterator itr = ((ArrayList) target).iterator(); + while (itr.hasNext() && !matched) + { + matched = OreDictionary.itemMatches(itr.next(), slot, false); + } - public ShapedBloodOrbRecipe setMirrored(boolean mirror) { - mirrored = mirror; - return this; - } + if (!matched) + { + return false; + } + } else if (target == null && slot != null) + { + return false; + } + } + } - public Object[] getInput() { - return this.input; - } + return true; + } + + public ShapedBloodOrbRecipe setMirrored(boolean mirror) + { + mirrored = mirror; + return this; + } + + public Object[] getInput() + { + return this.input; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java index fbf28a45..3b22dedd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java @@ -1,11 +1,6 @@ package WayofTime.alchemicalWizardry.api.items; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; import net.minecraft.block.Block; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; @@ -14,127 +9,166 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -/** Shapeless Blood Orb Recipe Handler by joshie **/ -public class ShapelessBloodOrbRecipe implements IRecipe { - private ItemStack output = null; - private ArrayList input = new ArrayList(); +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; - public ShapelessBloodOrbRecipe(Block result, Object... recipe) { - this(new ItemStack(result), recipe); - } +/** + * Shapeless Blood Orb Recipe Handler by joshie * + */ +public class ShapelessBloodOrbRecipe implements IRecipe +{ + private ItemStack output = null; + private ArrayList input = new ArrayList(); - public ShapelessBloodOrbRecipe(Item result, Object... recipe) { - this(new ItemStack(result), recipe); - } + public ShapelessBloodOrbRecipe(Block result, Object... recipe) + { + this(new ItemStack(result), recipe); + } - public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe) { - output = result.copy(); - for (Object in : recipe) { - if (in instanceof ItemStack) { - input.add(((ItemStack) in).copy()); - } else if (in instanceof IBloodOrb) { //If the item is an instanceof IBloodOrb then save the level of the orb - input.add((Integer)(((IBloodOrb)in).getOrbLevel())); - } else if (in instanceof Item) { - input.add(new ItemStack((Item) in)); - } else if (in instanceof Block) { - input.add(new ItemStack((Block) in)); - } else if (in instanceof String) { - input.add(OreDictionary.getOres((String) in)); - } else { - String ret = "Invalid shapeless ore recipe: "; - for (Object tmp : recipe) { - ret += tmp + ", "; - } - ret += output; - throw new RuntimeException(ret); - } - } - } + public ShapelessBloodOrbRecipe(Item result, Object... recipe) + { + this(new ItemStack(result), recipe); + } - @SuppressWarnings("unchecked") - ShapelessBloodOrbRecipe(ShapelessRecipes recipe, Map replacements) { - output = recipe.getRecipeOutput(); + public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe) + { + output = result.copy(); + for (Object in : recipe) + { + if (in instanceof ItemStack) + { + input.add(((ItemStack) in).copy()); + } else if (in instanceof IBloodOrb) + { //If the item is an instanceof IBloodOrb then save the level of the orb + input.add((Integer) (((IBloodOrb) in).getOrbLevel())); + } else if (in instanceof Item) + { + input.add(new ItemStack((Item) in)); + } else if (in instanceof Block) + { + input.add(new ItemStack((Block) in)); + } else if (in instanceof String) + { + input.add(OreDictionary.getOres((String) in)); + } else + { + String ret = "Invalid shapeless ore recipe: "; + for (Object tmp : recipe) + { + ret += tmp + ", "; + } + ret += output; + throw new RuntimeException(ret); + } + } + } - for (ItemStack ingred : ((List) recipe.recipeItems)) { - Object finalObj = ingred; - for (Entry replace : replacements.entrySet()) { - if (OreDictionary.itemMatches(replace.getKey(), ingred, false)) { - finalObj = OreDictionary.getOres(replace.getValue()); - break; - } - } - input.add(finalObj); - } - } + @SuppressWarnings("unchecked") + ShapelessBloodOrbRecipe(ShapelessRecipes recipe, Map replacements) + { + output = recipe.getRecipeOutput(); - @Override - public int getRecipeSize() { - return input.size(); - } + for (ItemStack ingred : ((List) recipe.recipeItems)) + { + Object finalObj = ingred; + for (Entry replace : replacements.entrySet()) + { + if (OreDictionary.itemMatches(replace.getKey(), ingred, false)) + { + finalObj = OreDictionary.getOres(replace.getValue()); + break; + } + } + input.add(finalObj); + } + } - @Override - public ItemStack getRecipeOutput() { - return output; - } + @Override + public int getRecipeSize() + { + return input.size(); + } - @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { - return output.copy(); - } + @Override + public ItemStack getRecipeOutput() + { + return output; + } - @SuppressWarnings("unchecked") - @Override - public boolean matches(InventoryCrafting var1, World world) { - ArrayList required = new ArrayList(input); + @Override + public ItemStack getCraftingResult(InventoryCrafting var1) + { + return output.copy(); + } - for (int x = 0; x < var1.getSizeInventory(); x++) { - ItemStack slot = var1.getStackInSlot(x); + @SuppressWarnings("unchecked") + @Override + public boolean matches(InventoryCrafting var1, World world) + { + ArrayList required = new ArrayList(input); - if (slot != null) { - boolean inRecipe = false; - Iterator req = required.iterator(); + for (int x = 0; x < var1.getSizeInventory(); x++) + { + ItemStack slot = var1.getStackInSlot(x); - while (req.hasNext()) { - boolean match = false; + if (slot != null) + { + boolean inRecipe = false; + Iterator req = required.iterator(); - Object next = req.next(); + while (req.hasNext()) + { + boolean match = false; - //If target is integer, then we should be check the blood orb value of the item instead - if(next instanceof Integer) { - if(slot != null && slot.getItem() instanceof IBloodOrb) { - IBloodOrb orb = (IBloodOrb) slot.getItem(); - if(orb.getOrbLevel() < (Integer)next) { - return false; - } - } else return false; - } else if (next instanceof ItemStack) { - match = OreDictionary.itemMatches((ItemStack) next, slot, false); - } else if (next instanceof ArrayList) { - Iterator itr = ((ArrayList) next).iterator(); - while (itr.hasNext() && !match) { - match = OreDictionary.itemMatches(itr.next(), slot, false); - } - } + Object next = req.next(); - if (match) { - inRecipe = true; - required.remove(next); - break; - } - } + //If target is integer, then we should be check the blood orb value of the item instead + if (next instanceof Integer) + { + if (slot != null && slot.getItem() instanceof IBloodOrb) + { + IBloodOrb orb = (IBloodOrb) slot.getItem(); + if (orb.getOrbLevel() < (Integer) next) + { + return false; + } + } else return false; + } else if (next instanceof ItemStack) + { + match = OreDictionary.itemMatches((ItemStack) next, slot, false); + } else if (next instanceof ArrayList) + { + Iterator itr = ((ArrayList) next).iterator(); + while (itr.hasNext() && !match) + { + match = OreDictionary.itemMatches(itr.next(), slot, false); + } + } - if (!inRecipe) { - return false; - } - } - } + if (match) + { + inRecipe = true; + required.remove(next); + break; + } + } - return required.isEmpty(); - } + if (!inRecipe) + { + return false; + } + } + } - public ArrayList getInput() { - return this.input; - } + return required.isEmpty(); + } + + public ArrayList getInput() + { + return this.input; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IBloodOrb.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IBloodOrb.java index 794172cc..e88e9cc2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IBloodOrb.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IBloodOrb.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.api.items.interfaces; -public interface IBloodOrb +public interface IBloodOrb { - public int getMaxEssence(); - - public int getOrbLevel(); + public int getMaxEssence(); + + public int getOrbLevel(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IHolding.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IHolding.java index cb07b998..4150abe2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IHolding.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IHolding.java @@ -1,6 +1,6 @@ package WayofTime.alchemicalWizardry.api.items.interfaces; -public interface IHolding +public interface IHolding { } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IReagentManipulator.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IReagentManipulator.java index df2c84bb..23ac7809 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IReagentManipulator.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IReagentManipulator.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.api.items.interfaces; /** * Implement this interface to have reagent blocks return false on activating them, to allow manipulation of said block */ -public interface IReagentManipulator +public interface IReagentManipulator { } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java index be31cbf8..e00ed793 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java @@ -1,13 +1,13 @@ package WayofTime.alchemicalWizardry.api.rituals; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler; public interface IMasterRitualStone extends ISegmentedReagentHandler { - public void performRitual(World world, int x, int y, int z, String ritualID); - + public void performRitual(World world, int x, int y, int z, String ritualID); + public String getOwner(); public void setCooldown(int newCooldown); @@ -21,16 +21,16 @@ public interface IMasterRitualStone extends ISegmentedReagentHandler public void setActive(boolean active); public int getDirection(); - + public World getWorld(); - + public int getXCoord(); - + public int getYCoord(); - + public int getZCoord(); - + public NBTTagCompound getCustomRitualTag(); - + public void setCustomRitualTag(NBTTagCompound tag); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java index 078cfd40..bd71154a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java @@ -1,6 +1,6 @@ package WayofTime.alchemicalWizardry.api.rituals; -public interface IRitualStone +public interface IRitualStone { } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java index f5339288..c8eb97cb 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java @@ -1,24 +1,24 @@ package WayofTime.alchemicalWizardry.api.rituals; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.List; public abstract class RitualEffect { public abstract void performEffect(IMasterRitualStone ritualStone); - + public boolean startRitual(IMasterRitualStone ritualStone, EntityPlayer player) { - return true; + return true; } - + public void onRitualBroken(IMasterRitualStone ritualStone) { - + } public abstract int getCostPerRefresh(); @@ -27,30 +27,30 @@ public abstract class RitualEffect { return 0; } - + public abstract List getRitualComponentList(); - + public boolean canDrainReagent(IMasterRitualStone ritualStone, Reagent reagent, int amount, boolean doDrain) { - if(ritualStone == null || reagent == null || amount == 0) - { - return false; - } - - ReagentStack reagentStack = new ReagentStack(reagent, amount); - - ReagentStack stack = ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, false); - - if(stack != null && stack.amount >= amount) - { - if(doDrain) - { - ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, true); - } - - return true; - } - - return false; + if (ritualStone == null || reagent == null || amount == 0) + { + return false; + } + + ReagentStack reagentStack = new ReagentStack(reagent, amount); + + ReagentStack stack = ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, false); + + if (stack != null && stack.amount >= amount) + { + if (doDrain) + { + ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, true); + } + + return true; + } + + return false; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java index 212a43e0..daa21917 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java @@ -1,26 +1,26 @@ package WayofTime.alchemicalWizardry.api.rituals; +import WayofTime.alchemicalWizardry.common.renderer.MRSRenderer; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.renderer.MRSRenderer; - public class Rituals { private int crystalLevel; private int actCost; private RitualEffect effect; private String name; - + private MRSRenderer customRenderer; - public static Map ritualMap = new HashMap(); - public static List keyList = new LinkedList(); + public static Map ritualMap = new HashMap(); + public static List keyList = new LinkedList(); public Rituals(int crystalLevel, int actCost, RitualEffect effect, String name, MRSRenderer renderer) { @@ -32,90 +32,89 @@ public class Rituals ritualMap.put(name, this); this.customRenderer = renderer; } - + public Rituals(int crystalLevel, int actCost, RitualEffect effect, String name) { - this(crystalLevel, actCost, effect, name, null); + this(crystalLevel, actCost, effect, name, null); } - + /** * Static method to register a ritual to the Ritual Registry - * @param key Unique identification key - must be different from all others to properly register - * @param crystalLevel Crystal level required to activate - * @param actCost LP amount required to activate - * @param effect The effect that will be ticked - * @param name The name of the ritual - * @return Returns true if properly registered, or false if the key is already used + * + * @param key Unique identification key - must be different from all others to properly register + * @param crystalLevel Crystal level required to activate + * @param actCost LP amount required to activate + * @param effect The effect that will be ticked + * @param name The name of the ritual + * @return Returns true if properly registered, or false if the key is already used */ public static boolean registerRitual(String key, int crystalLevel, int actCost, RitualEffect effect, String name, MRSRenderer renderer) { - if(ritualMap.containsKey(key)) - { - return false; - } - else - { - Rituals ritual = new Rituals(crystalLevel, actCost, effect, name, renderer); - ritual.removeRitualFromList(); - ritualMap.put(key, ritual); - keyList.add(key); - return true; - } + if (ritualMap.containsKey(key)) + { + return false; + } else + { + Rituals ritual = new Rituals(crystalLevel, actCost, effect, name, renderer); + ritual.removeRitualFromList(); + ritualMap.put(key, ritual); + keyList.add(key); + return true; + } } - + public static boolean registerRitual(String key, int crystalLevel, int actCost, RitualEffect effect, String name) { - if(ritualMap.containsKey(key)) - { - return false; - } - else - { - Rituals ritual = new Rituals(crystalLevel, actCost, effect, name); - ritual.removeRitualFromList(); - ritualMap.put(key, ritual); - keyList.add(key); - return true; - } + if (ritualMap.containsKey(key)) + { + return false; + } else + { + Rituals ritual = new Rituals(crystalLevel, actCost, effect, name); + ritual.removeRitualFromList(); + ritualMap.put(key, ritual); + keyList.add(key); + return true; + } } - + public void removeRitualFromList() { - if(ritualMap.containsValue(this)) - { - ritualMap.remove(ritualMap.remove(this.name)); - } - if(keyList.contains(this.name)) - { - keyList.remove(this.name); - } + if (ritualMap.containsValue(this)) + { + ritualMap.remove(ritualMap.remove(this.name)); + } + if (keyList.contains(this.name)) + { + keyList.remove(this.name); + } } public static String checkValidRitual(World world, int x, int y, int z) { - for(String key : ritualMap.keySet()) - { - if(checkRitualIsValid(world,x,y,z,key)) - { - return key; - } - } - - return ""; + for (String key : ritualMap.keySet()) + { + if (checkRitualIsValid(world, x, y, z, key)) + { + return key; + } + } + + return ""; } public static boolean canCrystalActivate(String ritualID, int crystalLevel) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null) - { - return ritual.getCrystalLevel() <= crystalLevel; - } - } - - return false; + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null) + { + return ritual.getCrystalLevel() <= crystalLevel; + } + } + + return false; } public static boolean checkRitualIsValid(World world, int x, int y, int z, String ritualID) @@ -170,8 +169,8 @@ public class Rituals case 2: for (RitualComponent rc : ritual) { - test = world.getBlock(x - rc.getZ(), y + rc.getY(), z + rc.getX()); - + test = world.getBlock(x - rc.getZ(), y + rc.getY(), z + rc.getX()); + if (!(test instanceof IRitualStone)) { return false; @@ -188,8 +187,8 @@ public class Rituals case 3: for (RitualComponent rc : ritual) { - test = world.getBlock(x - rc.getX(), y + rc.getY(), z - rc.getZ()); - + test = world.getBlock(x - rc.getX(), y + rc.getY(), z - rc.getZ()); + if (!(test instanceof IRitualStone)) { return false; @@ -206,9 +205,9 @@ public class Rituals case 4: for (RitualComponent rc : ritual) { - test = world.getBlock(x + rc.getZ(), y + rc.getY(), z - rc.getX()); - - if (!(test instanceof IRitualStone)) + test = world.getBlock(x + rc.getZ(), y + rc.getY(), z - rc.getX()); + + if (!(test instanceof IRitualStone)) { return false; } @@ -240,48 +239,48 @@ public class Rituals public static int getCostForActivation(String ritualID) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null) - { - return ritual.actCost; - } - } - - return 0; + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null) + { + return ritual.actCost; + } + } + + return 0; } public static int getInitialCooldown(String ritualID) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null && ritual.effect != null) - { - return ritual.effect.getInitialCooldown(); - } - } - - return 0; + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null && ritual.effect != null) + { + return ritual.effect.getInitialCooldown(); + } + } + + return 0; } public static List getRitualList(String ritualID) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null) - { - return ritual.obtainComponents(); - }else - { - return null; - } - }else - { - return null; - } + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null) + { + return ritual.obtainComponents(); + } else + { + return null; + } + } else + { + return null; + } } private List obtainComponents() @@ -293,53 +292,53 @@ public class Rituals { return this.crystalLevel; } - + private MRSRenderer getRenderer() { - return this.customRenderer; + return this.customRenderer; } public static void performEffect(IMasterRitualStone ritualStone, String ritualID) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null && ritual.effect != null) - { - ritual.effect.performEffect(ritualStone); - } - } + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null && ritual.effect != null) + { + ritual.effect.performEffect(ritualStone); + } + } } - + public static boolean startRitual(IMasterRitualStone ritualStone, String ritualID, EntityPlayer player) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null && ritual.effect != null) - { - return ritual.effect.startRitual(ritualStone, player); - } - } - - return false; + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null && ritual.effect != null) + { + return ritual.effect.startRitual(ritualStone, player); + } + } + + return false; } - + public static void onRitualBroken(IMasterRitualStone ritualStone, String ritualID) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null && ritual.effect != null) - { - ritual.effect.onRitualBroken(ritualStone); - } - } + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null && ritual.effect != null) + { + ritual.effect.onRitualBroken(ritualStone); + } + } } public static int getNumberOfRituals() { - return ritualMap.size(); + return ritualMap.size(); } public String getRitualName() @@ -349,54 +348,54 @@ public class Rituals public static String getNameOfRitual(String id) { - if(ritualMap.containsKey(id)) - { - Rituals ritual = ritualMap.get(id); - if(ritual != null) - { - return ritual.getRitualName(); - } - } - - return ""; + if (ritualMap.containsKey(id)) + { + Rituals ritual = ritualMap.get(id); + if (ritual != null) + { + return ritual.getRitualName(); + } + } + + return ""; } - + public static String getNextRitualKey(String key) { - boolean hasSpotted = false; - String firstKey = ""; + boolean hasSpotted = false; + String firstKey = ""; - for(String str : keyList) - { - if(firstKey.equals("")) - { - firstKey = str; - } - if(hasSpotted) - { - return str; - } - if(str.equals(key)) - { - hasSpotted = true; - } - } + for (String str : keyList) + { + if (firstKey.equals("")) + { + firstKey = str; + } + if (hasSpotted) + { + return str; + } + if (str.equals(key)) + { + hasSpotted = true; + } + } - return firstKey; + return firstKey; } public static String getPreviousRitualKey(String key) { boolean hasSpotted = false; - String lastKey = keyList.get(keyList.size()-1); + String lastKey = keyList.get(keyList.size() - 1); - for(String str : keyList) + for (String str : keyList) { - if(str.equals(key)) + if (str.equals(key)) { hasSpotted = true; } - if(hasSpotted) + if (hasSpotted) { return lastKey; } @@ -405,18 +404,18 @@ public class Rituals return lastKey; } - + public static MRSRenderer getRendererForKey(String ritualID) { - if(ritualMap.containsKey(ritualID)) - { - Rituals ritual = ritualMap.get(ritualID); - if(ritual != null) - { - return ritual.getRenderer(); - } - } - - return null; + if (ritualMap.containsKey(ritualID)) + { + Rituals ritual = ritualMap.get(ritualID); + if (ritual != null) + { + return ritual.getRenderer(); + } + } + + return null; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java index 0bf21a6e..c9526eb5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.api.soulNetwork; -import java.util.UUID; - +import com.mojang.authlib.GameProfile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -11,38 +10,36 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import com.mojang.authlib.GameProfile; +import java.util.UUID; -public class SoulNetworkHandler +public class SoulNetworkHandler { - public static UUID getUUIDFromPlayer(EntityPlayer player) - { - return player.getPersistentID(); - } - - public static EntityPlayer getPlayerFromUUID(UUID uuid) - { - MinecraftServer server = MinecraftServer.getServer(); - GameProfile gameProfile; - gameProfile = server.func_152358_ax().func_152652_a(uuid); -// LogHelper.info("player is " + gameProfile.getName() + " : " + gameProfile.getId()); - - return null; - } - - public static int syphonFromNetwork(ItemStack ist, int damageToBeDone) - { - if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) + public static UUID getUUIDFromPlayer(EntityPlayer player) + { + return player.getPersistentID(); + } + + public static EntityPlayer getPlayerFromUUID(UUID uuid) + { + MinecraftServer server = MinecraftServer.getServer(); + GameProfile gameProfile; + gameProfile = server.func_152358_ax().func_152652_a(uuid); + return null; + } + + public static int syphonFromNetwork(ItemStack ist, int damageToBeDone) + { + if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) { String ownerName = ist.getTagCompound().getString("ownerName"); return syphonFromNetwork(ownerName, damageToBeDone); } - return 0; - } - - public static int syphonFromNetwork(String ownerName, int damageToBeDone) - { + return 0; + } + + public static int syphonFromNetwork(String ownerName, int damageToBeDone) + { if (MinecraftServer.getServer() == null) { return 0; @@ -63,34 +60,34 @@ public class SoulNetworkHandler data.markDirty(); return damageToBeDone; } - + return 0; - } - - /** - * Master method used to syphon from the player's network, and will damage them accordingly if they do not have enough LP. - * Does not drain on the client side. - * - * @param ist Owned itemStack - * @param player Player using the item - * @param damageToBeDone - * @return True if server-sided, false if client-sided - */ - public static boolean syphonAndDamageFromNetwork(ItemStack ist, EntityPlayer player, int damageToBeDone) + } + + /** + * Master method used to syphon from the player's network, and will damage them accordingly if they do not have enough LP. + * Does not drain on the client side. + * + * @param ist Owned itemStack + * @param player Player using the item + * @param damageToBeDone + * @return True if server-sided, false if client-sided + */ + public static boolean syphonAndDamageFromNetwork(ItemStack ist, EntityPlayer player, int damageToBeDone) { - if(player.worldObj.isRemote) - { - return false; - } - - int amount = SoulNetworkHandler.syphonFromNetwork(ist, damageToBeDone); - - hurtPlayer(player, damageToBeDone-amount); + if (player.worldObj.isRemote) + { + return false; + } + + int amount = SoulNetworkHandler.syphonFromNetwork(ist, damageToBeDone); + + hurtPlayer(player, damageToBeDone - amount); return true; } - - public static boolean canSyphonFromOnlyNetwork(ItemStack ist, int damageToBeDone) + + public static boolean canSyphonFromOnlyNetwork(ItemStack ist, int damageToBeDone) { if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) { @@ -101,8 +98,8 @@ public class SoulNetworkHandler return false; } - - public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone) + + public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone) { if (MinecraftServer.getServer() == null) { @@ -120,10 +117,10 @@ public class SoulNetworkHandler return data.currentEssence >= damageToBeDone; } - - public static int getCurrentEssence(String ownerName) - { - if (MinecraftServer.getServer() == null) + + public static int getCurrentEssence(String ownerName) + { + if (MinecraftServer.getServer() == null) { return 0; } @@ -136,13 +133,13 @@ public class SoulNetworkHandler data = new LifeEssenceNetwork(ownerName); world.setItemData(ownerName, data); } - + return data.currentEssence; - } - - public static void setCurrentEssence(String ownerName, int essence) - { - if (MinecraftServer.getServer() == null) + } + + public static void setCurrentEssence(String ownerName, int essence) + { + if (MinecraftServer.getServer() == null) { return; } @@ -155,22 +152,22 @@ public class SoulNetworkHandler data = new LifeEssenceNetwork(ownerName); world.setItemData(ownerName, data); } - + data.currentEssence = essence; data.markDirty(); - } - - /** - * A method to add to an owner's network up to a maximum value. - * - * @param ownerName - * @param addedEssence - * @param maximum - * @return amount added to the network - */ - public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence, int maximum) - { - if (MinecraftServer.getServer() == null) + } + + /** + * A method to add to an owner's network up to a maximum value. + * + * @param ownerName + * @param addedEssence + * @param maximum + * @return amount added to the network + */ + public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence, int maximum) + { + if (MinecraftServer.getServer() == null) { return 0; } @@ -183,21 +180,21 @@ public class SoulNetworkHandler data = new LifeEssenceNetwork(ownerName); world.setItemData(ownerName, data); } - + int currEss = data.currentEssence; - - if(currEss>=maximum) + + if (currEss >= maximum) { - return 0; + return 0; } - - int newEss = Math.min(maximum, currEss+addedEssence); + + int newEss = Math.min(maximum, currEss + addedEssence); data.currentEssence = newEss; - - return newEss-currEss; - } - - public static void hurtPlayer(EntityPlayer user, int energySyphoned) + + return newEss - currEss; + } + + public static void hurtPlayer(EntityPlayer user, int energySyphoned) { if (energySyphoned < 100 && energySyphoned > 0) { @@ -227,8 +224,8 @@ public class SoulNetworkHandler } } } - - public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player) + + public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player) { if (item.stackTagCompound == null) { @@ -253,34 +250,34 @@ public class SoulNetworkHandler item.stackTagCompound.setString("ownerName", ownerName); } } - + public static String getUsername(EntityPlayer player) - { - return player.getDisplayName(); - } - + { + return player.getDisplayName(); + } + public static EntityPlayer getPlayerForUsername(String str) - { - if(MinecraftServer.getServer() == null) - { - return null; - } - return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str); - } - + { + if (MinecraftServer.getServer() == null) + { + return null; + } + return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str); + } + public static void causeNauseaToPlayer(ItemStack stack) { - if (stack.getTagCompound() != null && !(stack.getTagCompound().getString("ownerName").equals(""))) + if (stack.getTagCompound() != null && !(stack.getTagCompound().getString("ownerName").equals(""))) { String ownerName = stack.getTagCompound().getString("ownerName"); - + SoulNetworkHandler.causeNauseaToPlayer(ownerName); } } - + public static void causeNauseaToPlayer(String ownerName) { - EntityPlayer entityOwner = SoulNetworkHandler.getPlayerForUsername(ownerName); + EntityPlayer entityOwner = SoulNetworkHandler.getPlayerForUsername(ownerName); if (entityOwner == null) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningHelper.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningHelper.java index cccfe3f4..f1b63b22 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningHelper.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningHelper.java @@ -5,7 +5,7 @@ import net.minecraft.world.World; public abstract class SummoningHelper { - protected int id; + protected int id; public SummoningHelper(int id) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java index 864de3c4..7142278b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java @@ -1,11 +1,5 @@ package WayofTime.alchemicalWizardry.client; -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.client.event.RenderPlayerEvent; -import net.minecraftforge.client.event.sound.SoundEvent; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.client.renderer.RenderHelper; import cpw.mods.fml.client.FMLClientHandler; @@ -13,46 +7,51 @@ import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent.Phase; import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraftforge.client.event.sound.SoundEvent; +import org.lwjgl.opengl.GL11; -public class ClientEventHandler +public class ClientEventHandler { - private Minecraft mcClient = FMLClientHandler.instance().getClient(); + private Minecraft mcClient = FMLClientHandler.instance().getClient(); @SubscribeEvent public void onPlayerSoundEvent(SoundEvent event) { - if(Minecraft.getMinecraft() != null) - { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - - if(player != null && player.isPotionActive(AlchemicalWizardry.customPotionDeaf)) - { - event.setResult(Result.DENY); - } - } + if (Minecraft.getMinecraft() != null) + { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + + if (player != null && player.isPotionActive(AlchemicalWizardry.customPotionDeaf)) + { + event.setResult(Result.DENY); + } + } } - + @SubscribeEvent public void onTick(RenderTickEvent event) { if (event.phase.equals(Phase.START)) return; - + if (!RenderHelper.onTickInGame(mcClient)) { } } - + @SubscribeEvent public void onRenderLivingPlayerPre(RenderPlayerEvent.Pre event) { - GL11.glDisable(2929); + GL11.glDisable(2929); } - + @SubscribeEvent public void onRenderLivingPlayerPost(RenderPlayerEvent.Post event) { - GL11.glEnable(2929); + GL11.glEnable(2929); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java index ac7d29e2..1ef9d2b5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java @@ -1,89 +1,29 @@ package WayofTime.alchemicalWizardry.client; -import net.minecraft.item.ItemBlock; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.common.CommonProxy; import WayofTime.alchemicalWizardry.common.EntityAirElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.*; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderAlchemicCalcinator; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderConduit; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderCrystalBelljar; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderMasterStone; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderPedestal; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderPlinth; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderReagentConduit; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEffectBlock; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEnhancementBlock; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellModifierBlock; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellParadigmBlock; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderWritingTable; -import WayofTime.alchemicalWizardry.common.renderer.block.ShaderHelper; -import WayofTime.alchemicalWizardry.common.renderer.block.TEAltarRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAlchemicalCalcinatorItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAltarItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEBellJarItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEConduitItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellEffectBlockItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellEnhancementBlockItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellModifierBlockItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellParadigmBlockItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBileDemon; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBoulderFist; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderElemental; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderFallenAngel; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderIceDemon; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderLowerGuardian; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderShade; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderSmallEarthGolem; -import WayofTime.alchemicalWizardry.common.renderer.mob.RenderWingedFireDemon; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelBileDemon; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelBoulderFist; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelElemental; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelFallenAngel; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelIceDemon; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelLowerGuardian; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelShade; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelSmallEarthGolem; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelWingedFireDemon; +import WayofTime.alchemicalWizardry.common.renderer.block.*; +import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.*; +import WayofTime.alchemicalWizardry.common.renderer.mob.*; +import WayofTime.alchemicalWizardry.common.renderer.model.*; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBazookaMainProjectile; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor; import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import WayofTime.alchemicalWizardry.common.tileEntity.*; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraft.item.ItemBlock; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; public class ClientProxy extends CommonProxy { @@ -93,39 +33,24 @@ public class ClientProxy extends CommonProxy @Override public void registerRenderers() { - //altarRenderType = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerEntityRenderingHandler(EnergyBlastProjectile.class, new RenderEnergyBlastProjectile()); RenderingRegistry.registerEntityRenderingHandler(EntityEnergyBazookaMainProjectile.class, new RenderEnergyBazookaMainProjectile()); RenderingRegistry.registerEntityRenderingHandler(EntitySpellProjectile.class, new RenderEnergyBlastProjectile()); RenderingRegistry.registerEntityRenderingHandler(EntityParticleBeam.class, new RenderEnergyBlastProjectile()); RenderingRegistry.registerEntityRenderingHandler(EntityMeteor.class, new RenderMeteor()); - //EntityRegistry.registerGlobalEntityID(EntityFallenAngel.class, "AlchemicalWizardry.FallenAngel", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityFallenAngel.class, new RenderFallenAngel(new ModelFallenAngel(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityLowerGuardian.class, "AlchemicalWizardry.LowerGuardian", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityLowerGuardian.class, new RenderLowerGuardian(new ModelLowerGuardian(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityBileDemon.class, "AlchemicalWizardry.BileDemon", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityBileDemon.class, new RenderBileDemon(new ModelBileDemon(), 1.5F)); - //EntityRegistry.registerGlobalEntityID(EntityWingedFireDemon.class, "AlchemicalWizardry.WingedFireDemon", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityWingedFireDemon.class, new RenderWingedFireDemon(new ModelWingedFireDemon(), 1.0F)); - //EntityRegistry.registerGlobalEntityID(EntitySmallEarthGolem.class, "AlchemicalWizardry.SmallEarthGolem", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntitySmallEarthGolem.class, new RenderSmallEarthGolem(new ModelSmallEarthGolem(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityIceDemon.class, "AlchemicalWizardry.IceDemon", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityIceDemon.class, new RenderIceDemon(new ModelIceDemon(), 0.5F)); - // EntityRegistry.registerGlobalEntityID(EntityBoulderFist.class, "AlchemicalWizardry.BoulderFist", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityBoulderFist.class, new RenderBoulderFist(new ModelBoulderFist(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityShade.class, "AlchemicalWizardry.Shade", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityShade.class, new RenderShade(new ModelShade(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityAirElemental.class, "AlchemicalWizardry.AirElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityAirElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityWaterElemental.class, "AlchemicalWizardry.WaterElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityWaterElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityEarthElemental.class, "AlchemicalWizardry.EarthElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityEarthElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityFireElemental.class, "AlchemicalWizardry.FireElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityFireElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityShadeElemental.class, "AlchemicalWizardry.ShadeElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityShadeElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); - //EntityRegistry.registerGlobalEntityID(EntityHolyElemental.class, "AlchemicalWizardry.HolyElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); RenderingRegistry.registerEntityRenderingHandler(EntityHolyElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); ClientRegistry.bindTileEntitySpecialRenderer(TEAltar.class, new TEAltarRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TEPedestal.class, new RenderPedestal()); @@ -149,11 +74,7 @@ public class ClientProxy extends CommonProxy MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellModifier), new TESpellModifierBlockItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAlchemicCalcinator), new TEAlchemicalCalcinatorItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockCrystalBelljar), new TEBellJarItemRenderer()); - - //RenderingRegistry.registerEntityRenderingHandler(FireProjectile.class, new RenderFireProjectile()); - //RenderingRegistry.registerBlockHandler(new AltarRenderer()); - - ShaderHelper.initShaders(); + ShaderHelper.initShaders(); } @Override @@ -165,14 +86,12 @@ public class ClientProxy extends CommonProxy @Override public void InitRendering() { - MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAltar), new TEAltarItemRenderer()); - //MinecraftForgeClient.registerItemRenderer(AlchemicalWizardry.blockWritingTable.blockID, new TEWritingTableItemRenderer()); } - + @Override public void registerEvents() { - FMLCommonHandler.instance().bus().register(new ClientEventHandler()); + FMLCommonHandler.instance().bus().register(new ClientEventHandler()); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/ColourThreshold.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/ColourThreshold.java index f7ee748a..833f6b3b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/ColourThreshold.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/ColourThreshold.java @@ -1,13 +1,14 @@ package WayofTime.alchemicalWizardry.client.renderer; import java.util.List; + /** * This class is a utility class that was created by bspkrs. * https://github.com/bspkrs/bspkrsCore/blob/master/src/main/java/bspkrs/client/util/ColorThreshold.java */ public class ColourThreshold implements Comparable { - public int threshold; + public int threshold; public String colorCode; public ColourThreshold(int t, String c) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java index e597135f..2ceba76d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java @@ -1,38 +1,36 @@ package WayofTime.alchemicalWizardry.client.renderer; +import WayofTime.alchemicalWizardry.BloodMagicConfiguration; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.BloodMagicConfiguration; - public class HUDElement { public final ItemStack itemStack; - public final int iconW; - public final int iconH; - public final int padW; + public final int iconW; + public final int iconH; + public final int padW; public final int value; - private int elementW; - private int elementH; - private String itemName = ""; - private int itemNameW; - private String itemDamage = ""; - private int itemDamageW; - private Minecraft mc = Minecraft.getMinecraft(); - + private int elementW; + private int elementH; + private String itemName = ""; + private int itemNameW; + private String itemDamage = ""; + private int itemDamageW; + private Minecraft mc = Minecraft.getMinecraft(); + private static final int offset = 5; - + public boolean enableItemName = false; public boolean showValue = true; public boolean showDamageOverlay = false; public boolean showItemCount = false; - - static RenderItem itemRenderer = new RenderItem(); - + + static RenderItem itemRenderer = new RenderItem(); + public HUDElement(ItemStack itemStack, int iconW, int iconH, int padW, int value) { this.itemStack = itemStack; @@ -40,48 +38,47 @@ public class HUDElement this.iconH = iconH; this.padW = padW; this.value = value; - + initSize(); } - + public int width() { return elementW; } - + public int height() { return elementH; } - + private void initSize() { elementH = enableItemName ? Math.max(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT * 2, iconH) : Math.max(mc.fontRenderer.FONT_HEIGHT, iconH); - + if (itemStack != null) { int damage = 1; int maxDamage = 1; - + if (showValue) { maxDamage = itemStack.getMaxDamage() + 1; damage = maxDamage - itemStack.getItemDamageForDisplay(); - + boolean showSpecialValue = true; boolean showValue = false; boolean showPercent = false; - + boolean showMaxDamage = true; boolean thresholdPercent = true; - - if(showSpecialValue) + + if (showSpecialValue) { - itemDamage = "\247" + ColourThreshold.getColorCode(BloodMagicConfiguration.colorList, + itemDamage = "\247" + ColourThreshold.getColorCode(BloodMagicConfiguration.colorList, (thresholdPercent ? damage * 100 / maxDamage : damage)) + this.value; - } - else if (showValue) + } else if (showValue) itemDamage = "\247" + ColourThreshold.getColorCode(BloodMagicConfiguration.colorList, (thresholdPercent ? damage * 100 / maxDamage : damage)) + damage + (showMaxDamage ? "/" + maxDamage : ""); @@ -90,21 +87,21 @@ public class HUDElement (thresholdPercent ? damage * 100 / maxDamage : damage)) + (damage * 100 / maxDamage) + "%"; } - + itemDamageW = mc.fontRenderer.getStringWidth(HUDUtils.stripCtrl(itemDamage)); elementW = padW + iconW + padW + itemDamageW + offset; - + if (enableItemName) { itemName = itemStack.getDisplayName(); elementW = padW + iconW + padW + Math.max(mc.fontRenderer.getStringWidth(HUDUtils.stripCtrl(itemName)), itemDamageW); } - + itemNameW = mc.fontRenderer.getStringWidth(HUDUtils.stripCtrl(itemName)); } } - + public void renderToHud(int x, int y) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); @@ -112,31 +109,30 @@ public class HUDElement RenderHelper.enableStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting(); itemRenderer.zLevel = 200.0F; - + //if (ArmorStatusHUD.alignMode.toLowerCase().contains("right")) boolean toRight = true; - if(toRight) + if (toRight) { itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), itemStack, x - (iconW + padW), y); HUDUtils.renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, x - (iconW + padW), y, showDamageOverlay, showItemCount); - + RenderHelper.disableStandardItemLighting(); GL11.glDisable(32826 /* GL_RESCALE_NORMAL_EXT */); GL11.glDisable(GL11.GL_BLEND); - + mc.fontRenderer.drawStringWithShadow(itemName + "\247r", x - (padW + iconW + padW) - itemNameW, y, 0xffffff); mc.fontRenderer.drawStringWithShadow(itemDamage + "\247r", x - (padW + iconW + padW) - itemDamageW, y + (enableItemName ? elementH / 2 : elementH / 4), 0xffffff); - } - else + } else { itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), itemStack, x, y); HUDUtils.renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, x, y, showDamageOverlay, showItemCount); - + RenderHelper.disableStandardItemLighting(); GL11.glDisable(32826 /* GL_RESCALE_NORMAL_EXT */); GL11.glDisable(GL11.GL_BLEND); - + mc.fontRenderer.drawStringWithShadow(itemName + "\247r", x + iconW + padW, y, 0xffffff); mc.fontRenderer.drawStringWithShadow(itemDamage + "\247r", x + iconW + padW, y + (enableItemName ? elementH / 2 : elementH / 4), 0xffffff); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java index 08217699..2c42afea 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java @@ -9,7 +9,6 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; /** @@ -18,113 +17,113 @@ import org.lwjgl.opengl.GL11; */ public final class HUDUtils { - private static int[] colorCodes = new int[] { 0, 170, 43520, 43690, 11141120, 11141290, 16755200, 11184810, 5592405, 5592575, 5635925, 5636095, 16733525, 16733695, 16777045, 16777215, - 0, 42, 10752, 10794, 2752512, 2752554, 2763264, 2763306, 1381653, 1381695, 1392405, 1392447, 4134165, 4134207, 4144917, 4144959 }; - + private static int[] colorCodes = new int[]{0, 170, 43520, 43690, 11141120, 11141290, 16755200, 11184810, 5592405, 5592575, 5635925, 5636095, 16733525, 16733695, 16777045, 16777215, + 0, 42, 10752, 10794, 2752512, 2752554, 2763264, 2763306, 1381653, 1381695, 1392405, 1392447, 4134165, 4134207, 4144917, 4144959}; + public static int getColorCode(char c, boolean isLighter) { return colorCodes[isLighter ? "0123456789abcdef".indexOf(c) : "0123456789abcdef".indexOf(c) + 16]; } - + /** * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders * and filler. It is assumed that the desired texture ResourceLocation object has been bound using * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). - * - * @param x x axis offset - * @param y y axis offset - * @param u bound resource location image x offset - * @param v bound resource location image y offset - * @param width the desired box width - * @param height the desired box height - * @param textureWidth the width of the box texture in the resource location image + * + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image * @param textureHeight the height of the box texture in the resource location image - * @param borderSize the size of the box's borders - * @param zLevel the zLevel to draw at + * @param borderSize the size of the box's borders + * @param zLevel the zLevel to draw at */ public static void drawContinuousTexturedBox(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, - int borderSize, float zLevel) + int borderSize, float zLevel) { drawContinuousTexturedBox(x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel); } - + /** * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders * and filler. The provided ResourceLocation object will be bound using * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). - * - * @param res the ResourceLocation object that contains the desired image - * @param x x axis offset - * @param y y axis offset - * @param u bound resource location image x offset - * @param v bound resource location image y offset - * @param width the desired box width - * @param height the desired box height - * @param textureWidth the width of the box texture in the resource location image + * + * @param res the ResourceLocation object that contains the desired image + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image * @param textureHeight the height of the box texture in the resource location image - * @param borderSize the size of the box's borders - * @param zLevel the zLevel to draw at + * @param borderSize the size of the box's borders + * @param zLevel the zLevel to draw at */ public static void drawContinuousTexturedBox(ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, - int borderSize, float zLevel) + int borderSize, float zLevel) { drawContinuousTexturedBox(res, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel); } - + /** * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders * and filler. The provided ResourceLocation object will be bound using * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). - * - * @param res the ResourceLocation object that contains the desired image - * @param x x axis offset - * @param y y axis offset - * @param u bound resource location image x offset - * @param v bound resource location image y offset - * @param width the desired box width - * @param height the desired box height - * @param textureWidth the width of the box texture in the resource location image + * + * @param res the ResourceLocation object that contains the desired image + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image * @param textureHeight the height of the box texture in the resource location image - * @param topBorder the size of the box's top border - * @param bottomBorder the size of the box's bottom border - * @param leftBorder the size of the box's left border - * @param rightBorder the size of the box's right border - * @param zLevel the zLevel to draw at + * @param topBorder the size of the box's top border + * @param bottomBorder the size of the box's bottom border + * @param leftBorder the size of the box's left border + * @param rightBorder the size of the box's right border + * @param zLevel the zLevel to draw at */ public static void drawContinuousTexturedBox(ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, - int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) + int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) { Minecraft.getMinecraft().getTextureManager().bindTexture(res); drawContinuousTexturedBox(x, y, u, v, width, height, textureWidth, textureHeight, topBorder, bottomBorder, leftBorder, rightBorder, zLevel); } - + /** * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders * and filler. It is assumed that the desired texture ResourceLocation object has been bound using * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). - * - * @param x x axis offset - * @param y y axis offset - * @param u bound resource location image x offset - * @param v bound resource location image y offset - * @param width the desired box width - * @param height the desired box height - * @param textureWidth the width of the box texture in the resource location image + * + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image * @param textureHeight the height of the box texture in the resource location image - * @param topBorder the size of the box's top border - * @param bottomBorder the size of the box's bottom border - * @param leftBorder the size of the box's left border - * @param rightBorder the size of the box's right border - * @param zLevel the zLevel to draw at + * @param topBorder the size of the box's top border + * @param bottomBorder the size of the box's bottom border + * @param leftBorder the size of the box's left border + * @param rightBorder the size of the box's right border + * @param zLevel the zLevel to draw at */ public static void drawContinuousTexturedBox(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, - int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) + int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - + int fillerWidth = textureWidth - leftBorder - rightBorder; int fillerHeight = textureHeight - topBorder - bottomBorder; int canvasWidth = width - leftBorder - rightBorder; @@ -133,7 +132,7 @@ public final class HUDUtils int remainderWidth = canvasWidth % fillerWidth; int yPasses = canvasHeight / fillerHeight; int remainderHeight = canvasHeight % fillerHeight; - + // Draw Border // Top Left drawTexturedModalRect(x, y, u, v, leftBorder, topBorder, zLevel); @@ -143,19 +142,19 @@ public final class HUDUtils drawTexturedModalRect(x, y + topBorder + canvasHeight, u, v + topBorder + fillerHeight, leftBorder, bottomBorder, zLevel); // Bottom Right drawTexturedModalRect(x + leftBorder + canvasWidth, y + topBorder + canvasHeight, u + leftBorder + fillerWidth, v + topBorder + fillerHeight, rightBorder, bottomBorder, zLevel); - + for (int i = 0; i < xPasses + (remainderWidth > 0 ? 1 : 0); i++) { // Top Border drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y, u + leftBorder, v, (i == xPasses ? remainderWidth : fillerWidth), topBorder, zLevel); // Bottom Border drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y + topBorder + canvasHeight, u + leftBorder, v + topBorder + fillerHeight, (i == xPasses ? remainderWidth : fillerWidth), bottomBorder, zLevel); - + // Throw in some filler for good measure for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++) drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y + topBorder + (j * fillerHeight), u + leftBorder, v + topBorder, (i == xPasses ? remainderWidth : fillerWidth), (j == yPasses ? remainderHeight : fillerHeight), zLevel); } - + // Side Borders for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++) { @@ -165,7 +164,7 @@ public final class HUDUtils drawTexturedModalRect(x + leftBorder + canvasWidth, y + topBorder + (j * fillerHeight), u + leftBorder + fillerWidth, v + topBorder, rightBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel); } } - + public static void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, float zLevel) { float var7 = 0.00390625F; @@ -178,7 +177,7 @@ public final class HUDUtils tessellator.addVertexWithUV((x + 0), (y + 0), zLevel, ((u + 0) * var7), ((v + 0) * var8)); tessellator.draw(); } - + /** * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the specified position. */ @@ -186,7 +185,7 @@ public final class HUDUtils { renderItemOverlayIntoGUI(fontRenderer, itemStack, x, y, true, true); } - + /** * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the specified position. */ @@ -212,16 +211,16 @@ public final class HUDUtils GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } - + if (showCount) { int count = 0; - + if (itemStack.getMaxStackSize() > 1) count = HUDUtils.countInInventory(Minecraft.getMinecraft().thePlayer, itemStack.getItem(), itemStack.getItemDamage()); else if (itemStack.getItem().equals(Items.bow)) count = HUDUtils.countInInventory(Minecraft.getMinecraft().thePlayer, Items.arrow); - + if (count > 1) { String var6 = "" + count; @@ -234,7 +233,7 @@ public final class HUDUtils } } } - + /** * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: tessellator, x, y, width, * height, color @@ -249,12 +248,12 @@ public final class HUDUtils tessellator.addVertex((x + width), (y + 0), 0.0D); tessellator.draw(); } - + public static int countInInventory(EntityPlayer player, Item item) { return countInInventory(player, item, -1); } - + public static int countInInventory(EntityPlayer player, Item item, int md) { int count = 0; @@ -263,7 +262,7 @@ public final class HUDUtils count += player.inventory.mainInventory[i].stackSize; return count; } - + public static String stripCtrl(String s) { return s.replaceAll("(?i)\247[0-9a-fklmnor]", ""); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java index e9cfc87a..e74f7aa4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java @@ -1,121 +1,117 @@ package WayofTime.alchemicalWizardry.client.renderer; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import java.util.ArrayList; +import java.util.List; -public class RenderHelper +public class RenderHelper { - public static boolean showEquippedItem = true; - public static boolean enableItemName = false; - public static boolean enabled = true; - public static boolean showInChat = true; - - private static int xOffsetDefault = +50; - public static int xOffset = xOffsetDefault; - private static int yOffsetDefault = 2; - public static int yOffset = yOffsetDefault; - private static int yOffsetBottomCenterDefault = 41; - public static int yOffsetBottomCenter = yOffsetBottomCenterDefault; - private static boolean applyXOffsetToCenterDefault = true; - public static boolean applyXOffsetToCenter = applyXOffsetToCenterDefault; - private static boolean applyYOffsetToMiddleDefault = false; - public static boolean applyYOffsetToMiddle = applyYOffsetToMiddleDefault; - - public static String listMode = "horizontal"; - public static String alignMode = "bottomcenter"; - - private static ScaledResolution scaledResolution; - + public static boolean showEquippedItem = true; + public static boolean enableItemName = false; + public static boolean enabled = true; + public static boolean showInChat = true; + + private static int xOffsetDefault = +50; + public static int xOffset = xOffsetDefault; + private static int yOffsetDefault = 2; + public static int yOffset = yOffsetDefault; + private static int yOffsetBottomCenterDefault = 41; + public static int yOffsetBottomCenter = yOffsetBottomCenterDefault; + private static boolean applyXOffsetToCenterDefault = true; + public static boolean applyXOffsetToCenter = applyXOffsetToCenterDefault; + private static boolean applyYOffsetToMiddleDefault = false; + public static boolean applyYOffsetToMiddle = applyYOffsetToMiddleDefault; + + public static String listMode = "horizontal"; + public static String alignMode = "bottomcenter"; + + private static ScaledResolution scaledResolution; + public static boolean onTickInGame(Minecraft mc) { if (enabled && (mc.inGameHasFocus || mc.currentScreen == null || (mc.currentScreen instanceof GuiChat && showInChat)) && !mc.gameSettings.showDebugInfo) { - EntityPlayer player = mc.thePlayer; - World world = mc.theWorld; - if(SpellHelper.canPlayerSeeAlchemy(player)) - { - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + EntityPlayer player = mc.thePlayer; + World world = mc.theWorld; + if (SpellHelper.canPlayerSeeAlchemy(player)) + { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); displayArmorStatus(mc); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - } - + } + } - + return true; } - - private static List getHUDElements(Minecraft mc) + + private static List getHUDElements(Minecraft mc) { - List elements = new ArrayList(); - - MovingObjectPosition movingobjectposition = mc.objectMouseOver; - World world = mc.theWorld; + List elements = new ArrayList(); + + MovingObjectPosition movingobjectposition = mc.objectMouseOver; + World world = mc.theWorld; if (movingobjectposition == null) { - return elements; + return elements; } else { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int x = movingobjectposition.blockX; int y = movingobjectposition.blockY; int z = movingobjectposition.blockZ; - + TileEntity tile = world.getTileEntity(x, y, z); - - if(!(tile instanceof IReagentHandler)) + + if (!(tile instanceof IReagentHandler)) { - return elements; + return elements; } - - IReagentHandler relay = (IReagentHandler)tile; - + + IReagentHandler relay = (IReagentHandler) tile; + ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.getOrientation(movingobjectposition.sideHit)); - - if(infos != null) + + if (infos != null) { - for(ReagentContainerInfo info : infos) - { - if(info == null || info.reagent == null || info.reagent.reagent == null) - { - continue; - } - - ItemStack itemStack = ReagentRegistry.getItemForReagent(info.reagent.reagent); - + for (ReagentContainerInfo info : infos) + { + if (info == null || info.reagent == null || info.reagent.reagent == null) + { + continue; + } + + ItemStack itemStack = ReagentRegistry.getItemForReagent(info.reagent.reagent); + if (itemStack != null) elements.add(new HUDElement(itemStack, 16, 16, 2, info.reagent.amount)); - } + } } } } - + return elements; } - private static int getX(int width) + private static int getX(int width) { if (alignMode.toLowerCase().contains("center")) return scaledResolution.getScaledWidth() / 2 - width / 2 + (applyXOffsetToCenter ? xOffset : 0); @@ -124,7 +120,7 @@ public class RenderHelper else return xOffset; } - + private static int getY(int rowCount, int height) { if (alignMode.toLowerCase().contains("middle")) @@ -136,49 +132,48 @@ public class RenderHelper else return yOffset; } - - private static int getElementsWidth(List elements) + + private static int getElementsWidth(List elements) { int r = 0; for (HUDElement he : elements) r += he.width(); - + return r; } private static void displayArmorStatus(Minecraft mc) { List elements = getHUDElements(mc); - + if (elements.size() > 0) { int yOffset = enableItemName ? 18 : 16; - + if (listMode.equalsIgnoreCase("vertical")) { int yBase = getY(elements.size(), yOffset); - + for (HUDElement e : elements) { e.renderToHud((alignMode.toLowerCase().contains("right") ? getX(0) : getX(e.width())), yBase); yBase += yOffset; } - } - else if (listMode.equalsIgnoreCase("horizontal")) + } else if (listMode.equalsIgnoreCase("horizontal")) { int totalWidth = getElementsWidth(elements); int yBase = getY(1, yOffset); int xBase = getX(totalWidth); int prevX = 0; - + for (HUDElement e : elements) { e.renderToHud(xBase + prevX + (alignMode.toLowerCase().contains("right") ? e.width() : 0), yBase); prevX += (e.width()); } - }else if(listMode.equalsIgnoreCase("compound")) + } else if (listMode.equalsIgnoreCase("compound")) { - //TODO + //TODO } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index c3ed52af..8e3bd318 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -1,11 +1,13 @@ package WayofTime.alchemicalWizardry.common; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.common.ObfuscationReflectionHelper; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; @@ -26,138 +28,132 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; -import cpw.mods.fml.common.ObfuscationReflectionHelper; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; + +import java.util.*; public class AlchemicalWizardryEventHooks { - public static Map playerFlightBuff = new HashMap(); - public static Map playerBoostStepHeight = new HashMap(); + public static Map playerFlightBuff = new HashMap(); + public static Map playerBoostStepHeight = new HashMap(); public static List playersWith1Step = new ArrayList(); - + public static Map> respawnMap = new HashMap(); public static Map> forceSpawnMap = new HashMap(); - + @SubscribeEvent public void onPlayerDamageEvent(LivingAttackEvent event) { - if(event.source.isProjectile()) - { - if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt) && event.isCancelable()) - { - event.setCanceled(true); - } - } + if (event.source.isProjectile()) + { + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt) && event.isCancelable()) + { + event.setCanceled(true); + } + } } - + @SubscribeEvent public void onLivingSpawnEvent(CheckSpawn event) { - if(!(event.entityLiving instanceof EntityMob)) - { - return; - } - - String respawnRitual = "AW028SpawnWard"; - - Integer dimension = new Integer(event.world.provider.dimensionId); - if(respawnMap.containsKey(dimension)) - { - List list = respawnMap.get(dimension); - - if(list != null) - { - for(CoordAndRange coords : list) - { - TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); - - if(tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(respawnRitual)) - { - if(event.x > coords.xCoord-coords.horizRadius && event.x < coords.xCoord+coords.horizRadius && event.z > coords.zCoord-coords.horizRadius && event.z < coords.zCoord+coords.horizRadius && event.y > coords.yCoord-coords.vertRadius && event.y < coords.yCoord+coords.vertRadius) - { - switch(event.getResult()) - { - case ALLOW: - event.setResult(Result.DEFAULT); - break; - case DEFAULT: - event.setResult(Result.DENY); - break; - case DENY: - break; - default: - break; - } - break; - } - }else - { - list.remove(coords); - } - } - } - } - - if(event.entityLiving instanceof EntityCreeper) - { - return; - } - - String forceSpawnRitual = "AW029VeilOfEvil"; - - if(forceSpawnMap.containsKey(dimension)) - { - List list = forceSpawnMap.get(dimension); - - if(list != null) - { - for(CoordAndRange coords : list) - { - TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); - - if(tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(forceSpawnRitual)) - { - if(event.x > coords.xCoord-coords.horizRadius && event.x < coords.xCoord+coords.horizRadius && event.z > coords.zCoord-coords.horizRadius && event.z < coords.zCoord+coords.horizRadius && event.y > coords.yCoord-coords.vertRadius && event.y < coords.yCoord+coords.vertRadius) - { - switch(event.getResult()) - { - case ALLOW: - break; - case DEFAULT: - event.setResult(Result.ALLOW); - break; - case DENY: - event.setResult(Result.DEFAULT); - break; - default: - break; - } - break; - } - }else - { - list.remove(coords); - } - } - } - } + if (!(event.entityLiving instanceof EntityMob)) + { + return; + } + + String respawnRitual = "AW028SpawnWard"; + + Integer dimension = new Integer(event.world.provider.dimensionId); + if (respawnMap.containsKey(dimension)) + { + List list = respawnMap.get(dimension); + + if (list != null) + { + for (CoordAndRange coords : list) + { + TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); + + if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(respawnRitual)) + { + if (event.x > coords.xCoord - coords.horizRadius && event.x < coords.xCoord + coords.horizRadius && event.z > coords.zCoord - coords.horizRadius && event.z < coords.zCoord + coords.horizRadius && event.y > coords.yCoord - coords.vertRadius && event.y < coords.yCoord + coords.vertRadius) + { + switch (event.getResult()) + { + case ALLOW: + event.setResult(Result.DEFAULT); + break; + case DEFAULT: + event.setResult(Result.DENY); + break; + case DENY: + break; + default: + break; + } + break; + } + } else + { + list.remove(coords); + } + } + } + } + + if (event.entityLiving instanceof EntityCreeper) + { + return; + } + + String forceSpawnRitual = "AW029VeilOfEvil"; + + if (forceSpawnMap.containsKey(dimension)) + { + List list = forceSpawnMap.get(dimension); + + if (list != null) + { + for (CoordAndRange coords : list) + { + TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); + + if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(forceSpawnRitual)) + { + if (event.x > coords.xCoord - coords.horizRadius && event.x < coords.xCoord + coords.horizRadius && event.z > coords.zCoord - coords.horizRadius && event.z < coords.zCoord + coords.horizRadius && event.y > coords.yCoord - coords.vertRadius && event.y < coords.yCoord + coords.vertRadius) + { + switch (event.getResult()) + { + case ALLOW: + break; + case DEFAULT: + event.setResult(Result.ALLOW); + break; + case DENY: + event.setResult(Result.DEFAULT); + break; + default: + break; + } + break; + } + } else + { + list.remove(coords); + } + } + } + } } - + @SubscribeEvent public void onPlayerRespawnEvent(PlayerRespawnEvent event) { - if(AlchemicalWizardry.respawnWithDebuff) - { - event.player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, 20*60*5,0)); - } + if (AlchemicalWizardry.respawnWithDebuff) + { + event.player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, 20 * 60 * 5, 0)); + } } - + @SubscribeEvent public void onLivingJumpEvent(LivingJumpEvent event) { @@ -165,21 +161,21 @@ public class AlchemicalWizardryEventHooks { int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier(); event.entityLiving.motionY += (0.1f) * (2 + i); - } - - if(event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart)) + } + + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart)) { - event.entityLiving.motionY = 0; + event.entityLiving.motionY = 0; } } - + @SubscribeEvent public void onEndermanTeleportEvent(EnderTeleportEvent event) { - if(event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable()) - { - event.setCanceled(true); - } + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable()) + { + event.setCanceled(true); + } } @SubscribeEvent @@ -198,18 +194,18 @@ public class AlchemicalWizardryEventHooks ((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve); } } - - if(entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak)) + + if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak)) { int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier(); - Entity entityAttacking = event.source.getSourceOfDamage(); - - if(entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase)entityAttacking).isPotionActive(Potion.fireResistance)) - { - entityAttacking.attackEntityFrom(DamageSource.inFire, 2*i+2); - entityAttacking.setFire(3); - } + Entity entityAttacking = event.source.getSourceOfDamage(); + + if (entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase) entityAttacking).isPotionActive(Potion.fireResistance)) + { + entityAttacking.attackEntityFrom(DamageSource.inFire, 2 * i + 2); + entityAttacking.setFire(3); + } } } @@ -227,7 +223,7 @@ public class AlchemicalWizardryEventHooks // ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, event.player.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"}); // } // } - + @SubscribeEvent public void onEntityUpdate(LivingUpdateEvent event) { @@ -235,17 +231,17 @@ public class AlchemicalWizardryEventHooks double x = entityLiving.posX; double y = entityLiving.posY; double z = entityLiving.posZ; - - Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving); - int xPos = (int)(blockVector.xCoord); - int yPos = (int)(blockVector.yCoord); - int zPos = (int)(blockVector.zCoord); - if(entityLiving instanceof EntityPlayer) + Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving); + int xPos = (int) (blockVector.xCoord); + int yPos = (int) (blockVector.yCoord); + int zPos = (int) (blockVector.zCoord); + + if (entityLiving instanceof EntityPlayer) { - ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer)event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"}); + ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"}); } - + if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote) { EntityPlayer entityPlayer = (EntityPlayer) entityLiving; @@ -266,9 +262,9 @@ public class AlchemicalWizardryEventHooks if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionFeatherFall)) { - event.entityLiving.fallDistance = 0; + event.entityLiving.fallDistance = 0; } - + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionDrowning)) { int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier(); @@ -293,8 +289,8 @@ public class AlchemicalWizardryEventHooks EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving; entityPlayer.stepHeight = 1.0f; - if((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F) - entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease/2.0f) : percentIncrease); + if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F) + entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease); } } } @@ -306,7 +302,7 @@ public class AlchemicalWizardryEventHooks int posX = (int) Math.round(entity.posX - 0.5f); int posY = (int) Math.round(entity.posY); int posZ = (int) Math.round(entity.posZ - 0.5f); - int d0 = (int)((i+1)*2.5); + int d0 = (int) ((i + 1) * 2.5); AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5).expand(d0, d0, d0); List list = event.entityLiving.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -325,7 +321,7 @@ public class AlchemicalWizardryEventHooks { continue; } - + Entity throwingEntity = null; if (projectile instanceof EntityArrow) @@ -334,29 +330,29 @@ public class AlchemicalWizardryEventHooks } else if (projectile instanceof EnergyBlastProjectile) { throwingEntity = ((EnergyBlastProjectile) projectile).shootingEntity; - }else if(projectile instanceof EntityThrowable) + } else if (projectile instanceof EntityThrowable) { - throwingEntity = ((EntityThrowable) projectile).getThrower(); + throwingEntity = ((EntityThrowable) projectile).getThrower(); } - - if(throwingEntity != null && throwingEntity.equals(entity)) + + if (throwingEntity != null && throwingEntity.equals(entity)) { - continue; + continue; } double delX = projectile.posX - entity.posX; double delY = projectile.posY - entity.posY; double delZ = projectile.posZ - entity.posZ; - - if(throwingEntity != null) + + if (throwingEntity != null) { - delX = -projectile.posX + throwingEntity.posX; + delX = -projectile.posX + throwingEntity.posX; delY = -projectile.posY + (throwingEntity.posY + throwingEntity.getEyeHeight()); delZ = -projectile.posZ + throwingEntity.posZ; } - + double curVel = Math.sqrt(delX * delX + delY * delY + delZ * delZ); - + delX /= curVel; delY /= curVel; delZ /= curVel; @@ -376,7 +372,6 @@ public class AlchemicalWizardryEventHooks String ownerName = SpellHelper.getUsername(entityPlayer); playerFlightBuff.put(ownerName, true); entityPlayer.capabilities.allowFlying = true; - //entityPlayer.sendPlayerAbilities(); } } else { @@ -403,75 +398,75 @@ public class AlchemicalWizardryEventHooks } } } - - if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak)) + + if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak)) { - entityLiving.worldObj.spawnParticle("flame", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0, 0.06d, 0); - + entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0); + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier(); - double range = i*0.5; - - List entities = SpellHelper.getEntitiesInRange(entityLiving.worldObj, x, y, z, range, range); - if(entities!=null) - { - for(Entity entity : entities) - { - if(!entity.equals(entityLiving)&&!entity.isImmuneToFire()&&!(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(Potion.fireResistance))) - { - entity.setFire(3); - } - } - } + double range = i * 0.5; + + List entities = SpellHelper.getEntitiesInRange(entityLiving.worldObj, x, y, z, range, range); + if (entities != null) + { + for (Entity entity : entities) + { + if (!entity.equals(entityLiving) && !entity.isImmuneToFire() && !(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.fireResistance))) + { + entity.setFire(3); + } + } + } } - - if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionIceCloak)) + + if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionIceCloak)) { - if(entityLiving.worldObj.getWorldTime()%2==0) - entityLiving.worldObj.spawnParticle("reddust", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0x74,0xbb,0xfb); - + if (entityLiving.worldObj.getWorldTime() % 2 == 0) + entityLiving.worldObj.spawnParticle("reddust", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0x74, 0xbb, 0xfb); + int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionIceCloak).getAmplifier(); - int horizRange = r+1; - int vertRange = 1; - - if(!entityLiving.worldObj.isRemote) - { - for(int i=-horizRange; i<=horizRange;i++) - { - for(int k=-horizRange; k<=horizRange;k++) - { - for(int j=-vertRange-1; j<=vertRange-1; j++) - { - SpellHelper.freezeWaterBlock(entityLiving.worldObj, xPos+i, yPos+j, zPos+k); - } - } - } - } - } - - if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart)) - { - entityLiving.worldObj.spawnParticle("flame", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0, 0.06d, 0); - - int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionHeavyHeart).getAmplifier(); - double decrease = 0.025*(i+1); - - if(entityLiving.motionY>-0.9) - { - entityLiving.motionY-=decrease; - } + int horizRange = r + 1; + int vertRange = 1; + + if (!entityLiving.worldObj.isRemote) + { + for (int i = -horizRange; i <= horizRange; i++) + { + for (int k = -horizRange; k <= horizRange; k++) + { + for (int j = -vertRange - 1; j <= vertRange - 1; j++) + { + SpellHelper.freezeWaterBlock(entityLiving.worldObj, xPos + i, yPos + j, zPos + k); + } + } + } + } } - - if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionFireFuse)) + + if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart)) { - entityLiving.worldObj.spawnParticle("flame", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0, 0.06d, 0); + entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0); + + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionHeavyHeart).getAmplifier(); + double decrease = 0.025 * (i + 1); + + if (entityLiving.motionY > -0.9) + { + entityLiving.motionY -= decrease; + } + } + + if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFireFuse)) + { + entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0); int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getAmplifier(); - int radius = r+1; - - if(entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getDuration()<=2) - { - entityLiving.worldObj.createExplosion(null, x, y, z, radius, false); - } - } + int radius = r + 1; + + if (entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getDuration() <= 2) + { + entityLiving.worldObj.createExplosion(null, x, y, z, radius, false); + } + } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java index 157237ab..11c11587 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java @@ -1,5 +1,9 @@ package WayofTime.alchemicalWizardry.common; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.items.LavaCrystal; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.common.IFuelHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,10 +11,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.server.MinecraftServer; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.items.LavaCrystal; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.common.IFuelHandler; public class AlchemicalWizardryFuelHandler implements IFuelHandler { @@ -18,19 +18,15 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler public int getBurnTime(ItemStack fuel) { ItemStack itemStack = fuel; - if(itemStack == null) + if (itemStack == null) { - return 0; + return 0; } - + Item fuelItem = itemStack.getItem(); if (fuelItem.equals(ModItems.lavaCrystal)) { - /*ItemStack newItem = new ItemStack(AlchemicalWizardry.lavaCrystal); - newItem.getItem().setDamage(newItem, 50); - fuel.getItem().setContainerItem(((LavaCrystal)newItem.getItem()).change()); - */ LavaCrystal item = (LavaCrystal) fuel.getItem(); if (item.hasEnoughEssence(fuel)) @@ -66,7 +62,7 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler return 0; } } - + return 0; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryTickHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryTickHandler.java deleted file mode 100644 index 40eaf0f1..00000000 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryTickHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -package WayofTime.alchemicalWizardry.common; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.PlayerCapabilities; -import net.minecraft.server.MinecraftServer; -import cpw.mods.fml.common.ObfuscationReflectionHelper; - -@Deprecated -public class AlchemicalWizardryTickHandler //implements ITickHandler -{ -// public void tickStart(EnumSet type, Object... tickData) -// { -// } -// -// public EnumSet ticks() -// { -// return EnumSet.of(TickType.PLAYER); -// } -// -// public String getLabel() -// { -// return "BloodMagic"; -// } -// -// public void tickEnd(EnumSet type, Object... tickData) -// { -// String[] usernames = MinecraftServer.getServer().getAllUsernames(); -// -// if (usernames == null) -// { -// return; -// } -// -// for (String userName : usernames) -// { -// EntityPlayer entityPlayer = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(userName); -// -// if (entityPlayer != null) -// { -// ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"}); -// //entityPlayer.sendPlayerAbilities(); -// } -// } -// } -} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java index 7135097c..9af692fd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java @@ -1,27 +1,13 @@ package WayofTime.alchemicalWizardry.common; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaSecondaryProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam; -import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.*; import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.world.World; public class CommonProxy { @@ -49,7 +35,6 @@ public class CommonProxy public void registerEvents() { - } public void registerSoundHandler() diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java index cb56ceb5..f4a89a65 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java @@ -1,25 +1,25 @@ package WayofTime.alchemicalWizardry.common; -public class CoordAndRange +public class CoordAndRange { - public int xCoord; - public int yCoord; - public int zCoord; - public int horizRadius; - public int vertRadius; - - public CoordAndRange(int x, int y, int z, int horiz, int vert) - { - this.xCoord = x; - this.yCoord = y; - this.zCoord = z; - this.horizRadius = horiz; - this.vertRadius = vert; - } - - @Override - public boolean equals(Object o) - { - return o instanceof CoordAndRange ? ((CoordAndRange)o).xCoord == this.xCoord && ((CoordAndRange)o).yCoord == this.yCoord && ((CoordAndRange)o).zCoord == this.zCoord && ((CoordAndRange)o).horizRadius == this.horizRadius && ((CoordAndRange)o).vertRadius == this.vertRadius: false; - } + public int xCoord; + public int yCoord; + public int zCoord; + public int horizRadius; + public int vertRadius; + + public CoordAndRange(int x, int y, int z, int horiz, int vert) + { + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.horizRadius = horiz; + this.vertRadius = vert; + } + + @Override + public boolean equals(Object o) + { + return o instanceof CoordAndRange ? ((CoordAndRange) o).xCoord == this.xCoord && ((CoordAndRange) o).yCoord == this.yCoord && ((CoordAndRange) o).zCoord == this.zCoord && ((CoordAndRange) o).horizRadius == this.horizRadius && ((CoordAndRange) o).vertRadius == this.vertRadius : false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAIFly.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAIFly.java deleted file mode 100644 index dffc65cf..00000000 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAIFly.java +++ /dev/null @@ -1,5 +0,0 @@ -package WayofTime.alchemicalWizardry.common; - -public class EntityAIFly -{ -} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAirElemental.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAirElemental.java index cc5ab8ed..1923e4e7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAirElemental.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/EntityAirElemental.java @@ -1,15 +1,14 @@ package WayofTime.alchemicalWizardry.common; -import ibxm.Player; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityElemental; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityElemental; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityAirElemental extends EntityElemental implements IMob { @@ -22,7 +21,7 @@ public class EntityAirElemental extends EntityElemental implements IMob { if (target instanceof EntityPlayer) { - SpellHelper.setPlayerSpeedFromServer((EntityPlayer)target, target.motionX, target.motionY + 3, target.motionZ); + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) target, target.motionX, target.motionY + 3, target.motionZ); ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); } else if (target instanceof EntityLivingBase) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/Int3.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/Int3.java index a43776d9..51be4894 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/Int3.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/Int3.java @@ -3,36 +3,36 @@ package WayofTime.alchemicalWizardry.common; import net.minecraft.nbt.NBTTagCompound; -public class Int3 +public class Int3 { - public int xCoord; - public int yCoord; - public int zCoord; - - public Int3(int xCoord, int yCoord, int zCoord) - { - this.xCoord = xCoord; - this.yCoord = yCoord; - this.zCoord = zCoord; - } - - public static Int3 readFromNBT(NBTTagCompound tag) - { - return new Int3(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord")); - } - - public NBTTagCompound writeToNBT(NBTTagCompound tag) - { - tag.setInteger("xCoord", xCoord); - tag.setInteger("yCoord", yCoord); - tag.setInteger("zCoord", zCoord); - - return tag; - } - - @Override - public boolean equals(Object o) - { - return o instanceof Int3 ? ((Int3)o).xCoord == this.xCoord && ((Int3)o).yCoord == this.yCoord && ((Int3)o).zCoord == this.zCoord : false; - } + public int xCoord; + public int yCoord; + public int zCoord; + + public Int3(int xCoord, int yCoord, int zCoord) + { + this.xCoord = xCoord; + this.yCoord = yCoord; + this.zCoord = zCoord; + } + + public static Int3 readFromNBT(NBTTagCompound tag) + { + return new Int3(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord")); + } + + public NBTTagCompound writeToNBT(NBTTagCompound tag) + { + tag.setInteger("xCoord", xCoord); + tag.setInteger("yCoord", yCoord); + tag.setInteger("zCoord", zCoord); + + return tag; + } + + @Override + public boolean equals(Object o) + { + return o instanceof Int3 ? ((Int3) o).xCoord == this.xCoord && ((Int3) o).yCoord == this.yCoord && ((Int3) o).zCoord == this.zCoord : false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java index a7739d1b..3552f251 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java @@ -1,14 +1,14 @@ package WayofTime.alchemicalWizardry.common; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.ModItems; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.FillBucketEvent; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.ModItems; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class LifeBucketHandler { @@ -30,7 +30,7 @@ public class LifeBucketHandler { Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ); - if (block!=null && (block.equals(ModBlocks.blockLifeEssence)) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) + if (block != null && (block.equals(ModBlocks.blockLifeEssence)) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) { world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ); return new ItemStack(ModItems.bucketLife); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java index 22ede879..fdc69542 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java @@ -7,11 +7,8 @@ public class LifeEssence extends Fluid public LifeEssence(String fluidName) { super(fluidName); - //setUnlocalizedName("lifeEssence"); - //setBlockID(id); this.setDensity(2000); this.setViscosity(2000); - //this.setFlowingIcon(flowingIcon) } @Override diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java index 3659dbfe..663c52c0 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common; +import WayofTime.alchemicalWizardry.ModItems; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraftforge.event.entity.living.LivingDropsEvent; -import WayofTime.alchemicalWizardry.ModItems; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ModLivingDropsEvent { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java index 1d526216..24788fe3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java @@ -1,31 +1,8 @@ package WayofTime.alchemicalWizardry.common; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; - -import java.util.EnumMap; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.ColourAndCoords; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; -import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; -import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; -import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import WayofTime.alchemicalWizardry.common.tileEntity.*; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.FMLEmbeddedChannel; import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; @@ -33,932 +10,945 @@ import cpw.mods.fml.common.network.FMLOutboundHandler; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.EnumMap; +import java.util.LinkedList; +import java.util.List; /** -* Handles the packet wrangling for IronChest -* @author cpw -* -*/ -public enum NewPacketHandler + * Handles the packet wrangling for IronChest + * + * @author cpw + */ +public enum NewPacketHandler { - INSTANCE; + INSTANCE; - /** - * Our channel "pair" from {@link NetworkRegistry} - */ - private EnumMap channels; + /** + * Our channel "pair" from {@link NetworkRegistry} + */ + private EnumMap channels; - /** - * Make our packet handler, and add an {@link IronChestCodec} always - */ - private NewPacketHandler() - { - // request a channel pair for IronChest from the network registry - // Add the IronChestCodec as a member of both channel pipelines - this.channels = NetworkRegistry.INSTANCE.newChannel("BloodMagic", new TEAltarCodec()); - if (FMLCommonHandler.instance().getSide() == Side.CLIENT) - { - addClientHandler(); - } - } + /** + * Make our packet handler, and add an {@link IronChestCodec} always + */ + private NewPacketHandler() + { + // request a channel pair for IronChest from the network registry + // Add the IronChestCodec as a member of both channel pipelines + this.channels = NetworkRegistry.INSTANCE.newChannel("BloodMagic", new TEAltarCodec()); + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) + { + addClientHandler(); + } + } - @SideOnly(Side.CLIENT) - private void addClientHandler() - { - FMLEmbeddedChannel clientChannel = this.channels.get(Side.CLIENT); + @SideOnly(Side.CLIENT) + private void addClientHandler() + { + FMLEmbeddedChannel clientChannel = this.channels.get(Side.CLIENT); - String tileAltarCodec = clientChannel.findChannelHandlerNameForType(TEAltarCodec.class); - clientChannel.pipeline().addAfter(tileAltarCodec, "TEAltarHandler", new TEAltarMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TEOrientableHandler", new TEOrientableMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TEPedestalHandler", new TEPedestalMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TEPlinthHandler", new TEPlinthMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TESocketHandler", new TESocketMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TETeleposerHandler", new TETeleposerMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TEWritingTableHandler", new TEWritingTableMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "ParticleHandler", new ParticleMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "VelocityHandler", new VelocityMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TEMasterStoneHandler", new TEMasterStoneMessageHandler()); - clientChannel.pipeline().addAfter(tileAltarCodec, "TEReagentConduitHandler", new TEReagentConduitMessageHandler()); - } + String tileAltarCodec = clientChannel.findChannelHandlerNameForType(TEAltarCodec.class); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEAltarHandler", new TEAltarMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEOrientableHandler", new TEOrientableMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEPedestalHandler", new TEPedestalMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEPlinthHandler", new TEPlinthMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TESocketHandler", new TESocketMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TETeleposerHandler", new TETeleposerMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEWritingTableHandler", new TEWritingTableMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "ParticleHandler", new ParticleMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "VelocityHandler", new VelocityMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEMasterStoneHandler", new TEMasterStoneMessageHandler()); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEReagentConduitHandler", new TEReagentConduitMessageHandler()); + } - /** - * This class simply handles the {@link IronChestMessage} when it's received - * at the client side It can contain client only code, because it's only run - * on the client. - * - * @author cpw - * - */ - private static class TEAltarMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TEAltarMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TEAltar) - { - TEAltar altar = (TEAltar) te; + /** + * This class simply handles the {@link IronChestMessage} when it's received + * at the client side It can contain client only code, because it's only run + * on the client. + * + * @author cpw + */ + private static class TEAltarMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEAltarMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEAltar) + { + TEAltar altar = (TEAltar) te; - altar.handlePacketData(msg.items, msg.fluids, msg.capacity); - } - } - } - - private static class TEOrientableMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TEOrientableMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TEOrientable) - { - TEOrientable tile = (TEOrientable)te; + altar.handlePacketData(msg.items, msg.fluids, msg.capacity); + } + } + } - ((TEOrientable) te).setInputDirection(ForgeDirection.getOrientation(msg.input)); - ((TEOrientable) te).setOutputDirection(ForgeDirection.getOrientation(msg.output)); - } - } - } - - private static class TEPedestalMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TEPedestalMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TEPedestal) - { - TEPedestal pedestal = (TEPedestal) te; + private static class TEOrientableMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEOrientableMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEOrientable) + { + TEOrientable tile = (TEOrientable) te; - pedestal.handlePacketData(msg.items); - } - } - } - - private static class TEPlinthMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TEPlinthMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TEPlinth) - { - TEPlinth Plinth = (TEPlinth) te; + ((TEOrientable) te).setInputDirection(ForgeDirection.getOrientation(msg.input)); + ((TEOrientable) te).setOutputDirection(ForgeDirection.getOrientation(msg.output)); + } + } + } - Plinth.handlePacketData(msg.items); - } - } - } - - private static class TESocketMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TESocketMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TESocket) - { - TESocket Socket = (TESocket) te; + private static class TEPedestalMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEPedestalMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEPedestal) + { + TEPedestal pedestal = (TEPedestal) te; - Socket.handlePacketData(msg.items); - } - } - } - - private static class TETeleposerMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TETeleposerMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TETeleposer) - { - TETeleposer Teleposer = (TETeleposer) te; + pedestal.handlePacketData(msg.items); + } + } + } - Teleposer.handlePacketData(msg.items); - } - } - } - - private static class TEWritingTableMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TEWritingTableMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TEWritingTable) - { - TEWritingTable WritingTable = (TEWritingTable) te; + private static class TEPlinthMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEPlinthMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEPlinth) + { + TEPlinth Plinth = (TEPlinth) te; - WritingTable.handlePacketData(msg.items); - } - } - } - - private static class ParticleMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, ParticleMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - - world.spawnParticle(msg.particle, msg.xCoord, msg.yCoord, msg.zCoord, msg.xVel, msg.yVel, msg.zVel); - } - } - - private static class VelocityMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, VelocityMessage msg) throws Exception - { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - - if(player!=null) - { - player.motionX = msg.xVel; - player.motionY = msg.yVel; - player.motionZ = msg.zVel; - } - } - } - - private static class TEMasterStoneMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TEMasterStoneMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TEMasterStone) - { - TEMasterStone masterStone = (TEMasterStone) te; + Plinth.handlePacketData(msg.items); + } + } + } - masterStone.setCurrentRitual(msg.ritual); - masterStone.isRunning = msg.isRunning; - } - } - } - - private static class TEReagentConduitMessageHandler extends SimpleChannelInboundHandler - { - @Override - protected void channelRead0(ChannelHandlerContext ctx, TEReagentConduitMessage msg) throws Exception - { - World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); - if (te instanceof TEReagentConduit) - { - TEReagentConduit reagentConduit = (TEReagentConduit) te; + private static class TESocketMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TESocketMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TESocket) + { + TESocket Socket = (TESocket) te; - reagentConduit.destinationList = msg.destinationList; - } - } - } + Socket.handlePacketData(msg.items); + } + } + } - public static class BMMessage - { - int index; - } - - public static class TEAltarMessage extends BMMessage - { - int x; - int y; - int z; + private static class TETeleposerMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TETeleposerMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TETeleposer) + { + TETeleposer Teleposer = (TETeleposer) te; - int[] items; - int[] fluids; - int capacity; - } - - public static class TEOrientableMessage extends BMMessage - { - int x; - int y; - int z; - - int input; - int output; - } - - public static class TEPedestalMessage extends BMMessage - { - int x; - int y; - int z; + Teleposer.handlePacketData(msg.items); + } + } + } - int[] items; - } - - public static class TEPlinthMessage extends BMMessage - { - int x; - int y; - int z; + private static class TEWritingTableMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEWritingTableMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEWritingTable) + { + TEWritingTable WritingTable = (TEWritingTable) te; - int[] items; - } - - public static class TESocketMessage extends BMMessage - { - int x; - int y; - int z; + WritingTable.handlePacketData(msg.items); + } + } + } - int[] items; - } - - public static class TETeleposerMessage extends BMMessage - { - int x; - int y; - int z; + private static class ParticleMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, ParticleMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); - int[] items; - } - - public static class TEWritingTableMessage extends BMMessage - { - int x; - int y; - int z; + world.spawnParticle(msg.particle, msg.xCoord, msg.yCoord, msg.zCoord, msg.xVel, msg.yVel, msg.zVel); + } + } - int[] items; - } - - public static class ParticleMessage extends BMMessage - { - String particle; - - double xCoord; - double yCoord; - double zCoord; - - double xVel; - double yVel; - double zVel; - } - - public static class VelocityMessage extends BMMessage - { - double xVel; - double yVel; - double zVel; - } - - public static class TEMasterStoneMessage extends BMMessage - { - int x; - int y; - int z; - - String ritual; - boolean isRunning; - } - - public static class TEReagentConduitMessage extends BMMessage - { - int x; - int y; - int z; - - List destinationList; - } + private static class VelocityMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, VelocityMessage msg) throws Exception + { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; - private class TEAltarCodec extends FMLIndexedMessageToMessageCodec - { - public TEAltarCodec() - { - addDiscriminator(0, TEAltarMessage.class); - addDiscriminator(1, TEOrientableMessage.class); - addDiscriminator(2, TEPedestalMessage.class); - addDiscriminator(3, TEPlinthMessage.class); - addDiscriminator(4, TESocketMessage.class); - addDiscriminator(5, TETeleposerMessage.class); - addDiscriminator(6, TEWritingTableMessage.class); - addDiscriminator(7, ParticleMessage.class); - addDiscriminator(8, VelocityMessage.class); - addDiscriminator(9, TEMasterStoneMessage.class); - addDiscriminator(10, TEReagentConduitMessage.class); - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, BMMessage msg, ByteBuf target) throws Exception - { - target.writeInt(msg.index); - - switch(msg.index) - { - case 0: - target.writeInt(((TEAltarMessage)msg).x); - target.writeInt(((TEAltarMessage)msg).y); - target.writeInt(((TEAltarMessage)msg).z); + if (player != null) + { + player.motionX = msg.xVel; + player.motionY = msg.yVel; + player.motionZ = msg.zVel; + } + } + } - target.writeBoolean(((TEAltarMessage)msg).items != null); - if (((TEAltarMessage)msg).items != null) - { - int[] items = ((TEAltarMessage)msg).items; - for (int j = 0; j < items.length; j++) - { - int i = items[j]; - target.writeInt(i); - } - } - - target.writeBoolean(((TEAltarMessage)msg).fluids != null); - if(((TEAltarMessage)msg).fluids != null) - { - int[] fluids = ((TEAltarMessage)msg).fluids; - for (int j = 0; j < fluids.length; j++) - { - int i = fluids[j]; - target.writeInt(i); - } - } - - target.writeInt(((TEAltarMessage)msg).capacity); - - break; - - case 1: - target.writeInt(((TEOrientableMessage)msg).x); - target.writeInt(((TEOrientableMessage)msg).y); - target.writeInt(((TEOrientableMessage)msg).z); + private static class TEMasterStoneMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEMasterStoneMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEMasterStone) + { + TEMasterStone masterStone = (TEMasterStone) te; - target.writeInt(((TEOrientableMessage)msg).input); - target.writeInt(((TEOrientableMessage)msg).output); - - break; - - case 2: - target.writeInt(((TEPedestalMessage)msg).x); - target.writeInt(((TEPedestalMessage)msg).y); - target.writeInt(((TEPedestalMessage)msg).z); + masterStone.setCurrentRitual(msg.ritual); + masterStone.isRunning = msg.isRunning; + } + } + } - target.writeBoolean(((TEPedestalMessage)msg).items != null); - if (((TEPedestalMessage)msg).items != null) - { - int[] items = ((TEPedestalMessage)msg).items; - for (int j = 0; j < items.length; j++) - { - int i = items[j]; - target.writeInt(i); - } - } - - break; - - case 3: - target.writeInt(((TEPlinthMessage)msg).x); - target.writeInt(((TEPlinthMessage)msg).y); - target.writeInt(((TEPlinthMessage)msg).z); + private static class TEReagentConduitMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEReagentConduitMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEReagentConduit) + { + TEReagentConduit reagentConduit = (TEReagentConduit) te; - target.writeBoolean(((TEPlinthMessage)msg).items != null); - if (((TEPlinthMessage)msg).items != null) - { - int[] items = ((TEPlinthMessage)msg).items; - for (int j = 0; j < items.length; j++) - { - int i = items[j]; - target.writeInt(i); - } - } - - break; - - case 4: - target.writeInt(((TESocketMessage)msg).x); - target.writeInt(((TESocketMessage)msg).y); - target.writeInt(((TESocketMessage)msg).z); + reagentConduit.destinationList = msg.destinationList; + } + } + } - target.writeBoolean(((TESocketMessage)msg).items != null); - if (((TESocketMessage)msg).items != null) - { - int[] items = ((TESocketMessage)msg).items; - for (int j = 0; j < items.length; j++) - { - int i = items[j]; - target.writeInt(i); - } - } - - break; - - case 5: - target.writeInt(((TETeleposerMessage)msg).x); - target.writeInt(((TETeleposerMessage)msg).y); - target.writeInt(((TETeleposerMessage)msg).z); + public static class BMMessage + { + int index; + } - target.writeBoolean(((TETeleposerMessage)msg).items != null); - if (((TETeleposerMessage)msg).items != null) - { - int[] items = ((TETeleposerMessage)msg).items; - for (int j = 0; j < items.length; j++) - { - int i = items[j]; - target.writeInt(i); - } - } - - break; - - case 6: - target.writeInt(((TEWritingTableMessage)msg).x); - target.writeInt(((TEWritingTableMessage)msg).y); - target.writeInt(((TEWritingTableMessage)msg).z); + public static class TEAltarMessage extends BMMessage + { + int x; + int y; + int z; - target.writeBoolean(((TEWritingTableMessage)msg).items != null); - if (((TEWritingTableMessage)msg).items != null) - { - int[] items = ((TEWritingTableMessage)msg).items; - for (int j = 0; j < items.length; j++) - { - int i = items[j]; - target.writeInt(i); - } - } - - break; - - case 7: - String str = ((ParticleMessage)msg).particle; - target.writeInt(str.length()); - for(int i=0; i list = ((TEReagentConduitMessage)msg).destinationList; - target.writeInt(list.size()); - - for(ColourAndCoords colourSet : list) - { - target.writeInt(colourSet.colourRed); - target.writeInt(colourSet.colourGreen); - target.writeInt(colourSet.colourBlue); - target.writeInt(colourSet.colourIntensity); - target.writeInt(colourSet.xCoord); - target.writeInt(colourSet.yCoord); - target.writeInt(colourSet.zCoord); - } - - break; - } - } + int[] items; + int[] fluids; + int capacity; + } + + public static class TEOrientableMessage extends BMMessage + { + int x; + int y; + int z; + + int input; + int output; + } + + public static class TEPedestalMessage extends BMMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TEPlinthMessage extends BMMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TESocketMessage extends BMMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TETeleposerMessage extends BMMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TEWritingTableMessage extends BMMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class ParticleMessage extends BMMessage + { + String particle; + + double xCoord; + double yCoord; + double zCoord; + + double xVel; + double yVel; + double zVel; + } + + public static class VelocityMessage extends BMMessage + { + double xVel; + double yVel; + double zVel; + } + + public static class TEMasterStoneMessage extends BMMessage + { + int x; + int y; + int z; + + String ritual; + boolean isRunning; + } + + public static class TEReagentConduitMessage extends BMMessage + { + int x; + int y; + int z; + + List destinationList; + } + + private class TEAltarCodec extends FMLIndexedMessageToMessageCodec + { + public TEAltarCodec() + { + addDiscriminator(0, TEAltarMessage.class); + addDiscriminator(1, TEOrientableMessage.class); + addDiscriminator(2, TEPedestalMessage.class); + addDiscriminator(3, TEPlinthMessage.class); + addDiscriminator(4, TESocketMessage.class); + addDiscriminator(5, TETeleposerMessage.class); + addDiscriminator(6, TEWritingTableMessage.class); + addDiscriminator(7, ParticleMessage.class); + addDiscriminator(8, VelocityMessage.class); + addDiscriminator(9, TEMasterStoneMessage.class); + addDiscriminator(10, TEReagentConduitMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, BMMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.index); + + switch (msg.index) + { + case 0: + target.writeInt(((TEAltarMessage) msg).x); + target.writeInt(((TEAltarMessage) msg).y); + target.writeInt(((TEAltarMessage) msg).z); + + target.writeBoolean(((TEAltarMessage) msg).items != null); + if (((TEAltarMessage) msg).items != null) + { + int[] items = ((TEAltarMessage) msg).items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + + target.writeBoolean(((TEAltarMessage) msg).fluids != null); + if (((TEAltarMessage) msg).fluids != null) + { + int[] fluids = ((TEAltarMessage) msg).fluids; + for (int j = 0; j < fluids.length; j++) + { + int i = fluids[j]; + target.writeInt(i); + } + } + + target.writeInt(((TEAltarMessage) msg).capacity); + + break; + + case 1: + target.writeInt(((TEOrientableMessage) msg).x); + target.writeInt(((TEOrientableMessage) msg).y); + target.writeInt(((TEOrientableMessage) msg).z); + + target.writeInt(((TEOrientableMessage) msg).input); + target.writeInt(((TEOrientableMessage) msg).output); + + break; + + case 2: + target.writeInt(((TEPedestalMessage) msg).x); + target.writeInt(((TEPedestalMessage) msg).y); + target.writeInt(((TEPedestalMessage) msg).z); + + target.writeBoolean(((TEPedestalMessage) msg).items != null); + if (((TEPedestalMessage) msg).items != null) + { + int[] items = ((TEPedestalMessage) msg).items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + + break; + + case 3: + target.writeInt(((TEPlinthMessage) msg).x); + target.writeInt(((TEPlinthMessage) msg).y); + target.writeInt(((TEPlinthMessage) msg).z); + + target.writeBoolean(((TEPlinthMessage) msg).items != null); + if (((TEPlinthMessage) msg).items != null) + { + int[] items = ((TEPlinthMessage) msg).items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + + break; + + case 4: + target.writeInt(((TESocketMessage) msg).x); + target.writeInt(((TESocketMessage) msg).y); + target.writeInt(((TESocketMessage) msg).z); + + target.writeBoolean(((TESocketMessage) msg).items != null); + if (((TESocketMessage) msg).items != null) + { + int[] items = ((TESocketMessage) msg).items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + + break; + + case 5: + target.writeInt(((TETeleposerMessage) msg).x); + target.writeInt(((TETeleposerMessage) msg).y); + target.writeInt(((TETeleposerMessage) msg).z); + + target.writeBoolean(((TETeleposerMessage) msg).items != null); + if (((TETeleposerMessage) msg).items != null) + { + int[] items = ((TETeleposerMessage) msg).items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + + break; + + case 6: + target.writeInt(((TEWritingTableMessage) msg).x); + target.writeInt(((TEWritingTableMessage) msg).y); + target.writeInt(((TEWritingTableMessage) msg).z); + + target.writeBoolean(((TEWritingTableMessage) msg).items != null); + if (((TEWritingTableMessage) msg).items != null) + { + int[] items = ((TEWritingTableMessage) msg).items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + + break; + + case 7: + String str = ((ParticleMessage) msg).particle; + target.writeInt(str.length()); + for (int i = 0; i < str.length(); i++) + { + target.writeChar(str.charAt(i)); + } + + target.writeDouble(((ParticleMessage) msg).xCoord); + target.writeDouble(((ParticleMessage) msg).yCoord); + target.writeDouble(((ParticleMessage) msg).zCoord); + + target.writeDouble(((ParticleMessage) msg).xVel); + target.writeDouble(((ParticleMessage) msg).yVel); + target.writeDouble(((ParticleMessage) msg).zVel); + + break; + + case 8: + target.writeDouble(((VelocityMessage) msg).xVel); + target.writeDouble(((VelocityMessage) msg).yVel); + target.writeDouble(((VelocityMessage) msg).zVel); + + break; + + case 9: + target.writeInt(((TEMasterStoneMessage) msg).x); + target.writeInt(((TEMasterStoneMessage) msg).y); + target.writeInt(((TEMasterStoneMessage) msg).z); + + String ritual = ((TEMasterStoneMessage) msg).ritual; + target.writeInt(ritual.length()); + for (int i = 0; i < ritual.length(); i++) + { + target.writeChar(ritual.charAt(i)); + } + + target.writeBoolean(((TEMasterStoneMessage) msg).isRunning); + + break; + + case 10: + target.writeInt(((TEReagentConduitMessage) msg).x); + target.writeInt(((TEReagentConduitMessage) msg).y); + target.writeInt(((TEReagentConduitMessage) msg).z); + + List list = ((TEReagentConduitMessage) msg).destinationList; + target.writeInt(list.size()); + + for (ColourAndCoords colourSet : list) + { + target.writeInt(colourSet.colourRed); + target.writeInt(colourSet.colourGreen); + target.writeInt(colourSet.colourBlue); + target.writeInt(colourSet.colourIntensity); + target.writeInt(colourSet.xCoord); + target.writeInt(colourSet.yCoord); + target.writeInt(colourSet.zCoord); + } + + break; + } + } - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, BMMessage msg) - { - int index = dat.readInt(); - - switch(index) - { - case 0: - ((TEAltarMessage)msg).x = dat.readInt(); - ((TEAltarMessage)msg).y = dat.readInt(); - ((TEAltarMessage)msg).z = dat.readInt(); - boolean hasStacks = dat.readBoolean(); - - ((TEAltarMessage)msg).items = new int[TEAltar.sizeInv*3]; - if (hasStacks) - { - ((TEAltarMessage)msg).items = new int[TEAltar.sizeInv*3]; - for (int i = 0; i < ((TEAltarMessage)msg).items.length; i++) - { - ((TEAltarMessage)msg).items[i] = dat.readInt(); - } - } - - boolean hasFluids = dat.readBoolean(); - ((TEAltarMessage)msg).fluids = new int[6]; - if(hasFluids) - for (int i = 0; i < ((TEAltarMessage)msg).fluids.length; i++) - { - ((TEAltarMessage)msg).fluids[i] = dat.readInt(); - } - - ((TEAltarMessage)msg).capacity = dat.readInt(); - - break; - - case 1: - ((TEOrientableMessage)msg).x = dat.readInt(); - ((TEOrientableMessage)msg).y = dat.readInt(); - ((TEOrientableMessage)msg).z = dat.readInt(); - - ((TEOrientableMessage)msg).input = dat.readInt(); - ((TEOrientableMessage)msg).output = dat.readInt(); - - break; - - case 2: - ((TEPedestalMessage)msg).x = dat.readInt(); - ((TEPedestalMessage)msg).y = dat.readInt(); - ((TEPedestalMessage)msg).z = dat.readInt(); + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, BMMessage msg) + { + int index = dat.readInt(); - boolean hasStacks1 = dat.readBoolean(); - - ((TEPedestalMessage)msg).items = new int[TEPedestal.sizeInv*3]; - if (hasStacks1) - { - ((TEPedestalMessage)msg).items = new int[TEPedestal.sizeInv*3]; - for (int i = 0; i < ((TEPedestalMessage)msg).items.length; i++) - { - ((TEPedestalMessage)msg).items[i] = dat.readInt(); - } - } - - break; - - case 3: - ((TEPlinthMessage)msg).x = dat.readInt(); - ((TEPlinthMessage)msg).y = dat.readInt(); - ((TEPlinthMessage)msg).z = dat.readInt(); + switch (index) + { + case 0: + ((TEAltarMessage) msg).x = dat.readInt(); + ((TEAltarMessage) msg).y = dat.readInt(); + ((TEAltarMessage) msg).z = dat.readInt(); + boolean hasStacks = dat.readBoolean(); - boolean hasStacks2 = dat.readBoolean(); - - ((TEPlinthMessage)msg).items = new int[TEPlinth.sizeInv*3]; - if (hasStacks2) - { - ((TEPlinthMessage)msg).items = new int[TEPlinth.sizeInv*3]; - for (int i = 0; i < ((TEPlinthMessage)msg).items.length; i++) - { - ((TEPlinthMessage)msg).items[i] = dat.readInt(); - } - } - - break; - - case 4: - ((TESocketMessage)msg).x = dat.readInt(); - ((TESocketMessage)msg).y = dat.readInt(); - ((TESocketMessage)msg).z = dat.readInt(); + ((TEAltarMessage) msg).items = new int[TEAltar.sizeInv * 3]; + if (hasStacks) + { + ((TEAltarMessage) msg).items = new int[TEAltar.sizeInv * 3]; + for (int i = 0; i < ((TEAltarMessage) msg).items.length; i++) + { + ((TEAltarMessage) msg).items[i] = dat.readInt(); + } + } - boolean hasStacks3 = dat.readBoolean(); - - ((TESocketMessage)msg).items = new int[TESocket.sizeInv*3]; - if (hasStacks3) - { - ((TESocketMessage)msg).items = new int[TESocket.sizeInv*3]; - for (int i = 0; i < ((TESocketMessage)msg).items.length; i++) - { - ((TESocketMessage)msg).items[i] = dat.readInt(); - } - } - - break; - - case 5: - ((TETeleposerMessage)msg).x = dat.readInt(); - ((TETeleposerMessage)msg).y = dat.readInt(); - ((TETeleposerMessage)msg).z = dat.readInt(); + boolean hasFluids = dat.readBoolean(); + ((TEAltarMessage) msg).fluids = new int[6]; + if (hasFluids) + for (int i = 0; i < ((TEAltarMessage) msg).fluids.length; i++) + { + ((TEAltarMessage) msg).fluids[i] = dat.readInt(); + } - boolean hasStacks4 = dat.readBoolean(); - - ((TETeleposerMessage)msg).items = new int[TETeleposer.sizeInv*3]; - if (hasStacks4) - { - ((TETeleposerMessage)msg).items = new int[TETeleposer.sizeInv*3]; - for (int i = 0; i < ((TETeleposerMessage)msg).items.length; i++) - { - ((TETeleposerMessage)msg).items[i] = dat.readInt(); - } - } - - break; - - case 6: - ((TEWritingTableMessage)msg).x = dat.readInt(); - ((TEWritingTableMessage)msg).y = dat.readInt(); - ((TEWritingTableMessage)msg).z = dat.readInt(); + ((TEAltarMessage) msg).capacity = dat.readInt(); - boolean hasStacks5 = dat.readBoolean(); - - ((TEWritingTableMessage)msg).items = new int[TEWritingTable.sizeInv*3]; - if (hasStacks5) - { - ((TEWritingTableMessage)msg).items = new int[TEWritingTable.sizeInv*3]; - for (int i = 0; i < ((TEWritingTableMessage)msg).items.length; i++) - { - ((TEWritingTableMessage)msg).items[i] = dat.readInt(); - } - } - - break; - - case 7: - int size = dat.readInt(); - String str = ""; + break; - for (int i = 0; i < size; i++) - { - str = str + dat.readChar(); - } - - ((ParticleMessage)msg).particle = str; - - ((ParticleMessage)msg).xCoord = dat.readDouble(); - ((ParticleMessage)msg).yCoord = dat.readDouble(); - ((ParticleMessage)msg).zCoord = dat.readDouble(); - - ((ParticleMessage)msg).xVel = dat.readDouble(); - ((ParticleMessage)msg).yVel = dat.readDouble(); - ((ParticleMessage)msg).zVel = dat.readDouble(); - - break; - - case 8: - ((VelocityMessage)msg).xVel = dat.readDouble(); - ((VelocityMessage)msg).yVel = dat.readDouble(); - ((VelocityMessage)msg).zVel = dat.readDouble(); - - break; - - case 9: - ((TEMasterStoneMessage)msg).x = dat.readInt(); - ((TEMasterStoneMessage)msg).y = dat.readInt(); - ((TEMasterStoneMessage)msg).z = dat.readInt(); - - int ritualStrSize = dat.readInt(); - String ritual = ""; + case 1: + ((TEOrientableMessage) msg).x = dat.readInt(); + ((TEOrientableMessage) msg).y = dat.readInt(); + ((TEOrientableMessage) msg).z = dat.readInt(); - for (int i = 0; i < ritualStrSize; i++) - { - ritual = ritual + dat.readChar(); - } - - ((TEMasterStoneMessage)msg).ritual = ritual; - ((TEMasterStoneMessage)msg).isRunning = dat.readBoolean(); - - break; - - case 10: - ((TEReagentConduitMessage)msg).x = dat.readInt(); - ((TEReagentConduitMessage)msg).y = dat.readInt(); - ((TEReagentConduitMessage)msg).z = dat.readInt(); - - int listSize = dat.readInt(); - - List list = new LinkedList(); - - for(int i=0; i < listSize; i++) - { - list.add(new ColourAndCoords(dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt())); - } - - ((TEReagentConduitMessage)msg).destinationList = list; - - break; - } - } - } + ((TEOrientableMessage) msg).input = dat.readInt(); + ((TEOrientableMessage) msg).output = dat.readInt(); - //Packets to be obtained - public static Packet getPacket(TEAltar tileAltar) - { - TEAltarMessage msg = new TEAltarMessage(); - msg.index = 0; - msg.x = tileAltar.xCoord; - msg.y = tileAltar.yCoord; - msg.z = tileAltar.zCoord; - msg.items = tileAltar.buildIntDataList(); - msg.fluids = tileAltar.buildFluidList(); - msg.capacity = tileAltar.getCapacity(); - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TEOrientable tileOrientable) - { - TEOrientableMessage msg = new TEOrientableMessage(); - msg.index = 1; - msg.x = tileOrientable.xCoord; - msg.y = tileOrientable.yCoord; - msg.z = tileOrientable.zCoord; - msg.input = tileOrientable.getIntForForgeDirection(tileOrientable.getInputDirection()); - msg.output = tileOrientable.getIntForForgeDirection(tileOrientable.getOutputDirection()); - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TEPedestal tilePedestal) - { - TEPedestalMessage msg = new TEPedestalMessage(); - msg.index = 2; - msg.x = tilePedestal.xCoord; - msg.y = tilePedestal.yCoord; - msg.z = tilePedestal.zCoord; - msg.items = tilePedestal.buildIntDataList(); - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TEPlinth tilePlinth) - { - TEPlinthMessage msg = new TEPlinthMessage(); - msg.index = 3; - msg.x = tilePlinth.xCoord; - msg.y = tilePlinth.yCoord; - msg.z = tilePlinth.zCoord; - msg.items = tilePlinth.buildIntDataList(); - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TESocket tileSocket) - { - TESocketMessage msg = new TESocketMessage(); - msg.index = 4; - msg.x = tileSocket.xCoord; - msg.y = tileSocket.yCoord; - msg.z = tileSocket.zCoord; - msg.items = tileSocket.buildIntDataList(); - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TETeleposer tileTeleposer) - { - TETeleposerMessage msg = new TETeleposerMessage(); - msg.index = 5; - msg.x = tileTeleposer.xCoord; - msg.y = tileTeleposer.yCoord; - msg.z = tileTeleposer.zCoord; - msg.items = tileTeleposer.buildIntDataList(); - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TEWritingTable tileWritingTable) - { - TEWritingTableMessage msg = new TEWritingTableMessage(); - msg.index = 6; - msg.x = tileWritingTable.xCoord; - msg.y = tileWritingTable.yCoord; - msg.z = tileWritingTable.zCoord; - msg.items = tileWritingTable.buildIntDataList(); - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getParticlePacket(String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) - { - ParticleMessage msg = new ParticleMessage(); - msg.index = 7; - msg.particle = str; - msg.xCoord = xCoord; - msg.yCoord = yCoord; - msg.zCoord = zCoord; - msg.xVel = xVel; - msg.yVel = yVel; - msg.zVel = zVel; - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getVelSettingPacket(double xVel, double yVel, double zVel) - { - VelocityMessage msg = new VelocityMessage(); - msg.index = 8; - msg.xVel = xVel; - msg.yVel = yVel; - msg.zVel = zVel; - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TEMasterStone tile) - { - TEMasterStoneMessage msg = new TEMasterStoneMessage(); - msg.index = 9; - msg.x = tile.xCoord; - msg.y = tile.yCoord; - msg.z = tile.zCoord; - - msg.ritual = tile.getCurrentRitual(); - msg.isRunning = tile.isRunning; - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public static Packet getPacket(TEReagentConduit tile) - { - TEReagentConduitMessage msg = new TEReagentConduitMessage(); - msg.index = 10; - msg.x = tile.xCoord; - msg.y = tile.yCoord; - msg.z = tile.zCoord; - - msg.destinationList = tile.destinationList; - - return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); - } - - public void sendTo(Packet message, EntityPlayerMP player) - { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - public void sendToAll(Packet message) - { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - public void sendToAllAround(Packet message, NetworkRegistry.TargetPoint point) - { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } + break; + + case 2: + ((TEPedestalMessage) msg).x = dat.readInt(); + ((TEPedestalMessage) msg).y = dat.readInt(); + ((TEPedestalMessage) msg).z = dat.readInt(); + + boolean hasStacks1 = dat.readBoolean(); + + ((TEPedestalMessage) msg).items = new int[TEPedestal.sizeInv * 3]; + if (hasStacks1) + { + ((TEPedestalMessage) msg).items = new int[TEPedestal.sizeInv * 3]; + for (int i = 0; i < ((TEPedestalMessage) msg).items.length; i++) + { + ((TEPedestalMessage) msg).items[i] = dat.readInt(); + } + } + + break; + + case 3: + ((TEPlinthMessage) msg).x = dat.readInt(); + ((TEPlinthMessage) msg).y = dat.readInt(); + ((TEPlinthMessage) msg).z = dat.readInt(); + + boolean hasStacks2 = dat.readBoolean(); + + ((TEPlinthMessage) msg).items = new int[TEPlinth.sizeInv * 3]; + if (hasStacks2) + { + ((TEPlinthMessage) msg).items = new int[TEPlinth.sizeInv * 3]; + for (int i = 0; i < ((TEPlinthMessage) msg).items.length; i++) + { + ((TEPlinthMessage) msg).items[i] = dat.readInt(); + } + } + + break; + + case 4: + ((TESocketMessage) msg).x = dat.readInt(); + ((TESocketMessage) msg).y = dat.readInt(); + ((TESocketMessage) msg).z = dat.readInt(); + + boolean hasStacks3 = dat.readBoolean(); + + ((TESocketMessage) msg).items = new int[TESocket.sizeInv * 3]; + if (hasStacks3) + { + ((TESocketMessage) msg).items = new int[TESocket.sizeInv * 3]; + for (int i = 0; i < ((TESocketMessage) msg).items.length; i++) + { + ((TESocketMessage) msg).items[i] = dat.readInt(); + } + } + + break; + + case 5: + ((TETeleposerMessage) msg).x = dat.readInt(); + ((TETeleposerMessage) msg).y = dat.readInt(); + ((TETeleposerMessage) msg).z = dat.readInt(); + + boolean hasStacks4 = dat.readBoolean(); + + ((TETeleposerMessage) msg).items = new int[TETeleposer.sizeInv * 3]; + if (hasStacks4) + { + ((TETeleposerMessage) msg).items = new int[TETeleposer.sizeInv * 3]; + for (int i = 0; i < ((TETeleposerMessage) msg).items.length; i++) + { + ((TETeleposerMessage) msg).items[i] = dat.readInt(); + } + } + + break; + + case 6: + ((TEWritingTableMessage) msg).x = dat.readInt(); + ((TEWritingTableMessage) msg).y = dat.readInt(); + ((TEWritingTableMessage) msg).z = dat.readInt(); + + boolean hasStacks5 = dat.readBoolean(); + + ((TEWritingTableMessage) msg).items = new int[TEWritingTable.sizeInv * 3]; + if (hasStacks5) + { + ((TEWritingTableMessage) msg).items = new int[TEWritingTable.sizeInv * 3]; + for (int i = 0; i < ((TEWritingTableMessage) msg).items.length; i++) + { + ((TEWritingTableMessage) msg).items[i] = dat.readInt(); + } + } + + break; + + case 7: + int size = dat.readInt(); + String str = ""; + + for (int i = 0; i < size; i++) + { + str = str + dat.readChar(); + } + + ((ParticleMessage) msg).particle = str; + + ((ParticleMessage) msg).xCoord = dat.readDouble(); + ((ParticleMessage) msg).yCoord = dat.readDouble(); + ((ParticleMessage) msg).zCoord = dat.readDouble(); + + ((ParticleMessage) msg).xVel = dat.readDouble(); + ((ParticleMessage) msg).yVel = dat.readDouble(); + ((ParticleMessage) msg).zVel = dat.readDouble(); + + break; + + case 8: + ((VelocityMessage) msg).xVel = dat.readDouble(); + ((VelocityMessage) msg).yVel = dat.readDouble(); + ((VelocityMessage) msg).zVel = dat.readDouble(); + + break; + + case 9: + ((TEMasterStoneMessage) msg).x = dat.readInt(); + ((TEMasterStoneMessage) msg).y = dat.readInt(); + ((TEMasterStoneMessage) msg).z = dat.readInt(); + + int ritualStrSize = dat.readInt(); + String ritual = ""; + + for (int i = 0; i < ritualStrSize; i++) + { + ritual = ritual + dat.readChar(); + } + + ((TEMasterStoneMessage) msg).ritual = ritual; + ((TEMasterStoneMessage) msg).isRunning = dat.readBoolean(); + + break; + + case 10: + ((TEReagentConduitMessage) msg).x = dat.readInt(); + ((TEReagentConduitMessage) msg).y = dat.readInt(); + ((TEReagentConduitMessage) msg).z = dat.readInt(); + + int listSize = dat.readInt(); + + List list = new LinkedList(); + + for (int i = 0; i < listSize; i++) + { + list.add(new ColourAndCoords(dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt())); + } + + ((TEReagentConduitMessage) msg).destinationList = list; + + break; + } + } + } + + //Packets to be obtained + public static Packet getPacket(TEAltar tileAltar) + { + TEAltarMessage msg = new TEAltarMessage(); + msg.index = 0; + msg.x = tileAltar.xCoord; + msg.y = tileAltar.yCoord; + msg.z = tileAltar.zCoord; + msg.items = tileAltar.buildIntDataList(); + msg.fluids = tileAltar.buildFluidList(); + msg.capacity = tileAltar.getCapacity(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEOrientable tileOrientable) + { + TEOrientableMessage msg = new TEOrientableMessage(); + msg.index = 1; + msg.x = tileOrientable.xCoord; + msg.y = tileOrientable.yCoord; + msg.z = tileOrientable.zCoord; + msg.input = tileOrientable.getIntForForgeDirection(tileOrientable.getInputDirection()); + msg.output = tileOrientable.getIntForForgeDirection(tileOrientable.getOutputDirection()); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEPedestal tilePedestal) + { + TEPedestalMessage msg = new TEPedestalMessage(); + msg.index = 2; + msg.x = tilePedestal.xCoord; + msg.y = tilePedestal.yCoord; + msg.z = tilePedestal.zCoord; + msg.items = tilePedestal.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEPlinth tilePlinth) + { + TEPlinthMessage msg = new TEPlinthMessage(); + msg.index = 3; + msg.x = tilePlinth.xCoord; + msg.y = tilePlinth.yCoord; + msg.z = tilePlinth.zCoord; + msg.items = tilePlinth.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TESocket tileSocket) + { + TESocketMessage msg = new TESocketMessage(); + msg.index = 4; + msg.x = tileSocket.xCoord; + msg.y = tileSocket.yCoord; + msg.z = tileSocket.zCoord; + msg.items = tileSocket.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TETeleposer tileTeleposer) + { + TETeleposerMessage msg = new TETeleposerMessage(); + msg.index = 5; + msg.x = tileTeleposer.xCoord; + msg.y = tileTeleposer.yCoord; + msg.z = tileTeleposer.zCoord; + msg.items = tileTeleposer.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEWritingTable tileWritingTable) + { + TEWritingTableMessage msg = new TEWritingTableMessage(); + msg.index = 6; + msg.x = tileWritingTable.xCoord; + msg.y = tileWritingTable.yCoord; + msg.z = tileWritingTable.zCoord; + msg.items = tileWritingTable.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getParticlePacket(String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) + { + ParticleMessage msg = new ParticleMessage(); + msg.index = 7; + msg.particle = str; + msg.xCoord = xCoord; + msg.yCoord = yCoord; + msg.zCoord = zCoord; + msg.xVel = xVel; + msg.yVel = yVel; + msg.zVel = zVel; + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getVelSettingPacket(double xVel, double yVel, double zVel) + { + VelocityMessage msg = new VelocityMessage(); + msg.index = 8; + msg.xVel = xVel; + msg.yVel = yVel; + msg.zVel = zVel; + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEMasterStone tile) + { + TEMasterStoneMessage msg = new TEMasterStoneMessage(); + msg.index = 9; + msg.x = tile.xCoord; + msg.y = tile.yCoord; + msg.z = tile.zCoord; + + msg.ritual = tile.getCurrentRitual(); + msg.isRunning = tile.isRunning; + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEReagentConduit tile) + { + TEReagentConduitMessage msg = new TEReagentConduitMessage(); + msg.index = 10; + msg.x = tile.xCoord; + msg.y = tile.yCoord; + msg.z = tile.zCoord; + + msg.destinationList = tile.destinationList; + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public void sendTo(Packet message, EntityPlayerMP player) + { + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); + this.channels.get(Side.SERVER).writeAndFlush(message); + } + + public void sendToAll(Packet message) + { + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); + this.channels.get(Side.SERVER).writeAndFlush(message); + } + + public void sendToAllAround(Packet message, NetworkRegistry.TargetPoint point) + { + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); + this.channels.get(Side.SERVER).writeAndFlush(message); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/PacketHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/PacketHandler.java deleted file mode 100644 index 48642e37..00000000 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/PacketHandler.java +++ /dev/null @@ -1,966 +0,0 @@ -package WayofTime.alchemicalWizardry.common; - -import ibxm.Player; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.Random; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; -import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; -import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; - -import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteStreams; -import com.jcraft.jogg.Packet; - -public class PacketHandler //implements IPacketHandler -{ -// @Override -// public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) -// { -// if (packet.channel.equals("BloodAltar")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// int x = dat.readInt(); -// int y = dat.readInt(); -// int z = dat.readInt(); -// boolean hasStacks = dat.readByte() != 0; -// int[] items = new int[0]; -// -// if (hasStacks) -// { -// items = new int[1 * 3]; -// -// for (int i = 0; i < items.length; i++) -// { -// items[i] = dat.readInt(); -// } -// } -// -// int fluidIDMain = dat.readInt(); -// int fluidAmountMain = dat.readInt(); -// int fluidIDOutput = dat.readInt(); -// int fluidAmountOutput = dat.readInt(); -// int fluidIDInput = dat.readInt(); -// int fluidAmountInput = dat.readInt(); -// int capacity = dat.readInt(); -// World world = AlchemicalWizardry.proxy.getClientWorld(); -// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); -// -// if (tileEntity instanceof TEAltar) -// { -// TEAltar tileEntityAltar = (TEAltar) tileEntity; -// FluidStack flMain = new FluidStack(fluidIDMain, fluidAmountMain); -// FluidStack flOutput = new FluidStack(fluidIDOutput, fluidAmountOutput); -// FluidStack flInput = new FluidStack(fluidIDInput, fluidAmountInput); -// tileEntityAltar.handlePacketData(items, flMain, flOutput, flInput, capacity); -// } -// } else if (packet.channel.equals("FallReset")) -// { -// if (player instanceof EntityPlayer) -// { -// ((EntityPlayer) player).fallDistance = 0; -// } -// } else if (packet.channel.equals("particle")) -// { -// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); -// DataInputStream din = new DataInputStream(bin); -// Random rand = new Random(); -// -// try -// { -// double x = din.readDouble(); -// double y = din.readDouble(); -// double z = din.readDouble(); -// short particleType = din.readShort(); -// World world = ((EntityPlayer) player).worldObj; -// -// if (particleType == 1) -// { -// world.spawnParticle("mobSpell", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D); -// } -// -// if (particleType == 2) -// { -// world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D); -// } -// -// if (particleType == 3) -// { -// world.spawnParticle("mobSpell", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D); -// } -// -// if (particleType == 4) -// { -// float f = (float) 1.0F; -// float f1 = f * 0.6F + 0.4F; -// float f2 = f * f * 0.7F - 0.5F; -// float f3 = f * f * 0.6F - 0.7F; -// -// for (int l = 0; l < 8; ++l) -// { -// world.spawnParticle("reddust", x + Math.random() - Math.random(), y + Math.random() - Math.random(), z + Math.random() - Math.random(), f1, f2, f3); -// } -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// } else if (packet.channel.equals("CustomParticle")) -// { -// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); -// DataInputStream din = new DataInputStream(bin); -// Random rand = new Random(); -// -// try -// { -// World world = ((EntityPlayer) player).worldObj; -// int size = din.readInt(); -// String str = ""; -// -// for (int i = 0; i < size; i++) -// { -// str = str + din.readChar(); -// } -// -// double x = din.readDouble(); -// double y = din.readDouble(); -// double z = din.readDouble(); -// double xVel = din.readDouble(); -// double yVel = din.readDouble(); -// double zVel = din.readDouble(); -// world.spawnParticle(str, x, y, z, xVel, yVel, zVel); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// } else if (packet.channel.equals("SetLifeEssence")) //Sets the data for the character -// { -// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); -// DataInputStream din = new DataInputStream(bin); -// -// try -// { -// EntityPlayer user = (EntityPlayer) player; -// int length = din.readInt(); -// String ownerName = ""; -// -// for (int i = 0; i < length; i++) -// { -// ownerName = ownerName + din.readChar(); -// } -// -// int addedEssence = din.readInt(); -// int maxEssence = din.readInt(); -// World world = MinecraftServer.getServer().worldServers[0]; -// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); -// -// if (data == null) -// { -// data = new LifeEssenceNetwork(ownerName); -// world.setItemData(ownerName, data); -// } -// -// if (addedEssence > 0) -// { -// if (data.currentEssence < maxEssence) -// { -// data.currentEssence = Math.min(maxEssence, data.currentEssence + addedEssence); -// data.markDirty(); -// } -// -// if (!user.capabilities.isCreativeMode) -// { -// for (int i = 0; i < ((addedEssence + 99) / 100); i++) -// { -// //player.setEntityHealth((player.getHealth()-1)); -// user.setHealth((user.getHealth() - 1)); -// -// if (user.getHealth() <= 0.5f) -// { -// //user.inventory.dropAllItems(); -// user.onDeath(DamageSource.generic); -// return; -// } -// } -// } -// } else -// { -// int removedEssence = -addedEssence; -// -// if ((data.currentEssence - removedEssence) >= 0) -// { -// data.currentEssence -= removedEssence; -// data.markDirty(); -// } else -// { -// if (removedEssence >= 100) -// { -// for (int i = 0; i < ((removedEssence + 99) / 100); i++) -// { -// //player.setEntityHealth((player.getHealth()-1)); -// user.setHealth((user.getHealth() - 1)); -// -// if (user.getHealth() <= 0.5f) -// { -// //user.inventory.dropAllItems(); -// user.onDeath(DamageSource.generic); -// return; -// } -// } -// } else -// { -// if (user.worldObj.rand.nextInt(100) <= removedEssence) -// { -// user.setHealth((user.getHealth() - 1)); -// -// if (user.getHealth() <= 0.5f) -// { -// //user.inventory.dropAllItems(); -// user.onDeath(DamageSource.generic); -// return; -// } -// } -// } -// } -// } -// -// //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(ownerName), (Player)user); -//// data.currentEssence = addedEssence; -//// data.markDirty(); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// } else if (packet.channel.equals("InfiniteLPPath")) -// { -// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); -// DataInputStream din = new DataInputStream(bin); -// -// try -// { -// EntityPlayer user = (EntityPlayer) player; -// int length = din.readInt(); -// String ownerName = ""; -// -// for (int i = 0; i < length; i++) -// { -// ownerName = ownerName + din.readChar(); -// } -// -// boolean fill = din.readBoolean(); -// World world = MinecraftServer.getServer().worldServers[0]; -// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); -// -// if (data == null) -// { -// data = new LifeEssenceNetwork(ownerName); -// world.setItemData(ownerName, data); -// } -// -// if (fill) -// { -// data.currentEssence += 1000000; -// data.markDirty(); -// } else -// { -// data.currentEssence = 0; -// data.markDirty(); -// } -// -// //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(ownerName), (Player)user); -//// data.currentEssence = addedEssence; -//// data.markDirty(); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// } else if (packet.channel.equals("GetLifeEssence")) -// { -// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); -// DataInputStream din = new DataInputStream(bin); -// -// try -// { -// int length = din.readInt(); -// String ownerName = ""; -// -// for (int i = 0; i < length; i++) -// { -// ownerName = ownerName + din.readChar(); -// } -// -// World world = MinecraftServer.getServer().worldServers[0]; -// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); -// -// if (data == null) -// { -// data = new LifeEssenceNetwork(ownerName); -// world.setItemData(ownerName, data); -// } -// -// if (player instanceof EntityPlayer) -// { -// EntityPlayer owner = (EntityPlayer) player; -// ChatMessageComponent chatmessagecomponent = new ChatMessageComponent(); -// //chatmessagecomponent.func_111072_b("Current Essence: " + data.currentEssence + "LP"); -// chatmessagecomponent.addText("Current Essence: " + data.currentEssence + "LP"); -// owner.sendChatToPlayer(chatmessagecomponent); -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// } else if (packet.channel.equals("GetAltarEssence")) -// { -// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); -// DataInputStream din = new DataInputStream(bin); -// -// try -// { -// int x = din.readInt(); -// int y = din.readInt(); -// int z = din.readInt(); -// -// if (player instanceof EntityPlayer) -// { -// EntityPlayer owner = (EntityPlayer) player; -// World world = owner.worldObj; -// TEAltar tileEntity = (TEAltar) world.getBlockTileEntity(x, y, z); -// -// if (tileEntity != null) -// { -// int level = UpgradedAltars.isAltarValid(world, x, y, z); -// ChatMessageComponent chatmessagecomponent = new ChatMessageComponent(); -// chatmessagecomponent.addText("Altar's Current Essence: " + tileEntity.getFluidAmount() + "LP" + "\n" + "Altar's Current Tier: " + level + "\nCapacity: " + tileEntity.getCapacity() + "LP"); -// //chatmessagecomponent.addText(); -// owner.sendChatToPlayer(chatmessagecomponent); -// } -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// } else if (packet.channel.equals("TESocket")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// int x = dat.readInt(); -// int y = dat.readInt(); -// int z = dat.readInt(); -// boolean hasStacks = dat.readByte() != 0; -// int[] items = new int[0]; -// -// if (hasStacks) -// { -// items = new int[1 * 3]; -// -// for (int i = 0; i < items.length; i++) -// { -// items[i] = dat.readInt(); -// } -// } -// -// World world = AlchemicalWizardry.proxy.getClientWorld(); -// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); -// -// if (tileEntity instanceof TESocket) -// { -// TESocket tileEntityAltar = (TESocket) tileEntity; -// tileEntityAltar.handlePacketData(items); -// } -// } else if (packet.channel.equals("TEWritingTable")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// int x = dat.readInt(); -// int y = dat.readInt(); -// int z = dat.readInt(); -// boolean hasStacks = dat.readByte() != 0; -// int[] items = new int[0]; -// -// if (hasStacks) -// { -// items = new int[7 * 3]; -// -// for (int i = 0; i < items.length; i++) -// { -// items[i] = dat.readInt(); -// } -// } -// -// World world = AlchemicalWizardry.proxy.getClientWorld(); -// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); -// -// if (tileEntity instanceof TEWritingTable) -// { -// TEWritingTable tileEntityAltar = (TEWritingTable) tileEntity; -// tileEntityAltar.handlePacketData(items); -// } -// } else if (packet.channel.equals("TEOrientor")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// int x = dat.readInt(); -// int y = dat.readInt(); -// int z = dat.readInt(); -// World world = AlchemicalWizardry.proxy.getClientWorld(); -// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); -// -// if (tileEntity instanceof TEOrientable) -// { -// TEOrientable tileEntityOrientable = (TEOrientable) tileEntity; -// tileEntityOrientable.setInputDirection(ForgeDirection.getOrientation(dat.readInt())); -// tileEntityOrientable.setOutputDirection(ForgeDirection.getOrientation(dat.readInt())); -// world.markBlockForRenderUpdate(x, y, z); -// } -// } else if (packet.channel.equals("TEPedestal")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// int x = dat.readInt(); -// int y = dat.readInt(); -// int z = dat.readInt(); -// boolean hasStacks = dat.readByte() != 0; -// int[] items = new int[0]; -// -// if (hasStacks) -// { -// items = new int[1 * 3]; -// -// for (int i = 0; i < items.length; i++) -// { -// items[i] = dat.readInt(); -// } -// } -// -// World world = AlchemicalWizardry.proxy.getClientWorld(); -// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); -// -// if (tileEntity instanceof TEPedestal) -// { -// TEPedestal tileEntityAltar = (TEPedestal) tileEntity; -// tileEntityAltar.handlePacketData(items); -// } -// } else if (packet.channel.equals("TEPlinth")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// int x = dat.readInt(); -// int y = dat.readInt(); -// int z = dat.readInt(); -// boolean hasStacks = dat.readByte() != 0; -// int[] items = new int[0]; -// -// if (hasStacks) -// { -// items = new int[1 * 3]; -// -// for (int i = 0; i < items.length; i++) -// { -// items[i] = dat.readInt(); -// } -// } -// -// World world = AlchemicalWizardry.proxy.getClientWorld(); -// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); -// -// if (tileEntity instanceof TEPlinth) -// { -// TEPlinth tileEntityAltar = (TEPlinth) tileEntity; -// tileEntityAltar.handlePacketData(items); -// } -// } else if (packet.channel.equals("TETeleposer")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// int x = dat.readInt(); -// int y = dat.readInt(); -// int z = dat.readInt(); -// boolean hasStacks = dat.readByte() != 0; -// int[] items = new int[0]; -// -// if (hasStacks) -// { -// items = new int[1 * 3]; -// -// for (int i = 0; i < items.length; i++) -// { -// items[i] = dat.readInt(); -// } -// } -// -// World world = AlchemicalWizardry.proxy.getClientWorld(); -// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); -// -// if (tileEntity instanceof TETeleposer) -// { -// TETeleposer tileEntityAltar = (TETeleposer) tileEntity; -// tileEntityAltar.handlePacketData(items); -// } -// } else if (packet.channel.equals("SetPlayerVel")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// double xVel = dat.readDouble(); -// double yVel = dat.readDouble(); -// double zVel = dat.readDouble(); -// ((EntityPlayer) player).setVelocity(xVel, yVel, zVel); -// } else if (packet.channel.equals("SetPlayerPos")) -// { -// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); -// double xVel = dat.readDouble(); -// double yVel = dat.readDouble(); -// double zVel = dat.readDouble(); -// ((EntityPlayer) player).setPosition(xVel, yVel, zVel); -// } -// } -// -// public static Packet getPacket(TEAltar tileEntity) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// int[] items = tileEntity.buildIntDataList(); -// boolean hasStacks = (items != null); -// -// try -// { -// dos.writeInt(tileEntity.xCoord); -// dos.writeInt(tileEntity.yCoord); -// dos.writeInt(tileEntity.zCoord); -// dos.writeByte(hasStacks ? 1 : 0); -// -// if (hasStacks) -// { -// for (int i = 0; i < 3; i++) -// { -// dos.writeInt(items[i]); -// } -// } -// -// FluidStack flMain = tileEntity.getFluid(); -// -// if (flMain == null) -// { -// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID()); -// dos.writeInt(0); -// } else -// { -// dos.writeInt(flMain.fluidID); -// dos.writeInt(flMain.amount); -// } -// -// FluidStack flOut = tileEntity.getOutputFluid(); -// -// if (flOut == null) -// { -// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID()); -// dos.writeInt(0); -// } else -// { -// dos.writeInt(flOut.fluidID); -// dos.writeInt(flOut.amount); -// } -// -// FluidStack flIn = tileEntity.getInputFluid(); -// -// if (flIn == null) -// { -// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID()); -// dos.writeInt(0); -// } else -// { -// dos.writeInt(flIn.fluidID); -// dos.writeInt(flIn.amount); -// } -// -// dos.writeInt(tileEntity.capacity); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "BloodAltar"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getPacket(TESocket tileEntity) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// int[] items = tileEntity.buildIntDataList(); -// boolean hasStacks = (items != null); -// -// try -// { -// dos.writeInt(tileEntity.xCoord); -// dos.writeInt(tileEntity.yCoord); -// dos.writeInt(tileEntity.zCoord); -// dos.writeByte(hasStacks ? 1 : 0); -// -// if (hasStacks) -// { -// for (int i = 0; i < 3; i++) -// { -// dos.writeInt(items[i]); -// } -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "TESocket"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getPacket(String ownerName, int addedEssence, int maxEssence) -// //Packet to be sent to server to change essence -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeInt(ownerName.length()); -// dos.writeChars(ownerName); -// dos.writeInt(addedEssence); -// dos.writeInt(maxEssence); //Used for Blood Orbs, but does nothing for other items -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "SetLifeEssence"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// //pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getPacket(String ownerName) //stores the current essence in the player's NBT -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeInt(ownerName.length()); -// dos.writeChars(ownerName); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "GetLifeEssence"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// //pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getAltarPacket(int x, int y, int z) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeInt(x); -// dos.writeInt(y); -// dos.writeInt(z); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "GetAltarEssence"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// //pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getPacket(TEWritingTable tileEntity) -// { -// // TODO Auto-generated method stub -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// int[] items = tileEntity.buildIntDataList(); -// boolean hasStacks = (items != null); -// -// try -// { -// dos.writeInt(tileEntity.xCoord); -// dos.writeInt(tileEntity.yCoord); -// dos.writeInt(tileEntity.zCoord); -// dos.writeByte(hasStacks ? 1 : 0); -// -// if (hasStacks) -// { -// for (int i = 0; i < 3 * 7; i++) -// { -// dos.writeInt(items[i]); -// } -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "TEWritingTable"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getPacket(TEPedestal tileEntity) -// { -// // TODO Auto-generated method stub -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// int[] items = tileEntity.buildIntDataList(); -// boolean hasStacks = (items != null); -// -// try -// { -// dos.writeInt(tileEntity.xCoord); -// dos.writeInt(tileEntity.yCoord); -// dos.writeInt(tileEntity.zCoord); -// dos.writeByte(hasStacks ? 1 : 0); -// -// if (hasStacks) -// { -// for (int i = 0; i < 3 * 1; i++) -// { -// dos.writeInt(items[i]); -// } -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "TEPedestal"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getPacket(TEPlinth tileEntity) -// { -// // TODO Auto-generated method stub -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// int[] items = tileEntity.buildIntDataList(); -// boolean hasStacks = (items != null); -// -// try -// { -// dos.writeInt(tileEntity.xCoord); -// dos.writeInt(tileEntity.yCoord); -// dos.writeInt(tileEntity.zCoord); -// dos.writeByte(hasStacks ? 1 : 0); -// -// if (hasStacks) -// { -// for (int i = 0; i < 3 * 1; i++) -// { -// dos.writeInt(items[i]); -// } -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "TEPlinth"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getPacket(TETeleposer tileEntity) -// { -// // TODO Auto-generated method stub -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// int[] items = tileEntity.buildIntDataList(); -// boolean hasStacks = (items != null); -// -// try -// { -// dos.writeInt(tileEntity.xCoord); -// dos.writeInt(tileEntity.yCoord); -// dos.writeInt(tileEntity.zCoord); -// dos.writeByte(hasStacks ? 1 : 0); -// -// if (hasStacks) -// { -// for (int i = 0; i < 3 * 1; i++) -// { -// dos.writeInt(items[i]); -// } -// } -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "TETeleposer"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = true; -// return pkt; -// } -// -// public static Packet getCustomParticlePacket(String str, double x, double y, double z, double xVel, double yVel, double zVel) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeInt(str.length()); -// dos.writeChars(str); -// dos.writeDouble(x); -// dos.writeDouble(y); -// dos.writeDouble(z); -// dos.writeDouble(xVel); -// dos.writeDouble(yVel); -// dos.writeDouble(zVel); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "CustomParticle"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = false; -// return pkt; -// } -// -// public static Packet getPlayerVelocitySettingPacket(double xVel, double yVel, double zVel) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeDouble(xVel); -// dos.writeDouble(yVel); -// dos.writeDouble(zVel); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "SetPlayerVel"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = false; -// return pkt; -// } -// -// public static Packet getPlayerPositionSettingPacket(double xVel, double yVel, double zVel) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeDouble(xVel); -// dos.writeDouble(yVel); -// dos.writeDouble(zVel); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "SetPlayerPos"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = false; -// return pkt; -// } -// -// public static Packet getCreativeCheatPacket(String ownerName, boolean isFill) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeInt(ownerName.length()); -// dos.writeChars(ownerName); -// dos.writeBoolean(isFill); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "InfiniteLPPath"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = false; -// return pkt; -// } -// -// public static Packet getBlockOrientationPacket(TEOrientable tileEntity) -// { -// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); -// DataOutputStream dos = new DataOutputStream(bos); -// -// try -// { -// dos.writeInt(tileEntity.xCoord); -// dos.writeInt(tileEntity.yCoord); -// dos.writeInt(tileEntity.zCoord); -// dos.writeInt(tileEntity.getIntForForgeDirection(tileEntity.getInputDirection())); -// dos.writeInt(tileEntity.getIntForForgeDirection(tileEntity.getOutputDirection())); -// } catch (IOException e) -// { -// e.printStackTrace(); -// } -// -// Packet250CustomPayload pkt = new Packet250CustomPayload(); -// pkt.channel = "TEOrientor"; -// pkt.data = bos.toByteArray(); -// pkt.length = bos.size(); -// pkt.isChunkDataPacket = true; -// return pkt; -// } -} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionComponent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionComponent.java index 25dfa1b4..72c5d5c9 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionComponent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionComponent.java @@ -2,26 +2,26 @@ package WayofTime.alchemicalWizardry.common.alchemy; import net.minecraft.potion.Potion; -public class CombinedPotionComponent +public class CombinedPotionComponent { - public Potion result; - public Potion pot1; - public Potion pot2; - - public CombinedPotionComponent(Potion result, Potion pot1, Potion pot2) - { - this.result = result; - this.pot1 = pot1; - this.pot2 = pot2; - } - - public boolean isRecipeValid(Potion test1, Potion test2) - { - return (test1 == pot1 && test2 == pot2) || (test1 == pot2 && test2 == pot1); - } - - public boolean isRecipeValid(int test1, int test2) - { - return (test1 == pot1.id && test2 == pot2.id) || (test1 == pot2.id && test2 == pot1.id); - } + public Potion result; + public Potion pot1; + public Potion pot2; + + public CombinedPotionComponent(Potion result, Potion pot1, Potion pot2) + { + this.result = result; + this.pot1 = pot1; + this.pot2 = pot2; + } + + public boolean isRecipeValid(Potion test1, Potion test2) + { + return (test1 == pot1 && test2 == pot2) || (test1 == pot2 && test2 == pot1); + } + + public boolean isRecipeValid(int test1, int test2) + { + return (test1 == pot1.id && test2 == pot2.id) || (test1 == pot2.id && test2 == pot1.id); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java index 0a138dec..0ac3bf52 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java @@ -1,182 +1,182 @@ package WayofTime.alchemicalWizardry.common.alchemy; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; +import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + import java.util.ArrayList; import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; -import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask; - -public class CombinedPotionRegistry +public class CombinedPotionRegistry { - public static List potionList = new ArrayList(); - - public static void registerCombinedPotionRecipe(Potion result, Potion pot1, Potion pot2) - { - potionList.add(new CombinedPotionComponent(result, pot1, pot2)); - } - - public static boolean isRecipeValid(Potion pot1, Potion pot2) - { - for(CombinedPotionComponent recipe : potionList) - { - if(recipe.isRecipeValid(pot1, pot2)) - { - return true; - } - } - - return false; - } - - public static boolean isRecipeValid(int pot1, int pot2) - { - for(CombinedPotionComponent recipe : potionList) - { - if(recipe.isRecipeValid(pot1, pot2)) - { - return true; - } - } - - return false; - } - - public static Potion getPotion(Potion pot1, Potion pot2) - { - for(CombinedPotionComponent recipe : potionList) - { - if(recipe.isRecipeValid(pot1, pot2)) - { - return recipe.result; - } - } - - return null; - } - - public static Potion getPotion(int pot1, int pot2) - { - for(CombinedPotionComponent recipe : potionList) - { - if(recipe.isRecipeValid(pot1, pot2)) - { - return recipe.result; - } - } - - return null; - } - - public static ItemStack applyPotionEffect(ItemStack stack) - { - if(stack == null || !(stack.getItem() instanceof AlchemyFlask)) - { - return null; - } - - List list = AlchemyFlask.getEffects(stack); - if(list == null) - { - return stack; - } - - boolean isDone = false; - - for(AlchemyPotionHelper helper1 : list) - { - if(isDone) - { - continue; - } - - for(int i=0; i list = AlchemyFlask.getEffects(stack); - if(list == null) - { - return false; - } - - for(AlchemyPotionHelper helper1 : list) - { - for(AlchemyPotionHelper helper2 : list) - { - int pot1 = helper1.getPotionID(); - int pot2 = helper2.getPotionID(); - - if(isRecipeValid(pot1, pot2)) - { - return true; - } - } - } - - return false; - } - - public static PotionEffect getResultantPotion(AlchemyPotionHelper potE1, AlchemyPotionHelper potE2) - { - if(potE1 == null || potE2 == null) - { - return null; - } - - int pot1 = potE1.getPotionID(); - int pot2 = potE2.getPotionID(); - - if(isRecipeValid(pot1, pot2)) - { - int duration = (int)((potE1.getTickDuration()* Math.pow(8.0f / 3.0f, potE1.getdurationFactor()) + potE2.getdurationFactor() * Math.pow(8.0f / 3.0f, potE2.getdurationFactor()))/2.0); - int amplifier = (potE1.getConcentration() + potE2.getConcentration())/2; - - Potion pot = getPotion(pot1, pot2); - - return new PotionEffect(pot.id, duration, amplifier); - } - - return null; - } + public static List potionList = new ArrayList(); + + public static void registerCombinedPotionRecipe(Potion result, Potion pot1, Potion pot2) + { + potionList.add(new CombinedPotionComponent(result, pot1, pot2)); + } + + public static boolean isRecipeValid(Potion pot1, Potion pot2) + { + for (CombinedPotionComponent recipe : potionList) + { + if (recipe.isRecipeValid(pot1, pot2)) + { + return true; + } + } + + return false; + } + + public static boolean isRecipeValid(int pot1, int pot2) + { + for (CombinedPotionComponent recipe : potionList) + { + if (recipe.isRecipeValid(pot1, pot2)) + { + return true; + } + } + + return false; + } + + public static Potion getPotion(Potion pot1, Potion pot2) + { + for (CombinedPotionComponent recipe : potionList) + { + if (recipe.isRecipeValid(pot1, pot2)) + { + return recipe.result; + } + } + + return null; + } + + public static Potion getPotion(int pot1, int pot2) + { + for (CombinedPotionComponent recipe : potionList) + { + if (recipe.isRecipeValid(pot1, pot2)) + { + return recipe.result; + } + } + + return null; + } + + public static ItemStack applyPotionEffect(ItemStack stack) + { + if (stack == null || !(stack.getItem() instanceof AlchemyFlask)) + { + return null; + } + + List list = AlchemyFlask.getEffects(stack); + if (list == null) + { + return stack; + } + + boolean isDone = false; + + for (AlchemyPotionHelper helper1 : list) + { + if (isDone) + { + continue; + } + + for (int i = 0; i < list.size(); i++) + { + if (isDone) + { + continue; + } + + AlchemyPotionHelper helper2 = list.get(i); + + PotionEffect potEffect = getResultantPotion(helper1, helper2); + + if (potEffect != null) + { + AlchemyPotionHelper potHelper = new AlchemyPotionHelper(potEffect.getPotionID(), potEffect.getDuration(), 0, potEffect.getAmplifier()); + + list.remove(helper1); + list.remove(helper2); + + list.add(potHelper); + + isDone = true; + } + } + } + + if (isDone) + { + AlchemyFlask.setEffects(stack, list); + + return stack; + } + + return null; + } + + public static boolean hasCombinablePotionEffect(ItemStack stack) + { + if (stack == null || !(stack.getItem() instanceof AlchemyFlask)) + { + return false; + } + + List list = AlchemyFlask.getEffects(stack); + if (list == null) + { + return false; + } + + for (AlchemyPotionHelper helper1 : list) + { + for (AlchemyPotionHelper helper2 : list) + { + int pot1 = helper1.getPotionID(); + int pot2 = helper2.getPotionID(); + + if (isRecipeValid(pot1, pot2)) + { + return true; + } + } + } + + return false; + } + + public static PotionEffect getResultantPotion(AlchemyPotionHelper potE1, AlchemyPotionHelper potE2) + { + if (potE1 == null || potE2 == null) + { + return null; + } + + int pot1 = potE1.getPotionID(); + int pot2 = potE2.getPotionID(); + + if (isRecipeValid(pot1, pot2)) + { + int duration = (int) ((potE1.getTickDuration() * Math.pow(8.0f / 3.0f, potE1.getdurationFactor()) + potE2.getdurationFactor() * Math.pow(8.0f / 3.0f, potE2.getdurationFactor())) / 2.0); + int amplifier = (potE1.getConcentration() + potE2.getConcentration()) / 2; + + Potion pot = getPotion(pot1, pot2); + + return new PotionEffect(pot.id, duration, amplifier); + } + + return null; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/ICombinationalCatalyst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/ICombinationalCatalyst.java index 9acdc197..22d02030 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/ICombinationalCatalyst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/alchemy/ICombinationalCatalyst.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.alchemy; -public interface ICombinationalCatalyst +public interface ICombinationalCatalyst { - } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java index d1bc6a1d..df652209 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java @@ -1,8 +1,14 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.ArmourComponent; +import WayofTime.alchemicalWizardry.common.items.BoundArmour; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -14,16 +20,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.ArmourComponent; -import WayofTime.alchemicalWizardry.common.items.BoundArmour; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; public class ArmourForge extends Block { @@ -39,8 +38,6 @@ public class ArmourForge extends Block setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("armourForge"); - //setUnlocalizedName("armourForge"); - // TODO Auto-generated constructor stub } @Override @@ -160,7 +157,6 @@ public class ArmourForge extends Block for (int i = 0; i < 8; i++) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, world.provider.dimensionId, TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short) 1)); SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, world.provider.dimensionId, 1, xCoord, yCoord, zCoord); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicCalcinator.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicCalcinator.java index 6ed95221..cd1aeb22 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicCalcinator.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicCalcinator.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -12,29 +14,27 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; + +import java.util.Random; public class BlockAlchemicCalcinator extends BlockContainer { - public BlockAlchemicCalcinator() - { - super(Material.rock); - setHardness(2.0F); + public BlockAlchemicCalcinator() + { + super(Material.rock); + setHardness(2.0F); setResistance(5.0F); - this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - this.setBlockName("alchemicCalcinator"); - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) - { - return new TEAlchemicCalcinator(); - } - - @Override + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("alchemicCalcinator"); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TEAlchemicCalcinator(); + } + + @Override public boolean renderAsNormalBlock() { return false; @@ -57,13 +57,13 @@ public class BlockAlchemicCalcinator extends BlockContainer { return true; } - + @Override public boolean canProvidePower() { return true; } - + @Override public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { @@ -110,11 +110,11 @@ public class BlockAlchemicCalcinator extends BlockContainer } } } - - @Override + + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { - TEAlchemicCalcinator tileEntity = (TEAlchemicCalcinator) world.getTileEntity(x, y, z); + TEAlchemicCalcinator tileEntity = (TEAlchemicCalcinator) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -122,45 +122,44 @@ public class BlockAlchemicCalcinator extends BlockContainer } ItemStack playerItem = player.getCurrentEquippedItem(); - + if (playerItem != null) { - if(playerItem.getItem() instanceof IReagentManipulator) - { - return false; - } - - if(playerItem.getItem() instanceof IBloodOrb) - { - if(tileEntity.getStackInSlot(0) == null) - { - ItemStack newItem = playerItem.copy(); + if (playerItem.getItem() instanceof IReagentManipulator) + { + return false; + } + + if (playerItem.getItem() instanceof IBloodOrb) + { + if (tileEntity.getStackInSlot(0) == null) + { + ItemStack newItem = playerItem.copy(); newItem.stackSize = 1; --playerItem.stackSize; tileEntity.setInventorySlotContents(0, newItem); - } - } - else if(tileEntity.getStackInSlot(1) == null) - { - ItemStack newItem = playerItem.copy(); + } + } else if (tileEntity.getStackInSlot(1) == null) + { + ItemStack newItem = playerItem.copy(); newItem.stackSize = 1; --playerItem.stackSize; tileEntity.setInventorySlotContents(1, newItem); - } + } } else if (playerItem == null) { - if(tileEntity.getStackInSlot(1) != null) - { + if (tileEntity.getStackInSlot(1) != null) + { player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(1)); tileEntity.setInventorySlotContents(1, null); - }else if(tileEntity.getStackInSlot(0) != null) - { - player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); + } else if (tileEntity.getStackInSlot(0) != null) + { + player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); tileEntity.setInventorySlotContents(0, null); - } + } } - + tileEntity.getWorldObj().markBlockForUpdate(x, y, z); return true; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java index 8b1b2f8c..f4350a89 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java @@ -1,9 +1,12 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.Random; - -import javax.swing.Icon; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -15,17 +18,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.items.EnergyBattery; -import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; public class BlockAltar extends BlockContainer { @@ -45,8 +40,6 @@ public class BlockAltar extends BlockContainer setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("bloodAltar"); - //setUnlocalizedName("blockAltar"); - //func_111022_d("AlchemicalWizardry:blocks"); } @Override @@ -67,29 +60,23 @@ public class BlockAltar extends BlockContainer { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon2; } } - + @Override public boolean hasComparatorInputOverride() { - return true; + return true; } @Override public int getComparatorInputOverride(World world, int x, int y, int z, int meta) { - TileEntity tile = world.getTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TEAltar) { @@ -113,8 +100,6 @@ public class BlockAltar extends BlockContainer { TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z); -// world.scheduleBlockUpdate(x, y, z, this.blockID, 0); - if (tileEntity == null || player.isSneaking()) { return false; @@ -129,26 +114,24 @@ public class BlockAltar extends BlockContainer if (player.worldObj.isRemote) { world.markBlockForUpdate(x, y, z); - }else + } else { - tileEntity.sendChatInfoToPlayer(player); + tileEntity.sendChatInfoToPlayer(player); } return true; - } - else if(playerItem.getItem().equals(ModItems.itemSeerSigil)) + } else if (playerItem.getItem().equals(ModItems.itemSeerSigil)) { - if (player.worldObj.isRemote) + if (player.worldObj.isRemote) { - world.markBlockForUpdate(x, y, z); - }else + world.markBlockForUpdate(x, y, z); + } else { - tileEntity.sendMoreChatInfoToPlayer(player); + tileEntity.sendMoreChatInfoToPlayer(player); } - + return true; - } - else if (playerItem.getItem().equals(ModItems.sigilOfHolding)) + } else if (playerItem.getItem().equals(ModItems.sigilOfHolding)) { ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentItem(playerItem); @@ -156,24 +139,23 @@ public class BlockAltar extends BlockContainer { if (player.worldObj.isRemote) { - world.markBlockForUpdate(x, y, z); - }else + world.markBlockForUpdate(x, y, z); + } else { - tileEntity.sendChatInfoToPlayer(player); + tileEntity.sendChatInfoToPlayer(player); } - + return true; - } - else if(item !=null && item.getItem().equals(ModItems.itemSeerSigil)) + } else if (item != null && item.getItem().equals(ModItems.itemSeerSigil)) { - if (player.worldObj.isRemote) + if (player.worldObj.isRemote) { - world.markBlockForUpdate(x, y, z); - }else + world.markBlockForUpdate(x, y, z); + } else { - tileEntity.sendMoreChatInfoToPlayer(player); + tileEntity.sendMoreChatInfoToPlayer(player); } - + return true; } } @@ -183,27 +165,16 @@ public class BlockAltar extends BlockContainer { ItemStack newItem = playerItem.copy(); newItem.stackSize = 1; -// if(newItem.getMaxDamage()==0) -// { -// newItem.setItemDamage(0); -// } --playerItem.stackSize; tileEntity.setInventorySlotContents(0, newItem); tileEntity.startCycle(); } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) { - /**stub method - * Add the item that is in the slot to the player's inventory, and - * then set the slot to null. - */ player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); tileEntity.setInventorySlotContents(0, null); tileEntity.setActive(); } - world.markBlockForUpdate(x, y, z); - //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); - //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); return true; } @@ -294,21 +265,9 @@ public class BlockAltar extends BlockContainer } } -// @Override -// public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) -// { -// return 1; -// } - -// @Override -// public boolean canProvidePower() -// { -// return true; -// } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) - { - return new TEAltar(); - } + @Override + public TileEntity createNewTileEntity(World var1, int var2) + { + return new TEAltar(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java index 767213e3..47f36a65 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.ArrayList; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -9,84 +9,43 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; + +import java.util.ArrayList; public class BlockBelljar extends BlockContainer { - public BlockBelljar() - { - super(Material.glass); - setHardness(2.0F); + public BlockBelljar() + { + super(Material.glass); + setHardness(2.0F); setResistance(5.0F); - this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - this.setBlockName("crystalBelljar"); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack) - { - TileEntity tile = world.getTileEntity(x, y, z); - - if(tile instanceof TEBellJar) - { - NBTTagCompound tag = stack.getTagCompound(); - if(tag != null) - { - ((TEBellJar) tile).readTankNBTOnPlace(tag); - } - } - } - -// @Override -// public void breakBlock(World world, int x, int y, int z, Block par5, int par6) -// { -// if(world.isRemote) -// { -// return; -// } -// -// TileEntity tile = world.getTileEntity(x, y, z); -// -// if(tile == null) -// { -// System.out.println("Tile has been removed already!"); -// } -// -// if(tile instanceof TEBellJar) -// { -// if(((TEBellJar) tile).areTanksEmpty()) -// { -// super.breakBlock(world, x, y, z, par5, par6); -// return; -// } -// System.out.println("Writing..."); -// ItemStack droppedStack = new ItemStack(ModBlocks.blockCrystalBelljar); -// droppedStack.setTagCompound(new NBTTagCompound()); -// -// NBTTagCompound savedTag = droppedStack.getTagCompound(); -// ((TEBellJar) tile).writeTankNBT(savedTag); -// -// this.dropBlockAsItem(world, x, y, z, droppedStack); -// -// world.removeTileEntity(x, y, z); -// return; -// } -// -// super.breakBlock(world, x, y, z, par5, par6); -// } - - @Override - public TileEntity createNewTileEntity(World world, int meta) - { - return new TEBellJar(); - } - - @Override + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("crystalBelljar"); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack) + { + TileEntity tile = world.getTileEntity(x, y, z); + + if (tile instanceof TEBellJar) + { + NBTTagCompound tag = stack.getTagCompound(); + if (tag != null) + { + ((TEBellJar) tile).readTankNBTOnPlace(tag); + } + } + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TEBellJar(); + } + + @Override public boolean renderAsNormalBlock() { return false; @@ -108,50 +67,49 @@ public class BlockBelljar extends BlockContainer public boolean hasTileEntity() { return true; - } - + } + @Override public boolean hasComparatorInputOverride() { - return true; + return true; } @Override public int getComparatorInputOverride(World world, int x, int y, int z, int meta) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile instanceof TEBellJar) - { - return ((TEBellJar) tile).getRSPowerOutput(); - } + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TEBellJar) + { + return ((TEBellJar) tile).getRSPowerOutput(); + } return 15; } - + @Override public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) { - this.dropBlockAsItem(world, x, y, z, meta, 0); - - super.onBlockHarvested(world, x, y, z, meta, player); + this.dropBlockAsItem(world, x, y, z, meta, 0); + super.onBlockHarvested(world, x, y, z, meta, player); } - + @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList list = new ArrayList(); - - TileEntity tile = world.getTileEntity(x, y, z); - - if(tile instanceof TEBellJar) - { - ItemStack drop = new ItemStack(this); - NBTTagCompound tag = new NBTTagCompound(); - ((TEBellJar)tile).writeTankNBT(tag); - drop.stackTagCompound = tag; - - list.add(drop); - } - - return list; + ArrayList list = new ArrayList(); + + TileEntity tile = world.getTileEntity(x, y, z); + + if (tile instanceof TEBellJar) + { + ItemStack drop = new ItemStack(this); + NBTTagCompound tag = new NBTTagCompound(); + ((TEBellJar) tile).writeTankNBT(tag); + drop.stackTagCompound = tag; + + list.add(drop); + } + + return list; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java index 2ffc83e6..b49d3b99 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java @@ -1,8 +1,7 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; -import java.util.Random; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -10,15 +9,15 @@ import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; +import java.util.Random; public class BlockBloodLightSource extends Block { public BlockBloodLightSource() { super(Material.cloth); - //setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("blockBloodLightSource"); } @@ -65,7 +64,6 @@ public class BlockBloodLightSource extends Block public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { this.setBlockBounds(0.40F, 0.40F, 0.40F, 0.60F, 0.60F, 0.60F); - //super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } public int quantityDropped(Random par1Random) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java index c92daea7..15fc85db 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java @@ -1,14 +1,14 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; +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.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockConduit extends BlockOrientable { @@ -28,7 +28,6 @@ public class BlockConduit extends BlockOrientable setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("blockConduit"); - //func_111022_d("AlchemicalWizardry:blocks"); } @Override @@ -49,14 +48,8 @@ public class BlockConduit extends BlockOrientable { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon2; } @@ -65,7 +58,6 @@ public class BlockConduit extends BlockOrientable @Override public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - //dropItems(world, x, y, z); super.breakBlock(world, x, y, z, par5, par6); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java index c9d74de3..31d3a6df 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java @@ -1,43 +1,42 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEDemonPortal; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEDemonPortal; public class BlockDemonPortal extends BlockContainer { - public BlockDemonPortal() - { - super(Material.rock); + public BlockDemonPortal() + { + super(Material.rock); setHardness(2.0F); setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("demonPortal"); - } + } - @Override - public TileEntity createNewTileEntity(World var1, int var2) - { - return new TEDemonPortal(); - } - - @Override + @Override + public TileEntity createNewTileEntity(World var1, int var2) + { + return new TEDemonPortal(); + } + + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) { - if(world.isRemote) - { - return false; - } - - TEDemonPortal tileEntity = (TEDemonPortal) world.getTileEntity(x, y, z); - - tileEntity.rightClickBlock(player, side); - - return false; + if (world.isRemote) + { + return false; + } + + TEDemonPortal tileEntity = (TEDemonPortal) world.getTileEntity(x, y, z); + + tileEntity.rightClickBlock(player, side); + + return false; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java index 730b31f3..fcb8c82b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java @@ -1,5 +1,10 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.BlankSpell; +import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -9,11 +14,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.items.BlankSpell; -import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockHomHeart extends BlockContainer { @@ -47,14 +47,8 @@ public class BlockHomHeart extends BlockContainer { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java index 2744f58a..b426f08f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java @@ -1,5 +1,10 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.ActivationCrystal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -8,11 +13,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.items.ActivationCrystal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockMasterStone extends BlockContainer { @@ -23,7 +23,6 @@ public class BlockMasterStone extends BlockContainer setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("blockMasterStone"); - // TODO Auto-generated constructor stub } @Override @@ -32,17 +31,17 @@ public class BlockMasterStone extends BlockContainer { this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterStone"); } - + @Override public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile instanceof TEMasterStone) - { - ((TEMasterStone) tile).useOnRitualBroken(); - } - - super.onBlockHarvested(world, x, y, z, meta, player); + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TEMasterStone) + { + ((TEMasterStone) tile).useOnRitualBroken(); + } + + super.onBlockHarvested(world, x, y, z, meta, player); } @Override diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java index fbc115c8..5350fa63 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java @@ -1,49 +1,34 @@ package WayofTime.alchemicalWizardry.common.block; -import javax.swing.Icon; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class BlockOrientable extends BlockContainer -{ +{ public BlockOrientable() { super(Material.rock); setHardness(2.0F); setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - //setUnlocalizedName("bloodSocket"); - //func_111022_d("AlchemicalWizardry:blocks"); } -// @Override -// public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) -// { -// return false; -// } - @Override public TileEntity createNewTileEntity(World world, int dunno) { return new TEOrientable(); } - + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) { - //Right-click orients the output face. Shift-right-click orients the input face. + //Right-click orients the output face. Shift-right-click orients the input face. if (world.isRemote) { return false; @@ -54,137 +39,167 @@ public class BlockOrientable extends BlockContainer if (tile instanceof TEOrientable) { - TEOrientable newTile = (TEOrientable)tile; - if(player.isSneaking()) - { - int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection())+1; - - if(nextSide>5) - { - nextSide = 0; - } - if(ForgeDirection.getOrientation(nextSide)==newTile.getOutputDirection()) - { - nextSide++; - if(nextSide>5) - { - nextSide = 0; - } - } - - newTile.setInputDirection(ForgeDirection.getOrientation(nextSide)); - }else - { - int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection())+1; - - if(nextSide>5) - { - nextSide = 0; - } - if(ForgeDirection.getOrientation(nextSide)==newTile.getInputDirection()) - { - nextSide++; - if(nextSide>5) - { - nextSide = 0; - } - } - - newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide)); - } + TEOrientable newTile = (TEOrientable) tile; + if (player.isSneaking()) + { + int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection()) + 1; + + if (nextSide > 5) + { + nextSide = 0; + } + if (ForgeDirection.getOrientation(nextSide) == newTile.getOutputDirection()) + { + nextSide++; + if (nextSide > 5) + { + nextSide = 0; + } + } + + newTile.setInputDirection(ForgeDirection.getOrientation(nextSide)); + } else + { + int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection()) + 1; + + if (nextSide > 5) + { + nextSide = 0; + } + if (ForgeDirection.getOrientation(nextSide) == newTile.getInputDirection()) + { + nextSide++; + if (nextSide > 5) + { + nextSide = 0; + } + } + + newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide)); + } } world.markBlockForUpdate(x, y, z); 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; + 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/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java index 85dc2d68..f1b0569a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -16,10 +18,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; public class BlockPedestal extends BlockContainer { @@ -39,7 +39,6 @@ public class BlockPedestal extends BlockContainer setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("bloodPedestal"); - //func_111022_d("AlchemicalWizardry:blocks"); } @Override @@ -60,14 +59,8 @@ public class BlockPedestal extends BlockContainer { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon2; } @@ -93,18 +86,11 @@ public class BlockPedestal extends BlockContainer tileEntity.setInventorySlotContents(0, newItem); } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) { - /**stub method - * Add the item that is in the slot to the player's inventory, and - * then set the slot to null. - */ player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); tileEntity.setInventorySlotContents(0, null); tileEntity.setActive(); } - world.markBlockForUpdate(x, y, z); - //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); - //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); return true; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java index 619f61f1..7798ebb8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -16,10 +18,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; public class BlockPlinth extends BlockContainer { @@ -39,7 +39,6 @@ public class BlockPlinth extends BlockContainer setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("bloodPlinth"); - //func_111022_d("AlchemicalWizardry:blocks"); } @Override @@ -60,14 +59,8 @@ public class BlockPlinth extends BlockContainer { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon2; } @@ -93,18 +86,11 @@ public class BlockPlinth extends BlockContainer tileEntity.setInventorySlotContents(0, newItem); } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) { - /**stub method - * Add the item that is in the slot to the player's inventory, and - * then set the slot to null. - */ player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); tileEntity.setInventorySlotContents(0, null); tileEntity.setActive(); } - world.markBlockForUpdate(x, y, z); - //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); - //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); return true; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java index 83c5a91c..fb5ffeec 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java @@ -1,83 +1,67 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockReagentConduit extends BlockContainer -{ - public BlockReagentConduit() - { - super(Material.cloth); - setHardness(2.0F); +{ + public BlockReagentConduit() + { + super(Material.cloth); + setHardness(2.0F); setResistance(5.0F); - this.setBlockName("blockReagentConduit"); - this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - } - - @Override + this.setBlockName("blockReagentConduit"); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) - { - this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleTransCircle"); + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleTransCircle"); } - - @Override + + @Override public TileEntity createNewTileEntity(World world, int meta) { return new TEReagentConduit(); } - - @Override + + @Override public boolean canProvidePower() { return true; } - -// @Override -// @SideOnly(Side.CLIENT) -// public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) -// { -// if (this.equals(ModBlocks.blockSpellParadigm)) -// { -// par3List.add(new ItemStack(par1, 1, 0)); -// par3List.add(new ItemStack(par1, 1, 1)); -// par3List.add(new ItemStack(par1, 1, 2)); -// par3List.add(new ItemStack(par1, 1, 3)); -// } else -// { -// super.getSubBlocks(par1, par2CreativeTabs, par3List); -// } -// } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) - { - return super.onBlockActivated(world, x, y, z, player, side, what, these, are); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public int getRenderType() - { - return -1; - } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) + { + return super.onBlockActivated(world, x, y, z, player, side, what, these, are); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java index 9c85e4fa..be896e75 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java @@ -1,43 +1,42 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TESchematicSaver; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEDemonPortal; -import WayofTime.alchemicalWizardry.common.tileEntity.TESchematicSaver; public class BlockSchematicSaver extends BlockContainer { - public BlockSchematicSaver() - { - super(Material.rock); + public BlockSchematicSaver() + { + super(Material.rock); setHardness(2.0F); setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("schematicSaver"); - } + } - @Override - public TileEntity createNewTileEntity(World var1, int var2) - { - return new TESchematicSaver(); - } - - @Override + @Override + public TileEntity createNewTileEntity(World var1, int var2) + { + return new TESchematicSaver(); + } + + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) { - if(world.isRemote) - { - return false; - } - - TESchematicSaver tileEntity = (TESchematicSaver) world.getTileEntity(x, y, z); - - tileEntity.rightClickBlock(player, side); - - return false; + if (world.isRemote) + { + return false; + } + + TESchematicSaver tileEntity = (TESchematicSaver) world.getTileEntity(x, y, z); + + tileEntity.rightClickBlock(player, side); + + return false; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java index e4e53890..cfc79508 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java @@ -1,7 +1,10 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -14,11 +17,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; public class BlockSocket extends BlockContainer { @@ -59,14 +59,8 @@ public class BlockSocket extends BlockContainer { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon2; } @@ -83,7 +77,6 @@ public class BlockSocket extends BlockContainer } ItemStack playerItem = player.getCurrentEquippedItem(); - if (tileEntity.getStackInSlot(0) == null && playerItem != null) { if (playerItem.getItem() instanceof ArmourUpgrade) @@ -95,18 +88,11 @@ public class BlockSocket extends BlockContainer } } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) { - /**stub method - * Add the item that is in the slot to the player's inventory, and - * then set the slot to null. - */ player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); tileEntity.setInventorySlotContents(0, null); tileEntity.setActive(); } - world.markBlockForUpdate(x, y, z); - //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); - //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); return true; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java index 95a48ce3..adf845bb 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -11,18 +11,17 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; +import java.util.Random; public class BlockSpectralContainer extends BlockContainer { public BlockSpectralContainer() { super(Material.cloth); - //setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("blockSpectralContainer"); - this.setBlockBounds(0,0,0,0,0,0); + this.setBlockBounds(0, 0, 0, 0, 0, 0); } @Override @@ -54,22 +53,22 @@ public class BlockSpectralContainer extends BlockContainer { return 0; } - - @Override - public boolean isReplaceable(IBlockAccess world, int x, int y, int z) - { - return true; - } - - @Override - public boolean isAir(IBlockAccess world, int x, int y, int z) - { - return true; - } - @Override - public TileEntity createNewTileEntity(World var1, int var2) - { - return new TESpectralContainer(); - } + @Override + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { + return true; + } + + @Override + public boolean isAir(IBlockAccess world, int x, int y, int z) + { + return true; + } + + @Override + public TileEntity createNewTileEntity(World var1, int var2) + { + return new TESpectralContainer(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java index 14846d23..18e6d1bb 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; - +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; @@ -9,25 +9,25 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; + +import java.util.List; -public class BlockSpellEffect extends BlockOrientable +public class BlockSpellEffect extends BlockOrientable { - public BlockSpellEffect() - { - super(); - this.setBlockName("blockSpellEffect"); - } - - @Override + public BlockSpellEffect() + { + super(); + this.setBlockName("blockSpellEffect"); + } + + @Override public TileEntity createNewTileEntity(World world, int meta) { return new TESpellEffectBlock(); } - - @Override + + @Override public boolean renderAsNormalBlock() { return false; @@ -44,16 +44,16 @@ public class BlockSpellEffect extends BlockOrientable { return false; } - - @SideOnly(Side.CLIENT) + + @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { if (this.equals(ModBlocks.blockSpellEffect)) { - for(int i=0; i<4; i++) - { - par3List.add(new ItemStack(par1, 1, i)); - } + for (int i = 0; i < 4; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } } else { super.getSubBlocks(par1, par2CreativeTabs, par3List); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java index 14dc4af5..43d1e827 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; - +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; @@ -9,27 +9,25 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; + +import java.util.List; -public class BlockSpellEnhancement extends BlockOrientable +public class BlockSpellEnhancement extends BlockOrientable { - public BlockSpellEnhancement() - { - super(); - this.setBlockName("blockSpellEnhancement"); - } - - @Override + public BlockSpellEnhancement() + { + super(); + this.setBlockName("blockSpellEnhancement"); + } + + @Override public TileEntity createNewTileEntity(World world, int meta) { return new TESpellEnhancementBlock(); } - - @Override + + @Override public boolean renderAsNormalBlock() { return false; @@ -46,16 +44,16 @@ public class BlockSpellEnhancement extends BlockOrientable { return false; } - - @SideOnly(Side.CLIENT) + + @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { if (this.equals(ModBlocks.blockSpellEnhancement)) { - for(int i=0; i<15; i++) - { - par3List.add(new ItemStack(par1, 1, i)); - } + for (int i = 0; i < 15; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } } else { super.getSubBlocks(par1, par2CreativeTabs, par3List); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java index ae4e028f..4dcdf5be 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; - +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; @@ -9,55 +9,54 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; + +import java.util.List; -public class BlockSpellModifier extends BlockOrientable +public class BlockSpellModifier extends BlockOrientable { - public BlockSpellModifier() - { - super(); - this.setBlockName("blockSpellModifier"); - } - - @Override + public BlockSpellModifier() + { + super(); + this.setBlockName("blockSpellModifier"); + } + + @Override public TileEntity createNewTileEntity(World world, int meta) { return new TESpellModifierBlock(); } - - @SideOnly(Side.CLIENT) + + @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { if (this.equals(ModBlocks.blockSpellModifier)) { - for(int i=0; i<4; i++) - { - par3List.add(new ItemStack(par1, 1, i)); - } + for (int i = 0; i < 4; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } } else { super.getSubBlocks(par1, par2CreativeTabs, par3List); } } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public int getRenderType() - { - return -1; - } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java index f1945778..de4c60e1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java @@ -1,40 +1,38 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class BlockSpellParadigm extends BlockOrientable +import java.util.List; + +public class BlockSpellParadigm extends BlockOrientable { - public static final float minPos = (3f/16f); - public static final float maxPos = (13f/16f); - - public BlockSpellParadigm() - { - super(); - this.setBlockName("blockSpellParadigm"); - } - - @Override + public static final float minPos = (3f / 16f); + public static final float maxPos = (13f / 16f); + + public BlockSpellParadigm() + { + super(); + this.setBlockName("blockSpellParadigm"); + } + + @Override public TileEntity createNewTileEntity(World world, int meta) { return new TESpellParadigmBlock(); } - - @SideOnly(Side.CLIENT) + + @SideOnly(Side.CLIENT) /** * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) @@ -52,14 +50,14 @@ public class BlockSpellParadigm extends BlockOrientable super.getSubBlocks(par1, par2CreativeTabs, par3List); } } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) - { - ItemStack stack = player.getCurrentEquippedItem(); - - if(stack != null && stack.getItem() instanceof ItemComplexSpellCrystal) - { + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) + { + ItemStack stack = player.getCurrentEquippedItem(); + + if (stack != null && stack.getItem() instanceof ItemComplexSpellCrystal) + { if (stack.stackTagCompound == null) { stack.setTagCompound(new NBTTagCompound()); @@ -71,26 +69,26 @@ public class BlockSpellParadigm extends BlockOrientable itemTag.setInteger("zCoord", z); itemTag.setInteger("dimensionId", world.provider.dimensionId); return true; - } - - return super.onBlockActivated(world, x, y, z, player, side, what, these, are); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public int getRenderType() - { - return -1; - } + } + + return super.onBlockActivated(world, x, y, z, player, side, what, these, are); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java index 545535ee..7ea3448e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java @@ -1,7 +1,10 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockMobSpawner; @@ -16,11 +19,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; -import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; public class BlockTeleposer extends BlockContainer { @@ -40,7 +40,6 @@ public class BlockTeleposer extends BlockContainer setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("bloodTeleposer"); - //func_111022_d("AlchemicalWizardry:blocks"); } @Override @@ -61,14 +60,8 @@ public class BlockTeleposer extends BlockContainer { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon2; } @@ -97,13 +90,7 @@ public class BlockTeleposer extends BlockContainer return true; } } - player.openGui(AlchemicalWizardry.instance, 1, world, x, y, z); -// this.swapBlocks(world, x, y+1, z, x, y+2, z); -// -// world.markBlockForUpdate(x, y, z); - //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); - //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); return true; } @@ -216,11 +203,6 @@ public class BlockTeleposer extends BlockContainer } //TILES CLEARED -// worldF.destroyBlock(xf, yf, zf, false); -// worldI.destroyBlock(xi, yi, zi, false); -// worldI.setBlockToAir(xi, yi, zi); -// worldF.setBlockToAir(xf, yf, zf); - worldF.setBlock(xf, yf, zf, initialBlock, metaI, 3); if (tileEntityI != null) @@ -230,12 +212,6 @@ public class BlockTeleposer extends BlockContainer newTileEntityI.xCoord = xf; newTileEntityI.yCoord = yf; newTileEntityI.zCoord = zf; - -// TileEntity tile = worldI.getTileEntity(xf, yf, zf); -// if(tile instanceof TileMultipart) -// { -// TileMultipart.createFromNBT(nbttag1); -// } } worldI.setBlock(xi, yi, zi, finalBlock, metaF, 3); @@ -247,12 +223,6 @@ public class BlockTeleposer extends BlockContainer newTileEntityF.xCoord = xi; newTileEntityF.yCoord = yi; newTileEntityF.zCoord = zi; - - TileEntity tile = worldI.getTileEntity(xi, yi, zi); -// if(tile instanceof TileMultipart) -// { -// TileMultipart.createFromNBT(nbttag2); -// } } return true; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java index e7890015..d67883df 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java @@ -1,8 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -17,10 +18,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; +import java.util.Random; public class BlockWritingTable extends BlockContainer { @@ -60,14 +60,8 @@ public class BlockWritingTable extends BlockContainer { case 0: return bottomIcon; - case 1: return topIcon; - - //case 2: return sideIcon1; - //case 3: return sideIcon1; - //case 4: return sideIcon2; - //case 5: return sideIcon2; default: return sideIcon2; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java index b5df0d22..187ebdd0 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.List; - -import javax.swing.Icon; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -11,10 +11,8 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModBlocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class BloodRune extends Block { @@ -59,9 +57,9 @@ public class BloodRune extends Block case 3: //Orb Capacity rune return 7; - + case 4: //Better Capacity rune - return 8; + return 8; } return 0; @@ -104,9 +102,9 @@ public class BloodRune extends Block case 3: return this.orbCapacityRuneIcon; - + case 4: - return this.betterCapacityRuneIcon; + return this.betterCapacityRuneIcon; default: return blockIcon; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java index 0e33c138..054cd8b8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; public class BloodStoneBrick extends Block { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java index 337b3e90..6226b917 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class EfficiencyRune extends BloodRune { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java index ec78e760..f6964f63 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; public class EmptySocket extends Block { @@ -16,7 +16,6 @@ public class EmptySocket extends Block setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("emptySocket"); - // TODO Auto-generated constructor stub } @Override diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java index 224f4d55..f331bf78 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java @@ -1,5 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -10,12 +14,6 @@ import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class ImperfectRitualStone extends Block { @@ -26,7 +24,6 @@ public class ImperfectRitualStone extends Block setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("imperfectRitualStone"); - // TODO Auto-generated constructor stub } @Override @@ -39,25 +36,19 @@ public class ImperfectRitualStone extends Block @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOff, float yOff, float zOff) { - //ItemStack ist = player.getItemInUse(); - //if (!world.isRemote) { Block block = world.getBlock(x, y + 1, z); if (block == Blocks.water) { - if (!player.capabilities.isCreativeMode && !world.isRemote) + if (!player.capabilities.isCreativeMode && !world.isRemote) { - EnergyItems.drainPlayerNetwork(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } if (!world.isRemote) { world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); -// if (!player.capabilities.isCreativeMode) -// { -// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); -// } } world.getWorldInfo().setRaining(true); @@ -73,19 +64,13 @@ public class ImperfectRitualStone extends Block return true; } else if (block == Blocks.coal_block) { - if (!player.capabilities.isCreativeMode && !world.isRemote) + if (!player.capabilities.isCreativeMode && !world.isRemote) { - EnergyItems.drainPlayerNetwork(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } - //EntityFallenAngel zomb = new EntityFallenAngel(world); EntityZombie zomb = new EntityZombie(world); zomb.setPosition(x + 0.5, y + 2, z + 0.5); - // zomb.setCurrentItemOrArmor(4, new ItemStack(Item.helmetIron.itemID,1,0)); - // zomb.setCurrentItemOrArmor(3, new ItemStack(Item.plateIron.itemID,1,0)); - // zomb.setCurrentItemOrArmor(2, new ItemStack(Item.legsIron.itemID,1,0)); - // zomb.setCurrentItemOrArmor(1, new ItemStack(Item.bootsIron.itemID,1,0)); - //zomb.setCurrentItemOrArmor(0, new ItemStack(AlchemicalWizardry.energySword.itemID,1,0)); zomb.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2000)); zomb.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 20000, 7)); zomb.addPotionEffect(new PotionEffect(Potion.resistance.id, 20000, 3)); @@ -94,44 +79,31 @@ public class ImperfectRitualStone extends Block { world.spawnEntityInWorld(zomb); world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); -// if (!player.capabilities.isCreativeMode) -// { -// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); -// } } return true; - } else if (block== Blocks.lapis_block) + } else if (block == Blocks.lapis_block) { if (!player.capabilities.isCreativeMode && !world.isRemote) { - EnergyItems.drainPlayerNetwork(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } if (!world.isRemote) { world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); world.setWorldTime((world.getWorldTime() / 24000) * 24000 + 13800); -// if (!player.capabilities.isCreativeMode) -// { -// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); -// } } } else if (block == Blocks.bedrock) { - if (!player.capabilities.isCreativeMode && !world.isRemote) + if (!player.capabilities.isCreativeMode && !world.isRemote) { - EnergyItems.drainPlayerNetwork(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } if (!world.isRemote) { world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); - //world.setWorldTime((world.getWorldTime()/24000)*24000+13800); -// if (!player.capabilities.isCreativeMode) -// { -// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); -// } } player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 1)); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java index 1969c452..623c2418 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; public class LargeBloodStoneBrick extends Block { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java index 34676410..26344146 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java @@ -1,14 +1,14 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class LifeEssenceBlock extends BlockFluidClassic { @@ -16,8 +16,6 @@ public class LifeEssenceBlock extends BlockFluidClassic { super(AlchemicalWizardry.lifeEssenceFluid, Material.water); AlchemicalWizardry.lifeEssenceFluid.setBlock(this); - - //setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setBlockName("lifeEssenceFluidBlock"); } @@ -35,7 +33,6 @@ public class LifeEssenceBlock extends BlockFluidClassic this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:lifeEssenceStill"); AlchemicalWizardry.lifeEssenceFluid.setFlowingIcon(blockIcon); AlchemicalWizardry.lifeEssenceFluid.setStillIcon(blockIcon); - //this.getFluid().setIcons(blockIcon); } @Override diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java index a847c360..7d73e7e8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java @@ -1,5 +1,10 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.rituals.IRitualStone; +import WayofTime.alchemicalWizardry.common.items.ScribeTool; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -8,11 +13,6 @@ 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.api.rituals.IRitualStone; -import WayofTime.alchemicalWizardry.common.items.ScribeTool; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class RitualStone extends Block implements IRitualStone { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java index d06ec80f..2094e97a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class RuneOfSacrifice extends BloodRune { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java index 4032044d..2c13ce41 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class RuneOfSelfSacrifice extends BloodRune { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java index d3ceb131..62c001a4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java @@ -1,22 +1,21 @@ package WayofTime.alchemicalWizardry.common.block; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Facing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; public class SpectralBlock extends BlockContainer { @@ -26,13 +25,6 @@ public class SpectralBlock extends BlockContainer this.setBlockName("spectralBlock"); } -// @Override -// public int tickRate(World par1World) -// { -// return 10; -// } - - @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) @@ -43,7 +35,7 @@ public class SpectralBlock extends BlockContainer @Override public boolean isOpaqueCube() { - Block d; + Block d; return false; } @@ -52,7 +44,7 @@ public class SpectralBlock extends BlockContainer { return 0; } - + @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { @@ -83,7 +75,6 @@ public class SpectralBlock extends BlockContainer @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { - //TEAltar tileEntity = (TEAltar)world.getBlockTileEntity(x, y, z); if (player.isSneaking()) { return false; @@ -95,7 +86,7 @@ public class SpectralBlock extends BlockContainer { if (playerItem.getItem() instanceof ItemBlock) { - world.setBlock(x, y, z, ((ItemBlock)(playerItem.getItem())).field_150939_a, playerItem.getItemDamage(), 3); + world.setBlock(x, y, z, ((ItemBlock) (playerItem.getItem())).field_150939_a, playerItem.getItemDamage(), 3); if (!player.capabilities.isCreativeMode) { @@ -112,9 +103,9 @@ public class SpectralBlock extends BlockContainer return true; } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) - { - return new TESpectralBlock(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TESpectralBlock(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java index 0680b066..ac628ad6 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class SpeedRune extends BloodRune { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java index f6e231c2..c985fc49 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java @@ -57,10 +57,10 @@ public class AltarUpgradeComponent { orbCapacitiveUpgrades++; } - + public void addBetterCapacitiveUpgrade() { - betterCapacitiveUpgrades++; + betterCapacitiveUpgrades++; } public int getSpeedUpgrades() @@ -97,9 +97,9 @@ public class AltarUpgradeComponent { return this.orbCapacitiveUpgrades; } - + public int getBetterCapacitiveUpgrades() { - return this.betterCapacitiveUpgrades; + return this.betterCapacitiveUpgrades; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java index 4c5ea30d..5ee7d564 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java @@ -1,14 +1,13 @@ package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.block.BloodRune; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.block.BloodRune; + +import java.util.ArrayList; +import java.util.List; public class UpgradedAltars { @@ -189,10 +188,10 @@ public class UpgradedAltars case 7: upgrades.addorbCapacitiveUpgrade(); break; - + case 8: - upgrades.addBetterCapacitiveUpgrade(); - break; + upgrades.addBetterCapacitiveUpgrade(); + break; } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java index 25398812..b47b63c5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java @@ -1,195 +1,195 @@ package WayofTime.alchemicalWizardry.common.demonVillage; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.Int3; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.Int3; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; -public class BlockSet +import java.util.ArrayList; +import java.util.List; + +public class BlockSet { - protected String blockid; - protected int[] metadata; - protected List positions; - - public BlockSet() - { - this(Blocks.stone); - } - - public BlockSet(String blockid) - { - this.blockid = blockid; - this.metadata = new int[4]; - positions = new ArrayList(); - } - - public BlockSet(Block block) - { - this(BlockSet.getPairedIdForBlock(block)); - } - - public BlockSet(Block block, int meta) - { - this(block); - for(int i=0; i getPositions() - { - return positions; - } - - public void addPositionToBlock(int xOffset, int yOffset, int zOffset) - { - positions.add(new Int3(xOffset, yOffset, zOffset)); - } - - public Block getBlock() - { - return this.getBlockForString(blockid); - } - - public static String getPairedIdForBlock(Block block) - { - UniqueIdentifier un = GameRegistry.findUniqueIdentifierFor(block); - String name = ""; - - if(un != null) - { - name = un.modId + ":" + un.name; - } - - return name; - } - - public static Block getBlockForString(String str) - { - String[] parts = str.split(":"); - String modId = parts[0]; - String name = parts[1]; - return GameRegistry.findBlock(modId, name); - } - - public int getMetaForDirection(ForgeDirection dir) - { - if(metadata.length < 4) - { - return 0; - } - - switch(dir) - { - case NORTH: - return metadata[0]; - case SOUTH: - return metadata[1]; - case WEST: - return metadata[2]; - case EAST: - return metadata[3]; - default: - return 0; - } - } - - public void buildAtIndex(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, int index) - { - Block block = this.getBlock(); - if(index >= positions.size() || block == null) - { - return; - } - - Int3 position = positions.get(index); - int xOff = position.xCoord; - int yOff = position.yCoord; - int zOff = position.zCoord; - int meta = this.getMetaForDirection(dir); - - switch(dir) - { - case NORTH: - break; - case SOUTH: - xOff *= -1; - zOff *= -1; - break; - case WEST: - int temp = zOff; - zOff = xOff * -1; - xOff = temp; - break; - case EAST: - int temp2 = zOff * -1; - zOff = xOff; - xOff = temp2; - break; - default: - } - - world.setBlock(xCoord + xOff, yCoord + yOff, zCoord + zOff, block, meta, 3); - } - - public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) - { - for(int i=0; i positions; + + public BlockSet() + { + this(Blocks.stone); + } + + public BlockSet(String blockid) + { + this.blockid = blockid; + this.metadata = new int[4]; + positions = new ArrayList(); + } + + public BlockSet(Block block) + { + this(BlockSet.getPairedIdForBlock(block)); + } + + public BlockSet(Block block, int meta) + { + this(block); + for (int i = 0; i < metadata.length; i++) + { + metadata[i] = meta; + } + if (block instanceof BlockStairs) + { + int[] northSet = new int[]{2, 3, 0, 1}; + int[] eastSet = new int[]{1, 0, 2, 3}; + int[] southSet = new int[]{3, 2, 1, 0}; + int[] westSet = new int[]{0, 1, 3, 2}; + int[] northUpSet = new int[]{6, 7, 4, 5}; + int[] eastUpSet = new int[]{5, 4, 6, 7}; + int[] southUpSet = new int[]{7, 6, 5, 4}; + int[] westUpSet = new int[]{4, 5, 7, 6}; + + switch (meta) + { + case 0: + metadata = westSet; + break; + case 1: + metadata = eastSet; + break; + case 2: + metadata = northSet; + break; + case 3: + metadata = southSet; + break; + case 4: + metadata = westUpSet; + break; + case 5: + metadata = eastUpSet; + break; + case 6: + metadata = northUpSet; + break; + case 7: + metadata = southUpSet; + break; + } + } + } + + public List getPositions() + { + return positions; + } + + public void addPositionToBlock(int xOffset, int yOffset, int zOffset) + { + positions.add(new Int3(xOffset, yOffset, zOffset)); + } + + public Block getBlock() + { + return this.getBlockForString(blockid); + } + + public static String getPairedIdForBlock(Block block) + { + UniqueIdentifier un = GameRegistry.findUniqueIdentifierFor(block); + String name = ""; + + if (un != null) + { + name = un.modId + ":" + un.name; + } + + return name; + } + + public static Block getBlockForString(String str) + { + String[] parts = str.split(":"); + String modId = parts[0]; + String name = parts[1]; + return GameRegistry.findBlock(modId, name); + } + + public int getMetaForDirection(ForgeDirection dir) + { + if (metadata.length < 4) + { + return 0; + } + + switch (dir) + { + case NORTH: + return metadata[0]; + case SOUTH: + return metadata[1]; + case WEST: + return metadata[2]; + case EAST: + return metadata[3]; + default: + return 0; + } + } + + public void buildAtIndex(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, int index) + { + Block block = this.getBlock(); + if (index >= positions.size() || block == null) + { + return; + } + + Int3 position = positions.get(index); + int xOff = position.xCoord; + int yOff = position.yCoord; + int zOff = position.zCoord; + int meta = this.getMetaForDirection(dir); + + switch (dir) + { + case NORTH: + break; + case SOUTH: + xOff *= -1; + zOff *= -1; + break; + case WEST: + int temp = zOff; + zOff = xOff * -1; + xOff = temp; + break; + case EAST: + int temp2 = zOff * -1; + zOff = xOff; + xOff = temp2; + break; + default: + } + + world.setBlock(xCoord + xOff, yCoord + yOff, zCoord + zOff, block, meta, 3); + } + + public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) + { + for (int i = 0; i < positions.size(); i++) + { + this.buildAtIndex(world, xCoord, yCoord, zCoord, dir, i); + } + } + + public boolean isContained(Block block, int defaultMeta) + { + Block thisBlock = this.getBlock(); + return thisBlock == null ? false : thisBlock.equals(block) && this.metadata[0] == defaultMeta; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java index 7eb22ee9..09cad8c5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java @@ -1,183 +1,180 @@ package WayofTime.alchemicalWizardry.common.demonVillage; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.Int3; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import java.util.ArrayList; import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.Int3; - -public class BuildingSchematic +public class BuildingSchematic { - public String name; - public int doorX; - public int doorZ; - public int doorY; - public int buildingTier; - public int buildingType; - public List blockList; - - public BuildingSchematic() - { - this(""); - } - - public BuildingSchematic(String name) - { - this.name = name; - blockList = new ArrayList(); - this.doorX = 0; - this.doorZ = 0; - this.doorY = 0; - this.buildingTier = 0; - this.buildingType = DemonBuilding.BUILDING_HOUSE; - } - - public void addBlockWithMeta(Block block, int meta, int xOffset, int yOffset, int zOffset) - { - for(BlockSet set : blockList) - { - if(set.isContained(block, meta)) - { - set.addPositionToBlock(xOffset, yOffset, zOffset); - return; - } - } - - BlockSet set = new BlockSet(block, meta); - set.addPositionToBlock(xOffset, yOffset, zOffset); - blockList.add(set); - } - - public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) - { - for(BlockSet set : blockList) - { - set.buildAll(world, xCoord, yCoord, zCoord, dir); - } - } - - public GridSpaceHolder createGSH() - { - GridSpaceHolder holder = new GridSpaceHolder(); - - for(BlockSet set : blockList) - { - for(Int3 coords : set.getPositions()) - { - int gridX = (int)((coords.xCoord+2*Math.signum(coords.xCoord))/5); - int gridZ = (int)((coords.zCoord+2*Math.signum(coords.zCoord))/5); - - holder.setGridSpace(gridX, gridZ, new GridSpace(GridSpace.HOUSE,0)); - } - } - - return holder; - } - - public Int3 getGridSpotOfDoor() - { - int gridX = (int)((doorX+2*Math.signum(doorX))/5); - int gridZ = (int)((doorZ+2*Math.signum(doorZ))/5); - - return new Int3(gridX, doorY, gridZ); - } - - public List getGriddedPositions(ForgeDirection dir) - { - List positionList = new ArrayList(); - - for(BlockSet blockSet : blockList) - { - for(Int3 pos : blockSet.getPositions()) - { - int xOff = pos.xCoord; - int zOff = pos.zCoord; - - switch(dir) - { - case SOUTH: - xOff *= -1; - zOff *= -1; - break; - case WEST: - int temp = zOff; - zOff = xOff * -1; - xOff = temp; - break; - case EAST: - int temp2 = zOff * -1; - zOff = xOff; - xOff = temp2; - break; - default: - } - - Int3 nextPos = new Int3(xOff, 0, zOff); - if(!positionList.contains(nextPos)) - { - positionList.add(nextPos); - } - } - } - - return positionList; - } - - public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) - { - GridSpaceHolder grid = this.createGSH(); //GridSpaceHolder is not aware of the buildings - need to use the schematic - - List positionList = getGriddedPositions(dir); - - for(int i=this.getMinY(); i<=this.getMaxY(); i++) - { - for(Int3 pos : positionList) - { - Block block = world.getBlock(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord); - if(block != ModBlocks.blockDemonPortal) - { - world.setBlockToAir(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord); - } - } - - //grid.destroyAllInGridSpaces(world, xCoord, yCoord + i, zCoord, dir); //Deprecated method - } - } - - public int getMinY() - { - int min = 0; - for(BlockSet set : blockList) - { - for(Int3 pos : set.getPositions()) - { - if(pos.yCoord < min) - { - min = pos.yCoord; - } - } - } - - return min; - } - - public int getMaxY() - { - int max = 0; - for(BlockSet set : blockList) - { - for(Int3 pos : set.getPositions()) - { - if(pos.yCoord > max) - { - max = pos.yCoord; - } - } - } - - return max; - } + public String name; + public int doorX; + public int doorZ; + public int doorY; + public int buildingTier; + public int buildingType; + public List blockList; + + public BuildingSchematic() + { + this(""); + } + + public BuildingSchematic(String name) + { + this.name = name; + blockList = new ArrayList(); + this.doorX = 0; + this.doorZ = 0; + this.doorY = 0; + this.buildingTier = 0; + this.buildingType = DemonBuilding.BUILDING_HOUSE; + } + + public void addBlockWithMeta(Block block, int meta, int xOffset, int yOffset, int zOffset) + { + for (BlockSet set : blockList) + { + if (set.isContained(block, meta)) + { + set.addPositionToBlock(xOffset, yOffset, zOffset); + return; + } + } + + BlockSet set = new BlockSet(block, meta); + set.addPositionToBlock(xOffset, yOffset, zOffset); + blockList.add(set); + } + + public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) + { + for (BlockSet set : blockList) + { + set.buildAll(world, xCoord, yCoord, zCoord, dir); + } + } + + public GridSpaceHolder createGSH() + { + GridSpaceHolder holder = new GridSpaceHolder(); + + for (BlockSet set : blockList) + { + for (Int3 coords : set.getPositions()) + { + int gridX = (int) ((coords.xCoord + 2 * Math.signum(coords.xCoord)) / 5); + int gridZ = (int) ((coords.zCoord + 2 * Math.signum(coords.zCoord)) / 5); + + holder.setGridSpace(gridX, gridZ, new GridSpace(GridSpace.HOUSE, 0)); + } + } + + return holder; + } + + public Int3 getGridSpotOfDoor() + { + int gridX = (int) ((doorX + 2 * Math.signum(doorX)) / 5); + int gridZ = (int) ((doorZ + 2 * Math.signum(doorZ)) / 5); + + return new Int3(gridX, doorY, gridZ); + } + + public List getGriddedPositions(ForgeDirection dir) + { + List positionList = new ArrayList(); + + for (BlockSet blockSet : blockList) + { + for (Int3 pos : blockSet.getPositions()) + { + int xOff = pos.xCoord; + int zOff = pos.zCoord; + + switch (dir) + { + case SOUTH: + xOff *= -1; + zOff *= -1; + break; + case WEST: + int temp = zOff; + zOff = xOff * -1; + xOff = temp; + break; + case EAST: + int temp2 = zOff * -1; + zOff = xOff; + xOff = temp2; + break; + default: + } + + Int3 nextPos = new Int3(xOff, 0, zOff); + if (!positionList.contains(nextPos)) + { + positionList.add(nextPos); + } + } + } + + return positionList; + } + + public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) + { + GridSpaceHolder grid = this.createGSH(); //GridSpaceHolder is not aware of the buildings - need to use the schematic + + List positionList = getGriddedPositions(dir); + + for (int i = this.getMinY(); i <= this.getMaxY(); i++) + { + for (Int3 pos : positionList) + { + Block block = world.getBlock(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord); + if (block != ModBlocks.blockDemonPortal) + { + world.setBlockToAir(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord); + } + } + } + } + + public int getMinY() + { + int min = 0; + for (BlockSet set : blockList) + { + for (Int3 pos : set.getPositions()) + { + if (pos.yCoord < min) + { + min = pos.yCoord; + } + } + } + + return min; + } + + public int getMaxY() + { + int max = 0; + for (BlockSet set : blockList) + { + for (Int3 pos : set.getPositions()) + { + if (pos.yCoord > max) + { + max = pos.yCoord; + } + } + } + return max; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java index b0777a46..1e4ffdf8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java @@ -1,120 +1,120 @@ package WayofTime.alchemicalWizardry.common.demonVillage; +import WayofTime.alchemicalWizardry.common.Int3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.Int3; -public class DemonBuilding +public class DemonBuilding { - public static final int BUILDING_HOUSE = 0; - public static final int BUILDING_PORTAL = 1; - - public BuildingSchematic schematic; - public GridSpaceHolder area; - public int buildingTier; - public int buildingType; - public Int3 doorGridSpace; - - public DemonBuilding(BuildingSchematic schematic) - { - this.schematic = schematic; - this.buildingType = schematic.buildingType; - this.buildingTier = schematic.buildingTier; - this.area = this.createGSHForSchematic(schematic); - this.doorGridSpace = schematic.getGridSpotOfDoor(); - } - - public String getName() - { - return schematic.name; - } - - public boolean isValid(GridSpaceHolder master, int gridX, int gridZ, ForgeDirection dir) - { - return area.doesContainAll(master, gridX, gridZ, dir); - } - - public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) - { - schematic.buildAll(world, xCoord, yCoord, zCoord, dir); - } - - public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master) - { - area.setAllGridSpaces(xInit, zInit, yLevel, dir, type, master); - } - - public GridSpaceHolder createGSHForSchematic(BuildingSchematic scheme) - { - switch(this.buildingType) - { - case DemonBuilding.BUILDING_HOUSE: - return scheme.createGSH(); - case DemonBuilding.BUILDING_PORTAL: - - } - return scheme.createGSH(); - } - - public Int3 getDoorSpace(ForgeDirection dir) - { - int x = 0; - int z = 0; - switch(dir) - { - case SOUTH: - x = -doorGridSpace.xCoord; - z = -doorGridSpace.zCoord; - break; - case WEST: - x = doorGridSpace.zCoord; - z = -doorGridSpace.xCoord; - break; - case EAST: - x = -doorGridSpace.zCoord; - z = doorGridSpace.xCoord; - break; - default: - x = doorGridSpace.xCoord; - z = doorGridSpace.zCoord; - break; - } - - return new Int3(x, doorGridSpace.yCoord, z); - } - - public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel) - { - Int3 doorSpace = this.getDoorSpace(sideOfRoad); - int x = doorSpace.xCoord; - int z = doorSpace.zCoord; - - switch(sideOfRoad) - { - case SOUTH: - z++; - break; - case EAST: - x++; - break; - case WEST: - x--; - break; - default: - z--; - break; - } - - return new Int3(x, yLevel, z); - } - - public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) - { - schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir); - } - - public int getNumberOfGridSpaces() - { - return area.getNumberOfGridSpaces(); - } + public static final int BUILDING_HOUSE = 0; + public static final int BUILDING_PORTAL = 1; + + public BuildingSchematic schematic; + public GridSpaceHolder area; + public int buildingTier; + public int buildingType; + public Int3 doorGridSpace; + + public DemonBuilding(BuildingSchematic schematic) + { + this.schematic = schematic; + this.buildingType = schematic.buildingType; + this.buildingTier = schematic.buildingTier; + this.area = this.createGSHForSchematic(schematic); + this.doorGridSpace = schematic.getGridSpotOfDoor(); + } + + public String getName() + { + return schematic.name; + } + + public boolean isValid(GridSpaceHolder master, int gridX, int gridZ, ForgeDirection dir) + { + return area.doesContainAll(master, gridX, gridZ, dir); + } + + public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) + { + schematic.buildAll(world, xCoord, yCoord, zCoord, dir); + } + + public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master) + { + area.setAllGridSpaces(xInit, zInit, yLevel, dir, type, master); + } + + public GridSpaceHolder createGSHForSchematic(BuildingSchematic scheme) + { + switch (this.buildingType) + { + case DemonBuilding.BUILDING_HOUSE: + return scheme.createGSH(); + case DemonBuilding.BUILDING_PORTAL: + + } + return scheme.createGSH(); + } + + public Int3 getDoorSpace(ForgeDirection dir) + { + int x = 0; + int z = 0; + switch (dir) + { + case SOUTH: + x = -doorGridSpace.xCoord; + z = -doorGridSpace.zCoord; + break; + case WEST: + x = doorGridSpace.zCoord; + z = -doorGridSpace.xCoord; + break; + case EAST: + x = -doorGridSpace.zCoord; + z = doorGridSpace.xCoord; + break; + default: + x = doorGridSpace.xCoord; + z = doorGridSpace.zCoord; + break; + } + + return new Int3(x, doorGridSpace.yCoord, z); + } + + public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel) + { + Int3 doorSpace = this.getDoorSpace(sideOfRoad); + int x = doorSpace.xCoord; + int z = doorSpace.zCoord; + + switch (sideOfRoad) + { + case SOUTH: + z++; + break; + case EAST: + x++; + break; + case WEST: + x--; + break; + default: + z--; + break; + } + + return new Int3(x, yLevel, z); + } + + public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) + { + schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir); + } + + public int getNumberOfGridSpaces() + { + return area.getNumberOfGridSpaces(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonCrosspath.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonCrosspath.java index 3b8a7a71..6badd634 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonCrosspath.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonCrosspath.java @@ -2,21 +2,21 @@ package WayofTime.alchemicalWizardry.common.demonVillage; import net.minecraft.world.World; -public class DemonCrosspath +public class DemonCrosspath { - private int xCoord; - private int yLevel; - private int zCoord; - - public DemonCrosspath(int xCoord, int yLevel, int zCoord) - { - this.xCoord = xCoord; - this.yLevel = yLevel; - this.zCoord = zCoord; - } - - public void createCrosspath(World world) - { - - } + private int xCoord; + private int yLevel; + private int zCoord; + + public DemonCrosspath(int xCoord, int yLevel, int zCoord) + { + this.xCoord = xCoord; + this.yLevel = yLevel; + this.zCoord = zCoord; + } + + public void createCrosspath(World world) + { + + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java index 01645f35..018c2699 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java @@ -1,135 +1,135 @@ package WayofTime.alchemicalWizardry.common.demonVillage; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.Int3; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.Int3; -public class DemonVillagePath +public class DemonVillagePath { - public int xi; - public int yi; - public int zi; - public ForgeDirection dir; - public int length; - - public DemonVillagePath(int xi, int yi, int zi, ForgeDirection dir, int length) - { - this.xi = xi; - this.yi = yi; - this.zi = zi; - this.dir = dir; - this.length = length; - } - - public Int3 constructFullPath(World world, int clearance, Block block, int meta) - { - int xPos = this.xi; - int yPos = this.yi; - int zPos = this.zi; - int rad = this.getRoadRadius(); - - for(int i=-rad; i<=rad; i++) - { - this.constructPartialPath(world, clearance, block, meta, xPos-rad*dir.offsetX+i*dir.offsetZ, yPos, zPos-rad*dir.offsetZ+i*dir.offsetX, dir, length+2*rad); - } - - return this.getFinalLocation(world, clearance); - } - - public void constructPartialPath(World world, int clearance, Block roadBlock, int meta, int xi, int yi, int zi, ForgeDirection dir, int length) - { - int xPos = xi; - int yPos = yi; - int zPos = zi; - - for(int i=0; i posXRadius|| x < -negXRadius || z > posZRadius || z < -negZRadius) - { - return new GridSpace(); - }else - { - return (area[x + negXRadius][z + negZRadius]); - } - } - - public void setGridSpace(int x, int z, GridSpace space) - { - if(x > posXRadius) - { - this.expandAreaInPosX(); - this.setGridSpace(x, z, space); - return; - }else if(x < -negXRadius) - { - this.expandAreaInNegX(); - this.setGridSpace(x, z, space); - return; - }else if(z > posZRadius) - { - this.expandAreaInPosZ(); - this.setGridSpace(x, z, space); - return; - }else if(z < -negZRadius) - { - this.expandAreaInNegZ(); - this.setGridSpace(x, z, space); - return; - }else - { - area[x + negXRadius][z + negZRadius] = space; - } - } - - public boolean doesContainAll(GridSpaceHolder master, int xInit, int zInit, ForgeDirection dir) - { - if(master != null) - { - System.out.println("negXRadius: " + negXRadius + " posXRadius: " + posXRadius + " negZRadius: " + negZRadius + " posZRadius: " + posZRadius); - for(int i=-negXRadius; i<=posXRadius; i++) - { - for(int j=-negZRadius; j<=posZRadius; j++) - { - GridSpace thisSpace = this.getGridSpace(i, j); - if(thisSpace.isEmpty()) - { - continue; - } - - System.out.println("x: " + i + " z: " + j); - - int xOff = 0; - int zOff = 0; - - switch(dir) - { - case SOUTH: - xOff = -i; - zOff = -j; - break; - case WEST: - xOff = j; - zOff = -i; - break; - case EAST: - xOff = -j; - zOff = i; - break; - default: - xOff = i; - zOff = j; - break; - } - if(!master.getGridSpace(xInit + xOff, zInit + zOff).isEmpty()) - { - return false; - } - } - } - return true; - } - return false; - } - - public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master) - { - System.out.println("Grid space selected: (" + xInit + "," + zInit + ")"); - if(master != null) - { - for(int i=-negXRadius; i<=posXRadius; i++) - { - for(int j=-negZRadius; j<=posZRadius; j++) - { - GridSpace thisSpace = this.getGridSpace(i, j); - if(thisSpace.isEmpty()) - { - continue; - } - - int xOff = 0; - int zOff = 0; - - switch(dir) - { - case SOUTH: - xOff = -i; - zOff = -j; - break; - case WEST: - xOff = j; - zOff = -i; - break; - case EAST: - xOff = -j; - zOff = i; - break; - default: - xOff = i; - zOff = j; - break; - } - - System.out.println("Grid space (" + (xInit + xOff) + "," + (zInit + zOff) + ")"); - - master.setGridSpace(xInit + xOff, zInit + zOff, new GridSpace(type, yLevel)); - } - } - } - } - - public void destroyAllInGridSpaces(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) - { - for(int i=-negXRadius; i<=posXRadius; i++) - { - for(int j=-negZRadius; j<=posZRadius; j++) - { - GridSpace thisSpace = this.getGridSpace(i, j); - if(thisSpace.isEmpty()) - { - continue; - } - - int xOff = 0; - int zOff = 0; - - switch(dir) - { - case SOUTH: - xOff = -i; - zOff = -j; - break; - case WEST: - xOff = j; - zOff = -i; - break; - case EAST: - xOff = -j; - zOff = i; - break; - default: - xOff = i; - zOff = j; - break; - } - - for(int l = -2; l<=2; l++) - { - for(int m = -2; m<=2; m++) - { - Block block = world.getBlock(xCoord + xOff*5 + l, yCoord, zCoord + zOff*5 + m); - if(block == ModBlocks.blockDemonPortal) - { - continue; - } - world.setBlockToAir(xCoord + xOff*5 + l, yCoord, zCoord + zOff*5 + m); - } - } - } - } - } - - public int getNumberOfGridSpaces() - { - int num = 0; - for(int i=-this.negXRadius; i<=this.posXRadius; i++) - { - for(int j=-this.negZRadius; j<=this.posZRadius; j++) - { - if(!this.getGridSpace(i, j).isEmpty()) - { - num++; - } - } - } - - return num; - } + public GridSpace[][] area; + public int negXRadius; //These variables indicate how much the grid has expanded from the 1x1 + public int posXRadius; //matrix in each direction + public int negZRadius; + public int posZRadius; + + public GridSpaceHolder() + { + area = new GridSpace[1][1]; + area[0][0] = new GridSpace(); + } + + public void expandAreaInNegX() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1]; + for (int i = 0; i <= negZRadius + posZRadius; i++) + { + newGrid[0][i] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i + 1][j] = area[i][j]; + } + } + + area = newGrid; + negXRadius += 1; + } + + public void expandAreaInPosX() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1]; + + for (int i = 0; i <= negZRadius + posZRadius; i++) + { + newGrid[negXRadius + posXRadius + 1][i] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i][j] = area[i][j]; + } + } + + area = newGrid; + posXRadius += 1; + } + + public void expandAreaInNegZ() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2]; + + System.out.println("x " + newGrid.length + "z " + newGrid[0].length); + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + newGrid[i][0] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i][j + 1] = area[i][j]; + } + } + + area = newGrid; + negZRadius += 1; + } + + public void expandAreaInPosZ() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2]; + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + newGrid[i][negZRadius + posZRadius + 1] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i][j] = area[i][j]; + } + } + + area = newGrid; + posZRadius += 1; + } + + public GridSpace getGridSpace(int x, int z) + { + if (x > posXRadius || x < -negXRadius || z > posZRadius || z < -negZRadius) + { + return new GridSpace(); + } else + { + return (area[x + negXRadius][z + negZRadius]); + } + } + + public void setGridSpace(int x, int z, GridSpace space) + { + if (x > posXRadius) + { + this.expandAreaInPosX(); + this.setGridSpace(x, z, space); + return; + } else if (x < -negXRadius) + { + this.expandAreaInNegX(); + this.setGridSpace(x, z, space); + return; + } else if (z > posZRadius) + { + this.expandAreaInPosZ(); + this.setGridSpace(x, z, space); + return; + } else if (z < -negZRadius) + { + this.expandAreaInNegZ(); + this.setGridSpace(x, z, space); + return; + } else + { + area[x + negXRadius][z + negZRadius] = space; + } + } + + public boolean doesContainAll(GridSpaceHolder master, int xInit, int zInit, ForgeDirection dir) + { + if (master != null) + { + System.out.println("negXRadius: " + negXRadius + " posXRadius: " + posXRadius + " negZRadius: " + negZRadius + " posZRadius: " + posZRadius); + for (int i = -negXRadius; i <= posXRadius; i++) + { + for (int j = -negZRadius; j <= posZRadius; j++) + { + GridSpace thisSpace = this.getGridSpace(i, j); + if (thisSpace.isEmpty()) + { + continue; + } + + System.out.println("x: " + i + " z: " + j); + + int xOff = 0; + int zOff = 0; + + switch (dir) + { + case SOUTH: + xOff = -i; + zOff = -j; + break; + case WEST: + xOff = j; + zOff = -i; + break; + case EAST: + xOff = -j; + zOff = i; + break; + default: + xOff = i; + zOff = j; + break; + } + if (!master.getGridSpace(xInit + xOff, zInit + zOff).isEmpty()) + { + return false; + } + } + } + return true; + } + return false; + } + + public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master) + { + System.out.println("Grid space selected: (" + xInit + "," + zInit + ")"); + if (master != null) + { + for (int i = -negXRadius; i <= posXRadius; i++) + { + for (int j = -negZRadius; j <= posZRadius; j++) + { + GridSpace thisSpace = this.getGridSpace(i, j); + if (thisSpace.isEmpty()) + { + continue; + } + + int xOff = 0; + int zOff = 0; + + switch (dir) + { + case SOUTH: + xOff = -i; + zOff = -j; + break; + case WEST: + xOff = j; + zOff = -i; + break; + case EAST: + xOff = -j; + zOff = i; + break; + default: + xOff = i; + zOff = j; + break; + } + + System.out.println("Grid space (" + (xInit + xOff) + "," + (zInit + zOff) + ")"); + + master.setGridSpace(xInit + xOff, zInit + zOff, new GridSpace(type, yLevel)); + } + } + } + } + + public void destroyAllInGridSpaces(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) + { + for (int i = -negXRadius; i <= posXRadius; i++) + { + for (int j = -negZRadius; j <= posZRadius; j++) + { + GridSpace thisSpace = this.getGridSpace(i, j); + if (thisSpace.isEmpty()) + { + continue; + } + + int xOff = 0; + int zOff = 0; + + switch (dir) + { + case SOUTH: + xOff = -i; + zOff = -j; + break; + case WEST: + xOff = j; + zOff = -i; + break; + case EAST: + xOff = -j; + zOff = i; + break; + default: + xOff = i; + zOff = j; + break; + } + + for (int l = -2; l <= 2; l++) + { + for (int m = -2; m <= 2; m++) + { + Block block = world.getBlock(xCoord + xOff * 5 + l, yCoord, zCoord + zOff * 5 + m); + if (block == ModBlocks.blockDemonPortal) + { + continue; + } + world.setBlockToAir(xCoord + xOff * 5 + l, yCoord, zCoord + zOff * 5 + m); + } + } + } + } + } + + public int getNumberOfGridSpaces() + { + int num = 0; + for (int i = -this.negXRadius; i <= this.posXRadius; i++) + { + for (int j = -this.negZRadius; j <= this.posZRadius; j++) + { + if (!this.getGridSpace(i, j).isEmpty()) + { + num++; + } + } + } + + return num; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java index 2209f58c..a135df1a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java @@ -4,5 +4,5 @@ import net.minecraft.nbt.NBTTagCompound; public class TileBlockSet extends BlockSet { - public NBTTagCompound tag; + public NBTTagCompound tag; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java index 884b37f2..85c08619 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java @@ -1,18 +1,13 @@ package WayofTime.alchemicalWizardry.common.entity.mob; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIFollowOwner; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; -import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityAnimal; @@ -20,17 +15,12 @@ import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.pathfinding.PathEntity; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityBileDemon extends EntityDemon { @@ -46,22 +36,17 @@ public class EntityBileDemon extends EntityDemon this.setSize(1.3F, 2.0F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); - //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true)); this.tasks.addTask(3, this.aiSit); - this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); attackTimer = 0; - //this.isImmuneToFire = true; } @Override @@ -318,7 +303,7 @@ public class EntityBileDemon extends EntityDemon } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { @@ -375,7 +360,6 @@ public class EntityBileDemon extends EntityDemon public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -455,7 +439,6 @@ public class EntityBileDemon extends EntityDemon */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java index fa4106de..0e26556b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java @@ -5,7 +5,6 @@ import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import net.minecraft.block.BlockColored; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; @@ -18,7 +17,6 @@ import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -28,7 +26,6 @@ import net.minecraft.world.World; public class EntityBoulderFist extends EntityDemon { - //private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); private static float maxTamedHealth = 60.0F; @@ -44,25 +41,20 @@ public class EntityBoulderFist extends EntityDemon this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); if (par1World != null && !par1World.isRemote) { this.setCombatTask(); } - - //this.isImmuneToFire = true; } @Override @@ -80,8 +72,6 @@ public class EntityBoulderFist extends EntityDemon { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); } - - //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } /** @@ -121,7 +111,6 @@ public class EntityBoulderFist extends EntityDemon super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); } /** @@ -300,7 +289,7 @@ public class EntityBoulderFist extends EntityDemon } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { @@ -358,7 +347,6 @@ public class EntityBoulderFist extends EntityDemon public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -438,7 +426,6 @@ public class EntityBoulderFist extends EntityDemon */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java index fd56ebce..64749322 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java @@ -1,15 +1,15 @@ package WayofTime.alchemicalWizardry.common.entity.mob; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.IDemon; +import WayofTime.alchemicalWizardry.common.items.DemonPlacer; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.IDemon; -import WayofTime.alchemicalWizardry.common.items.DemonPlacer; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityDemon extends EntityTameable implements IDemon { @@ -51,11 +51,11 @@ public class EntityDemon extends EntityTameable implements IDemon { ItemStack drop = new ItemStack(ModItems.demonPlacer, 1, this.getDemonID()); - if((this.getOwner() instanceof EntityPlayer)) - { - DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer)this.getOwner())); - } - + if ((this.getOwner() instanceof EntityPlayer)) + { + DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer) this.getOwner())); + } + if (this.hasCustomNameTag()) { drop.setStackDisplayName(this.getCustomNameTag()); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java index f9492ece..1fd1dc81 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java @@ -5,9 +5,7 @@ import WayofTime.alchemicalWizardry.ModItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; -import net.minecraft.block.BlockColored; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; @@ -15,7 +13,6 @@ import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityHorse; -import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.ItemStack; @@ -30,7 +27,6 @@ import java.util.List; public class EntityElemental extends EntityDemon { - //private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); private static float maxTamedHealth = 100.0F; @@ -41,15 +37,12 @@ public class EntityElemental extends EntityDemon super(par1World, demonID); this.setSize(0.5F, 1.0F); this.setAggro(false); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); if (par1World != null && !par1World.isRemote) { this.setCombatTask(); } - - //this.isImmuneToFire = true; } public int courseChangeCooldown; @@ -68,11 +61,6 @@ public class EntityElemental extends EntityDemon /** * The explosion radius of spawned fireballs. */ - //private int explosionStrength = 1; -// -// private int heightOffsetUpdateTime; -// private float heightOffset = 0.5F; -// private int field_70846_g; protected void dropFewItems(boolean par1, int par2) { if (worldObj.rand.nextFloat() < (1 - Math.pow(0.6f, par2 + 1))) @@ -174,12 +162,6 @@ public class EntityElemental extends EntityDemon protected void updateEntityActionState() { -// if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) -// { -// this.setDead(); -// } - - //this.despawnEntity(); if (this.getHealth() <= this.getMaxHealth() / 2.0f && worldObj.rand.nextInt(200) == 0) { this.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionReciprocation.id, 100, 1)); @@ -265,10 +247,6 @@ public class EntityElemental extends EntityDemon { if (Math.sqrt(d5 * d5 + d6 * d6 + d7 * d7) < 4) { -// if (this.attackCounter == 10) -// { -// this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1007, (int)this.posX, (int)this.posY, (int)this.posZ, 0); -// } ++this.attackCounter; if (this.attackCounter >= 10) @@ -369,8 +347,6 @@ public class EntityElemental extends EntityDemon { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); } - - //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } /** @@ -410,7 +386,6 @@ public class EntityElemental extends EntityDemon super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); this.dataWatcher.addObject(25, Byte.valueOf((byte) 0)); } @@ -546,7 +521,6 @@ public class EntityElemental extends EntityDemon public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -602,7 +576,6 @@ public class EntityElemental extends EntityDemon */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } @@ -622,7 +595,6 @@ public class EntityElemental extends EntityDemon } return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); - //return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).func_96122_a((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).func_110248_bS(); } else { return false; @@ -636,7 +608,6 @@ public class EntityElemental extends EntityDemon public void setCombatTask() { this.tasks.removeTask(this.aiAttackOnCollide); - //this.tasks.removeTask(this.aiArrowAttack); ItemStack itemstack = this.getHeldItem(); this.tasks.addTask(4, this.aiAttackOnCollide); } @@ -708,7 +679,7 @@ public class EntityElemental extends EntityDemon } @Override - public int getTotalArmorValue() //TODO + public int getTotalArmorValue() { return 10; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java index 6bd801a9..23c4b297 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java @@ -1,21 +1,12 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -import net.minecraft.block.BlockColored; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityAgeable; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIArrowAttack; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIFollowOwner; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; -import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityAnimal; @@ -29,11 +20,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.pathfinding.PathEntity; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; -import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob { @@ -50,20 +36,15 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); - //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); - //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); - this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); if (par1World != null && !par1World.isRemote) @@ -89,8 +70,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); } - - //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } /** @@ -130,7 +109,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); } /** @@ -309,7 +287,7 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java index fafe24b7..994d11a3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java @@ -1,21 +1,12 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -import net.minecraft.block.BlockColored; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityAgeable; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIArrowAttack; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIFollowOwner; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; -import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityAnimal; @@ -30,11 +21,6 @@ import net.minecraft.pathfinding.PathEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; -import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityIceDemon extends EntityDemon implements IRangedAttackMob { @@ -48,31 +34,23 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob { super(par1World, AlchemicalWizardry.entityIceDemonID); this.setSize(0.5F, 2.0F); - //this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); - //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); - //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); - this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); if (par1World != null && !par1World.isRemote) { this.setCombatTask(); } - - //this.isImmuneToFire = true; } @Override @@ -90,8 +68,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); } - - //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } /** @@ -131,7 +107,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); } /** @@ -210,12 +185,12 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob { super.onLivingUpdate(); int range = 2; - + Vec3 blockVector = SpellHelper.getEntityBlockVector(this); - - int xCoord = (int)(blockVector.xCoord); - int yCoord = (int)(blockVector.yCoord); - int zCoord = (int)(blockVector.zCoord); + + int xCoord = (int) (blockVector.xCoord); + int yCoord = (int) (blockVector.yCoord); + int zCoord = (int) (blockVector.zCoord); for (int i = -range; i <= range; i++) { @@ -330,7 +305,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { @@ -388,7 +363,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -468,7 +442,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java index 5d20a4e2..6081778a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java @@ -4,7 +4,6 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import net.minecraft.block.BlockColored; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; @@ -17,7 +16,6 @@ import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -40,15 +38,12 @@ public class EntityLowerGuardian extends EntityDemon this.setSize(0.7F, 1.8F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); - //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true)); this.tasks.addTask(3, this.aiSit); - this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); @@ -56,8 +51,6 @@ public class EntityLowerGuardian extends EntityDemon this.setAggro(false); this.setTamed(false); attackTimer = 0; - //isAggro = false; - //this.isImmuneToFire = true; } @Override @@ -75,8 +68,6 @@ public class EntityLowerGuardian extends EntityDemon { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); } - - //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } /** @@ -116,7 +107,6 @@ public class EntityLowerGuardian extends EntityDemon super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); } /** @@ -316,7 +306,7 @@ public class EntityLowerGuardian extends EntityDemon } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { @@ -374,7 +364,6 @@ public class EntityLowerGuardian extends EntityDemon public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -454,7 +443,6 @@ public class EntityLowerGuardian extends EntityDemon */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java index 068095a2..ee7be27e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java @@ -5,7 +5,6 @@ import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import net.minecraft.block.BlockColored; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; @@ -18,7 +17,6 @@ import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -28,7 +26,6 @@ import net.minecraft.world.World; public class EntityShade extends EntityDemon { - //private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); private static float maxTamedHealth = 50.0F; @@ -41,28 +38,22 @@ public class EntityShade extends EntityDemon this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); - //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); - this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); - this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); if (par1World != null && !par1World.isRemote) { this.setCombatTask(); } - - //this.isImmuneToFire = true; } @Override @@ -80,8 +71,6 @@ public class EntityShade extends EntityDemon { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); } - - //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } /** @@ -121,7 +110,6 @@ public class EntityShade extends EntityDemon super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); } /** @@ -300,7 +288,7 @@ public class EntityShade extends EntityDemon } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { @@ -358,7 +346,6 @@ public class EntityShade extends EntityDemon public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -438,7 +425,6 @@ public class EntityShade extends EntityDemon */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java index 73e4e076..ea304b8d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java @@ -1,20 +1,12 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityAgeable; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIArrowAttack; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIFollowOwner; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; -import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityAnimal; @@ -28,11 +20,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.pathfinding.PathEntity; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; -import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackMob { @@ -49,28 +36,21 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); - //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); - //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); - this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(5, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); if (par1World != null && !par1World.isRemote) { this.setCombatTask(); } - - //this.isImmuneToFire = true; } @Override @@ -88,8 +68,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); } - - //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } /** @@ -129,7 +107,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); } /** @@ -307,7 +284,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { @@ -365,7 +342,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -445,7 +421,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java index 804cdb65..0deadbca 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java @@ -1,21 +1,12 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -import net.minecraft.block.BlockColored; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityAgeable; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIArrowAttack; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIFollowOwner; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; -import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityAnimal; @@ -23,18 +14,12 @@ import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.pathfinding.PathEntity; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; -import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackMob { @@ -51,20 +36,15 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); - //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); - //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); - this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); - //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); - //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); - this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(9, new EntityAILookIdle(this)); + this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); - //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setTamed(false); if (par1World != null && !par1World.isRemote) @@ -131,7 +111,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte) 0)); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); } /** @@ -309,7 +288,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM } } - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack)) + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) { if (!this.worldObj.isRemote) { @@ -367,7 +346,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM public boolean isBreedingItem(ItemStack par1ItemStack) { return false; - //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); } /** @@ -447,7 +425,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM */ protected boolean canDespawn() { - //return !this.isTamed() && this.ticksExisted > 2400; return false; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java index 3b5d6e71..178fcb3d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; -import java.util.Iterator; -import java.util.List; - +import cpw.mods.fml.common.registry.IThrowableEntity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -11,15 +11,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.*; import net.minecraft.world.World; -import cpw.mods.fml.common.registry.IThrowableEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Iterator; +import java.util.List; //Shamelessly ripped off from x3n0ph0b3 public class EnergyBlastProjectile extends Entity implements IProjectile, IThrowableEntity @@ -252,8 +248,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) { - // this.groundImpact(); - // this.setDead(); } } else { @@ -261,7 +255,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow if (ticksInAir > 1 && ticksInAir < 3) { - //worldObj.spawnParticle("flame", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0D, 0D, 0D); for (int particles = 0; particles < 3; particles++) { this.doFiringParticles(); @@ -328,7 +321,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow posZ += motionZ; MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); this.setPosition(posX, posY, posZ); - //this.doBlockCollisions(); } } @@ -457,12 +449,10 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2)); } - doDamage(projectileDamage, mop); worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true); } @@ -509,18 +499,18 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow return 0; } - @Override - public Entity getThrower() - { - // TODO Auto-generated method stub - return this.shootingEntity; - } + @Override + public Entity getThrower() + { + // TODO Auto-generated method stub + return this.shootingEntity; + } - @Override - public void setThrower(Entity entity) - { - if(entity instanceof EntityLivingBase) - this.shootingEntity = (EntityLivingBase)entity; - - } + @Override + public void setThrower(Entity entity) + { + if (entity instanceof EntityLivingBase) + this.shootingEntity = (EntityLivingBase) entity; + + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java index a0cf955c..d4029d91 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java @@ -6,11 +6,11 @@ import net.minecraft.world.World; public class EntityBeamParticle extends EntityFX { - protected EntityBeamParticle(World p_i1218_1_, double p_i1218_2_, - double p_i1218_4_, double p_i1218_6_) - { - super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_); - // TODO Auto-generated constructor stub - } + protected EntityBeamParticle(World p_i1218_1_, double p_i1218_2_, + double p_i1218_4_, double p_i1218_6_) + { + super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_); + // TODO Auto-generated constructor stub + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java index 4a1729a0..c0490bd8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java @@ -1,13 +1,12 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.ModBlocks; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; -import net.minecraft.potion.Potion; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; public class EntityBloodLightProjectile extends EnergyBlastProjectile @@ -90,8 +89,6 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile { this.worldObj.setBlock(blockX + 1, blockY, blockZ, ModBlocks.blockBloodLight); } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } this.setDead(); @@ -106,18 +103,11 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - ((EntityLivingBase) mop).setRevengeTarget(shootingEntity); - doDamage(1, mop); - } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java index 9c55f452..fbc3fa57 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java @@ -68,7 +68,6 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { spawnSecondaryProjectiles(); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java index cdbf72f4..abc38a70 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java @@ -195,8 +195,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) { - // this.groundImpact(); - // this.setDead(); } } else { @@ -204,7 +202,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil if (ticksInAir > 1 && ticksInAir < 3) { - //worldObj.spawnParticle("flame", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0D, 0D, 0D); for (int particles = 0; particles < 3; particles++) { this.doFiringParticles(); @@ -271,7 +268,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil posZ += motionZ; MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); this.setPosition(posX, posY, posZ); - //this.doBlockCollisions(); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java index a1f6bc9b..2307236c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java @@ -1,16 +1,16 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; public class EntityMeteor extends EnergyBlastProjectile { private int meteorID; - + public boolean hasTerrae; public boolean hasOrbisTerrae; public boolean hasCrystallos; @@ -28,12 +28,12 @@ public class EntityMeteor extends EnergyBlastProjectile super(par1World, par2, par4, par6); this.meteorID = meteorID; } - + @Override public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); - + par1NBTTagCompound.setInteger("meteorID", meteorID); par1NBTTagCompound.setBoolean("hasTerrae", hasTerrae); par1NBTTagCompound.setBoolean("hasOrbisTerrae", hasOrbisTerrae); @@ -46,7 +46,7 @@ public class EntityMeteor extends EnergyBlastProjectile public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); - + meteorID = par1NBTTagCompound.getInteger("meteorID"); hasTerrae = par1NBTTagCompound.getBoolean("hasTerrae"); hasOrbisTerrae = par1NBTTagCompound.getBoolean("hasOrbisTerrae"); @@ -83,7 +83,7 @@ public class EntityMeteor extends EnergyBlastProjectile @Override public void onImpact(Entity mop) { - MeteorRegistry.createMeteorImpact(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae}); + MeteorRegistry.createMeteorImpact(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae}); this.setDead(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java index 564e7dea..88c92ad2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java @@ -1,5 +1,9 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.registry.IThrowableEntity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.particle.EntityCloudFX; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.Entity; @@ -9,10 +13,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.registry.IThrowableEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; //Shamelessly ripped off from x3n0ph0b3 public class EntityParticleBeam extends Entity implements IProjectile, IThrowableEntity @@ -205,31 +205,29 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl posZ += motionZ; MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); this.setPosition(posX, posY, posZ); - + this.doFiringParticles(); - - if(Math.pow(posX - xDest, 2) + Math.pow(posY - yDest, 2) + Math.pow(posZ - zDest, 2) <= 1) + + if (Math.pow(posX - xDest, 2) + Math.pow(posY - yDest, 2) + Math.pow(posZ - zDest, 2) <= 1) { - this.scheduledForDeath = true; + this.scheduledForDeath = true; } - - if(this.scheduledForDeath) + + if (this.scheduledForDeath) { - this.setDead(); + this.setDead(); } } public void doFiringParticles() { - if(!worldObj.isRemote) - { - return; - } - //worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - EntityFX particle = new EntityCloudFX(worldObj, posX, posY, posZ, 0, 0, 0); - particle.setRBGColorF(colourRed + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourGreen + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourBlue + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat())); - FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); - //worldObj.spawnParticle("happyVillager", posX, posY, posZ, 0, 0, 0); + if (!worldObj.isRemote) + { + return; + } + EntityFX particle = new EntityCloudFX(worldObj, posX, posY, posZ, 0, 0, 0); + particle.setRBGColorF(colourRed + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourGreen + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourBlue + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat())); + FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); } /** @@ -319,32 +317,32 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl return 0; } - @Override - public Entity getThrower() - { - // TODO Auto-generated method stub - return this.shootingEntity; - } + @Override + public Entity getThrower() + { + // TODO Auto-generated method stub + return this.shootingEntity; + } - @Override - public void setThrower(Entity entity) - { - if(entity instanceof EntityLivingBase) - this.shootingEntity = (EntityLivingBase)entity; - - } - - public void setColour(float red, float green, float blue) - { - this.colourRed = red; - this.colourGreen = green; - this.colourBlue = blue; - } - - public void setDestination(int xDest, int yDest, int zDest) - { - this.xDest = xDest; - this.yDest = yDest; - this.zDest = zDest; - } + @Override + public void setThrower(Entity entity) + { + if (entity instanceof EntityLivingBase) + this.shootingEntity = (EntityLivingBase) entity; + + } + + public void setColour(float red, float green, float blue) + { + this.colourRed = red; + this.colourGreen = green; + this.colourBlue = blue; + } + + public void setDestination(int xDest, int yDest, int zDest) + { + this.xDest = xDest; + this.yDest = yDest; + this.zDest = zDest; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java index 569aaf0b..6f48e648 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java @@ -50,22 +50,8 @@ public class ExplosionProjectile extends EnergyBlastProjectile } worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage); - //this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { -// for(int i=-1;i<=1;i++) -// { -// for(int j=-1;j<=1;j++) -// { -// for(int k=-1;k<=1;k++) -// { -// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) -// { -// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); -// } -// } -// } -// } worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage); } @@ -81,12 +67,8 @@ public class ExplosionProjectile extends EnergyBlastProjectile this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); if (((EntityLivingBase) mop).isImmuneToFire()) { doDamage((int) (projectileDamage), mop); @@ -95,13 +77,10 @@ public class ExplosionProjectile extends EnergyBlastProjectile doDamage(projectileDamage, mop); } } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) { - //worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID); } spawnHitParticles("magicCrit", 8); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java index 7ab8f052..4ae7377c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; -import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; @@ -68,8 +67,6 @@ public class FireProjectile extends EnergyBlastProjectile } } } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } this.setDead(); @@ -84,10 +81,8 @@ public class FireProjectile extends EnergyBlastProjectile this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); ((EntityLivingBase) mop).setFire(50); ((EntityLivingBase) mop).setRevengeTarget(shootingEntity); @@ -100,8 +95,6 @@ public class FireProjectile extends EnergyBlastProjectile ((EntityLivingBase) mop).hurtResistantTime = 0; } } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java index 062ccbf7..3fc5e2ac 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java @@ -1,12 +1,11 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class HolyProjectile extends EnergyBlastProjectile { @@ -54,19 +53,6 @@ public class HolyProjectile extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { -// for(int i=-1;i<=1;i++) -// { -// for(int j=-1;j<=1;j++) -// { -// for(int k=-1;k<=1;k++) -// { -// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) -// { -// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); -// } -// } -// } -// } } this.setDead(); @@ -81,12 +67,8 @@ public class HolyProjectile extends EnergyBlastProjectile this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); if (((EntityLivingBase) mop).isEntityUndead()) { doDamage((int) (projectileDamage * 2), mop); @@ -95,13 +77,10 @@ public class HolyProjectile extends EnergyBlastProjectile doDamage(projectileDamage, mop); } } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) { - //worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID); } spawnHitParticles("magicCrit", 8); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java index 06867d81..0861befa 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java @@ -1,5 +1,7 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; @@ -7,9 +9,6 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class IceProjectile extends EnergyBlastProjectile { @@ -57,22 +56,7 @@ public class IceProjectile extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { -// for(int i=-1;i<=1;i++) -// { -// for(int j=-1;j<=1;j++) -// { -// for(int k=-1;k<=1;k++) -// { -// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) -// { -// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); -// } -// } -// } -// } - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } - this.setDead(); } @@ -85,12 +69,8 @@ public class IceProjectile extends EnergyBlastProjectile this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); if (((EntityLivingBase) mop).isImmuneToFire()) { doDamage((int) (projectileDamage * 2), mop); @@ -101,8 +81,6 @@ public class IceProjectile extends EnergyBlastProjectile ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 1)); } } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java index 106cf420..fe521b4c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.effect.EntityLightningBolt; @@ -7,7 +8,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class LightningBoltProjectile extends EnergyBlastProjectile { @@ -68,23 +68,11 @@ public class LightningBoltProjectile extends EnergyBlastProjectile { if (mop == shootingEntity && ticksInAir > 3) { - //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); -// if(((EntityLivingBase)mop).isEntityUndead()) -// { -// doDamage((int)(projectileDamage*2),mop); -// }else -// { -// doDamage(projectileDamage, mop); -// } if (causeLightning) { this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, ((EntityLivingBase) mop).posX, ((EntityLivingBase) mop).posY, ((EntityLivingBase) mop).posZ)); @@ -92,11 +80,7 @@ public class LightningBoltProjectile extends EnergyBlastProjectile { doDamage(projectileDamage, mop); } - - //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } spawnHitParticles("magicCrit", 8); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java index 2c944959..cc9cf06c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; @@ -8,8 +9,6 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class MudProjectile extends EnergyBlastProjectile { @@ -72,23 +71,11 @@ public class MudProjectile extends EnergyBlastProjectile { if (mop == shootingEntity && ticksInAir > 3) { - //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); -// if(((EntityLivingBase)mop).isEntityUndead()) -// { -// doDamage((int)(projectileDamage*2),mop); -// }else -// { -// doDamage(projectileDamage, mop); -// } if (doesBlindness) { ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 0)); @@ -96,12 +83,8 @@ public class MudProjectile extends EnergyBlastProjectile { ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); } - doDamage(projectileDamage, mop); - //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } spawnHitParticles("magicCrit", 8); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java index c448fadf..48ea1bf5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java @@ -1,5 +1,7 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayerMP; @@ -9,12 +11,10 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; public class TeleportProjectile extends EnergyBlastProjectile { - private boolean isEntityTeleport; //True if the entity firing teleports on hit + private boolean isEntityTeleport; public TeleportProjectile(World par1World) { @@ -75,8 +75,7 @@ public class TeleportProjectile extends EnergyBlastProjectile { EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity; - if(entityplayermp.worldObj == this.worldObj) - //if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj) + if (entityplayermp.worldObj == this.worldObj) { EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); @@ -86,10 +85,7 @@ public class TeleportProjectile extends EnergyBlastProjectile { shootingEntity.mountEntity((Entity) null); } - shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); -// this.getThrower().fallDistance = 0.0F; -// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); } } } @@ -104,34 +100,19 @@ public class TeleportProjectile extends EnergyBlastProjectile { if (mop == shootingEntity && ticksInAir > 3) { - //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); -// if(((EntityLivingBase)mop).isEntityUndead()) -// { -// doDamage((int)(projectileDamage*2),mop); -// }else -// { -// doDamage(projectileDamage, mop); -// } if (isEntityTeleport) { if (shootingEntity != null && shootingEntity instanceof EntityPlayerMP) { EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity; - - if(entityplayermp.worldObj == this.worldObj) - //if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj) + if (entityplayermp.worldObj == this.worldObj) { EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); - if (!MinecraftForge.EVENT_BUS.post(event)) { if (shootingEntity.isRiding()) @@ -140,42 +121,14 @@ public class TeleportProjectile extends EnergyBlastProjectile } shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); -// this.getThrower().fallDistance = 0.0F; -// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); } } } } else { -// int x = (int)this.posX + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); -// int y = (int)this.posY + mop.worldObj.rand.nextInt(10) - mop.worldObj.rand.nextInt(10); -// int z = (int)this.posZ + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); -// -// boolean bool = false; -// int i = 0; -// -// while(!bool&&i<100) -// { -// if(worldObj.isAirBlock(x, y, z)||worldObj.isAirBlock(x, y+1, z)) -// { -// ((EntityLivingBase) mop).setPositionAndUpdate(x, y, z); -// bool=true; -// }else -// { -// x = (int)this.posX + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); -// y = (int)this.posY + mop.worldObj.rand.nextInt(10) - mop.worldObj.rand.nextInt(10); -// z = (int)this.posZ + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); -// i++; -// } -// } SpellTeleport.teleportRandomly((EntityLivingBase) mop, 64); } - - //doDamage(projectileDamage, mop); - //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } spawnHitParticles("magicCrit", 8); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java index 8fa7704c..4ec890ff 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java @@ -1,14 +1,13 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class WaterProjectile extends EnergyBlastProjectile { @@ -61,23 +60,11 @@ public class WaterProjectile extends EnergyBlastProjectile { if (mop == shootingEntity && ticksInAir > 3) { - //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); -// if(((EntityLivingBase)mop).isEntityUndead()) -// { -// doDamage((int)(projectileDamage*2),mop); -// }else -// { -// doDamage(projectileDamage, mop); -// } if (((EntityLivingBase) mop).isImmuneToFire()) { doDamage(projectileDamage * 2, mop); @@ -87,11 +74,7 @@ public class WaterProjectile extends EnergyBlastProjectile doDamage(projectileDamage, mop); ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 0)); } - - //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } spawnHitParticles("magicCrit", 8); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java index 46fa01d7..aac4552a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class WindGustProjectile extends EnergyBlastProjectile { @@ -48,19 +48,6 @@ public class WindGustProjectile extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { -// for(int i=-1;i<=1;i++) -// { -// for(int j=-1;j<=1;j++) -// { -// for(int k=-1;k<=1;k++) -// { -// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) -// { -// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); -// } -// } -// } -// } } this.setDead(); @@ -71,30 +58,15 @@ public class WindGustProjectile extends EnergyBlastProjectile { if (mop == shootingEntity && ticksInAir > 3) { - //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); this.setDead(); } else { - //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - //((EntityLivingBase)mop).setFire(50); - //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); -// if(((EntityLivingBase)mop).isEntityUndead()) -// { -// doDamage((int)(projectileDamage*2),mop); -// }else -// { -// doDamage(projectileDamage, mop); -// } ((EntityLivingBase) mop).motionX = this.motionX * 2; ((EntityLivingBase) mop).motionY = 1.5; ((EntityLivingBase) mop).motionZ = this.motionZ * 2; - //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); } - - //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); } spawnHitParticles("magicCrit", 8); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java index fdf6e3c8..f1b28c48 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.harvest; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; @@ -10,120 +9,121 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; -import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; + +import java.util.List; public class BloodMagicHarvestHandler implements IHarvestHandler { - public boolean canHandleBlock(Block block) - { - return block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes || block == Blocks.nether_wart; - } + public boolean canHandleBlock(Block block) + { + return block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes || block == Blocks.nether_wart; + } - public int getHarvestMeta(Block block) - { - if(block == Blocks.wheat) - { - return 7; - } - if(block == Blocks.carrots) - { - return 7; - } - if(block == Blocks.potatoes) - { - return 7; - } - if(block == Blocks.nether_wart) - { - return 3; - } - return 7; - } + public int getHarvestMeta(Block block) + { + if (block == Blocks.wheat) + { + return 7; + } + if (block == Blocks.carrots) + { + return 7; + } + if (block == Blocks.potatoes) + { + return 7; + } + if (block == Blocks.nether_wart) + { + return 3; + } + return 7; + } - @Override - public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) - { - if(!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) - { - return false; - } - - IPlantable seed = this.getSeedItem(block); - - if(seed == null) - { - return false; - } - - int fortune = 0; - - List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); - boolean foundAndRemovedSeed = false; - - for(ItemStack stack : list) - { - if(stack == null) - { - continue; - } - - Item item = stack.getItem(); - if(item == seed) - { - int itemSize = stack.stackSize; - if(itemSize > 1) - { - stack.stackSize--; - foundAndRemovedSeed = true; - break; - }else if(itemSize == 1) - { - list.remove(stack); - foundAndRemovedSeed = true; - break; - } - } - } - - if(foundAndRemovedSeed) - { - int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord); - Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord); - - world.func_147480_a(xCoord, yCoord, zCoord, false); + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if (!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) + { + return false; + } - world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3); - - for(ItemStack stack : list) - { - EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); - - world.spawnEntityInWorld(itemEnt); - } - } - - return false; - } + IPlantable seed = this.getSeedItem(block); - public IPlantable getSeedItem(Block block) - { - if(block == Blocks.wheat) - { - return (IPlantable) Items.wheat_seeds; - } - if(block == Blocks.carrots) - { - return (IPlantable) Items.carrot; - } - if(block == Blocks.potatoes) - { - return (IPlantable) Items.potato; - } - if(block == Blocks.nether_wart) - { - return (IPlantable) Items.nether_wart; - } - - return null; - } + if (seed == null) + { + return false; + } + + int fortune = 0; + + List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); + boolean foundAndRemovedSeed = false; + + for (ItemStack stack : list) + { + if (stack == null) + { + continue; + } + + Item item = stack.getItem(); + if (item == seed) + { + int itemSize = stack.stackSize; + if (itemSize > 1) + { + stack.stackSize--; + foundAndRemovedSeed = true; + break; + } else if (itemSize == 1) + { + list.remove(stack); + foundAndRemovedSeed = true; + break; + } + } + } + + if (foundAndRemovedSeed) + { + int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord); + Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord); + + world.func_147480_a(xCoord, yCoord, zCoord, false); + + world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3); + + for (ItemStack stack : list) + { + EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); + + world.spawnEntityInWorld(itemEnt); + } + } + + return false; + } + + public IPlantable getSeedItem(Block block) + { + if (block == Blocks.wheat) + { + return (IPlantable) Items.wheat_seeds; + } + if (block == Blocks.carrots) + { + return (IPlantable) Items.carrot; + } + if (block == Blocks.potatoes) + { + return (IPlantable) Items.potato; + } + if (block == Blocks.nether_wart) + { + return (IPlantable) Items.nether_wart; + } + + return null; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java index e80e3e4f..3f948080 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java @@ -1,39 +1,32 @@ package WayofTime.alchemicalWizardry.common.harvest; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; public class CactusReedHarvestHandler implements IHarvestHandler { - public boolean canHandleBlock(Block block) - { - return block == Blocks.reeds || block == Blocks.cactus; - } + public boolean canHandleBlock(Block block) + { + return block == Blocks.reeds || block == Blocks.cactus; + } - @Override - public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) - { - if(!this.canHandleBlock(block)) - { - return false; - } - - if(world.getBlock(xCoord, yCoord-1, zCoord) != block || world.getBlock(xCoord, yCoord-2, zCoord) != block) - { - return false; - } + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if (!this.canHandleBlock(block)) + { + return false; + } - world.func_147480_a(xCoord, yCoord, zCoord, true); + if (world.getBlock(xCoord, yCoord - 1, zCoord) != block || world.getBlock(xCoord, yCoord - 2, zCoord) != block) + { + return false; + } - return true; - } + world.func_147480_a(xCoord, yCoord, zCoord, true); + + return true; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java index 42fa189c..a5d4b036 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java @@ -1,74 +1,67 @@ package WayofTime.alchemicalWizardry.common.harvest; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; -import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; public class GenericPamSeedlessFruitHarvestHandler implements IHarvestHandler { - public Block harvestBlock; - public int harvestMeta; - public int resetMeta; - - public GenericPamSeedlessFruitHarvestHandler(String block, int harvestMeta, int resetMeta) - { - this.harvestBlock = getBlockForString(block); - this.harvestMeta = harvestMeta; - this.resetMeta = resetMeta; - } - - public boolean isHarvesterValid() - { - return harvestBlock != null; - } - - public static Block getBlockForString(String str) - { - String[] parts = str.split(":"); - String modId = parts[0]; - String name = parts[1]; - return GameRegistry.findBlock(modId, name); - } - - public static Item getItemForString(String str) - { - String[] parts = str.split(":"); - String modId = parts[0]; - String name = parts[1]; - return GameRegistry.findItem(modId, name); - } - - public boolean canHandleBlock(Block block) - { - return block == harvestBlock; - } + public Block harvestBlock; + public int harvestMeta; + public int resetMeta; - public int getHarvestMeta(Block block) - { - return harvestMeta; - } - - @Override - public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) - { - if(!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) - { - return false; - } - - world.func_147480_a(xCoord, yCoord, zCoord, true); - - world.setBlock(xCoord, yCoord, zCoord, harvestBlock, resetMeta, 3); - - return true; - } + public GenericPamSeedlessFruitHarvestHandler(String block, int harvestMeta, int resetMeta) + { + this.harvestBlock = getBlockForString(block); + this.harvestMeta = harvestMeta; + this.resetMeta = resetMeta; + } + + public boolean isHarvesterValid() + { + return harvestBlock != null; + } + + public static Block getBlockForString(String str) + { + String[] parts = str.split(":"); + String modId = parts[0]; + String name = parts[1]; + return GameRegistry.findBlock(modId, name); + } + + public static Item getItemForString(String str) + { + String[] parts = str.split(":"); + String modId = parts[0]; + String name = parts[1]; + return GameRegistry.findItem(modId, name); + } + + public boolean canHandleBlock(Block block) + { + return block == harvestBlock; + } + + public int getHarvestMeta(Block block) + { + return harvestMeta; + } + + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if (!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) + { + return false; + } + + world.func_147480_a(xCoord, yCoord, zCoord, true); + + world.setBlock(xCoord, yCoord, zCoord, harvestBlock, resetMeta, 3); + + return true; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java index daea729c..0fbd69e1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java @@ -1,139 +1,137 @@ package WayofTime.alchemicalWizardry.common.harvest; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; -import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; + +import java.util.List; public class GenericSeededHarvestHandler implements IHarvestHandler { - public Block harvestBlock; - public int harvestMeta; - public IPlantable harvestSeed; - - public GenericSeededHarvestHandler(String block, int meta, String seed) - { - harvestBlock = getBlockForString(block); - harvestMeta = meta; - Item testSeed = getItemForString(seed); - if(testSeed instanceof IPlantable) - { - harvestSeed = (IPlantable)testSeed; - }else - { - harvestSeed = null; - } - } - - public boolean isHarvesterValid() - { - return harvestBlock != null && harvestSeed != null; - } - - public static Block getBlockForString(String str) - { - String[] parts = str.split(":"); - String modId = parts[0]; - String name = parts[1]; - return GameRegistry.findBlock(modId, name); - } - - public static Item getItemForString(String str) - { - String[] parts = str.split(":"); - String modId = parts[0]; - String name = parts[1]; - return GameRegistry.findItem(modId, name); - } - - public boolean canHandleBlock(Block block) - { - return block == harvestBlock; - } + public Block harvestBlock; + public int harvestMeta; + public IPlantable harvestSeed; - public int getHarvestMeta(Block block) - { - return harvestMeta; - } - - @Override - public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) - { - if(!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) - { - return false; - } - - IPlantable seed = this.getSeedItem(block); - - if(seed == null) - { - world.func_147480_a(xCoord, yCoord, zCoord, true); + public GenericSeededHarvestHandler(String block, int meta, String seed) + { + harvestBlock = getBlockForString(block); + harvestMeta = meta; + Item testSeed = getItemForString(seed); + if (testSeed instanceof IPlantable) + { + harvestSeed = (IPlantable) testSeed; + } else + { + harvestSeed = null; + } + } - return true; - }else - { - int fortune = 0; - - List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); - boolean foundAndRemovedSeed = false; - - for(ItemStack stack : list) - { - if(stack == null) - { - continue; - } - - Item item = stack.getItem(); - if(item == seed) - { - int itemSize = stack.stackSize; - if(itemSize > 1) - { - stack.stackSize--; - foundAndRemovedSeed = true; - break; - }else if(itemSize == 1) - { - list.remove(stack); - foundAndRemovedSeed = true; - break; - } - } - } - - if(foundAndRemovedSeed) - { - int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord); - Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord); - - world.func_147480_a(xCoord, yCoord, zCoord, false); + public boolean isHarvesterValid() + { + return harvestBlock != null && harvestSeed != null; + } - world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3); - - for(ItemStack stack : list) - { - EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); - - world.spawnEntityInWorld(itemEnt); - } - } - - return false; - } - } - - public IPlantable getSeedItem(Block block) - { - return harvestSeed; - } + public static Block getBlockForString(String str) + { + String[] parts = str.split(":"); + String modId = parts[0]; + String name = parts[1]; + return GameRegistry.findBlock(modId, name); + } + + public static Item getItemForString(String str) + { + String[] parts = str.split(":"); + String modId = parts[0]; + String name = parts[1]; + return GameRegistry.findItem(modId, name); + } + + public boolean canHandleBlock(Block block) + { + return block == harvestBlock; + } + + public int getHarvestMeta(Block block) + { + return harvestMeta; + } + + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if (!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) + { + return false; + } + + IPlantable seed = this.getSeedItem(block); + + if (seed == null) + { + world.func_147480_a(xCoord, yCoord, zCoord, true); + + return true; + } else + { + int fortune = 0; + + List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); + boolean foundAndRemovedSeed = false; + + for (ItemStack stack : list) + { + if (stack == null) + { + continue; + } + + Item item = stack.getItem(); + if (item == seed) + { + int itemSize = stack.stackSize; + if (itemSize > 1) + { + stack.stackSize--; + foundAndRemovedSeed = true; + break; + } else if (itemSize == 1) + { + list.remove(stack); + foundAndRemovedSeed = true; + break; + } + } + } + + if (foundAndRemovedSeed) + { + int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord); + Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord); + + world.func_147480_a(xCoord, yCoord, zCoord, false); + + world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3); + + for (ItemStack stack : list) + { + EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); + + world.spawnEntityInWorld(itemEnt); + } + } + + return false; + } + } + + public IPlantable getSeedItem(Block block) + { + return harvestSeed; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java index 4ea2b7dc..485005d4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java @@ -1,34 +1,25 @@ package WayofTime.alchemicalWizardry.common.harvest; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; public class GourdHarvestHandler implements IHarvestHandler { - public boolean canHandleBlock(Block block) - { - return block == Blocks.melon_block || block == Blocks.pumpkin; - } + public boolean canHandleBlock(Block block) + { + return block == Blocks.melon_block || block == Blocks.pumpkin; + } - @Override - public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) - { - if(!this.canHandleBlock(block)) - { - return false; - } - - world.func_147480_a(xCoord, yCoord, zCoord, true); - - return true; - } + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if (!this.canHandleBlock(block)) + { + return false; + } + world.func_147480_a(xCoord, yCoord, zCoord, true); + return true; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java index feff8da5..30b4df24 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java @@ -2,124 +2,124 @@ package WayofTime.alchemicalWizardry.common.harvest; import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; -public class PamHarvestCompatRegistry +public class PamHarvestCompatRegistry { - public static void registerPamHandlers() - { - registerSeededHandler("blackberry", 7); - registerSeededHandler("blueberry", 7); - registerSeededHandler("candleberry", 7); - registerSeededHandler("raspberry", 7); - registerSeededHandler("strawberry", 7); - registerSeededHandler("cactusfruit", 7); - registerSeededHandler("asparagus", 7); - registerSeededHandler("barley", 7); - registerSeededHandler("oats", 7); - registerSeededHandler("rye", 7); - registerSeededHandler("corn", 7); - registerSeededHandler("bambooshoot", 7); - registerSeededHandler("cantaloupe", 7); - registerSeededHandler("cucumber", 7); - registerSeededHandler("windersquash", 7); - registerSeededHandler("zucchini", 7); - registerSeededHandler("beat", 7); - registerSeededHandler("onion", 7); - registerSeededHandler("parsnip", 7); - registerSeededHandler("peanut", 7); - registerSeededHandler("radish", 7); - registerSeededHandler("rutabaga", 7); - registerSeededHandler("sweetpotato", 7); - registerSeededHandler("turnip", 7); - registerSeededHandler("rhubarb", 7); - registerSeededHandler("celery", 7); - registerSeededHandler("garlic", 7); - registerSeededHandler("ginger", 7); - registerSeededHandler("spiceleaf", 7); - registerSeededHandler("tealeaf", 7); - registerSeededHandler("coffeebean", 7); - registerSeededHandler("mustardseeds", 7); - registerSeededHandler("brocolli", 7); - registerSeededHandler("cauliflower", 7); - registerSeededHandler("leek", 7); - registerSeededHandler("lettuce", 7); - registerSeededHandler("scallion", 7); - registerSeededHandler("artichoke", 7); - registerSeededHandler("brusselsprout", 7); - registerSeededHandler("cabbage", 7); - registerSeededHandler("whitemushroom", 7); - registerSeededHandler("bean", 7); - registerSeededHandler("soybean", 7); - registerSeededHandler("bellpepper", 7); - registerSeededHandler("chili", 7); - registerSeededHandler("eggplant", 7); - registerSeededHandler("pamokra", 7); - registerSeededHandler("peas", 7); - registerSeededHandler("tomato", 7); - registerSeededHandler("cotton", 7); - registerSeededHandler("pineapple", 7); - registerSeededHandler("grape", 7); - registerSeededHandler("kiwi", 7); - registerSeededHandler("cranberry", 7); - registerSeededHandler("rice", 7); - registerSeededHandler("seaweed", 7); + public static void registerPamHandlers() + { + registerSeededHandler("blackberry", 7); + registerSeededHandler("blueberry", 7); + registerSeededHandler("candleberry", 7); + registerSeededHandler("raspberry", 7); + registerSeededHandler("strawberry", 7); + registerSeededHandler("cactusfruit", 7); + registerSeededHandler("asparagus", 7); + registerSeededHandler("barley", 7); + registerSeededHandler("oats", 7); + registerSeededHandler("rye", 7); + registerSeededHandler("corn", 7); + registerSeededHandler("bambooshoot", 7); + registerSeededHandler("cantaloupe", 7); + registerSeededHandler("cucumber", 7); + registerSeededHandler("windersquash", 7); + registerSeededHandler("zucchini", 7); + registerSeededHandler("beat", 7); + registerSeededHandler("onion", 7); + registerSeededHandler("parsnip", 7); + registerSeededHandler("peanut", 7); + registerSeededHandler("radish", 7); + registerSeededHandler("rutabaga", 7); + registerSeededHandler("sweetpotato", 7); + registerSeededHandler("turnip", 7); + registerSeededHandler("rhubarb", 7); + registerSeededHandler("celery", 7); + registerSeededHandler("garlic", 7); + registerSeededHandler("ginger", 7); + registerSeededHandler("spiceleaf", 7); + registerSeededHandler("tealeaf", 7); + registerSeededHandler("coffeebean", 7); + registerSeededHandler("mustardseeds", 7); + registerSeededHandler("brocolli", 7); + registerSeededHandler("cauliflower", 7); + registerSeededHandler("leek", 7); + registerSeededHandler("lettuce", 7); + registerSeededHandler("scallion", 7); + registerSeededHandler("artichoke", 7); + registerSeededHandler("brusselsprout", 7); + registerSeededHandler("cabbage", 7); + registerSeededHandler("whitemushroom", 7); + registerSeededHandler("bean", 7); + registerSeededHandler("soybean", 7); + registerSeededHandler("bellpepper", 7); + registerSeededHandler("chili", 7); + registerSeededHandler("eggplant", 7); + registerSeededHandler("pamokra", 7); + registerSeededHandler("peas", 7); + registerSeededHandler("tomato", 7); + registerSeededHandler("cotton", 7); + registerSeededHandler("pineapple", 7); + registerSeededHandler("grape", 7); + registerSeededHandler("kiwi", 7); + registerSeededHandler("cranberry", 7); + registerSeededHandler("rice", 7); + registerSeededHandler("seaweed", 7); - registerFruitHandler("apple", 7, 0); - registerFruitHandler("Almond", 7, 0); - registerFruitHandler("Apricot", 7, 0); - registerFruitHandler("Avocado", 7, 0); - registerFruitHandler("Banana", 7, 0); - registerFruitHandler("Cashew", 7, 0); - registerFruitHandler("Cherry", 7, 0); - registerFruitHandler("Chestnut", 7, 0); - registerFruitHandler("Cinnamon", 7, 0); - registerFruitHandler("Coconut", 7, 0); - registerFruitHandler("Date", 7, 0); - registerFruitHandler("Dragonfruit", 7, 0); - registerFruitHandler("Durian", 7, 0); - registerFruitHandler("Fig", 7, 0); - registerFruitHandler("Grapefruit", 7, 0); - registerFruitHandler("Lemon", 7, 0); - registerFruitHandler("Lime", 7, 0); - registerFruitHandler("Maple", 7, 0); - registerFruitHandler("Mango", 7, 0); - registerFruitHandler("Nutmeg", 7, 0); - registerFruitHandler("Olive", 7, 0); - registerFruitHandler("Orange", 7, 0); - registerFruitHandler("Papaya", 7, 0); - registerFruitHandler("Paperbark", 7, 0); - registerFruitHandler("Peach", 7, 0); - registerFruitHandler("Pear", 7, 0); - registerFruitHandler("Pecan", 7, 0); - registerFruitHandler("Peppercorn", 7, 0); - registerFruitHandler("Persimmon", 7, 0); - registerFruitHandler("Pistachio", 7, 0); - registerFruitHandler("Plum", 7, 0); - registerFruitHandler("Pomegranate", 7, 0); - registerFruitHandler("Starfruit", 7, 0); - registerFruitHandler("Vanillabean", 7, 0); - registerFruitHandler("Walnut", 7, 0); - } - - public static void registerSeededHandler(String name, int meta) - { - String block = "harvestcraft:pam" + name + "Crop"; - String seed = "harvestcraft:" + name + "Item"; - - GenericSeededHarvestHandler handler = new GenericSeededHarvestHandler(block, meta, seed); - if(handler.isHarvesterValid()) - { - HarvestRegistry.registerHarvestHandler(handler); - } - } - - public static void registerFruitHandler(String name, int harvestMeta, int resetMeta) - { - String block = "harvestcraft:pam" + name; - - GenericPamSeedlessFruitHarvestHandler handler = new GenericPamSeedlessFruitHarvestHandler(block, harvestMeta, resetMeta); - if(handler.isHarvesterValid()) - { - HarvestRegistry.registerHarvestHandler(handler); - } - } + registerFruitHandler("apple", 7, 0); + registerFruitHandler("Almond", 7, 0); + registerFruitHandler("Apricot", 7, 0); + registerFruitHandler("Avocado", 7, 0); + registerFruitHandler("Banana", 7, 0); + registerFruitHandler("Cashew", 7, 0); + registerFruitHandler("Cherry", 7, 0); + registerFruitHandler("Chestnut", 7, 0); + registerFruitHandler("Cinnamon", 7, 0); + registerFruitHandler("Coconut", 7, 0); + registerFruitHandler("Date", 7, 0); + registerFruitHandler("Dragonfruit", 7, 0); + registerFruitHandler("Durian", 7, 0); + registerFruitHandler("Fig", 7, 0); + registerFruitHandler("Grapefruit", 7, 0); + registerFruitHandler("Lemon", 7, 0); + registerFruitHandler("Lime", 7, 0); + registerFruitHandler("Maple", 7, 0); + registerFruitHandler("Mango", 7, 0); + registerFruitHandler("Nutmeg", 7, 0); + registerFruitHandler("Olive", 7, 0); + registerFruitHandler("Orange", 7, 0); + registerFruitHandler("Papaya", 7, 0); + registerFruitHandler("Paperbark", 7, 0); + registerFruitHandler("Peach", 7, 0); + registerFruitHandler("Pear", 7, 0); + registerFruitHandler("Pecan", 7, 0); + registerFruitHandler("Peppercorn", 7, 0); + registerFruitHandler("Persimmon", 7, 0); + registerFruitHandler("Pistachio", 7, 0); + registerFruitHandler("Plum", 7, 0); + registerFruitHandler("Pomegranate", 7, 0); + registerFruitHandler("Starfruit", 7, 0); + registerFruitHandler("Vanillabean", 7, 0); + registerFruitHandler("Walnut", 7, 0); + } + + public static void registerSeededHandler(String name, int meta) + { + String block = "harvestcraft:pam" + name + "Crop"; + String seed = "harvestcraft:" + name + "Item"; + + GenericSeededHarvestHandler handler = new GenericSeededHarvestHandler(block, meta, seed); + if (handler.isHarvesterValid()) + { + HarvestRegistry.registerHarvestHandler(handler); + } + } + + public static void registerFruitHandler(String name, int harvestMeta, int resetMeta) + { + String block = "harvestcraft:pam" + name; + + GenericPamSeedlessFruitHarvestHandler handler = new GenericPamSeedlessFruitHarvestHandler(block, harvestMeta, resetMeta); + if (handler.isHarvesterValid()) + { + HarvestRegistry.registerHarvestHandler(handler); + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java index dd3e4a69..a847bca8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java @@ -1,13 +1,13 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; + +import java.util.List; public class AWBaseItems extends Item { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java index 6c6c6fc2..63de5092 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - -import javax.swing.Icon; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -13,13 +13,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; - import org.lwjgl.input.Keyboard; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; public class ActivationCrystal extends EnergyItems { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java index 9f20b743..612ee865 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class AirScribeTool extends ScribeTool { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java index 3bc4a2eb..ac3aa56c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class ApprenticeBloodOrb extends EnergyBattery { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java index 6bd83098..065781e3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class ArchmageBloodOrb extends EnergyBattery { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java index 1b42a0de..5266b685 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java @@ -1,9 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - -import javax.swing.Icon; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -12,9 +11,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ArmourInhibitor extends EnergyItems { @@ -26,7 +24,6 @@ public class ArmourInhibitor extends EnergyItems { super(); this.maxStackSize = 1; - //setMaxDamage(1000); setEnergyUsed(0); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -92,23 +89,6 @@ public class ArmourInhibitor extends EnergyItems } } -// @Override -// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) -// { -// -// if(applyBonemeal(par1ItemStack,par3World,par4,par5,par6,par2EntityPlayer)) -// { -// if (par3World.isRemote) -// { -// par3World.playAuxSFX(2005, par4, par5, par6, 0); -// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); -// return true; -// } -// return true; -// } -// return false; -// } - @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { @@ -134,7 +114,6 @@ public class ArmourInhibitor extends EnergyItems if (!par3EntityPlayer.capabilities.isCreativeMode) { - //EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); } } else { @@ -163,7 +142,6 @@ public class ArmourInhibitor extends EnergyItems { if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) { - //EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer)par3Entity, getEnergyUsed()); } //TODO Do stuff @@ -172,44 +150,4 @@ public class ArmourInhibitor extends EnergyItems return; } - -// @Override -// public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { -// -// int range = 5; -// int verticalRange = 2; -// int posX = (int)Math.round(player.posX-0.5f); -// int posY = (int)player.posY; -// int posZ = (int)Math.round(player.posZ-0.5f); -// -// for(int ix=posX-range;ix<=posX+range;ix++) -// { -// for(int iz=posZ-range;iz<=posZ+range;iz++) -// { -// for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++) -// { -// int id = world.getBlockId(ix, iy, iz); -// Block block = Block.blocksList[id]; -// if(block instanceof IPlantable) -// { -// if(world.rand.nextInt(10)==0) -// block.updateTick(world, ix, iy, iz, world.rand); -// } -// } -// } -// } -// -// } - -// @Override -// public boolean isUpgrade() { -// // TODO Auto-generated method stub -// return true; -// } -// -// @Override -// public int getEnergyForTenSeconds() { -// // TODO Auto-generated method stub -// return 50; -// } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java index 58c004d3..0d90060c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -9,10 +11,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class BlankSpell extends EnergyItems { @@ -61,7 +61,6 @@ public class BlankSpell extends EnergyItems if (!par2World.isRemote) { - //World world = MinecraftServer.getServer().worldServers[getDimensionID(par1ItemStack)]; World world = DimensionManager.getWorld(getDimensionID(par1ItemStack)); if (world != null) @@ -92,13 +91,7 @@ public class BlankSpell extends EnergyItems { return par1ItemStack; } - par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -// if (!par2World.isRemote) -// { -// //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); -// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10)); -// } return par1ItemStack; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java index 43b5e5b8..eb79625d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java @@ -1,15 +1,15 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; public class BloodShard extends Item implements ArmourUpgrade { @@ -17,7 +17,6 @@ public class BloodShard extends Item implements ArmourUpgrade { super(); this.maxStackSize = 64; - //setEnergyUsed(100); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -40,8 +39,8 @@ public class BloodShard extends Item implements ArmourUpgrade public int getBloodShardLevel() { - if (this.equals(ModItems.weakBloodShard)) - { + if (this.equals(ModItems.weakBloodShard)) + { return 1; } else if (this.equals(ModItems.demonBloodShard)) { @@ -54,20 +53,17 @@ public class BloodShard extends Item implements ArmourUpgrade @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - // TODO Auto-generated method stub } @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return false; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 0; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodboundSword.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodboundSword.java index 07b4ac20..bbd150f6 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodboundSword.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BloodboundSword.java @@ -1,7 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -10,14 +11,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class BloodboundSword extends EnergyItems { private float weaponDamage; - //private int maxMode = 3; private NBTTagCompound data; public BloodboundSword(int id) @@ -45,20 +44,12 @@ public class BloodboundSword extends EnergyItems if (!this.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed())) { - //this.damagePlayer(null, (EntityPlayer)par3EntityLivingBase, (this.getEnergyUsed() + 99) / 100); } } return true; } - /* - public int getDamageVsEntity(Entity par1Entity) - { - return this.weaponDamage; - } - */ - public float func_82803_g() { return 4.0F; @@ -93,11 +84,4 @@ public class BloodboundSword extends EnergyItems { return false; } - -// public Multimap func_111205_h() -// { -// Multimap multimap = super.func_111205_h(); -// multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.weaponDamage, 0)); -// return multimap; -// } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundArmour.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundArmour.java index 1baaab9a..3f7d006a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundArmour.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundArmour.java @@ -1,7 +1,15 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.Optional.Interface; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; @@ -22,26 +30,18 @@ import net.minecraftforge.common.util.Constants; import thaumcraft.api.IGoggles; import thaumcraft.api.IRunicArmor; import thaumcraft.api.nodes.IRevealer; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.Optional.Interface; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -@Optional.InterfaceList(value = {@Interface(iface="thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface="thaumcraft.api.IGoggles", modid = "Thaumcraft"), @Interface(iface="thaumcraft.api.IRunicArmor", modid = "Thaumcraft")}) -public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialArmor,IBindable ,IRevealer, IGoggles, IRunicArmor +import java.util.List; + +@Optional.InterfaceList(value = {@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IRunicArmor", modid = "Thaumcraft")}) +public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor { private static int invSize = 9; private static IIcon helmetIcon; private static IIcon plateIcon; private static IIcon leggingsIcon; private static IIcon bootsIcon; - + private static final boolean tryComplexRendering = true; public BoundArmour(int armorType) @@ -54,70 +54,70 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr ModelBiped model1 = null; ModelBiped model2 = null; ModelBiped model = null; - + @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - if(tryComplexRendering) - { - int type = ((ItemArmor)itemStack.getItem()).armorType; - if(this.model1 == null) - { - this.model1 = new ModelOmegaArmour(1.0f, true, true, false, true); - } - if(this.model2 == null) - { - this.model2 = new ModelOmegaArmour(0.5f, false, false, true, false); - } - - if(type == 1 || type == 3 || type == 0) - { - this.model = model1; - }else - { - this.model = model2; - } - - if(this.model != null) - { - this.model.bipedHead.showModel = (type == 0); - this.model.bipedHeadwear.showModel = (type == 0); - this.model.bipedBody.showModel = ((type == 1) || (type == 2)); - this.model.bipedLeftArm.showModel = (type == 1); - this.model.bipedRightArm.showModel = (type == 1); - this.model.bipedLeftLeg.showModel = (type == 2 || type == 3); - this.model.bipedRightLeg.showModel = (type == 2 || type == 3); - this.model.isSneak = entityLiving.isSneaking(); - - this.model.isRiding = entityLiving.isRiding(); - this.model.isChild = entityLiving.isChild(); - - this.model.aimedBow = false; - this.model.heldItemRight = (entityLiving.getHeldItem() != null ? 1 : 0); - - if ((entityLiving instanceof EntityPlayer)) - { - if (((EntityPlayer)entityLiving).getItemInUseDuration() > 0) - { - EnumAction enumaction = ((EntityPlayer)entityLiving).getItemInUse().getItemUseAction(); - if (enumaction == EnumAction.block) - { - this.model.heldItemRight = 3; - } else if (enumaction == EnumAction.bow) - { - this.model.aimedBow = true; - } - } - } - } - - return model; - - }else - { - return super.getArmorModel(entityLiving, itemStack, armorSlot); - } + if (tryComplexRendering) + { + int type = ((ItemArmor) itemStack.getItem()).armorType; + if (this.model1 == null) + { + this.model1 = new ModelOmegaArmour(1.0f, true, true, false, true); + } + if (this.model2 == null) + { + this.model2 = new ModelOmegaArmour(0.5f, false, false, true, false); + } + + if (type == 1 || type == 3 || type == 0) + { + this.model = model1; + } else + { + this.model = model2; + } + + if (this.model != null) + { + this.model.bipedHead.showModel = (type == 0); + this.model.bipedHeadwear.showModel = (type == 0); + this.model.bipedBody.showModel = ((type == 1) || (type == 2)); + this.model.bipedLeftArm.showModel = (type == 1); + this.model.bipedRightArm.showModel = (type == 1); + this.model.bipedLeftLeg.showModel = (type == 2 || type == 3); + this.model.bipedRightLeg.showModel = (type == 2 || type == 3); + this.model.isSneak = entityLiving.isSneaking(); + + this.model.isRiding = entityLiving.isRiding(); + this.model.isChild = entityLiving.isChild(); + + this.model.aimedBow = false; + this.model.heldItemRight = (entityLiving.getHeldItem() != null ? 1 : 0); + + if ((entityLiving instanceof EntityPlayer)) + { + if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) + { + EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction(); + if (enumaction == EnumAction.block) + { + this.model.heldItemRight = 3; + } else if (enumaction == EnumAction.bow) + { + this.model.aimedBow = true; + } + } + } + } + + return model; + + } else + { + return super.getArmorModel(entityLiving, itemStack, armorSlot); + } } @Override @@ -166,30 +166,30 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - double armourReduction = 0.0; - - if(player.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) + double armourReduction = 0.0; + + if (player.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) { int i = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulFray).getAmplifier() + 1; - - armourReduction = (i+1)*0.1; + + armourReduction = (i + 1) * 0.1; } - - double damageAmount = 0.25; - - if(player.isPotionActive(AlchemicalWizardry.customPotionSoulHarden)) - { - int i = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulHarden).getAmplifier() + 1; - damageAmount /= Math.max((1 - i*0.1), 0.1); - }else - { - damageAmount *= 0.9; - } - - damageAmount *= (1.0-armourReduction); - - int maxAbsorption = 100000; - + + double damageAmount = 0.25; + + if (player.isPotionActive(AlchemicalWizardry.customPotionSoulHarden)) + { + int i = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulHarden).getAmplifier() + 1; + damageAmount /= Math.max((1 - i * 0.1), 0.1); + } else + { + damageAmount *= 0.9; + } + + damageAmount *= (1.0 - armourReduction); + + int maxAbsorption = 100000; + if (source.equals(DamageSource.drown)) { return new ArmorProperties(-1, 0, 0); @@ -266,8 +266,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr { return; } - - //EnergyItems.syphonBatteries(stack, (EntityPlayer)entity, 200); } stack.setItemDamage(stack.getItemDamage() + damage); @@ -305,16 +303,16 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - if(this.tryComplexRendering) - { - return "alchemicalwizardry:models/armor/BloodArmour_WIP.png"; - } + if (this.tryComplexRendering) + { + return "alchemicalwizardry:models/armor/BloodArmour_WIP.png"; + } - if (entity instanceof EntityLivingBase) + if (entity instanceof EntityLivingBase) { if (this.getIsInvisible(stack)) { - if (this== ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots) + if (this == ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots) { return "alchemicalwizardry:models/armor/boundArmour_invisible_layer_1.png"; } @@ -368,7 +366,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr { tickInternalInventory(itemStack, world, player, 0, false); } - + this.setIsInvisible(itemStack, player.isPotionActive(Potion.invisibility.id)); if (itemStack.getItemDamage() > 0) @@ -395,8 +393,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr } int blood = getMaxBloodShardLevel(par1ItemStack); - - //int blood = 1; for (int i = 0; i < invSize; i++) { if (inv[i] == null) @@ -633,7 +629,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr return false; } - + public float getUpgradeCostMultiplier(ItemStack itemStack) { ItemStack[] inv = getInternalInventory(itemStack); @@ -683,29 +679,29 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr { return 0; } - + public boolean getIsInvisible(ItemStack armourStack) { - NBTTagCompound tag = armourStack.getTagCompound(); - if(tag != null) - { - return tag.getBoolean("invisible"); - } - - return false; + NBTTagCompound tag = armourStack.getTagCompound(); + if (tag != null) + { + return tag.getBoolean("invisible"); + } + + return false; } - + public void setIsInvisible(ItemStack armourStack, boolean invisible) { - NBTTagCompound tag = armourStack.getTagCompound(); - - if(tag == null) - { - armourStack.setTagCompound(new NBTTagCompound()); - tag = armourStack.getTagCompound(); - } - - tag.setBoolean("invisible", invisible); + NBTTagCompound tag = armourStack.getTagCompound(); + + if (tag == null) + { + armourStack.setTagCompound(new NBTTagCompound()); + tag = armourStack.getTagCompound(); + } + + tag.setBoolean("invisible", invisible); } @Override @@ -722,66 +718,66 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr return this.hasIGoggles(itemstack); } - @Override - @Optional.Method(modid = "Thaumcraft") - public int getRunicCharge(ItemStack itemstack) - { - ItemStack[] inv = this.getInternalInventory(itemstack); - int shardLevel = this.getMaxBloodShardLevel(itemstack); - int count = 0; - int harden = 0; - - if(inv == null) - { - return 0; - } - - for(ItemStack stack : inv) - { - if(count >= shardLevel) - { - break; - } - - if(stack == null || !(stack.getItem() instanceof ArmourUpgrade)) - { - continue; - } - - if(stack.getItem() instanceof ItemArmor && ((ItemArmor)stack.getItem()).armorType != this.armorType) - { - continue; - } - - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound(); - - int enchLvl = tag.getByte("RS.HARDEN"); - - if(stack.getItem() instanceof IRunicArmor) - { - enchLvl += ((IRunicArmor)stack.getItem()).getRunicCharge(stack); - } - - if(enchLvl > 0) - { - harden += enchLvl; - if(((ArmourUpgrade)stack.getItem()).isUpgrade()) - { - count += 1; - } - } - } - } - - return harden; - } + @Override + @Optional.Method(modid = "Thaumcraft") + public int getRunicCharge(ItemStack itemstack) + { + ItemStack[] inv = this.getInternalInventory(itemstack); + int shardLevel = this.getMaxBloodShardLevel(itemstack); + int count = 0; + int harden = 0; - @Override - public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player) - { - ItemStack[] inv = getInternalInventory(stack); + if (inv == null) + { + return 0; + } + + for (ItemStack stack : inv) + { + if (count >= shardLevel) + { + break; + } + + if (stack == null || !(stack.getItem() instanceof ArmourUpgrade)) + { + continue; + } + + if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).armorType != this.armorType) + { + continue; + } + + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound(); + + int enchLvl = tag.getByte("RS.HARDEN"); + + if (stack.getItem() instanceof IRunicArmor) + { + enchLvl += ((IRunicArmor) stack.getItem()).getRunicCharge(stack); + } + + if (enchLvl > 0) + { + harden += enchLvl; + if (((ArmourUpgrade) stack.getItem()).isUpgrade()) + { + count += 1; + } + } + } + } + + return harden; + } + + @Override + public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player) + { + ItemStack[] inv = getInternalInventory(stack); if (inv == null) { @@ -802,5 +798,5 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr } return false; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java index e6d0a770..04eb4386 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -1,58 +1,41 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.enchantment.Enchantment; -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.init.Blocks; -import net.minecraft.item.ItemAxe; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.IIcon; -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.spell.complex.effect.SpellHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +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; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +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 BoundAxe extends ItemAxe implements IBindable { - /** - * Array of blocks the tool has extra effect against. - */ - public static final Block[] blocksEffectiveAgainst = new Block[]{Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.chest, Blocks.stone_slab, Blocks.pumpkin, Blocks.lit_pumpkin}; - public float efficiencyOnProperMaterial = 12.0F; - - /** - * Damage versus entities. - */ public float damageVsEntity; - private static IIcon activeIcon; private static IIcon passiveIcon; - private int energyUsed; public BoundAxe() { super(AlchemicalWizardry.bloodBoundToolMaterial); this.maxStackSize = 1; - //this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); this.efficiencyOnProperMaterial = 12.0F; this.damageVsEntity = 5; setCreativeTab(AlchemicalWizardry.tabBloodMagic); @@ -142,9 +125,9 @@ public class BoundAxe extends ItemAxe implements IBindable } Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); - int posX = (int)(blockVec.xCoord); - int posY = (int)(blockVec.yCoord); - int posZ = (int)(blockVec.zCoord); + int posX = (int) (blockVec.xCoord); + int posY = (int) (blockVec.yCoord); + int posZ = (int) (blockVec.zCoord); boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); @@ -163,7 +146,6 @@ public class BoundAxe extends ItemAxe implements IBindable if (str > 1.1f || block instanceof BlockLeavesBase && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) { - //par1ItemStack.getEnchantmentTagList(); if (silkTouch) { ItemStack droppedItem = new ItemStack(block, 1, meta); @@ -187,7 +169,6 @@ public class BoundAxe extends ItemAxe implements IBindable } } } - par2World.setBlockToAir(posX + i, posY + j, posZ + k); } } @@ -213,12 +194,6 @@ public class BoundAxe extends ItemAxe implements IBindable { par1ItemStack.setTagCompound(new NBTTagCompound()); } - -// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) -// { -// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); -// } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) @@ -280,8 +255,6 @@ public class BoundAxe extends ItemAxe implements IBindable { return false; } - - //par1ItemStack.damageItem(2, par3EntityLivingBase); return true; } @@ -289,7 +262,6 @@ public class BoundAxe extends ItemAxe implements IBindable { if ((double) par3.getBlockHardness(par2World, par4, par5, par6) != 0.0D) { - //par1ItemStack.damageItem(1, par7EntityLivingBase); } return true; @@ -314,14 +286,6 @@ public class BoundAxe extends ItemAxe implements IBindable return 30; } - /** - * Return whether this item is repairable in an anvil. - */ -// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) -// { -// return true; -// } - /** * FORGE: Overridden to allow custom tool effectiveness */ @@ -346,15 +310,15 @@ public class BoundAxe extends ItemAxe implements IBindable { return !getActivated(stack); } - + @Override public int getHarvestLevel(ItemStack stack, String toolClass) { - if("axe".equals(toolClass)) - { - return 5; - } - - return 0; + if ("axe".equals(toolClass)) + { + return 5; + } + + return 0; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java index 922f59f9..3d85614e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -1,11 +1,13 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.ArrayList; -import java.util.List; - +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 net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; @@ -13,32 +15,19 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.util.IIcon; 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.spell.complex.effect.SpellHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.enchantment.EnchantmentHelper; + +import java.util.ArrayList; +import java.util.List; public class BoundPickaxe extends ItemPickaxe implements IBindable { - /** - * Array of blocks the tool has extra effect against. - */ - // public static final Block[] blocksEffectiveAgainst = new Block[]{Blocks.cobblestone, Blocks.stoneDoubleSlab, Blocks.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, Block.railActivator}; public float efficiencyOnProperMaterial = 12.0F; - - /** - * Damage versus entities. - */ public float damageVsEntity; - private static IIcon activeIcon; private static IIcon passiveIcon; @@ -48,7 +37,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable { super(AlchemicalWizardry.bloodBoundToolMaterial); this.maxStackSize = 1; - //this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); this.efficiencyOnProperMaterial = 12.0F; this.damageVsEntity = 5; setCreativeTab(AlchemicalWizardry.tabBloodMagic); @@ -137,16 +125,16 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable { return par1ItemStack; } - - if(par2World.isRemote) + + if (par2World.isRemote) { - return par1ItemStack; + return par1ItemStack; } - + Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); - int posX = (int)(blockVec.xCoord); - int posY = (int)(blockVec.yCoord); - int posZ = (int)(blockVec.zCoord); + int posX = (int) (blockVec.xCoord); + int posY = (int) (blockVec.yCoord); + int posZ = (int) (blockVec.zCoord); boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); @@ -165,7 +153,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) { - //par1ItemStack.getEnchantmentTagList(); if (silkTouch) { ItemStack droppedItem = new ItemStack(block, 1, meta); @@ -216,11 +203,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable par1ItemStack.setTagCompound(new NBTTagCompound()); } -// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) -// { -// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); -// } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) @@ -282,8 +264,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable { return false; } - - //par1ItemStack.damageItem(2, par3EntityLivingBase); return true; } @@ -295,9 +275,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable { EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed()); } - - //TODO Possibly add better functionality for the items? - //par7EntityLivingBase.getLookVec(); return true; } @@ -320,14 +297,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable return 30; } - /** - * Return whether this item is repairable in an anvil. - */ -// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) -// { -// return false; -// } - /** * FORGE: Overridden to allow custom tool effectiveness */ @@ -347,30 +316,20 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable return func_150893_a(stack, block); } -// @Override -// -// /** -// * Returns if the item (tool) can harvest results from the block type. -// */ -// public boolean func_150897_b(Block par1Block) //canHarvestBlock -// { -// return par1Block == Blocks.obsidian ? true : (par1Block != Blocks.diamond_block && par1Block != Blocks.diamond_ore ? (par1Block != Blocks.emerald_ore && par1Block != Blocks.emerald_block ? (par1Block != Blocks.gold_block && par1Block != Blocks.gold_ore ? (par1Block != Blocks.iron_block && par1Block != Blocks.iron_ore ? (par1Block != Blocks.lapis_block && par1Block != Blocks.lapis_ore ? (par1Block != Blocks.redstone_ore && par1Block != Blocks.oreRedstoneGlowing ? (par1Block.getMaterial() == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : true) : true) : true) : true) : true) : true); -// } - @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { return !getActivated(stack); } - + @Override public int getHarvestLevel(ItemStack stack, String toolClass) { - if("pickaxe".equals(toolClass)) - { - return 5; - } - - return 0; + if ("pickaxe".equals(toolClass)) + { + return 5; + } + + return 0; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java index df65ebcb..feffcb7c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -1,11 +1,14 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +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.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -15,33 +18,17 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.util.IIcon; 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.spell.complex.effect.SpellHelper; -import net.minecraft.enchantment.EnchantmentHelper; -import com.google.common.collect.Multimap; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; public class BoundShovel extends ItemSpade implements IBindable { - /** - * Array of blocks the tool has extra effect against. - */ - //public static final Block[] blocksEffectiveAgainst = new Block[]{Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium}; - public float efficiencyOnProperMaterial = 12.0F; - - /** - * Damage versus entities. - */ public float damageVsEntity; private static IIcon activeIcon; @@ -53,7 +40,6 @@ public class BoundShovel extends ItemSpade implements IBindable { super(AlchemicalWizardry.bloodBoundToolMaterial); this.maxStackSize = 1; - //this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); this.efficiencyOnProperMaterial = 12.0F; this.damageVsEntity = 5; setCreativeTab(AlchemicalWizardry.tabBloodMagic); @@ -143,10 +129,10 @@ public class BoundShovel extends ItemSpade implements IBindable } Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); - int posX = (int)(blockVec.xCoord); - int posY = (int)(blockVec.yCoord); - int posZ = (int)(blockVec.zCoord); - boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); + int posX = (int) (blockVec.xCoord); + int posY = (int) (blockVec.yCoord); + int posZ = (int) (blockVec.zCoord); + boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer); int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); for (int i = -5; i <= 5; i++) @@ -164,7 +150,6 @@ public class BoundShovel extends ItemSpade implements IBindable if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) { - //par1ItemStack.getEnchantmentTagList(); if (silkTouch) { ItemStack droppedItem = new ItemStack(block, 1, meta); @@ -214,12 +199,6 @@ public class BoundShovel extends ItemSpade implements IBindable { par1ItemStack.setTagCompound(new NBTTagCompound()); } - -// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) -// { -// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); -// } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) @@ -281,8 +260,6 @@ public class BoundShovel extends ItemSpade implements IBindable { return false; } - - //par1ItemStack.damageItem(2, par3EntityLivingBase); return true; } @@ -309,13 +286,6 @@ public class BoundShovel extends ItemSpade implements IBindable return 30; } - /** - * Return whether this item is repairable in an anvil. - */ -// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) -// { -// return false; -// } @Override public Multimap getItemAttributeModifiers() { @@ -342,26 +312,21 @@ public class BoundShovel extends ItemSpade implements IBindable return func_150893_a(stack, block); } -// -// public boolean canHarvestBlock(Block par1Block) -// { -// return par1Block == Block.snow ? true : par1Block == Block.blockSnow; -// } @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { return !getActivated(stack); } - + @Override public int getHarvestLevel(ItemStack stack, String toolClass) { - if("shovel".equals(toolClass)) - { - return 5; - } - - return 0; + if ("shovel".equals(toolClass)) + { + return 5; + } + + return 0; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java index 8b44398d..d4d9b19f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java @@ -1,7 +1,11 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -11,30 +15,17 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class CheatyItem extends Item implements IBindable { - // private int maxEssence; - //protected int orbLevel; - public CheatyItem() { super(); DamageSource damageSource = DamageSource.generic; setMaxStackSize(1); - //setMaxDamage(damage); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - //setFull3D(); - //maxEssence = damage; - //orbLevel = 1; } @Override @@ -51,19 +42,10 @@ public class CheatyItem extends Item implements IBindable par3List.add("Right-click to fill network,"); par3List.add("shift-right to empty."); - //par3List.add("LP: " + (this.getMaxDamage() - this.getDamage(par1ItemStack))); if (!(par1ItemStack.stackTagCompound == null)) { par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); -// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1ItemStack.stackTagCompound.getString("ownerName")); -// if(owner!=null) -// { -// NBTTagCompound tag = owner.getEntityData(); -// par3List.add("LP: " + tag.getInteger("currentEssence")); -// } } - - //par3List.add("LP: " + par2EntityPlayer.getEntityData().getInteger("currentEssence")); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) @@ -104,16 +86,6 @@ public class CheatyItem extends Item implements IBindable { EnergyItems.addEssenceToMaximum(itemTag.getString("ownerName"), 1000000, Integer.MAX_VALUE); } - - //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(itemTag.getString("ownerName")), (Player)par3EntityPlayer); -// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(itemTag.getString("ownerName")); -// if(owner==null){return par1ItemStack;} -// NBTTagCompound ownerTag = owner.getEntityData(); -// if(ownerTag.getInteger("currentEssence")<=this.maxEssence) -// { -// damagePlayer(par2World, par3EntityPlayer,2); -// ownerTag.setInteger("currentEssence", Math.min(this.maxEssence, ownerTag.getInteger("currentEssence")+200/2)); -// } return par1ItemStack; } @@ -156,7 +128,6 @@ public class CheatyItem extends Item implements IBindable for (int i = 0; i < damage; i++) { player.setHealth((player.getHealth() - 1)); - //player.setEntityHealth(player.func_110143_aJ() - 1); } } @@ -166,48 +137,9 @@ public class CheatyItem extends Item implements IBindable } } -// public int getMaxEssence() -// { -// return this.maxEssence; -// } -// -// public int getOrbLevel() -// { -// return orbLevel; -// } -// -// @Override -// public void onArmourUpdate(World world, EntityPlayer player, -// ItemStack thisItemStack) { -// // TODO Auto-generated method stub -// -// } -// -// @Override -// public boolean isUpgrade() -// { -// // TODO Auto-generated method stub -// return false; -// } -// -// @Override -// public int getEnergyForTenSeconds() -// { -// // TODO Auto-generated method stub -// return 0; -// } - @Override public ItemStack getContainerItem(ItemStack itemStack) { - //if(!syphonBatteries(itemStack, null, 10)) - { - //syphonWhileInContainer(itemStack, this.getEnergyUsed()); -// ItemStack copiedStack = itemStack.copy(); -// copiedStack.setItemDamage(copiedStack.getItemDamage()); -// copiedStack.stackSize = 1; -// return copiedStack; - } return itemStack; } @@ -217,7 +149,6 @@ public class CheatyItem extends Item implements IBindable return true; } - //@SideOnly(Side.SERVER) public int getCurrentEssence(ItemStack par1ItemStack) { if (par1ItemStack == null) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java index a2569610..dd08ad38 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java @@ -1,7 +1,11 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +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.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,20 +20,13 @@ import net.minecraft.entity.monster.EntitySlime; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import com.google.common.collect.Multimap; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; public class DaggerOfSacrifice extends EnergyItems { @@ -61,14 +58,13 @@ public class DaggerOfSacrifice extends EnergyItems return false; } - //EntityWither d; if (par2EntityLivingBase.isChild() || par2EntityLivingBase instanceof EntityWither || par2EntityLivingBase instanceof EntityDragon || par2EntityLivingBase instanceof EntityPlayer || par2EntityLivingBase instanceof IBossDisplayData) { return false; } - + World world = par2EntityLivingBase.worldObj; - + if (par2EntityLivingBase.isDead || par2EntityLivingBase.getHealth() < 0.5f) { return false; @@ -82,8 +78,7 @@ public class DaggerOfSacrifice extends EnergyItems double posY = par2EntityLivingBase.posY; double posZ = par2EntityLivingBase.posZ; - - + for (int i = 0; i < 8; i++) { SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java index 6708cd74..b45807b1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,20 +18,14 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Facing; -import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class DemonPlacer extends Item { - @SideOnly(Side.CLIENT) - private IIcon theIcon; - public DemonPlacer() { super(); @@ -40,15 +36,6 @@ public class DemonPlacer extends Item public String getItemDisplayName(ItemStack par1ItemStack) { -// String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); -// String s1 = EntityList.getStringFromID(par1ItemStack.getItemDamage()); -// -// if (s1 != null) -// { -// s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name"); -// } -// -// return s; return "Demon Crystal"; } @@ -163,77 +150,35 @@ public class DemonPlacer extends Item */ public static Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6, ItemStack itemStack) { -// if (!EntityList.entityEggs.containsKey(Integer.valueOf(par1))) -// { -// return null; -// } -// else + Entity entity = null; + + for (int j = 0; j < 1; ++j) { - Entity entity = null; + entity = SummoningRegistry.getEntityWithID(par0World, par1); - for (int j = 0; j < 1; ++j) + if (entity != null && entity instanceof EntityLivingBase) { - entity = SummoningRegistry.getEntityWithID(par0World, par1); - - if (entity != null && entity instanceof EntityLivingBase) + EntityLiving entityliving = (EntityLiving) entity; + entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F); + entityliving.rotationYawHead = entityliving.rotationYaw; + entityliving.renderYawOffset = entityliving.rotationYaw; + if (entityliving instanceof EntityDemon) { - EntityLiving entityliving = (EntityLiving) entity; - entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F); - entityliving.rotationYawHead = entityliving.rotationYaw; - entityliving.renderYawOffset = entityliving.rotationYaw; + ((EntityDemon) entityliving).func_152115_b(DemonPlacer.getOwnerName(itemStack)); - //entityliving.onSpawnWithEgg((EntityLivingData)null); - if (entityliving instanceof EntityDemon) + if (!DemonPlacer.getOwnerName(itemStack).equals("")) { - ((EntityDemon) entityliving).func_152115_b(DemonPlacer.getOwnerName(itemStack)); - - if (!DemonPlacer.getOwnerName(itemStack).equals("")) - { - ((EntityDemon) entityliving).setTamed(true); - } + ((EntityDemon) entityliving).setTamed(true); } - - par0World.spawnEntityInWorld(entity); - entityliving.playLivingSound(); } + + par0World.spawnEntityInWorld(entity); + entityliving.playLivingSound(); } - - return entity; } + return entity; } -// @SideOnly(Side.CLIENT) -// public boolean requiresMultipleRenderPasses() -// { -// return true; -// } - -// @SideOnly(Side.CLIENT) -// -// /** -// * Gets an icon index based on an item's damage value and the given render pass -// */ -// public Icon getIconFromDamageForRenderPass(int par1, int par2) -// { -// return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); -// } - -// @SideOnly(Side.CLIENT) -// -// /** -// * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -// */ -// public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) -// { -// Iterator iterator = EntityList.entityEggs.values().iterator(); -// -// while (iterator.hasNext()) -// { -// EntityEggInfo entityegginfo = (EntityEggInfo)iterator.next(); -// par3List.add(new ItemStack(par1, 1, entityegginfo.spawnedID)); -// } -// } - public static void setOwnerName(ItemStack par1ItemStack, String ownerName) { if (par1ItemStack.stackTagCompound == null) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java index d26de12d..d976128b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java @@ -1,27 +1,25 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class DemonicTelepositionFocus extends TelepositionFocus { public DemonicTelepositionFocus() { super(4); - // TODO Auto-generated constructor stub } @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - //TODO this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonicTeleposerFocus"); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java index ddbdbfe9..6de25769 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class DuskScribeTool extends ScribeTool { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java index 290c6f91..824d3925 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class EarthScribeTool extends ScribeTool { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java index e935437e..9ac62979 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java @@ -1,15 +1,5 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; @@ -18,6 +8,16 @@ import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +import java.util.List; public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBloodOrb { @@ -29,9 +29,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl super(); DamageSource damageSource = DamageSource.generic; setMaxStackSize(1); - //setMaxDamage(damage); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - //setFull3D(); maxEssence = damage; orbLevel = 1; } @@ -47,32 +45,16 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("Stores raw Life Essence"); - - //par3List.add("LP: " + (this.getMaxDamage() - this.getDamage(par1ItemStack))); if (!(par1ItemStack.stackTagCompound == null)) { par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); -// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1ItemStack.stackTagCompound.getString("ownerName")); -// if(owner!=null) -// { -// NBTTagCompound tag = owner.getEntityData(); -// par3List.add("LP: " + tag.getInteger("currentEssence")); -// } } - - //par3List.add("LP: " + par2EntityPlayer.getEntityData().getInteger("currentEssence")); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); World world = par3EntityPlayer.worldObj; - -// if (par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP) -// { -// return par1ItemStack; -// } - if (world != null) { double posX = par3EntityPlayer.posX; @@ -81,41 +63,20 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); } - -// if (!(par3EntityPlayer.getClass().equals(EntityPlayerMP.class))) -// { -// return par1ItemStack; -// } - - - -// if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) -// { -// return par1ItemStack; -// } NBTTagCompound itemTag = par1ItemStack.stackTagCompound; if (itemTag == null || itemTag.getString("ownerName").equals("")) { return par1ItemStack; } - - if(world.isRemote) + + if (world.isRemote) { - return par1ItemStack; + return par1ItemStack; } EnergyItems.addEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence()); EnergyItems.hurtPlayer(par3EntityPlayer, 200); - //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(itemTag.getString("ownerName")), (Player)par3EntityPlayer); -// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(itemTag.getString("ownerName")); -// if(owner==null){return par1ItemStack;} -// NBTTagCompound ownerTag = owner.getEntityData(); -// if(ownerTag.getInteger("currentEssence")<=this.maxEssence) -// { -// damagePlayer(par2World, par3EntityPlayer,2); -// ownerTag.setInteger("currentEssence", Math.min(this.maxEssence, ownerTag.getInteger("currentEssence")+200/2)); -// } return par1ItemStack; } @@ -158,7 +119,6 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl for (int i = 0; i < damage; i++) { player.setHealth((player.getHealth() - 1)); - //player.setEntityHealth(player.func_110143_aJ() - 1); } } @@ -198,14 +158,6 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl @Override public ItemStack getContainerItem(ItemStack itemStack) { - //if(!syphonBatteries(itemStack, null, 10)) - { - //syphonWhileInContainer(itemStack, this.getEnergyUsed()); -// ItemStack copiedStack = itemStack.copy(); -// copiedStack.setItemDamage(copiedStack.getItemDamage()); -// copiedStack.stackSize = 1; -// return copiedStack; - } return itemStack; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java index be0eddc2..73dd8dfe 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -10,17 +12,14 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class EnergyBazooka extends EnergyItems { private static IIcon activeIcon; private static IIcon passiveIcon; private static int damage; - //private static int delay; private static final int maxDelay = 150; public EnergyBazooka() @@ -32,7 +31,6 @@ public class EnergyBazooka extends EnergyItems setMaxDamage(250); this.setEnergyUsed(20000); damage = 12; - //delay = 0; } @Override @@ -94,7 +92,6 @@ public class EnergyBazooka extends EnergyItems if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EntityEnergyBazookaMainProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new EntityEnergyBazookaMainProjectile(par2World, par3EntityPlayer, damage)); this.setDelay(par1ItemStack, maxDelay); } @@ -123,11 +120,6 @@ public class EnergyBazooka extends EnergyItems { par1ItemStack.setTagCompound(new NBTTagCompound()); } - -// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) -// { -// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); -// } int delay = this.getDelay(par1ItemStack); if (!par2World.isRemote && delay > 0) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java index 298c950d..ab2e32fe 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -9,17 +11,14 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class EnergyBlast extends EnergyItems { private static IIcon activeIcon; private static IIcon passiveIcon; private static int damage; - //private static int delay; private static final int maxDelay = 15; public EnergyBlast() @@ -32,7 +31,6 @@ public class EnergyBlast extends EnergyItems setMaxDamage(250); this.setEnergyUsed(150); damage = 12; - //delay = 0; } @Override @@ -94,7 +92,6 @@ public class EnergyBlast extends EnergyItems if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); this.setDelay(par1ItemStack, maxDelay); } @@ -109,18 +106,12 @@ public class EnergyBlast extends EnergyItems { return; } - EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; if (par1ItemStack.stackTagCompound == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); } - -// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) -// { -// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); -// } int delay = this.getDelay(par1ItemStack); if (!par2World.isRemote && delay > 0) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java index 88b7ef89..13d4ebf1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java @@ -1,5 +1,10 @@ package WayofTime.alchemicalWizardry.common.items; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,11 +12,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EnergyItems extends Item implements IBindable { @@ -32,8 +32,6 @@ public class EnergyItems extends Item implements IBindable { return this.energyUsed; } - //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, - //the item is not used. protected void damagePlayer(World world, EntityPlayer player, int damage) { @@ -47,16 +45,13 @@ public class EnergyItems extends Item implements IBindable float f1 = f * 0.6F + 0.4F; float f2 = f * f * 0.7F - 0.5F; float f3 = f * f * 0.6F - 0.7F; - for (int l = 0; l < 8; ++l) { world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); } } - for (int i = 0; i < damage; i++) { - //player.setEntityHealth((player.getHealth()-1)); player.setHealth((player.getHealth() - 1)); if (player.getHealth() <= 0.0005) @@ -75,22 +70,17 @@ public class EnergyItems extends Item implements IBindable } else { World world = player.worldObj; - if (world != null) { double posX = player.posX; double posY = player.posY; double posZ = player.posZ; - //if(particles) - { - SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); - world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); - } + + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); + world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); } } - return true; - //return syphonBatteriesWithoutParticles(ist, player, damageToBeDone, true); } public static boolean syphonWhileInContainer(ItemStack ist, int damageToBeDone) @@ -119,16 +109,6 @@ public class EnergyItems extends Item implements IBindable data.markDirty(); return true; } - -// EntityPlayer ownerEntity = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(ist.getTagCompound().getString("ownerName")); -// if(ownerEntity==null){return false;} -// NBTTagCompound tag = ownerEntity.getEntityData(); -// int currentEssence = tag.getInteger("currentEssence"); -// if(currentEssence>=damageToBeDone) -// { -// tag.setInteger("currentEssence", currentEssence-damageToBeDone); -// return true; -// } } return false; @@ -155,15 +135,6 @@ public class EnergyItems extends Item implements IBindable } return data.currentEssence >= damageToBeDone; -// EntityPlayer ownerEntity = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(ist.getTagCompound().getString("ownerName")); -// if(ownerEntity==null){return false;} -// NBTTagCompound tag = ownerEntity.getEntityData(); -// int currentEssence = tag.getInteger("currentEssence"); -// if(currentEssence>=damageToBeDone) -// { -// tag.setInteger("currentEssence", currentEssence-damageToBeDone); -// return true; -// } } return false; @@ -175,13 +146,12 @@ public class EnergyItems extends Item implements IBindable { if (!user.capabilities.isCreativeMode) { - //player.setEntityHealth((player.getHealth()-1)); user.setHealth((user.getHealth() - 1)); if (user.getHealth() <= 0.0005f) { user.onDeath(DamageSource.generic); - + } } } else if (energySyphoned >= 100) @@ -190,7 +160,6 @@ public class EnergyItems extends Item implements IBindable { for (int i = 0; i < ((energySyphoned + 99) / 100); i++) { - //player.setEntityHealth((player.getHealth()-1)); user.setHealth((user.getHealth() - 1)); if (user.getHealth() <= 0.0005f) @@ -228,15 +197,15 @@ public class EnergyItems extends Item implements IBindable initializePlayer(player); } - + public static void setItemOwner(ItemStack item, String ownerName) { - if (item.stackTagCompound == null) + if (item.stackTagCompound == null) { item.setTagCompound(new NBTTagCompound()); } - item.stackTagCompound.setString("ownerName", ownerName); + item.stackTagCompound.setString("ownerName", ownerName); } public static void checkAndSetItemOwner(ItemStack item, String ownerName) @@ -271,11 +240,11 @@ public class EnergyItems extends Item implements IBindable return item.stackTagCompound.getString("ownerName"); } - + public static void drainPlayerNetwork(EntityPlayer player, int damageToBeDone) { - String ownerName = SpellHelper.getUsername(player); - + String ownerName = SpellHelper.getUsername(player); + if (MinecraftServer.getServer() == null) { return; @@ -294,15 +263,15 @@ public class EnergyItems extends Item implements IBindable { data.currentEssence -= damageToBeDone; data.markDirty(); - }else + } else { - hurtPlayer(player, damageToBeDone); + hurtPlayer(player, damageToBeDone); } } - + public static int getCurrentEssence(String ownerName) { - if (MinecraftServer.getServer() == null) + if (MinecraftServer.getServer() == null) { return 0; } @@ -318,10 +287,10 @@ public class EnergyItems extends Item implements IBindable return data.currentEssence; } - + public static void setCurrentEssence(String ownerName, int amount) { - if (MinecraftServer.getServer() == null) + if (MinecraftServer.getServer() == null) { return; } @@ -338,10 +307,10 @@ public class EnergyItems extends Item implements IBindable data.currentEssence = amount; data.markDirty(); } - + public static void addEssenceToMaximum(String ownerName, int amount, int maximum) { - if (MinecraftServer.getServer() == null) + if (MinecraftServer.getServer() == null) { return; } @@ -355,11 +324,11 @@ public class EnergyItems extends Item implements IBindable world.setItemData(ownerName, data); } - if(data.currentEssence>=maximum) + if (data.currentEssence >= maximum) { - return; + return; } - + data.currentEssence = Math.min(maximum, data.currentEssence + amount); data.markDirty(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java index a4578599..9bb2848b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java @@ -1,7 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,19 +17,14 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class EnergySword extends ItemSword { - //private float weaponDamaged; - //private int maxMode = 3; private NBTTagCompound data; - private static IIcon activeIcon; private static IIcon passiveIcon; - private int energyUsed; public EnergySword() @@ -39,7 +35,6 @@ public class EnergySword extends ItemSword setEnergyUsed(50); setFull3D(); setMaxDamage(100); - //weaponDamaged = 12.0F; } public void setEnergyUsed(int i) @@ -95,7 +90,6 @@ public class EnergySword extends ItemSword if (!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed())) { - //this.damagePlayer(null, (EntityPlayer)par3EntityLivingBase, (this.getEnergyUsed() + 99) / 100); } } @@ -144,11 +138,6 @@ public class EnergySword extends ItemSword par1ItemStack.setTagCompound(new NBTTagCompound()); } -// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) -// { -// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); -// } - if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) @@ -185,11 +174,6 @@ public class EnergySword extends ItemSword return itemTag.getBoolean("isActive"); } -// public int getDamageVsEntity(Entity par1Entity) -// { -// return (int) this.weaponDamage; -// } - public float func_82803_g() { return 4.0F; @@ -230,9 +214,4 @@ public class EnergySword extends ItemSword return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F; } } - -// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) -// { -// return false; -// } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java index 4753fc05..4ef5bf57 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java @@ -1,27 +1,25 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class EnhancedTelepositionFocus extends TelepositionFocus { public EnhancedTelepositionFocus() { super(2); - // TODO Auto-generated constructor stub } @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - //TODO this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedTeleposerFocus"); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java index 18fc3a52..67420fc2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class FireScribeTool extends ScribeTool { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java index 8319c4a8..322e0b26 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -11,17 +13,13 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; - import org.lwjgl.input.Keyboard; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; public class ItemAlchemyBase extends Item { - private static final String[] ITEM_NAMES = new String[]{"Offensa","Praesidium","OrbisTerrae","StrengthenedCatalyst","ConcentratedCatalyst","FracturedBone","Virtus","Reductus","Potentia"}; + private static final String[] ITEM_NAMES = new String[]{"Offensa", "Praesidium", "OrbisTerrae", "StrengthenedCatalyst", "ConcentratedCatalyst", "FracturedBone", "Virtus", "Reductus", "Potentia"}; @SideOnly(Side.CLIENT) private IIcon[] icons; @@ -45,7 +43,7 @@ public class ItemAlchemyBase extends Item icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseAlchemyItem" + ITEM_NAMES[i]); } } - + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -82,7 +80,6 @@ public class ItemAlchemyBase extends Item @Override public String getUnlocalizedName(ItemStack itemStack) { - //This is what will do all the localisation things on the alchemy components so you dont have to set it :D int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ITEM_NAMES.length - 1); return ("" + "item.bloodMagicAlchemyItem." + ITEM_NAMES[meta]); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java index 7788b60b..cf0cd50e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; @@ -10,16 +10,14 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; + +import java.util.List; public class ItemBlockCrystalBelljar extends ItemBlock { public ItemBlockCrystalBelljar(Block par1) { super(par1); -// this.setUnlocalizedName("itemSpellEnhancementBlock"); -// setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setHasSubtypes(true); this.setMaxDamage(0); this.setMaxStackSize(16); @@ -29,68 +27,68 @@ public class ItemBlockCrystalBelljar extends ItemBlock { return par1; } - + public ReagentContainer[] getReagentContainers(ItemStack stack) { - if(stack != null && stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound(); - - NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND); - + if (stack != null && stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound(); + + NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND); + int size = tagList.tagCount(); ReagentContainer[] tanks = new ReagentContainer[size]; - - for(int i=0; i ritualList = Rituals.getRitualList(this.getCurrentRitual(par1ItemStack)); - if(ritualList == null) + if (ritualList == null) { - return; + return; } int blankStones = 0; @@ -112,7 +112,6 @@ public class ItemRitualDiviner extends EnergyItems par3List.add(EnumChatFormatting.RED + "Fire stones: " + fireStones); par3List.add(EnumChatFormatting.DARK_GREEN + "Earth stones: " + earthStones); par3List.add(EnumChatFormatting.BOLD + "Dusk stones: " + duskStones); - //par3List.add("Ritual Name: " + Rituals.getNameOfRitual(ritualID)); } } @@ -122,12 +121,11 @@ public class ItemRitualDiviner extends EnergyItems if (!(par1ItemStack.stackTagCompound == null)) { String ritualID = this.getCurrentRitual(par1ItemStack); - if(ritualID.equals("")) + if (ritualID.equals("")) { - return super.getItemStackDisplayName(par1ItemStack); + return super.getItemStackDisplayName(par1ItemStack); } return "Ritual: " + Rituals.getNameOfRitual(ritualID); - //par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); } else { return super.getItemStackDisplayName(par1ItemStack); @@ -145,11 +143,11 @@ public class ItemRitualDiviner extends EnergyItems { TEMasterStone masterStone = (TEMasterStone) tileEntity; List ritualList = Rituals.getRitualList(this.getCurrentRitual(par1ItemStack)); - if(ritualList == null) + if (ritualList == null) { - return false; + return false; } - + int playerInvRitualStoneLocation = -1; for (int i = 0; i < playerInventory.length; i++) @@ -221,14 +219,6 @@ public class ItemRitualDiviner extends EnergyItems } } } - -// if (par3World.isRemote) -// { -// par3World.playAuxSFX(2005, par4, par5, par6, 0); -// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); -// return true; -// } -// return true; } return false; @@ -249,8 +239,6 @@ public class ItemRitualDiviner extends EnergyItems if (par2World.isRemote) { IChatComponent chatmessagecomponent = new ChatComponentText("Current Ritual: " + Rituals.getNameOfRitual(this.getCurrentRitual(par1ItemStack))); - //chatmessagecomponent.func_111072_b("Current Essence: " + data.currentEssence + "LP"); - //chatmessagecomponent.addText("Current Ritual: " + Rituals.getNameOfRitual(this.getCurrentRitual(par1ItemStack))); par3EntityPlayer.addChatComponentMessage(chatmessagecomponent); } } @@ -261,11 +249,11 @@ public class ItemRitualDiviner extends EnergyItems @Override public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) { - if(entityLiving instanceof EntityPlayer) + if (entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entityLiving; - if(player.isSneaking() && !player.isSwingInProgress) + if (player.isSneaking() && !player.isSwingInProgress) { int maxRitualID = Rituals.getNumberOfRituals(); String currentRitualID = this.getCurrentRitual(stack); @@ -275,8 +263,6 @@ public class ItemRitualDiviner extends EnergyItems if (entityLiving.worldObj.isRemote) { IChatComponent chatmessagecomponent = new ChatComponentText("Current Ritual: " + Rituals.getNameOfRitual(this.getCurrentRitual(stack))); - //chatmessagecomponent.func_111072_b("Current Essence: " + data.currentEssence + "LP"); - //chatmessagecomponent.addText("Current Ritual: " + Rituals.getNameOfRitual(this.getCurrentRitual(par1ItemStack))); player.addChatComponentMessage(chatmessagecomponent); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java index 2c5e106d..2c4cf212 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.items; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -12,9 +11,6 @@ public class ItemSpellEffectBlock extends ItemBlock { super(par1); setHasSubtypes(true); -// this.setUnlocalizedName("itemSpellEffectBlock"); -// setCreativeTab(AlchemicalWizardry.tabBloodMagic); - } public String getUnlocalizedName(ItemStack itemstack) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java index 670cbce8..9a43e529 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.items; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -12,8 +11,6 @@ public class ItemSpellEnhancementBlock extends ItemBlock { super(par1); setHasSubtypes(true); -// this.setUnlocalizedName("itemSpellEnhancementBlock"); -// setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -30,7 +27,7 @@ public class ItemSpellEnhancementBlock extends ItemBlock case 1: name = "power2"; - break; + break; case 2: name = "power3"; @@ -39,47 +36,47 @@ public class ItemSpellEnhancementBlock extends ItemBlock case 3: name = "power4"; break; - + case 4: name = "power5"; break; - + case 5: name = "cost1"; break; - + case 6: name = "cost2"; break; - + case 7: name = "cost3"; break; - + case 8: name = "cost4"; break; - + case 9: name = "cost5"; break; - + case 10: name = "potency1"; break; - + case 11: name = "potency2"; break; - + case 12: name = "potency3"; break; - + case 13: name = "potency4"; break; - + case 14: name = "potency5"; break; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java index acd47516..0dfdcd30 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.items; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -12,8 +11,6 @@ public class ItemSpellModifierBlock extends ItemBlock { super(par1); setHasSubtypes(true); -// this.setUnlocalizedName("itemSpellModifierBlock"); -// setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -39,7 +36,7 @@ public class ItemSpellModifierBlock extends ItemBlock case 2: name = "defensive"; break; - + case 3: name = "environmental"; break; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java index 5fb0b9e3..a22e0ce0 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.items; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -12,7 +11,6 @@ public class ItemSpellParadigmBlock extends ItemBlock { super(par1); setHasSubtypes(true); - //this.setUnlocalizedName("itemSpellParadigmBlock"); } @Override @@ -38,10 +36,10 @@ public class ItemSpellParadigmBlock extends ItemBlock case 2: name = "melee"; break; - + case 3: - name = "tool"; - break; + name = "tool"; + break; default: name = "broken"; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java index 87610c5e..451017d2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java @@ -1,23 +1,22 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class LavaCrystal extends EnergyItems { public LavaCrystal() { super(); - //setMaxDamage(1000); setMaxStackSize(1); setCreativeTab(AlchemicalWizardry.tabBloodMagic); setUnlocalizedName("lavaCrystal"); @@ -37,7 +36,6 @@ public class LavaCrystal extends EnergyItems @Override public ItemStack getContainerItem(ItemStack itemStack) { - //if(!syphonBatteries(itemStack, null, 10)) { syphonWhileInContainer(itemStack, this.getEnergyUsed()); ItemStack copiedStack = itemStack.copy(); @@ -45,7 +43,6 @@ public class LavaCrystal extends EnergyItems copiedStack.stackSize = 1; return copiedStack; } - //return itemStack; } @Override @@ -97,18 +94,7 @@ public class LavaCrystal extends EnergyItems { return true; } - -// EntityPlayer ownerEntity = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(ist.getTagCompound().getString("ownerName")); -// if(ownerEntity==null){return false;} -// NBTTagCompound tag = ownerEntity.getEntityData(); -// int currentEssence = tag.getInteger("currentEssence"); -// if(currentEssence>=damageToBeDone) -// { -// tag.setInteger("currentEssence", currentEssence-damageToBeDone); -// return true; -// } } - return false; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java index 80a29ed3..daaec1d1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java @@ -1,17 +1,16 @@ package WayofTime.alchemicalWizardry.common.items; +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.item.ItemBucket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class LifeBucket extends ItemBucket { public LifeBucket(Block block) { super(block); - // TODO Auto-generated constructor stub } @Override diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java index e6081180..737760e4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class MagicianBloodOrb extends EnergyBattery { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java index 5e9c19c7..e82a160d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class MasterBloodOrb extends EnergyBattery { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java index 06482ac3..cd737697 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.items; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class OrbOfTesting extends EnergyItems { @@ -28,8 +28,6 @@ public class OrbOfTesting extends EnergyItems this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Untitled"); } - //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, - //the item is not used. public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.shouldHeal()) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java index 37134dbc..235ddf42 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java @@ -1,27 +1,25 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ReinforcedTelepositionFocus extends TelepositionFocus { public ReinforcedTelepositionFocus() { super(3); - // TODO Auto-generated constructor stub } @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - //TODO this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedTeleposerFocus"); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java index 5452e519..ffccaeca 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java @@ -1,21 +1,20 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SacrificialDagger extends Item { @@ -31,25 +30,25 @@ public class SacrificialDagger extends Item @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - if(AlchemicalWizardry.wimpySettings) - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); - }else - { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SacrificialDagger"); - } + if (AlchemicalWizardry.wimpySettings) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } else + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SacrificialDagger"); + } } public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - if(AlchemicalWizardry.wimpySettings) - { - par3List.add("A slight draining feeling tickles your fingers"); - }else - { - par3List.add("Just a prick of the"); + if (AlchemicalWizardry.wimpySettings) + { + par3List.add("A slight draining feeling tickles your fingers"); + } else + { + par3List.add("Just a prick of the"); par3List.add("finger will suffice..."); - } + } } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) @@ -78,23 +77,21 @@ public class SacrificialDagger extends Item par2World.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); } - if(!par2World.isRemote && SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) - //if (!(par3EntityPlayer.getClass().equals(EntityPlayerMP.class))) + if (!par2World.isRemote && SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) { return par1ItemStack; } - if(par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) + if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) { findAndFillAltar(par2World, par3EntityPlayer, 20); - }else + } else { findAndFillAltar(par2World, par3EntityPlayer, 200); } if (par3EntityPlayer.getHealth() <= 0.001f) { - //par3EntityPlayer.inventory.dropAllItems(); par3EntityPlayer.onDeath(DamageSource.generic); } @@ -154,14 +151,14 @@ public class SacrificialDagger extends Item return null; } - + @Override public String getItemStackDisplayName(ItemStack par1ItemStack) { - if(AlchemicalWizardry.wimpySettings) - { - return "Sacrificial Orb"; - } - return super.getItemStackDisplayName(par1ItemStack); + if (AlchemicalWizardry.wimpySettings) + { + return "Sacrificial Orb"; + } + return super.getItemStackDisplayName(par1ItemStack); } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java index 192f34f4..20e032dc 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java @@ -1,16 +1,16 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class TelepositionFocus extends EnergyItems { @@ -28,7 +28,6 @@ public class TelepositionFocus extends EnergyItems @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - //TODO this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TeleposerFocus"); } @@ -60,12 +59,6 @@ public class TelepositionFocus extends EnergyItems { return par1ItemStack; } - -// if (!par2World.isRemote) -// { -// //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); -// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10)); -// } return par1ItemStack; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java index 86132c84..bec61005 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.items; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class WaterScribeTool extends ScribeTool { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java index 1bf349ca..b8aa28b3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java @@ -1,8 +1,12 @@ package WayofTime.alchemicalWizardry.common.items.energy; -import java.util.LinkedList; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.*; +import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; +import WayofTime.alchemicalWizardry.common.Int3; +import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -14,49 +18,41 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.common.Int3; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.LinkedList; +import java.util.List; public class ItemAttunedCrystal extends Item implements IReagentManipulator { - public static final int maxDistance = 5; - - public IIcon crystalBody; - public IIcon crystalLabel; - - public ItemAttunedCrystal() - { - super(); - this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - this.hasSubtypes = true; - this.maxStackSize = 1; - } - - @Override - public String getItemStackDisplayName(ItemStack stack) - { - Reagent reagent = this.getReagent(stack); - - String name = super.getItemStackDisplayName(stack); - - if(reagent != null) - { - name = name + " (" + reagent.name + ")"; - } - - return name; - } - - @Override + public static final int maxDistance = 5; + + public IIcon crystalBody; + public IIcon crystalLabel; + + public ItemAttunedCrystal() + { + super(); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.hasSubtypes = true; + this.maxStackSize = 1; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) + { + Reagent reagent = this.getReagent(stack); + + String name = super.getItemStackDisplayName(stack); + + if (reagent != null) + { + name = name + " (" + reagent.name + ")"; + } + + return name; + } + + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("A tool to tune alchemy"); @@ -64,324 +60,324 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator if (!(par1ItemStack.stackTagCompound == null)) { - Reagent reagent = this.getReagent(par1ItemStack); - if(reagent != null) - { - par3List.add("Currently selected reagent: " + reagent.name); - } - - if(this.getHasSavedCoordinates(par1ItemStack)) + Reagent reagent = this.getReagent(par1ItemStack); + if (reagent != null) { - par3List.add(""); - Int3 coords = this.getCoordinates(par1ItemStack); - par3List.add("Coords: " + coords.xCoord + ", " + coords.yCoord + ", " + coords.zCoord); + par3List.add("Currently selected reagent: " + reagent.name); + } + + if (this.getHasSavedCoordinates(par1ItemStack)) + { + par3List.add(""); + Int3 coords = this.getCoordinates(par1ItemStack); + par3List.add("Coords: " + coords.xCoord + ", " + coords.yCoord + ", " + coords.zCoord); par3List.add("Bound Dimension: " + getDimension(par1ItemStack)); - } + } } } - - @Override + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal1"); this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal2"); } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - switch(pass) - { - case 0: - return 256*(256*255 + 255) + 255; - case 1: - Reagent reagent = this.getReagent(stack); - if(reagent != null) - { - return (reagent.getColourRed()*256*256 + reagent.getColourGreen()*256 + reagent.getColourBlue()); - } - break; - } - - return 256*(256*255 + 255) + 255; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderPasses(int meta) - { - return 2; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int pass) - { - switch(pass) - { - case 0: - return this.crystalBody; - case 1: - return this.crystalLabel; - } - return this.itemIcon; - } - - @Override + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + switch (pass) + { + case 0: + return 256 * (256 * 255 + 255) + 255; + case 1: + Reagent reagent = this.getReagent(stack); + if (reagent != null) + { + return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue()); + } + break; + } + + return 256 * (256 * 255 + 255) + 255; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderPasses(int meta) + { + return 2; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int pass) + { + switch (pass) + { + case 0: + return this.crystalBody; + case 1: + return this.crystalLabel; + } + return this.itemIcon; + } + + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if(world.isRemote) - { - return itemStack; - } - - MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false); + if (world.isRemote) + { + return itemStack; + } + + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false); if (movingobjectposition == null) { - if(player.isSneaking()) - { - this.setHasSavedCoordinates(itemStack, false); - player.addChatComponentMessage(new ChatComponentText("Clearing saved container...")); - } - + if (player.isSneaking()) + { + this.setHasSavedCoordinates(itemStack, false); + player.addChatComponentMessage(new ChatComponentText("Clearing saved container...")); + } + return itemStack; } else { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int x = movingobjectposition.blockX; int y = movingobjectposition.blockY; int z = movingobjectposition.blockZ; - - TileEntity tile = world.getTileEntity(x, y, z); - - if(!(tile instanceof IReagentHandler)) - { - return itemStack; - } - - IReagentHandler relay = (IReagentHandler)tile; - if(player.isSneaking()) + TileEntity tile = world.getTileEntity(x, y, z); + + if (!(tile instanceof IReagentHandler)) { - ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN); - if(infos != null) - { - List reagentList = new LinkedList(); - for(ReagentContainerInfo info : infos) - { - if(info != null) - { - ReagentStack reagentStack = info.reagent; - if(reagentStack != null) - { - Reagent reagent = reagentStack.reagent; - if(reagent != null) - { - reagentList.add(reagent); - } - } - } - } - - Reagent pastReagent = this.getReagent(itemStack); - - if(reagentList.size() <= 0) - { - return itemStack; - } - - int reagentLocation = -1; - - reagentLocation = reagentList.indexOf(pastReagent); - - if(reagentLocation == -1 || reagentLocation+1 >= reagentList.size()) - { - this.setReagentWithNotification(itemStack, reagentList.get(0), player); - }else - { - this.setReagentWithNotification(itemStack, reagentList.get(reagentLocation + 1), player); - } - } - }else + return itemStack; + } + + IReagentHandler relay = (IReagentHandler) tile; + + if (player.isSneaking()) { - if(this.getHasSavedCoordinates(itemStack)) + ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN); + if (infos != null) { - Int3 coords = this.getCoordinates(itemStack); - int dimension = this.getDimension(itemStack); - - if(coords == null) - { - return itemStack; - } - - if(dimension != world.provider.dimensionId || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance) - { - player.addChatComponentMessage(new ChatComponentText("Linked container is either too far or is in a different dimension.")); - return itemStack; - } - - TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); - if(!(pastTile instanceof TEReagentConduit)) - { - player.addChatComponentMessage(new ChatComponentText("Can no longer find linked container.")); - return itemStack; - } - - Reagent reagent = this.getReagent(itemStack); - - if(reagent == null) - { - return itemStack; - } - - TEReagentConduit pastRelay = (TEReagentConduit)pastTile; - - if(player.isSneaking()) - { - pastRelay.removeReagentDestinationViaActual(reagent, x, y, z); - }else - { - if(pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) - { - player.addChatComponentMessage(new ChatComponentText("Container is now linked. Transmitting: " + reagent.name)); - }else - { - player.addChatComponentMessage(new ChatComponentText("Linked container has no connections remaining!")); - } - } - world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord); - }else - { - int dimension = world.provider.dimensionId; - - this.setDimension(itemStack, dimension); - this.setCoordinates(itemStack, new Int3(x, y, z)); - - player.addChatComponentMessage(new ChatComponentText("Linking to selected container.")); + List reagentList = new LinkedList(); + for (ReagentContainerInfo info : infos) + { + if (info != null) + { + ReagentStack reagentStack = info.reagent; + if (reagentStack != null) + { + Reagent reagent = reagentStack.reagent; + if (reagent != null) + { + reagentList.add(reagent); + } + } + } + } + + Reagent pastReagent = this.getReagent(itemStack); + + if (reagentList.size() <= 0) + { + return itemStack; + } + + int reagentLocation = -1; + + reagentLocation = reagentList.indexOf(pastReagent); + + if (reagentLocation == -1 || reagentLocation + 1 >= reagentList.size()) + { + this.setReagentWithNotification(itemStack, reagentList.get(0), player); + } else + { + this.setReagentWithNotification(itemStack, reagentList.get(reagentLocation + 1), player); + } } - } + } else + { + if (this.getHasSavedCoordinates(itemStack)) + { + Int3 coords = this.getCoordinates(itemStack); + int dimension = this.getDimension(itemStack); + + if (coords == null) + { + return itemStack; + } + + if (dimension != world.provider.dimensionId || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance) + { + player.addChatComponentMessage(new ChatComponentText("Linked container is either too far or is in a different dimension.")); + return itemStack; + } + + TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); + if (!(pastTile instanceof TEReagentConduit)) + { + player.addChatComponentMessage(new ChatComponentText("Can no longer find linked container.")); + return itemStack; + } + + Reagent reagent = this.getReagent(itemStack); + + if (reagent == null) + { + return itemStack; + } + + TEReagentConduit pastRelay = (TEReagentConduit) pastTile; + + if (player.isSneaking()) + { + pastRelay.removeReagentDestinationViaActual(reagent, x, y, z); + } else + { + if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) + { + player.addChatComponentMessage(new ChatComponentText("Container is now linked. Transmitting: " + reagent.name)); + } else + { + player.addChatComponentMessage(new ChatComponentText("Linked container has no connections remaining!")); + } + } + world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord); + } else + { + int dimension = world.provider.dimensionId; + + this.setDimension(itemStack, dimension); + this.setCoordinates(itemStack, new Int3(x, y, z)); + + player.addChatComponentMessage(new ChatComponentText("Linking to selected container.")); + } + } } } - - return itemStack; + + return itemStack; + } + + public void setCoordinates(ItemStack stack, Int3 coords) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + coords.writeToNBT(tag); + + this.setHasSavedCoordinates(stack, true); + } + + public void setDimension(ItemStack stack, int dimension) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + tag.setInteger("dimension", dimension); + } + + public Int3 getCoordinates(ItemStack stack) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + return Int3.readFromNBT(tag); + } + + public int getDimension(ItemStack stack) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + return tag.getInteger("dimension"); + } + + public void setHasSavedCoordinates(ItemStack stack, boolean flag) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + tag.setBoolean("hasSavedCoordinates", flag); + } + + public boolean getHasSavedCoordinates(ItemStack stack) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + return tag.getBoolean("hasSavedCoordinates"); + } + + public Reagent getReagent(ItemStack stack) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + return ReagentRegistry.getReagentForKey(tag.getString("reagent")); + } + + public void setReagent(ItemStack stack, Reagent reagent) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + tag.setString("reagent", ReagentRegistry.getKeyForReagent(reagent)); + } + + public void setReagentWithNotification(ItemStack stack, Reagent reagent, EntityPlayer player) + { + this.setReagent(stack, reagent); + + if (reagent != null) + { + player.addChatComponentMessage(new ChatComponentText("Attuned Crystal now set to: " + reagent.name)); + } } - - public void setCoordinates(ItemStack stack, Int3 coords) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - coords.writeToNBT(tag); - - this.setHasSavedCoordinates(stack, true); - } - - public void setDimension(ItemStack stack, int dimension) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - tag.setInteger("dimension", dimension); - } - - public Int3 getCoordinates(ItemStack stack) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - return Int3.readFromNBT(tag); - } - - public int getDimension(ItemStack stack) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - return tag.getInteger("dimension"); - } - - public void setHasSavedCoordinates(ItemStack stack, boolean flag) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - tag.setBoolean("hasSavedCoordinates", flag); - } - - public boolean getHasSavedCoordinates(ItemStack stack) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - return tag.getBoolean("hasSavedCoordinates"); - } - - public Reagent getReagent(ItemStack stack) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - return ReagentRegistry.getReagentForKey(tag.getString("reagent")); - } - - public void setReagent(ItemStack stack, Reagent reagent) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - tag.setString("reagent", ReagentRegistry.getKeyForReagent(reagent)); - } - - public void setReagentWithNotification(ItemStack stack, Reagent reagent, EntityPlayer player) - { - this.setReagent(stack, reagent); - - if(reagent != null) - { - player.addChatComponentMessage(new ChatComponentText("Attuned Crystal now set to: " + reagent.name)); - } - } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java index 38ae34fc..28bf37fb 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java @@ -1,7 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.energy; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; +import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -10,73 +13,68 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.common.Int3; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemDestinationClearer extends Item implements IReagentManipulator -{ - public ItemDestinationClearer() - { - super(); - this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - this.maxStackSize = 1; - } - - @Override +{ + public ItemDestinationClearer() + { + super(); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.maxStackSize = 1; + } + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TankClearer"); } - - @Override + + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("Used to clear the destination"); par3List.add("list for an alchemy container"); } - - @Override + + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if(world.isRemote) - { - return itemStack; - } - - MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false); + if (world.isRemote) + { + return itemStack; + } + + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false); if (movingobjectposition == null) - { + { return itemStack; } else { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int x = movingobjectposition.blockX; int y = movingobjectposition.blockY; int z = movingobjectposition.blockZ; - + TileEntity tile = world.getTileEntity(x, y, z); - - if(!(tile instanceof TEReagentConduit)) + + if (!(tile instanceof TEReagentConduit)) { - return itemStack; + return itemStack; } - - TEReagentConduit relay = (TEReagentConduit)tile; + + TEReagentConduit relay = (TEReagentConduit) tile; relay.reagentTargetList.clear(); - + player.addChatComponentMessage(new ChatComponentText("Destination list now cleared.")); } } - - return itemStack; + + return itemStack; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java index 14772607..97cc4a6a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java @@ -1,8 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.energy; -import java.util.LinkedList; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.*; +import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -14,47 +16,36 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.common.Int3; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.LinkedList; +import java.util.List; public class ItemTankSegmenter extends Item implements IReagentManipulator { - public IIcon crystalBody; - public IIcon crystalLabel; - - public ItemTankSegmenter() - { - super(); - this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - this.hasSubtypes = true; - this.maxStackSize = 1; - } - - @Override - public String getItemStackDisplayName(ItemStack stack) - { - Reagent reagent = this.getReagent(stack); - - String name = super.getItemStackDisplayName(stack); - - if(reagent != null) - { - name = name + " (" + reagent.name + ")"; - } - - return name; - } - - @Override + public IIcon crystalBody; + public IIcon crystalLabel; + + public ItemTankSegmenter() + { + super(); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.hasSubtypes = true; + this.maxStackSize = 1; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) + { + Reagent reagent = this.getReagent(stack); + String name = super.getItemStackDisplayName(stack); + if (reagent != null) + { + name = name + " (" + reagent.name + ")"; + } + return name; + } + + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("Used to designate which"); @@ -62,217 +53,209 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator if (!(par1ItemStack.stackTagCompound == null)) { - Reagent reagent = this.getReagent(par1ItemStack); - if(reagent != null) - { - par3List.add("Currently selected reagent: " + reagent.name); - } + Reagent reagent = this.getReagent(par1ItemStack); + if (reagent != null) + { + par3List.add("Currently selected reagent: " + reagent.name); + } } } - - @Override + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter1"); this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter2"); } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - switch(pass) - { - case 0: - return 256*(256*255 + 255) + 255; - case 1: - Reagent reagent = this.getReagent(stack); - if(reagent != null) - { - return (reagent.getColourRed()*256*256 + reagent.getColourGreen()*256 + reagent.getColourBlue()); - } - break; - } - - return 256*(256*255 + 255) + 255; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderPasses(int meta) - { - return 2; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int pass) - { - switch(pass) - { - case 0: - return this.crystalBody; - case 1: - return this.crystalLabel; - } - return this.itemIcon; - } - - @Override + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + switch (pass) + { + case 0: + return 256 * (256 * 255 + 255) + 255; + case 1: + Reagent reagent = this.getReagent(stack); + if (reagent != null) + { + return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue()); + } + break; + } + + return 256 * (256 * 255 + 255) + 255; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderPasses(int meta) + { + return 2; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int pass) + { + switch (pass) + { + case 0: + return this.crystalBody; + case 1: + return this.crystalLabel; + } + return this.itemIcon; + } + + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if(world.isRemote) - { - return itemStack; - } - - MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false); + if (world.isRemote) + { + return itemStack; + } + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false); if (movingobjectposition == null) { return itemStack; } else { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int x = movingobjectposition.blockX; int y = movingobjectposition.blockY; int z = movingobjectposition.blockZ; - TileEntity tile = world.getTileEntity(x, y, z); - - if(!(tile instanceof ISegmentedReagentHandler)) + if (!(tile instanceof ISegmentedReagentHandler)) { - return itemStack; + return itemStack; } - - ISegmentedReagentHandler reagentHandler = (ISegmentedReagentHandler)tile; - - if(player.isSneaking()) + ISegmentedReagentHandler reagentHandler = (ISegmentedReagentHandler) tile; + + if (player.isSneaking()) { - ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN); - if(infos != null) - { - List reagentList = new LinkedList(); - for(ReagentContainerInfo info : infos) - { - if(info != null) - { - ReagentStack reagentStack = info.reagent; - if(reagentStack != null) - { - Reagent reagent = reagentStack.reagent; - if(reagent != null) - { - reagentList.add(reagent); - } - } - } - } - - Reagent pastReagent = this.getReagent(itemStack); - - boolean goForNext = false; - boolean hasFound = false; - for(Reagent reagent : reagentList) - { - if(goForNext) - { - goForNext = false; - break; - } - - if(reagent == pastReagent) - { - goForNext = true; - hasFound = true; - } - } - - if(hasFound) - { - if(goForNext) - { - this.setReagentWithNotification(itemStack, reagentList.get(0), player); - } - }else - { - if(reagentList.size() >= 1) - { - this.setReagentWithNotification(itemStack, reagentList.get(0), player); - } - } - } - - }else - { - Reagent reagent = this.getReagent(itemStack); - if(reagent == null) + ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN); + if (infos != null) { - //TODO: Send message that "All are wiped" - reagentHandler.getAttunedTankMap().clear(); - return itemStack; + List reagentList = new LinkedList(); + for (ReagentContainerInfo info : infos) + { + if (info != null) + { + ReagentStack reagentStack = info.reagent; + if (reagentStack != null) + { + Reagent reagent = reagentStack.reagent; + if (reagent != null) + { + reagentList.add(reagent); + } + } + } + } + Reagent pastReagent = this.getReagent(itemStack); + boolean goForNext = false; + boolean hasFound = false; + for (Reagent reagent : reagentList) + { + if (goForNext) + { + goForNext = false; + break; + } + + if (reagent == pastReagent) + { + goForNext = true; + hasFound = true; + } + } + if (hasFound) + { + if (goForNext) + { + this.setReagentWithNotification(itemStack, reagentList.get(0), player); + } + } else + { + if (reagentList.size() >= 1) + { + this.setReagentWithNotification(itemStack, reagentList.get(0), player); + } + } + } + } else + { + Reagent reagent = this.getReagent(itemStack); + if (reagent == null) + { + //TODO: Send message that "All are wiped" + reagentHandler.getAttunedTankMap().clear(); + return itemStack; } int totalTankSize = reagentHandler.getNumberOfTanks(); int numberAssigned = reagentHandler.getTanksTunedToReagent(reagent) + 1; - - if(numberAssigned > totalTankSize) + + if (numberAssigned > totalTankSize) { - numberAssigned = 0; + numberAssigned = 0; } - - player.addChatComponentMessage(new ChatComponentText("Tank now has " + numberAssigned + " tank(s) set to: " + reagent.name)); - + + player.addChatComponentMessage(new ChatComponentText("Tank now has " + numberAssigned + " tank(s) set to: " + reagent.name)); + reagentHandler.setTanksTunedToReagent(reagent, numberAssigned); - } - }else if(movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS) + } + } else if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS) { - this.setReagent(itemStack, null); + this.setReagent(itemStack, null); } } - - return itemStack; + + return itemStack; + } + + public Reagent getReagent(ItemStack stack) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + return ReagentRegistry.getReagentForKey(tag.getString("reagent")); + } + + public void setReagent(ItemStack stack, Reagent reagent) + { + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + tag.setString("reagent", ReagentRegistry.getKeyForReagent(reagent)); + } + + public void setReagentWithNotification(ItemStack stack, Reagent reagent, EntityPlayer player) + { + this.setReagent(stack, reagent); + + if (reagent != null) + { + player.addChatComponentMessage(new ChatComponentText("Tank Segmenter now set to: " + reagent.name)); + } } - - public Reagent getReagent(ItemStack stack) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - return ReagentRegistry.getReagentForKey(tag.getString("reagent")); - } - - public void setReagent(ItemStack stack, Reagent reagent) - { - if(!stack.hasTagCompound()) - { - stack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tag = stack.getTagCompound(); - - tag.setString("reagent", ReagentRegistry.getKeyForReagent(reagent)); - } - - public void setReagentWithNotification(ItemStack stack, Reagent reagent, EntityPlayer player) - { - this.setReagent(stack, reagent); - - if(reagent != null) - { - player.addChatComponentMessage(new ChatComponentText("Tank Segmenter now set to: " + reagent.name)); - } - } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java index 32da83be..8c348659 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java @@ -1,15 +1,15 @@ package WayofTime.alchemicalWizardry.common.items.forestry; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.List; public class ItemBloodFrame extends EnergyItems //implements IHiveFrame { @@ -18,7 +18,6 @@ public class ItemBloodFrame extends EnergyItems //implements IHiveFrame super(); this.maxStackSize = 1; this.setMaxDamage(10); - //setMaxDamage(1000); setEnergyUsed(3000); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -45,107 +44,96 @@ public class ItemBloodFrame extends EnergyItems //implements IHiveFrame public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); - - if(par1ItemStack.getItemDamage()>0) + + if (par1ItemStack.getItemDamage() > 0) { - EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); - par1ItemStack.setItemDamage(par1ItemStack.getItemDamage()-1); + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); + par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); } - + return par1ItemStack; } /**TODO Bee Stuff - @Override - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } + @Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } - @Override - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } + @Override public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } - @Override - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - // TODO Auto-generated method stub - return 0.0001f; - } + @Override public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) + { + // TODO Auto-generated method stub + return 0.0001f; + } - @Override - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 0; - } + @Override public float getProductionModifier(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 0; + } - @Override - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } + @Override public float getFloweringModifier(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } - @Override - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - // TODO Auto-generated method stub - return 1; - } + @Override public float getGeneticDecay(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } - @Override - public boolean isSealed() - { - // TODO Auto-generated method stub - return false; - } + @Override public boolean isSealed() + { + // TODO Auto-generated method stub + return false; + } - @Override - public boolean isSelfLighted() - { - // TODO Auto-generated method stub - return false; - } + @Override public boolean isSelfLighted() + { + // TODO Auto-generated method stub + return false; + } - @Override - public boolean isSunlightSimulated() - { - // TODO Auto-generated method stub - return false; - } + @Override public boolean isSunlightSimulated() + { + // TODO Auto-generated method stub + return false; + } - @Override - public boolean isHellish() - { - // TODO Auto-generated method stub - return false; - } + @Override public boolean isHellish() + { + // TODO Auto-generated method stub + return false; + } - @Override - public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) - { - // TODO Auto-generated method stub - if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear)) - { - EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear); - return frame; - }else - { - frame.setItemDamage(frame.getItemDamage() + wear); - if(frame.getItemDamage()>=frame.getMaxDamage()) - { - return null; - } - return frame; - } + @Override public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) + { + // TODO Auto-generated method stub + if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear)) + { + EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear); + return frame; + }else + { + frame.setItemDamage(frame.getItemDamage() + wear); + if(frame.getItemDamage()>=frame.getMaxDamage()) + { + return null; + } + return frame; + } - } - - */ + } + + */ } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java index 05f3d698..8e945e28 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java @@ -1,11 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; +import com.google.common.collect.HashMultimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -24,13 +23,12 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; -import com.google.common.collect.HashMultimap; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; public class AlchemyFlask extends Item { @@ -42,7 +40,6 @@ public class AlchemyFlask extends Item this.setMaxDamage(8); this.setMaxStackSize(1); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - // TODO Auto-generated constructor stub } @Override @@ -64,7 +61,6 @@ public class AlchemyFlask extends Item NBTTagCompound nbttagcompound = (NBTTagCompound) nbttaglist.getCompoundTagAt(i); arraylist.add(AlchemyPotionHelper.readEffectFromNBT(nbttagcompound)); } - return arraylist; } else { @@ -166,11 +162,6 @@ public class AlchemyFlask extends Item */ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -// if(par3EntityPlayer.isSneaking()) -// { -// this.setIsPotionThrowable(true, par1ItemStack); -// return par1ItemStack; -// } if (par1ItemStack.getItemDamage() < par1ItemStack.getMaxDamage()) { if (this.isPotionThrowable(par1ItemStack)) @@ -195,14 +186,12 @@ public class AlchemyFlask extends Item par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); } - return par1ItemStack; } public void setConcentrationOfPotion(ItemStack par1ItemStack, int potionID, int concentration) { ArrayList list = this.getEffects(par1ItemStack); - if (list != null) { for (AlchemyPotionHelper aph : list) @@ -213,7 +202,6 @@ public class AlchemyFlask extends Item break; } } - this.setEffects(par1ItemStack, list); } } @@ -221,7 +209,6 @@ public class AlchemyFlask extends Item public void setDurationFactorOfPotion(ItemStack par1ItemStack, int potionID, int durationFactor) { ArrayList list = this.getEffects(par1ItemStack); - if (list != null) { for (AlchemyPotionHelper aph : list) @@ -232,7 +219,6 @@ public class AlchemyFlask extends Item break; } } - this.setEffects(par1ItemStack, list); } } @@ -257,7 +243,6 @@ public class AlchemyFlask extends Item { int i = 0; ArrayList list = this.getEffects(par1ItemStack); - if (list != null) { for (AlchemyPotionHelper aph : list) @@ -269,13 +254,9 @@ public class AlchemyFlask extends Item i++; } - - //if(i=1 && potionEffects<=5) { switch (potionEffects) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java index 65bb052e..32d0e599 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class GreaterLengtheningCatalyst extends LengtheningCatalyst { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java index e5dd6d47..56dbe73f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class GreaterPowerCatalyst extends PowerCatalyst { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java index 7476f689..24831748 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java @@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; - import org.lwjgl.input.Keyboard; import java.util.List; @@ -18,7 +17,6 @@ public class LengtheningCatalyst extends Item implements ICatalyst public LengtheningCatalyst(int catalystStrength) { - super(); this.catalystStrength = catalystStrength; setCreativeTab(AlchemicalWizardry.tabBloodMagic); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java index e945ed22..581a4575 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class MundaneLengtheningCatalyst extends LengtheningCatalyst { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java index 86291dec..0a85efbe 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class MundanePowerCatalyst extends PowerCatalyst { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java index 60d98566..541c8f25 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java @@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; - import org.lwjgl.input.Keyboard; import java.util.List; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java index 6a2edc0b..d3015035 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java @@ -1,20 +1,18 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import org.lwjgl.input.Keyboard; - import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.common.IBindingAgent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; + +import java.util.List; public class StandardBindingAgent extends Item implements IBindingAgent { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java index 0cc4c9a8..c0a93be4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import net.minecraft.client.renderer.texture.IIconRegister; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class StandardFillingAgent extends WeakFillingAgent { @@ -16,7 +16,6 @@ public class StandardFillingAgent extends WeakFillingAgent @Override public int getFilledAmountForPotionNumber(int potionEffects) { - //Random rand = new Random(); if (potionEffects == 0) { return 8; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java index 24ee6f0b..86c941e5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java @@ -1,15 +1,14 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import net.minecraft.client.renderer.texture.IIconRegister; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; public class WeakBindingAgent extends StandardBindingAgent { public WeakBindingAgent() { super(); - // TODO Auto-generated constructor stub } @Override diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java index cd858f16..a5a8a101 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java @@ -1,21 +1,19 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import java.util.List; -import java.util.Random; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import org.lwjgl.input.Keyboard; - import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.common.IFillingAgent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; + +import java.util.List; +import java.util.Random; public class WeakFillingAgent extends Item implements IFillingAgent { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java index 8858819b..2236bd84 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java @@ -1,17 +1,17 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +import java.util.List; public class AirSigil extends EnergyItems implements ArmourUpgrade { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java index bf83193b..8c99a5ad 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java @@ -1,7 +1,15 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -14,16 +22,8 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class DivinationSigil extends Item implements ArmourUpgrade, IReagentManipulator, IBindable { @@ -31,7 +31,6 @@ public class DivinationSigil extends Item implements ArmourUpgrade, IReagentMani { super(); this.maxStackSize = 1; - //setMaxDamage(1000); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -72,9 +71,8 @@ public class DivinationSigil extends Item implements ArmourUpgrade, IReagentMani } String ownerName = itemTag.getString("ownerName"); - //PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(ownerName)); int currentEssence = EnergyItems.getCurrentEssence(ownerName); - + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); if (movingobjectposition == null) @@ -84,58 +82,55 @@ public class DivinationSigil extends Item implements ArmourUpgrade, IReagentMani return par1ItemStack; } else { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int x = movingobjectposition.blockX; int y = movingobjectposition.blockY; int z = movingobjectposition.blockZ; - + TileEntity tile = par2World.getTileEntity(x, y, z); - - if(!(tile instanceof IReagentHandler)) + + if (!(tile instanceof IReagentHandler)) { - par3EntityPlayer.addChatMessage(new ChatComponentText("Current Essence: " + EnergyItems.getCurrentEssence(ownerName) + "LP")); - - return par1ItemStack; + par3EntityPlayer.addChatMessage(new ChatComponentText("Current Essence: " + EnergyItems.getCurrentEssence(ownerName) + "LP")); + + return par1ItemStack; } - - IReagentHandler relay = (IReagentHandler)tile; + + IReagentHandler relay = (IReagentHandler) tile; ReagentContainerInfo[] infoList = relay.getContainerInfo(ForgeDirection.UNKNOWN); - if(infoList != null) + if (infoList != null) { - for(ReagentContainerInfo info : infoList) - { - if(info != null && info.reagent != null && info.reagent.reagent != null) - { - par3EntityPlayer.addChatComponentMessage(new ChatComponentText("Reagent: " + ReagentRegistry.getKeyForReagent(info.reagent.reagent) + ", Amount: " + info.reagent.amount)); - } - } + for (ReagentContainerInfo info : infoList) + { + if (info != null && info.reagent != null && info.reagent.reagent != null) + { + par3EntityPlayer.addChatComponentMessage(new ChatComponentText("Reagent: " + ReagentRegistry.getKeyForReagent(info.reagent.reagent) + ", Amount: " + info.reagent.amount)); + } + } } } } - + return par1ItemStack; } @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - // TODO Auto-generated method stub player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9, true)); } @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 25; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java index 6134399a..440e6be2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java @@ -1,13 +1,5 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; @@ -15,6 +7,14 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightPro import WayofTime.alchemicalWizardry.common.items.EnergyItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +import java.util.List; public class ItemBloodLightSigil extends EnergyItems implements IHolding { @@ -24,10 +24,8 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding { super(); this.maxStackSize = 1; - //setMaxDamage(1000); setEnergyUsed(10); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - // TODO Auto-generated constructor stub } @Override diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java index 2af9459f..38331762 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemFluidSigil.java @@ -1,8 +1,9 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.Int3; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.MaterialLiquid; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,208 +17,194 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidContainerItem; -import net.minecraftforge.fluids.IFluidHandler; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.Int3; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fluids.*; + +import java.util.ArrayList; +import java.util.List; public class ItemFluidSigil extends Item implements IFluidContainerItem { - private int capacity = 128 * 1000; - private static final int STATE_SYPHON = 0; - private static final int STATE_FORCE_SYPHON = 1; - private static final int STATE_PLACE = 2; - private static final int STATE_INPUT_TANK = 3; - private static final int STATE_DRAIN_TANK = 4; - private static final int STATE_BEAST_DRAIN = 5; - private static final int maxNumOfStates = 6; - - public ItemFluidSigil() - { - super(); - this.setMaxDamage(0); - this.setMaxStackSize(1); - setCreativeTab(AlchemicalWizardry.tabBloodMagic); - } - - @Override + private int capacity = 128 * 1000; + private static final int STATE_SYPHON = 0; + private static final int STATE_FORCE_SYPHON = 1; + private static final int STATE_PLACE = 2; + private static final int STATE_INPUT_TANK = 3; + private static final int STATE_DRAIN_TANK = 4; + private static final int STATE_BEAST_DRAIN = 5; + private static final int maxNumOfStates = 6; + + public ItemFluidSigil() + { + super(); + this.setMaxDamage(0); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("A sigil with a lovely affinity for fluids"); if (!(par1ItemStack.stackTagCompound == null)) { - //par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); - - switch(this.getActionState(par1ItemStack)) + switch (this.getActionState(par1ItemStack)) { - case STATE_SYPHON: - par3List.add("Syphoning Mode"); - break; - case STATE_FORCE_SYPHON: - par3List.add("Force-syphon Mode"); - break; - case STATE_PLACE: - par3List.add("Fluid Placement Mode"); - break; - case STATE_INPUT_TANK: - par3List.add("Fill Tank Mode"); - break; - case STATE_DRAIN_TANK: - par3List.add("Drain Tank Mode"); - break; - case STATE_BEAST_DRAIN: - par3List.add("Beast Mode"); - break; + case STATE_SYPHON: + par3List.add("Syphoning Mode"); + break; + case STATE_FORCE_SYPHON: + par3List.add("Force-syphon Mode"); + break; + case STATE_PLACE: + par3List.add("Fluid Placement Mode"); + break; + case STATE_INPUT_TANK: + par3List.add("Fill Tank Mode"); + break; + case STATE_DRAIN_TANK: + par3List.add("Drain Tank Mode"); + break; + case STATE_BEAST_DRAIN: + par3List.add("Beast Mode"); + break; } - + FluidStack fluid = this.getFluid(par1ItemStack); - if(fluid!=null && fluid.amount>0) + if (fluid != null && fluid.amount > 0) { - String str = fluid.getFluid().getName(); - int amount = fluid.amount; - - par3List.add("" + amount + "mB of " + str); - }else + String str = fluid.getFluid().getName(); + int amount = fluid.amount; + + par3List.add("" + amount + "mB of " + str); + } else { - par3List.add("Empty"); + par3List.add("Empty"); } } } - - @Override + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil"); } - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) - { - if(par3EntityPlayer.isSneaking()) - { - int curState = this.cycleActionState(par1ItemStack); - this.sendMessageViaState(curState, par3EntityPlayer); - return par1ItemStack; - } - -// if(par2World.isRemote) -// { -// return par1ItemStack; -// } - - switch(this.getActionState(par1ItemStack)) - { - case STATE_SYPHON: - return this.fillItemFromWorld(par1ItemStack, par2World, par3EntityPlayer,false); - case STATE_FORCE_SYPHON: - return this.fillItemFromWorld(par1ItemStack, par2World, par3EntityPlayer,true); - case STATE_PLACE: - return this.emptyItemToWorld(par1ItemStack, par2World, par3EntityPlayer); - case STATE_INPUT_TANK: - return this.fillSelectedTank(par1ItemStack, par2World, par3EntityPlayer); - case STATE_DRAIN_TANK: - return this.drainSelectedTank(par1ItemStack, par2World, par3EntityPlayer); - case STATE_BEAST_DRAIN: - return this.fillItemFromBeastWorld(par1ItemStack, par2World, par3EntityPlayer, true); - } - - return par1ItemStack; - } - - public int getActionState(ItemStack item) - { - if (item.stackTagCompound == null) + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (par3EntityPlayer.isSneaking()) { - item.setTagCompound(new NBTTagCompound()); - } - - return item.stackTagCompound.getInteger("actionState"); - } - - public void setActionState(ItemStack item, int actionState) - { - if (item.stackTagCompound == null) + int curState = this.cycleActionState(par1ItemStack); + this.sendMessageViaState(curState, par3EntityPlayer); + return par1ItemStack; + } + + switch (this.getActionState(par1ItemStack)) + { + case STATE_SYPHON: + return this.fillItemFromWorld(par1ItemStack, par2World, par3EntityPlayer, false); + case STATE_FORCE_SYPHON: + return this.fillItemFromWorld(par1ItemStack, par2World, par3EntityPlayer, true); + case STATE_PLACE: + return this.emptyItemToWorld(par1ItemStack, par2World, par3EntityPlayer); + case STATE_INPUT_TANK: + return this.fillSelectedTank(par1ItemStack, par2World, par3EntityPlayer); + case STATE_DRAIN_TANK: + return this.drainSelectedTank(par1ItemStack, par2World, par3EntityPlayer); + case STATE_BEAST_DRAIN: + return this.fillItemFromBeastWorld(par1ItemStack, par2World, par3EntityPlayer, true); + } + + return par1ItemStack; + } + + public int getActionState(ItemStack item) + { + if (item.stackTagCompound == null) { item.setTagCompound(new NBTTagCompound()); } - - item.stackTagCompound.setInteger("actionState", actionState); - } - - public int cycleActionState(ItemStack item) - { - int state = this.getActionState(item); - - state++; - - if(state>=maxNumOfStates) - { - state = 0; - } - - this.setActionState(item, state); - - return state; - } - - public void sendMessageViaState(int state, EntityPlayer player) - { - if(player.worldObj.isRemote) - { - ChatComponentText cmc = new ChatComponentText(""); - switch(state) - { - case STATE_SYPHON: - cmc.appendText("Now in Syphoning Mode"); - break; - case STATE_FORCE_SYPHON: - cmc.appendText("Now in Force-syphon Mode"); - break; - case STATE_PLACE: - cmc.appendText("Now in Fluid Placement Mode"); - break; - case STATE_INPUT_TANK: - cmc.appendText("Now in Fill Tank Mode"); - break; - case STATE_DRAIN_TANK: - cmc.appendText("Now in Drain Tank Mode"); - break; - case STATE_BEAST_DRAIN: - cmc.appendText("Now in Beast Mode"); - break; - } - player.addChatComponentMessage(cmc); - } - } - - public ItemStack fillItemFromBeastWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill) - { - if(world.isRemote) - { - return container; - } - int range = 5; - - float f = 1.0F; - double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f; - double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + 1.62D - (double)player.yOffset; - double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f; + + return item.stackTagCompound.getInteger("actionState"); + } + + public void setActionState(ItemStack item, int actionState) + { + if (item.stackTagCompound == null) + { + item.setTagCompound(new NBTTagCompound()); + } + + item.stackTagCompound.setInteger("actionState", actionState); + } + + public int cycleActionState(ItemStack item) + { + int state = this.getActionState(item); + + state++; + + if (state >= maxNumOfStates) + { + state = 0; + } + + this.setActionState(item, state); + + return state; + } + + public void sendMessageViaState(int state, EntityPlayer player) + { + if (player.worldObj.isRemote) + { + ChatComponentText cmc = new ChatComponentText(""); + switch (state) + { + case STATE_SYPHON: + cmc.appendText("Now in Syphoning Mode"); + break; + case STATE_FORCE_SYPHON: + cmc.appendText("Now in Force-syphon Mode"); + break; + case STATE_PLACE: + cmc.appendText("Now in Fluid Placement Mode"); + break; + case STATE_INPUT_TANK: + cmc.appendText("Now in Fill Tank Mode"); + break; + case STATE_DRAIN_TANK: + cmc.appendText("Now in Drain Tank Mode"); + break; + case STATE_BEAST_DRAIN: + cmc.appendText("Now in Beast Mode"); + break; + } + player.addChatComponentMessage(cmc); + } + } + + public ItemStack fillItemFromBeastWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill) + { + if (world.isRemote) + { + return container; + } + int range = 5; + + float f = 1.0F; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; boolean flag = true; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); if (movingobjectposition == null) { return container; - } - else + } else { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { @@ -241,15 +228,15 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem { for (int j = 0; j < 2 * range + 1; j++) { - for(int k = 0; k < 2 * range + 1; k++) - { + for (int k = 0; k < 2 * range + 1; k++) + { boolList[i][j][k] = false; - } + } } } List positionList = new ArrayList(); - + boolList[range][range][range] = true; positionList.add(new Int3(range, range, range)); boolean isReady = false; @@ -262,158 +249,156 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem { for (int j = 0; j < 2 * range + 1; j++) { - for(int k=0; k < 2*range+1;k++) - { - if (boolList[i][j][k]) - { - if (i - 1 >= 0 && !boolList[i - 1][j][k]) - { - Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k); - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - if (fluid != null) - { - boolList[i - 1][j][k] = true; - positionList.add(new Int3(i-1,j,k)); - isReady = false; - } - } - - if (j - 1 >= 0 && !boolList[i][j - 1][k]) - { - Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k); - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - if (fluid != null) - { - boolList[i][j - 1][k] = true; - positionList.add(new Int3(i,j-1,k)); - isReady = false; - } - } - - if(k - 1 >=0 && !boolList[i][j][k - 1]) - { - Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1); - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - if (fluid != null) - { - boolList[i][j][k - 1] = true; - positionList.add(new Int3(i,j,k-1)); - isReady = false; - } - } - - if (i + 1 <= 2 * range && !boolList[i + 1][j][k]) - { - Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k); - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - if (fluid != null) - { - boolList[i + 1][j][k] = true; - positionList.add(new Int3(i+1,j,k)); - isReady = false; - } - } - - if (j + 1 <= 2 * range && !boolList[i][j + 1][k]) - { - Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k); - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - if (fluid != null) - { - boolList[i][j + 1][k] = true; - positionList.add(new Int3(i,j+1,k)); - isReady = false; - } - } - - if(k + 1 <= 2*range && !boolList[i][j][k+1]) - { - Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1); - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - if (fluid != null) - { - boolList[i][j][k+1] = true; - positionList.add(new Int3(i,j,k+1)); - isReady = false; - } - } - } - } + for (int k = 0; k < 2 * range + 1; k++) + { + if (boolList[i][j][k]) + { + if (i - 1 >= 0 && !boolList[i - 1][j][k]) + { + Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k); + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); + + if (fluid != null) + { + boolList[i - 1][j][k] = true; + positionList.add(new Int3(i - 1, j, k)); + isReady = false; + } + } + + if (j - 1 >= 0 && !boolList[i][j - 1][k]) + { + Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k); + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); + + if (fluid != null) + { + boolList[i][j - 1][k] = true; + positionList.add(new Int3(i, j - 1, k)); + isReady = false; + } + } + + if (k - 1 >= 0 && !boolList[i][j][k - 1]) + { + Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1); + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); + + if (fluid != null) + { + boolList[i][j][k - 1] = true; + positionList.add(new Int3(i, j, k - 1)); + isReady = false; + } + } + + if (i + 1 <= 2 * range && !boolList[i + 1][j][k]) + { + Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k); + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); + + if (fluid != null) + { + boolList[i + 1][j][k] = true; + positionList.add(new Int3(i + 1, j, k)); + isReady = false; + } + } + + if (j + 1 <= 2 * range && !boolList[i][j + 1][k]) + { + Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k); + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); + + if (fluid != null) + { + boolList[i][j + 1][k] = true; + positionList.add(new Int3(i, j + 1, k)); + isReady = false; + } + } + + if (k + 1 <= 2 * range && !boolList[i][j][k + 1]) + { + Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1); + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); + + if (fluid != null) + { + boolList[i][j][k + 1] = true; + positionList.add(new Int3(i, j, k + 1)); + isReady = false; + } + } + } + } } } } - - for(Int3 pos : positionList) + + for (Int3 pos : positionList) { - int i = pos.xCoord; - int j = pos.yCoord; - int k = pos.zCoord; + int i = pos.xCoord; + int j = pos.yCoord; + int k = pos.zCoord; - if(!boolList[i][j][k]) - { - continue; - } - if (world.getBlock(x+i-range, y+j-range, z+k-range) != null && world.getBlock(x+i-range, y+j-range, z+k-range).getMaterial() instanceof MaterialLiquid) + if (!boolList[i][j][k]) { - //world.setBlockToAir(x+i-range, y+j-range, z+k-range); - Block block = world.getBlock(x+i-range, y+j-range, z+k-range); - if(block == null) - { - continue; - } - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - System.out.println("x: " + (i-range) + " y: " + (j-range) + " z: " + (k-range)); - - - if(fluid==null || world.getBlockMetadata(x+i-range, y+j-range, z+k-range) != 0) - { - continue; - } - - - FluidStack fillStack = new FluidStack(fluid,1000); - - int amount = this.fill(container, fillStack, false); - - if((amount > 0 && forceFill) || (amount >=1000 && !forceFill)) - { - //if(!player.capabilities.isCreativeMode) - { - world.setBlockToAir(x+i-range, y+j-range, z+k-range); - - } - - this.fill(container, new FluidStack(fluid,1000), true); - } + continue; } - } + if (world.getBlock(x + i - range, y + j - range, z + k - range) != null && world.getBlock(x + i - range, y + j - range, z + k - range).getMaterial() instanceof MaterialLiquid) + { + //world.setBlockToAir(x+i-range, y+j-range, z+k-range); + Block block = world.getBlock(x + i - range, y + j - range, z + k - range); + if (block == null) + { + continue; + } + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); + + System.out.println("x: " + (i - range) + " y: " + (j - range) + " z: " + (k - range)); + + + if (fluid == null || world.getBlockMetadata(x + i - range, y + j - range, z + k - range) != 0) + { + continue; + } + + + FluidStack fillStack = new FluidStack(fluid, 1000); + + int amount = this.fill(container, fillStack, false); + + if ((amount > 0 && forceFill) || (amount >= 1000 && !forceFill)) + { + { + world.setBlockToAir(x + i - range, y + j - range, z + k - range); + + } + + this.fill(container, new FluidStack(fluid, 1000), true); + } + } + } } return container; } - } - - public ItemStack fillItemFromWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill) - { - float f = 1.0F; - double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f; - double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + 1.62D - (double)player.yOffset; - double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f; + } + + public ItemStack fillItemFromWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill) + { + float f = 1.0F; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; boolean flag = true; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); if (movingobjectposition == null) { return container; - } - else + } else { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { @@ -433,77 +418,72 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem if (world.getBlock(i, j, k) != null && world.getBlock(i, j, k).getMaterial() instanceof MaterialLiquid) { - Block block = world.getBlock(i, j, k); - Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - - if(fluid==null) - { - return container; - } - - FluidStack fillStack = new FluidStack(fluid,1000); - - int amount = this.fill(container, fillStack, false); + Block block = world.getBlock(i, j, k); + Fluid fluid = FluidRegistry.lookupFluidForBlock(block); - if((amount > 0 && forceFill) || (amount >=1000 && !forceFill)) - { - if(!player.capabilities.isCreativeMode) - { - world.setBlockToAir(i, j, k); - } - - this.fill(container, new FluidStack(fluid,1000), true); + if (fluid == null) + { + return container; + } + + FluidStack fillStack = new FluidStack(fluid, 1000); + + int amount = this.fill(container, fillStack, false); + + if ((amount > 0 && forceFill) || (amount >= 1000 && !forceFill)) + { + if (!player.capabilities.isCreativeMode) + { + world.setBlockToAir(i, j, k); + } + + this.fill(container, new FluidStack(fluid, 1000), true); if (!player.capabilities.isCreativeMode) { -// if (!EnergyItems.syphonBatteries(container, player, getEnergyUsed())) -// { -// } - } - else + } else { return container; } - } + } } } return container; } - } - - public ItemStack emptyItemToWorld(ItemStack container, World world, EntityPlayer player) - { - FluidStack simStack = this.drain(container, 1000, false); - - if(simStack!=null && simStack.amount>=1000) - { - Block fluidBlock = simStack.getFluid().getBlock(); - - float f = 1.0F; - double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f; - double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + 1.62D - (double)player.yOffset; - double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f; - boolean flag = false; - MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); + } - if (movingobjectposition == null) - { - return container; - } - else - { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) - { - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; + public ItemStack emptyItemToWorld(ItemStack container, World world, EntityPlayer player) + { + FluidStack simStack = this.drain(container, 1000, false); + + if (simStack != null && simStack.amount >= 1000) + { + Block fluidBlock = simStack.getFluid().getBlock(); + + float f = 1.0F; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; + boolean flag = false; + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); + + if (movingobjectposition == null) + { + return container; + } else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!world.canMineBlock(player, i, j, k)) + { + return container; + } - if (!world.canMineBlock(player, i, j, k)) - { - return container; - } - if (movingobjectposition.sideHit == 0) { --j; @@ -542,30 +522,28 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem if (this.tryPlaceContainedLiquid(world, fluidBlock, d0, d1, d2, i, j, k) && !player.capabilities.isCreativeMode) { this.drain(container, 1000, true); - - return container; - } - - } - return container; - } - } - - return container; - } - - public boolean tryPlaceContainedLiquid(World par1World, Block block, double par2, double par4, double par6, int par8, int par9, int par10) + return container; + } + + } + + return container; + } + } + + return container; + } + + public boolean tryPlaceContainedLiquid(World par1World, Block block, double par2, double par4, double par6, int par8, int par9, int par10) { if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).func_149730_j()) { return false; - } - else if ((par1World.getBlock(par8, par9, par10).getMaterial() instanceof MaterialLiquid && (par1World.getBlockMetadata(par8, par9, par10) == 0))) + } else if ((par1World.getBlock(par8, par9, par10).getMaterial() instanceof MaterialLiquid && (par1World.getBlockMetadata(par8, par9, par10) == 0))) { return false; - } - else + } else { if ((block == Blocks.water || block == Blocks.flowing_water) && par1World.provider.isHellWorld) { @@ -573,10 +551,9 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem for (int l = 0; l < 8; ++l) { - par1World.spawnParticle("largesmoke", (double)par8 + Math.random(), (double)par9 + Math.random(), (double)par10 + Math.random(), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("largesmoke", (double) par8 + Math.random(), (double) par9 + Math.random(), (double) par10 + Math.random(), 0.0D, 0.0D, 0.0D); } - } - else + } else { par1World.setBlock(par8, par9, par10, block, 0, 3); } @@ -584,91 +561,89 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem return true; } } - - public ItemStack fillSelectedTank(ItemStack container, World world, EntityPlayer player) - { - FluidStack fluid = this.getFluid(container); - - if(fluid == null) - { - return container; - } - - float f = 1.0F; - double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f; - double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + 1.62D - (double)player.yOffset; - double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f; + + public ItemStack fillSelectedTank(ItemStack container, World world, EntityPlayer player) + { + FluidStack fluid = this.getFluid(container); + + if (fluid == null) + { + return container; + } + + float f = 1.0F; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; boolean flag = false; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); if (movingobjectposition == null) { return container; - } - else + } else { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; - + TileEntity tile = world.getTileEntity(i, j, k); - - if(tile instanceof IFluidHandler) + + if (tile instanceof IFluidHandler) { - int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true); - - this.drain(container, amount, true); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true); + + this.drain(container, amount, true); } } } - + return container; - } - - public ItemStack drainSelectedTank(ItemStack container, World world, EntityPlayer player) - { - float f = 1.0F; - double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f; - double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + 1.62D - (double)player.yOffset; - double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f; + } + + public ItemStack drainSelectedTank(ItemStack container, World world, EntityPlayer player) + { + float f = 1.0F; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; boolean flag = false; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); if (movingobjectposition == null) { return container; - } - else + } else { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; - + TileEntity tile = world.getTileEntity(i, j, k); - - if(tile instanceof IFluidHandler) + + if (tile instanceof IFluidHandler) { - FluidStack fluidAmount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), false); - - int amount = this.fill(container, fluidAmount, false); - - if(amount>0) - { - ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), true); - - this.fill(container, fluidAmount, true); - } + FluidStack fluidAmount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), false); + + int amount = this.fill(container, fluidAmount, false); + + if (amount > 0) + { + ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), true); + + this.fill(container, fluidAmount, true); + } } } } - + return container; - } - + } + /* IFluidContainerItem */ @Override public FluidStack getFluid(ItemStack container) @@ -738,10 +713,10 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); FluidStack stack = FluidStack.loadFluidStackFromNBT(fluidTag); - - if(stack==null || stack.amount<=0) + + if (stack == null || stack.amount <= 0) { - NBTTagCompound fluidTag1 = resource.writeToNBT(new NBTTagCompound()); + NBTTagCompound fluidTag1 = resource.writeToNBT(new NBTTagCompound()); if (capacity < resource.amount) { @@ -764,8 +739,7 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem { stack.amount += resource.amount; filled = resource.amount; - } - else + } else { stack.amount = capacity; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java index ea4e4db2..9e15505e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSeerSigil.java @@ -1,19 +1,19 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +import java.util.List; public class ItemSeerSigil extends Item implements IHolding, ArmourUpgrade { @@ -60,29 +60,24 @@ public class ItemSeerSigil extends Item implements IHolding, ArmourUpgrade } String ownerName = itemTag.getString("ownerName"); - + return par1ItemStack; } - @Override - public void onArmourUpdate(World world, EntityPlayer player, - ItemStack thisItemStack) - { - // TODO Auto-generated method stub - - } + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + } - @Override - public boolean isUpgrade() - { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isUpgrade() + { + return false; + } - @Override - public int getEnergyForTenSeconds() - { - // TODO Auto-generated method stub - return 0; - } + @Override + public int getEnergyForTenSeconds() + { + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java index b341e859..d84f4118 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfEnderSeverance.java @@ -1,7 +1,11 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -11,12 +15,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding { @@ -148,18 +148,16 @@ public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding if (par1ItemStack.stackTagCompound.getBoolean("isActive")) { List list = SpellHelper.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5); - for(Entity entity : list) + for (Entity entity : list) { - if(!entity.equals(par3Entity)&&entity instanceof EntityLiving) - { - ((EntityLiving)entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionPlanarBinding.id,5,0)); - } + if (!entity.equals(par3Entity) && entity instanceof EntityLiving) + { + ((EntityLiving) entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionPlanarBinding.id, 5, 0)); + } } } - if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java index c7c607c4..30dd88df 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemSigilOfSupression.java @@ -1,9 +1,12 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - -import javax.swing.Icon; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; +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.entity.Entity; @@ -14,13 +17,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade { @@ -103,11 +101,11 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade { EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); - if(SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) + if (SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) { - return par1ItemStack; + return par1ItemStack; } - + if (par3EntityPlayer.isSneaking()) { return par1ItemStack; @@ -145,10 +143,10 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade { return; } - - if(SpellHelper.isFakePlayer(par2World, (EntityPlayer)par3Entity)) + + if (SpellHelper.isFakePlayer(par2World, (EntityPlayer) par3Entity)) { - return; + return; } EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; @@ -158,55 +156,53 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (par1ItemStack.stackTagCompound.getBoolean("isActive")&&(!par2World.isRemote)) + if (par1ItemStack.stackTagCompound.getBoolean("isActive") && (!par2World.isRemote)) { - Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); - int x = (int)blockVec.xCoord; - int y = (int)blockVec.yCoord; - int z = (int)blockVec.zCoord; + Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); + int x = (int) blockVec.xCoord; + int y = (int) blockVec.yCoord; + int z = (int) blockVec.zCoord; for (int i = -radius; i <= radius; i++) { for (int j = -radius; j <= radius; j++) { - for(int k = -radius; k <= radius; k++) + for (int k = -radius; k <= radius; k++) { - if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) + if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) { continue; } - - Block block = par2World.getBlock(x+i, y+j, z+k); - - - if(SpellHelper.isBlockFluid(block)) - { - if(par2World.getTileEntity(x+i, y+j, z+k)!=null) - { - par2World.setBlockToAir(x+i, y+j, z+k); - } - TESpectralContainer.createSpectralBlockAtLocation(par2World, x+i, y+j, z+k, refresh); - } - else - { - TileEntity tile = par2World.getTileEntity(x+i, y+j, z+k); - if(tile instanceof TESpectralContainer) - { - ((TESpectralContainer) tile).resetDuration(refresh); - } - } + + Block block = par2World.getBlock(x + i, y + j, z + k); + + + if (SpellHelper.isBlockFluid(block)) + { + if (par2World.getTileEntity(x + i, y + j, z + k) != null) + { + par2World.setBlockToAir(x + i, y + j, z + k); + } + TESpectralContainer.createSpectralBlockAtLocation(par2World, x + i, y + j, z + k, refresh); + } else + { + TileEntity tile = par2World.getTileEntity(x + i, y + j, z + k); + if (tile instanceof TESpectralContainer) + { + ((TESpectralContainer) tile).resetDuration(refresh); + } + } } } } } - + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); - + } } @@ -216,41 +212,40 @@ public class ItemSigilOfSupression extends EnergyItems implements ArmourUpgrade @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - Vec3 blockVec = SpellHelper.getEntityBlockVector(player); - int x = (int)blockVec.xCoord; - int y = (int)blockVec.yCoord; - int z = (int)blockVec.zCoord; + Vec3 blockVec = SpellHelper.getEntityBlockVector(player); + int x = (int) blockVec.xCoord; + int y = (int) blockVec.yCoord; + int z = (int) blockVec.zCoord; for (int i = -radius; i <= radius; i++) { for (int j = -radius; j <= radius; j++) { - for(int k = -radius; k <= radius; k++) + for (int k = -radius; k <= radius; k++) { - if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) + if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) { continue; } - - Block block = world.getBlock(x+i, y+j, z+k); - - - if(SpellHelper.isBlockFluid(block)) - { - if(world.getTileEntity(x+i, y+j, z+k)!=null) - { - world.setBlockToAir(x+i, y+j, z+k); - } - TESpectralContainer.createSpectralBlockAtLocation(world, x+i, y+j, z+k, refresh); - } - else - { - TileEntity tile = world.getTileEntity(x+i, y+j, z+k); - if(tile instanceof TESpectralContainer) - { - ((TESpectralContainer) tile).resetDuration(refresh); - } - } + + Block block = world.getBlock(x + i, y + j, z + k); + + + if (SpellHelper.isBlockFluid(block)) + { + if (world.getTileEntity(x + i, y + j, z + k) != null) + { + world.setBlockToAir(x + i, y + j, z + k); + } + TESpectralContainer.createSpectralBlockAtLocation(world, x + i, y + j, z + k, refresh); + } else + { + TileEntity tile = world.getTileEntity(x + i, y + j, z + k); + if (tile instanceof TESpectralContainer) + { + ((TESpectralContainer) tile).resetDuration(refresh); + } + } } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java index 75028002..e7692c32 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java @@ -1,7 +1,11 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +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.entity.player.EntityPlayer; @@ -18,12 +22,8 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyBattery; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class LavaSigil extends ItemBucket implements ArmourUpgrade { @@ -37,7 +37,6 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade { super(Blocks.lava); this.maxStackSize = 1; - //setMaxDamage(2000); setEnergyUsed(1000); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -86,7 +85,7 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f; double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset; double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f; - + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); if (movingobjectposition == null) @@ -104,79 +103,72 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade { return par1ItemStack; } - + TileEntity tile = par2World.getTileEntity(i, j, k); - if(tile instanceof IFluidHandler) + if (tile instanceof IFluidHandler) { - FluidStack fluid = new FluidStack(FluidRegistry.LAVA,1000); - int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false); - - if(amount>0) - { - ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true); - if (!par3EntityPlayer.capabilities.isCreativeMode) - { - if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) - { - } - } - } - - return par1ItemStack; - } + FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false); - //if (this.isFull == 0) - { - //Empty - } //else - { - if (movingobjectposition.sideHit == 0) - { - --j; - } - - if (movingobjectposition.sideHit == 1) - { - ++j; - } - - if (movingobjectposition.sideHit == 2) - { - --k; - } - - if (movingobjectposition.sideHit == 3) - { - ++k; - } - - if (movingobjectposition.sideHit == 4) - { - --i; - } - - if (movingobjectposition.sideHit == 5) - { - ++i; - } - - if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) - { - return par1ItemStack; - } - - if (this.tryPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k) && !par3EntityPlayer.capabilities.isCreativeMode) + if (amount > 0) { + ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { } - } else - { - return par1ItemStack; } } + + return par1ItemStack; + } + if (movingobjectposition.sideHit == 0) + { + --j; + } + + if (movingobjectposition.sideHit == 1) + { + ++j; + } + + if (movingobjectposition.sideHit == 2) + { + --k; + } + + if (movingobjectposition.sideHit == 3) + { + ++k; + } + + if (movingobjectposition.sideHit == 4) + { + --i; + } + + if (movingobjectposition.sideHit == 5) + { + ++i; + } + + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + if (this.tryPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k) && !par3EntityPlayer.capabilities.isCreativeMode) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } else + { + return par1ItemStack; + } } } @@ -189,10 +181,7 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade */ public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) { - //if (this.isFull <= 0) - { - //return false; - } if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) + if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) { return false; } else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0) @@ -214,39 +203,7 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade { return this.energyUsed; } - //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, - //the item is not used. - // protected void damagePlayer(World world, EntityPlayer player, int damage) -// { -// if (world != null) -// { -// double posX = player.posX; -// double posY = player.posY; -// double posZ = player.posZ; -// world.playSoundEffect((double)((float)posX + 0.5F), (double)((float)posY + 0.5F), (double)((float)posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); -// float f = (float)1.0F; -// float f1 = f * 0.6F + 0.4F; -// float f2 = f * f * 0.7F - 0.5F; -// float f3 = f * f * 0.6F - 0.7F; -// -// for (int l = 0; l < 8; ++l) -// { -// world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); -// } -// } -// -// for (int i = 0; i < damage; i++) -// { -// //player.setEntityHealth((player.getHealth()-1)); -// player.setEntityHealth(player.func_110143_aJ() - 1); -// -// if (player.func_110143_aJ() <= 0) -// { -// player.inventory.dropAllItems(); -// } -// } -// } protected boolean syphonBatteries(ItemStack ist, EntityPlayer player, int damageToBeDone) { if (!player.capabilities.isCreativeMode) @@ -262,7 +219,6 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade { continue; } - if (stack.getItem() instanceof EnergyBattery && !usedBattery) { if (stack.getItemDamage() <= stack.getMaxDamage() - damageToBeDone) @@ -286,25 +242,21 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade } @Override - public void onArmourUpdate(World world, EntityPlayer player, - ItemStack thisItemStack) + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - // TODO Auto-generated method stub - player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9,true)); + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9, true)); player.extinguish(); } @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 100; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java index daa017a1..6ff19344 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -11,10 +13,8 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SigilOfElementalAffinity extends EnergyItems { @@ -116,9 +116,6 @@ public class SigilOfElementalAffinity extends EnergyItems tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true)); par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true)); - - //Test with added health boost - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -157,7 +154,6 @@ public class SigilOfElementalAffinity extends EnergyItems if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java index 54c64001..bdddb8a8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java @@ -1,7 +1,11 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.IGrowable; import net.minecraft.client.renderer.texture.IIconRegister; @@ -14,13 +18,8 @@ import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.BonemealEvent; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade { @@ -32,10 +31,8 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade { super(); this.maxStackSize = 1; - //setMaxDamage(1000); setEnergyUsed(150); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - // TODO Auto-generated constructor stub } @Override @@ -124,10 +121,10 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); - - if(par2World.isRemote) + + if (par2World.isRemote) { - return par1ItemStack; + return par1ItemStack; } if (par3EntityPlayer.isSneaking()) @@ -169,7 +166,6 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade } EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (par1ItemStack.stackTagCompound == null) { par1ItemStack.setTagCompound(new NBTTagCompound()); @@ -181,7 +177,6 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade { EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()); } - int range = 5; int verticalRange = 2; int posX = (int) Math.round(par3Entity.posX - 0.5f); @@ -195,7 +190,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) { Block block = par2World.getBlock(ix, iy, iz); - + if (block instanceof IPlantable) { @@ -226,14 +221,14 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade { if (!p_150919_1_.isRemote) { - + } return true; } if (block instanceof IGrowable) { - IGrowable igrowable = (IGrowable)block; + IGrowable igrowable = (IGrowable) block; if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote)) { @@ -244,7 +239,7 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_); } - + } return true; @@ -257,11 +252,11 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - if(world.isRemote) + if (world.isRemote) { - return; + return; } - + int range = 5; int verticalRange = 2; int posX = (int) Math.round(player.posX - 0.5f); @@ -274,8 +269,8 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade { for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) { - Block block = world.getBlock(ix, iy, iz); - + Block block = world.getBlock(ix, iy, iz); + if (block instanceof IPlantable) { @@ -292,14 +287,12 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 50; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java index 2aecbf25..8878be0f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java @@ -1,9 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - -import javax.swing.Icon; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -12,11 +13,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SigilOfHaste extends EnergyItems implements ArmourUpgrade { @@ -29,7 +27,6 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade { super(); this.maxStackSize = 1; - //setMaxDamage(100); setEnergyUsed(250); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -117,10 +114,6 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1)); - //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 2)); - - //Test with added health boost - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -157,9 +150,6 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { - //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 205, 1)); - - //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 205, 2)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -179,20 +169,18 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade itemStack.setTagCompound(new NBTTagCompound()); } - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1,true)); + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true)); } @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 150; } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java index 03b1f730..1fd61f76 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java @@ -1,8 +1,11 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -13,12 +16,9 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; public class SigilOfHolding extends EnergyItems { @@ -30,7 +30,6 @@ public class SigilOfHolding extends EnergyItems { super(); this.maxStackSize = 1; - //setEnergyUsed(100); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -72,7 +71,6 @@ public class SigilOfHolding extends EnergyItems if (!(par1ItemStack.stackTagCompound == null)) { par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); -// par3List.add("Current slot: " + par1ItemStack.stackTagCompound.getInteger("selectedSlot")); ItemStack[] inv = getInternalInventory(par1ItemStack); if (inv == null) @@ -101,8 +99,6 @@ public class SigilOfHolding extends EnergyItems public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { //TODO Might be a good idea to have this item need to be in the player's first slot - //for it to search and consume sigils on right click. Might avoid confusion? At least - //will avoid the need to add a button just for it... this.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); if (par3EntityPlayer.isSneaking()) @@ -306,13 +302,13 @@ public class SigilOfHolding extends EnergyItems return false; } - if(addedItemStack.getItem() instanceof IHolding) + if (addedItemStack.getItem() instanceof IHolding) { - inv[candidateSlot] = addedItemStack; + inv[candidateSlot] = addedItemStack; saveInternalInventory(sigilItemStack, inv); return true; } - + for (ItemStack i : allowedSigils) { if (i != null && i.getItem() == item) @@ -335,7 +331,6 @@ public class SigilOfHolding extends EnergyItems if (this.hasAddedToInventory(sigilItemStack, playerInventory[i])) { player.inventory.consumeInventoryItem(playerInventory[i].getItem()); - //playerInventory[i].stackSize--; return true; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java index 5693d17f..7ad164b4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java @@ -1,7 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -11,11 +14,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade { @@ -27,17 +27,14 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade { super(); this.maxStackSize = 1; - //setMaxDamage(1000); setEnergyUsed(50); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - // TODO Auto-generated constructor stub } @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("I have a very magnetic personality!"); -// par3List.add("you have a green slate?"); if (!(par1ItemStack.stackTagCompound == null)) { @@ -94,23 +91,6 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade } } -// @Override -// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) -// { -// EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer); -// if(applyBonemeal(par1ItemStack,par3World,par4,par5,par6,par2EntityPlayer)) -// { -// if (par3World.isRemote) -// { -// par3World.playAuxSFX(2005, par4, par5, par6, 0); -// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); -// return true; -// } -// return true; -// } -// return false; -// } - @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { @@ -209,14 +189,12 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 25; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java index 424b4904..c4ec6672 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java @@ -1,7 +1,12 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; +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.entity.Entity; @@ -11,13 +16,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade { @@ -29,10 +29,8 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade { super(); this.maxStackSize = 1; - //setMaxDamage(1000); setEnergyUsed(100); setCreativeTab(AlchemicalWizardry.tabBloodMagic); - // TODO Auto-generated constructor stub } @Override @@ -96,23 +94,6 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade } } -// @Override -// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) -// { -// -// if(applyBonemeal(par1ItemStack,par3World,par4,par5,par6,par2EntityPlayer)) -// { -// if (par3World.isRemote) -// { -// par3World.playAuxSFX(2005, par4, par5, par6, 0); -// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); -// return true; -// } -// return true; -// } -// return false; -// } - @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { @@ -170,11 +151,6 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack)); this.setLPUsed(par1ItemStack, 0); } - -// if(par2World.isRemote) -// { -// return; -// } if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking()) { return; @@ -202,31 +178,30 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade { for (int iz = posZ - range; iz <= posZ + range; iz++) { - //for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++) { Block block = par2World.getBlock(ix, posY + verticalOffset, iz); - + if (par2World.isAirBlock(ix, posY + verticalOffset, iz)) { par2World.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3); - + TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz); - if(tile instanceof TESpectralBlock) - { - ((TESpectralBlock) tile).setDuration(100); - } + if (tile instanceof TESpectralBlock) + { + ((TESpectralBlock) tile).setDuration(100); + } if (par2World.rand.nextInt(2) == 0) { incremented++; } - }else if(block == ModBlocks.spectralBlock) + } else if (block == ModBlocks.spectralBlock) { - TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz); - if(tile instanceof TESpectralBlock) - { - ((TESpectralBlock) tile).setDuration(100); - } + TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz); + if (tile instanceof TESpectralBlock) + { + ((TESpectralBlock) tile).setDuration(100); + } } } } @@ -287,33 +262,27 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade int posX = (int) Math.round(player.posX - 0.5f); int posY = (int) player.posY; int posZ = (int) Math.round(player.posZ - 0.5f); - - //int incremented = 0; - for (int ix = posX - range; ix <= posX + range; ix++) { for (int iz = posZ - range; iz <= posZ + range; iz++) { - //for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++) + Block block = world.getBlock(ix, posY + verticalOffset, iz); + + if (world.isAirBlock(ix, posY + verticalOffset, iz)) { - Block block = world.getBlock(ix, posY + verticalOffset, iz); - - if (world.isAirBlock(ix, posY + verticalOffset, iz)) + world.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3); + + TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz); + if (tile instanceof TESpectralBlock) { - world.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3); - - TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz); - if(tile instanceof TESpectralBlock) - { - ((TESpectralBlock) tile).setDuration(100); - } - }else if(block == ModBlocks.spectralBlock) + ((TESpectralBlock) tile).setDuration(100); + } + } else if (block == ModBlocks.spectralBlock) + { + TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz); + if (tile instanceof TESpectralBlock) { - TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz); - if(tile instanceof TESpectralBlock) - { - ((TESpectralBlock) tile).setDuration(100); - } + ((TESpectralBlock) tile).setDuration(100); } } } @@ -323,14 +292,12 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 100; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java index 4f439bfe..0b4fb723 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java @@ -1,7 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -11,11 +14,8 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade { @@ -28,7 +28,6 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade { super(); this.maxStackSize = 1; - //setMaxDamage(100); setEnergyUsed(100); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -116,9 +115,6 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true)); - - //Test with added health boost - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -155,7 +151,6 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -181,14 +176,12 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 50; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java index 752797a7..04a9ecb2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java @@ -1,7 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -10,11 +13,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class SigilOfWind extends EnergyItems implements ArmourUpgrade { @@ -27,7 +27,6 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade { super(); this.maxStackSize = 1; - //setMaxDamage(100); setEnergyUsed(250); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -115,10 +114,6 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1)); - //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 2)); - - //Test with added health boost - //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -155,9 +150,6 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) { - //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 205, 1)); - - //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 205, 2)); if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) @@ -183,14 +175,12 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 150; } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java index 54695d21..925418d3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java @@ -1,12 +1,13 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - -import net.minecraft.block.Block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.MaterialLiquid; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemBucket; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -15,15 +16,10 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.entity.player.FillBucketEvent; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyBattery; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class VoidSigil extends ItemBucket implements ArmourUpgrade { @@ -34,7 +30,6 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade { super(null); this.maxStackSize = 1; - //setMaxDamage(1000); setEnergyUsed(50); isFull = 0; setCreativeTab(AlchemicalWizardry.tabBloodMagic); @@ -116,24 +111,24 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade { return par1ItemStack; } - + TileEntity tile = par2World.getTileEntity(i, j, k); - if(tile instanceof IFluidHandler) + if (tile instanceof IFluidHandler) { - FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, false); - - if(amount != null && amount.amount > 0) - { - ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, true); - if (!par3EntityPlayer.capabilities.isCreativeMode) + FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, false); + + if (amount != null && amount.amount > 0) + { + ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, true); + if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { } } - } - - return par1ItemStack; + } + + return par1ItemStack; } if (this.isFull == 0) @@ -173,23 +168,19 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade } @Override - public void onArmourUpdate(World world, EntityPlayer player, - ItemStack thisItemStack) + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - // TODO Auto-generated method stub } @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 25; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java index e8378c7a..83223570 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java @@ -1,7 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +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.entity.player.EntityPlayer; @@ -18,17 +21,11 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class WaterSigil extends ItemBucket implements ArmourUpgrade { - /** - * field for checking if the bucket has been filled. - */ private Block isFull = Blocks.water; private int energyUsed; @@ -36,7 +33,6 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade { super(Blocks.water); this.maxStackSize = 1; - //setMaxDamage(1000); setEnergyUsed(100); setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @@ -93,7 +89,6 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f; double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset; double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f; - //boolean flag = this.isFull == 0; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); if (movingobjectposition == null) @@ -111,27 +106,27 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade { return par1ItemStack; } - + TileEntity tile = par2World.getTileEntity(i, j, k); - if(tile instanceof IFluidHandler) + if (tile instanceof IFluidHandler) { - FluidStack fluid = new FluidStack(FluidRegistry.WATER,1000); - int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false); - - if(amount>0) - { - ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true); - if (!par3EntityPlayer.capabilities.isCreativeMode) + FluidStack fluid = new FluidStack(FluidRegistry.WATER, 1000); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false); + + if (amount > 0) + { + ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true); + if (!par3EntityPlayer.capabilities.isCreativeMode) { if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { } } - } - - return par1ItemStack; + } + + return par1ItemStack; } - + { if (movingobjectposition.sideHit == 0) { @@ -226,60 +221,22 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade { return this.energyUsed; } - //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, - //the item is not used. - -// protected void damagePlayer(World world, EntityPlayer player, int damage) -// { -// if (world != null) -// { -// double posX = player.posX; -// double posY = player.posY; -// double posZ = player.posZ; -// world.playSoundEffect((double)((float)posX + 0.5F), (double)((float)posY + 0.5F), (double)((float)posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); -// float f = (float)1.0F; -// float f1 = f * 0.6F + 0.4F; -// float f2 = f * f * 0.7F - 0.5F; -// float f3 = f * f * 0.6F - 0.7F; -// -// for (int l = 0; l < 8; ++l) -// { -// world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); -// } -// } -// -// for (int i = 0; i < damage; i++) -// { -// //player.setEntityHealth((player.getHealth()-1)); -// player.setEntityHealth(player.func_110143_aJ() - 1); -// } -// -// if (player.func_110143_aJ() <= 0) -// { -// player.inventory.dropAllItems(); -// } -// } @Override - public void onArmourUpdate(World world, EntityPlayer player, - ItemStack thisItemStack) + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - // TODO Auto-generated method stub - //PotionEffect effect = new PotionEffect(Potion.waterBreathing.id, 2,9); - player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9,true)); + player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true)); } @Override public boolean isUpgrade() { - // TODO Auto-generated method stub return true; } @Override public int getEnergyForTenSeconds() { - // TODO Auto-generated method stub return 50; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java index 6f1806a1..6664a019 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java @@ -1,11 +1,9 @@ package WayofTime.alchemicalWizardry.common.items.spell; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Random; -import java.util.Set; - +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -23,107 +21,103 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.*; public class ItemSpellMultiTool extends Item { - private static final String harvestLevelSuffix = "harvestLvl"; - private static final String digLevelSuffix = "digLvl"; - private static final String tagName = "BloodMagicTool"; - private Random rand = new Random(); - - public ItemSpellMultiTool() - { - super(); - this.setMaxDamage(0); - this.setMaxStackSize(1); - this.setFull3D(); - } + private static final String harvestLevelSuffix = "harvestLvl"; + private static final String digLevelSuffix = "digLvl"; + private static final String tagName = "BloodMagicTool"; + private Random rand = new Random(); + + public ItemSpellMultiTool() + { + super(); + this.setMaxDamage(0); + this.setMaxStackSize(1); + this.setFull3D(); + } @Override - public void registerIcons (IIconRegister iconRegister) + public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundTool"); + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundTool"); } - - @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + + @Override + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { - float damage = this.getCustomItemAttack(par1ItemStack); - - SpellParadigmTool parad = this.loadParadigmFromStack(par1ItemStack); - - if(parad != null) - { - parad.onLeftClickEntity(par1ItemStack, par2EntityLivingBase, par3EntityLivingBase); - } - - damage += parad.getAddedDamageForEntity(par2EntityLivingBase); - - if(rand.nextFloat() < this.getCritChance(par1ItemStack)) - { - damage *= 1.75f; - } - - if(par3EntityLivingBase instanceof EntityPlayer) - { - par2EntityLivingBase.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)par3EntityLivingBase), damage); - } - else - { - par2EntityLivingBase.attackEntityFrom(DamageSource.causeMobDamage(par3EntityLivingBase), damage); - } - + float damage = this.getCustomItemAttack(par1ItemStack); + + SpellParadigmTool parad = this.loadParadigmFromStack(par1ItemStack); + + if (parad != null) + { + parad.onLeftClickEntity(par1ItemStack, par2EntityLivingBase, par3EntityLivingBase); + } + + damage += parad.getAddedDamageForEntity(par2EntityLivingBase); + + if (rand.nextFloat() < this.getCritChance(par1ItemStack)) + { + damage *= 1.75f; + } + + if (par3EntityLivingBase instanceof EntityPlayer) + { + par2EntityLivingBase.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) par3EntityLivingBase), damage); + } else + { + par2EntityLivingBase.attackEntityFrom(DamageSource.causeMobDamage(par3EntityLivingBase), damage); + } + return true; } - - @Override - public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) + + @Override + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - SpellParadigmTool parad = this.loadParadigmFromStack(stack); - - if(parad != null && entity instanceof EntityLivingBase) - { - parad.onLeftClickEntity(stack, (EntityLivingBase)entity, player); - } - + SpellParadigmTool parad = this.loadParadigmFromStack(stack); + + if (parad != null && entity instanceof EntityLivingBase) + { + parad.onLeftClickEntity(stack, (EntityLivingBase) entity, player); + } + return false; } - - @Override - public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) + + @Override + public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { - if(player.worldObj.isRemote) - { - return false; - } - - if (!stack.hasTagCompound()) + if (player.worldObj.isRemote) + { + return false; + } + + if (!stack.hasTagCompound()) return false; World world = player.worldObj; Block block = player.worldObj.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); - // Block block = Block.blocksList[bID]; if (block == null || block == Blocks.air) return false; int hlvl = -1; float blockHardness = block.getBlockHardness(world, x, y, z); - + MovingObjectPosition mop = SpellHelper.raytraceFromEntity(world, player, true, 5.0D); - + Block localBlock = world.getBlock(x, y, z); int localMeta = world.getBlockMetadata(x, y, z); String toolClass = block.getHarvestTool(meta); if (toolClass != null && this.getHarvestLevel(stack, toolClass) != -1) hlvl = block.getHarvestLevel(meta); int toolLevel = this.getHarvestLevel(stack, toolClass); - - float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, x, y, z); - + + float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, x, y, z); + if (hlvl <= toolLevel && localHardness - 1.5 <= blockHardness) { boolean cancelHarvest = false; @@ -136,9 +130,9 @@ public class ItemSpellMultiTool extends Item String localToolClass = this.getToolClassForMaterial(localBlock.getMaterial()); - if(localToolClass != null && this.getHarvestLevel(stack, toolClass) >= localBlock.getHarvestLevel(localMeta)) + if (localToolClass != null && this.getHarvestLevel(stack, toolClass) >= localBlock.getHarvestLevel(localMeta)) { - isEffective = true; + isEffective = true; } @@ -155,42 +149,39 @@ public class ItemSpellMultiTool extends Item { localBlock.onBlockDestroyedByPlayer(world, x, y, z, localMeta); } - //localBlock.harvestBlock(world, player, x, y, z, localMeta); localBlock.onBlockHarvested(world, x, y, z, localMeta, player); if (blockHardness > 0f) onBlockDestroyed(stack, world, localBlock, x, y, z, player); - + List items = SpellHelper.getItemsFromBlock(world, localBlock, x, y, z, localMeta, this.getSilkTouch(stack), this.getFortuneLevel(stack)); - + SpellParadigmTool parad = this.loadParadigmFromStack(stack); List newItems = parad.handleItemList(stack, items); - - if(!world.isRemote) + + if (!world.isRemote) { - SpellHelper.spawnItemListInWorld(newItems, world, x + 0.5f, y + 0.5f, z + 0.5f); + SpellHelper.spawnItemListInWorld(newItems, world, x + 0.5f, y + 0.5f, z + 0.5f); } - + world.func_147479_m(x, y, z); - + int cost = 0; - + cost += parad.digSurroundingArea(stack, world, player, mop, localToolClass, localHardness, toolLevel, this); - + cost += parad.onBreakBlock(stack, world, player, localBlock, localMeta, x, y, z, ForgeDirection.getOrientation(mop.sideHit)); - - if(cost > 0) + + if (cost > 0) { - EnergyItems.syphonAndDamageWhileInContainer(stack, player, cost); + EnergyItems.syphonAndDamageWhileInContainer(stack, player, cost); } - } - else + } else { world.setBlockToAir(x, y, z); world.func_147479_m(x, y, z); - } + } - } - else + } else { world.setBlockToAir(x, y, z); world.func_147479_m(x, y, z); @@ -198,223 +189,201 @@ public class ItemSpellMultiTool extends Item } } } - + if (!world.isRemote) world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); return true; } - - public Material[] getMaterialsForToolclass(String toolClass) - { - if("pickaxe".equals(toolClass)) - { - return new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits }; - } - else if("shovel".equals(toolClass)) - { - return new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; - } - else if("axe".equals(toolClass)) - { - return new Material[]{ Material.wood, Material.vine, Material.circuits, Material.cactus }; - } - return new Material[0]; - } - - public String getToolClassForMaterial(Material mat) - { - String testString = "pickaxe"; - - Material[] matList = this.getMaterialsForToolclass(testString); - for(int i=0; i < matList.length; i++) - { - if(matList[i] == mat) - { - return testString; - } - } - - testString = "shovel"; - matList = this.getMaterialsForToolclass(testString); - for(int i=0; i < matList.length; i++) - { - if(matList[i] == mat) - { - return testString; - } - } - - testString = "axe"; - matList = this.getMaterialsForToolclass(testString); - for(int i=0; i < matList.length; i++) - { - if(matList[i] == mat) - { - return testString; - } - } - - return null; - } - - public Set getToolClasses(ItemStack stack) + + public Material[] getMaterialsForToolclass(String toolClass) + { + if ("pickaxe".equals(toolClass)) + { + return new Material[]{Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits}; + } else if ("shovel".equals(toolClass)) + { + return new Material[]{Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay}; + } else if ("axe".equals(toolClass)) + { + return new Material[]{Material.wood, Material.vine, Material.circuits, Material.cactus}; + } + return new Material[0]; + } + + public String getToolClassForMaterial(Material mat) + { + String testString = "pickaxe"; + + Material[] matList = this.getMaterialsForToolclass(testString); + for (int i = 0; i < matList.length; i++) + { + if (matList[i] == mat) + { + return testString; + } + } + + testString = "shovel"; + matList = this.getMaterialsForToolclass(testString); + for (int i = 0; i < matList.length; i++) + { + if (matList[i] == mat) + { + return testString; + } + } + + testString = "axe"; + matList = this.getMaterialsForToolclass(testString); + for (int i = 0; i < matList.length; i++) + { + if (matList[i] == mat) + { + return testString; + } + } + + return null; + } + + public Set getToolClasses(ItemStack stack) { Set set = new HashSet(); - - if(this.getHarvestLevel(stack, "pickaxe") > -1) + + if (this.getHarvestLevel(stack, "pickaxe") > -1) { - set.add("pickaxe"); + set.add("pickaxe"); } - - if(this.getHarvestLevel(stack, "axe") > -1) + + if (this.getHarvestLevel(stack, "axe") > -1) { - set.add("axe"); + set.add("axe"); } - - if(this.getHarvestLevel(stack, "shovel") > -1) + + if (this.getHarvestLevel(stack, "shovel") > -1) { - set.add("shovel"); + set.add("shovel"); } - + return set; } - -// @Override -// public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player) -// { -// if (block != null && block.getMaterial() == Material.leaves) -// return false; -// -// -// return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random); -// } - @Override + @Override public float getDigSpeed(ItemStack stack, Block block, int meta) { - String toolClass = block.getHarvestTool(meta); - - if(toolClass == null || toolClass.equals("")) - { - return 1.0f; - } - - //if (ForgeHooks.isToolEffective(stack, block, meta)) + String toolClass = block.getHarvestTool(meta); + + if (toolClass == null || toolClass.equals("")) { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - return tag.getFloat(digLevelSuffix + toolClass); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - } + return 1.0f; + } + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + return tag.getFloat(digLevelSuffix + toolClass); + } else + { + stack.setTagCompound(new NBTTagCompound()); + } } return 1.0f; } - - @Override + + @Override public int getHarvestLevel(ItemStack stack, String toolClass) { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - if(tag.hasKey(harvestLevelSuffix + toolClass)) - { - return tag.getInteger(harvestLevelSuffix + toolClass); - }else - { - return -1; - } - } - else - { - stack.setTagCompound(new NBTTagCompound()); - } - - return -1; + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + if (tag.hasKey(harvestLevelSuffix + toolClass)) + { + return tag.getInteger(harvestLevelSuffix + toolClass); + } else + { + return -1; + } + } else + { + stack.setTagCompound(new NBTTagCompound()); + } + + return -1; } - -// @Override -// public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) -// { -// return p_150893_2_.getMaterial() != Material.iron && p_150893_2_.getMaterial() != Material.anvil && p_150893_2_.getMaterial() != Material.rock ? super.func_150893_a(p_150893_1_, p_150893_2_) : 15; -// } - - @Override - public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) + + @Override + public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - - return true; + + return true; } - - @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - return false; - } - - @Override - public void onUpdate(ItemStack toolStack, World world, Entity par3Entity, int par4, boolean par5) - { - if(world.isRemote) - { - return; - } - - SpellParadigmTool parad = this.loadParadigmFromStack(toolStack); - int cost = parad.onUpdate(toolStack, world, par3Entity, par4, par5); - - if(par3Entity instanceof EntityPlayer && cost > 0) - EnergyItems.syphonAndDamageWhileInContainer(toolStack, (EntityPlayer)par3Entity, cost); - - int duration = Math.max(this.getDuration(toolStack, world), 0); - - if(duration <= 0 && par3Entity instanceof EntityPlayer) - { - int banishCost = parad.onBanishTool(toolStack, world, par3Entity, par4, par5); - EnergyItems.syphonAndDamageWhileInContainer(toolStack, (EntityPlayer)par3Entity, banishCost); - ((EntityPlayer) par3Entity).inventory.mainInventory[par4] = this.getContainedCrystal(toolStack); - } - } - - @Override + + @Override + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return false; + } + + @Override + public void onUpdate(ItemStack toolStack, World world, Entity par3Entity, int par4, boolean par5) + { + if (world.isRemote) + { + return; + } + + SpellParadigmTool parad = this.loadParadigmFromStack(toolStack); + int cost = parad.onUpdate(toolStack, world, par3Entity, par4, par5); + + if (par3Entity instanceof EntityPlayer && cost > 0) + EnergyItems.syphonAndDamageWhileInContainer(toolStack, (EntityPlayer) par3Entity, cost); + + int duration = Math.max(this.getDuration(toolStack, world), 0); + + if (duration <= 0 && par3Entity instanceof EntityPlayer) + { + int banishCost = parad.onBanishTool(toolStack, world, par3Entity, par4, par5); + EnergyItems.syphonAndDamageWhileInContainer(toolStack, (EntityPlayer) par3Entity, banishCost); + ((EntityPlayer) par3Entity).inventory.mainInventory[par4] = this.getContainedCrystal(toolStack); + } + } + + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if(par3EntityPlayer.isSneaking()) - { - par3EntityPlayer.setCurrentItemOrArmor(0, this.getContainedCrystal(par1ItemStack)); - return par1ItemStack; - } - - SpellParadigmTool parad = this.loadParadigmFromStack(par1ItemStack); + if (par3EntityPlayer.isSneaking()) + { + par3EntityPlayer.setCurrentItemOrArmor(0, this.getContainedCrystal(par1ItemStack)); + return par1ItemStack; + } + + SpellParadigmTool parad = this.loadParadigmFromStack(par1ItemStack); MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); - + int cost = 0; - - if(mop != null && mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) - { - cost = parad.onRightClickBlock(par1ItemStack, par3EntityPlayer, par2World, mop); - }else - { - cost = parad.onRightClickAir(par1ItemStack, par2World, par3EntityPlayer); - } - - if(cost > 0) - { - EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, cost); - } - - return par1ItemStack; + + if (mop != null && mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) + { + cost = parad.onRightClickBlock(par1ItemStack, par3EntityPlayer, par2World, mop); + } else + { + cost = parad.onRightClickAir(par1ItemStack, par2World, par3EntityPlayer); + } + + if (cost > 0) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, cost); + } + + return par1ItemStack; } - - @Override + + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("A mace filled with ancient alchemy"); @@ -425,437 +394,409 @@ public class ItemSpellMultiTool extends Item { par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); } - - for(String str : this.getToolListString(par1ItemStack)) + + for (String str : this.getToolListString(par1ItemStack)) { - par3List.add(str); + par3List.add(str); } - + par3List.add(""); float damage = this.getCustomItemAttack(par1ItemStack); - par3List.add("\u00A79+" + ((int)(damage*10))/10.0f + " " + "Attack Damage"); - float critChance = ((int)(this.getCritChance(par1ItemStack)*1000))/10.0f; + par3List.add("\u00A79+" + ((int) (damage * 10)) / 10.0f + " " + "Attack Damage"); + float critChance = ((int) (this.getCritChance(par1ItemStack) * 1000)) / 10.0f; par3List.add("\u00A79+" + critChance + "% " + "Crit Chance"); } } - - //--------------Custom methods--------------// - - public void setHarvestLevel(ItemStack stack, String toolClass, int harvestLevel) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setInteger(harvestLevelSuffix + toolClass, Math.max(-1,harvestLevel)); - - stack.getTagCompound().setTag(tagName, tag); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setInteger(harvestLevelSuffix + toolClass, Math.max(-1,harvestLevel)); - - stack.getTagCompound().setTag(tagName, tag); - } - } - - public void setDigSpeed(ItemStack stack, String toolClass, float digSpeed) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setFloat(digLevelSuffix + toolClass, digSpeed); - - stack.getTagCompound().setTag(tagName, tag); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setFloat(digLevelSuffix + toolClass, digSpeed); - - stack.getTagCompound().setTag(tagName, tag); - } - } - - public float getDigSpeed(ItemStack stack, String toolClass) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - return tag.getFloat(digLevelSuffix + toolClass); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - return 0.0f; - } - } - - public void setItemAttack(ItemStack stack, float damage) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setFloat("itemAttack", Math.max(damage, 0.0f)); - - stack.stackTagCompound.setTag(tagName, tag); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setFloat("itemAttack", Math.max(damage, 0.0f)); - - stack.stackTagCompound.setTag(tagName, tag); - } - } - - public float getCustomItemAttack(ItemStack stack) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - return tag.getFloat("itemAttack"); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - return 0.0f; - } - } - - public ItemStack getContainedCrystal(ItemStack container) - { - if(container.hasTagCompound()) - { - NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName).getCompoundTag("heldItem"); - - return ItemStack.loadItemStackFromNBT(tag); - } - else - { - container.setTagCompound(new NBTTagCompound()); - - return null; - } - } - - public void setContainedCrystal(ItemStack container, ItemStack crystal) - { - if(container.hasTagCompound()) - { - NBTTagCompound compTag = container.getTagCompound().getCompoundTag(tagName); - NBTTagCompound tag = compTag.getCompoundTag("heldItem"); - - crystal.writeToNBT(tag); - - compTag.setTag("heldItem", tag); - container.getTagCompound().setTag(tagName, compTag); - } - else - { - container.setTagCompound(new NBTTagCompound()); - - NBTTagCompound compTag = container.getTagCompound().getCompoundTag(tagName); - NBTTagCompound tag = compTag.getCompoundTag("heldItem"); - - crystal.writeToNBT(tag); - - compTag.setTag("heldItem", tag); - container.getTagCompound().setTag(tagName, compTag); - } - } - - public void setDuration(ItemStack container, World world, int duration) - { - if(world.isRemote) - { - return; - }else - { - World overWorld = DimensionManager.getWorld(0); - long worldtime = overWorld.getTotalWorldTime(); - - if(container.hasTagCompound()) - { - NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); - - tag.setLong("duration", Math.max(duration + worldtime, worldtime)); - - container.getTagCompound().setTag(tagName, tag); - } - else - { - container.setTagCompound(new NBTTagCompound()); - - NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); - - tag.setLong("duration", Math.max(duration + worldtime, worldtime)); - - container.getTagCompound().setTag(tagName, tag); - } - } - } - - public int getDuration(ItemStack container, World world) - { - if(world.isRemote) - { - return 0; - } - else - { - World overWorld = DimensionManager.getWorld(0); - long worldtime = overWorld.getTotalWorldTime(); - - if(container.hasTagCompound()) - { - NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); - - return (int)(tag.getLong("duration") - worldtime); - } - else - { - container.setTagCompound(new NBTTagCompound()); - - return 0; - } - } -// if(container.hasTagCompound()) -// { -// NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); -// -// return tag.getInteger("duration"); -// } -// else -// { -// container.setTagCompound(new NBTTagCompound()); -// -// return 0; -// } - } - - public void loadParadigmIntoStack(ItemStack container, List list) - { - if(!container.hasTagCompound()) - { - container.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); - - NBTTagList effectList = new NBTTagList(); + //--------------Custom methods--------------// - for(SpellEffect eff : list) - { - effectList.appendTag(eff.getTag()); - } + public void setHarvestLevel(ItemStack stack, String toolClass, int harvestLevel) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setInteger(harvestLevelSuffix + toolClass, Math.max(-1, harvestLevel)); + + stack.getTagCompound().setTag(tagName, tag); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setInteger(harvestLevelSuffix + toolClass, Math.max(-1, harvestLevel)); + + stack.getTagCompound().setTag(tagName, tag); + } + } + + public void setDigSpeed(ItemStack stack, String toolClass, float digSpeed) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setFloat(digLevelSuffix + toolClass, digSpeed); + + stack.getTagCompound().setTag(tagName, tag); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setFloat(digLevelSuffix + toolClass, digSpeed); + + stack.getTagCompound().setTag(tagName, tag); + } + } + + public float getDigSpeed(ItemStack stack, String toolClass) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + return tag.getFloat(digLevelSuffix + toolClass); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + return 0.0f; + } + } + + public void setItemAttack(ItemStack stack, float damage) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setFloat("itemAttack", Math.max(damage, 0.0f)); + + stack.stackTagCompound.setTag(tagName, tag); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setFloat("itemAttack", Math.max(damage, 0.0f)); + + stack.stackTagCompound.setTag(tagName, tag); + } + } + + public float getCustomItemAttack(ItemStack stack) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + return tag.getFloat("itemAttack"); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + return 0.0f; + } + } + + public ItemStack getContainedCrystal(ItemStack container) + { + if (container.hasTagCompound()) + { + NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName).getCompoundTag("heldItem"); + + return ItemStack.loadItemStackFromNBT(tag); + } else + { + container.setTagCompound(new NBTTagCompound()); + + return null; + } + } + + public void setContainedCrystal(ItemStack container, ItemStack crystal) + { + if (container.hasTagCompound()) + { + NBTTagCompound compTag = container.getTagCompound().getCompoundTag(tagName); + NBTTagCompound tag = compTag.getCompoundTag("heldItem"); + + crystal.writeToNBT(tag); + + compTag.setTag("heldItem", tag); + container.getTagCompound().setTag(tagName, compTag); + } else + { + container.setTagCompound(new NBTTagCompound()); + + NBTTagCompound compTag = container.getTagCompound().getCompoundTag(tagName); + NBTTagCompound tag = compTag.getCompoundTag("heldItem"); + + crystal.writeToNBT(tag); + + compTag.setTag("heldItem", tag); + container.getTagCompound().setTag(tagName, compTag); + } + } + + public void setDuration(ItemStack container, World world, int duration) + { + if (world.isRemote) + { + return; + } else + { + World overWorld = DimensionManager.getWorld(0); + long worldtime = overWorld.getTotalWorldTime(); + + if (container.hasTagCompound()) + { + NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); + + tag.setLong("duration", Math.max(duration + worldtime, worldtime)); + + container.getTagCompound().setTag(tagName, tag); + } else + { + container.setTagCompound(new NBTTagCompound()); + + NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); + + tag.setLong("duration", Math.max(duration + worldtime, worldtime)); + + container.getTagCompound().setTag(tagName, tag); + } + } + } + + public int getDuration(ItemStack container, World world) + { + if (world.isRemote) + { + return 0; + } else + { + World overWorld = DimensionManager.getWorld(0); + long worldtime = overWorld.getTotalWorldTime(); + + if (container.hasTagCompound()) + { + NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); + + return (int) (tag.getLong("duration") - worldtime); + } else + { + container.setTagCompound(new NBTTagCompound()); + + return 0; + } + } + } + + public void loadParadigmIntoStack(ItemStack container, List list) + { + if (!container.hasTagCompound()) + { + container.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); + + NBTTagList effectList = new NBTTagList(); + + for (SpellEffect eff : list) + { + effectList.appendTag(eff.getTag()); + } + + tagiest.setTag("Effects", effectList); - tagiest.setTag("Effects", effectList); - container.getTagCompound().setTag(tagName, tagiest); - } - - public SpellParadigmTool loadParadigmFromStack(ItemStack container) - { - if(!container.hasTagCompound()) - { - container.setTagCompound(new NBTTagCompound()); - } - NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); - - NBTTagList tagList = tagiest.getTagList("Effects",Constants.NBT.TAG_COMPOUND); - - List spellEffectList = new LinkedList(); - for (int i = 0; i < tagList.tagCount(); i++) + } + + public SpellParadigmTool loadParadigmFromStack(ItemStack container) + { + if (!container.hasTagCompound()) + { + container.setTagCompound(new NBTTagCompound()); + } + NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); + + NBTTagList tagList = tagiest.getTagList("Effects", Constants.NBT.TAG_COMPOUND); + + List spellEffectList = new LinkedList(); + for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); SpellEffect eff = SpellEffect.getEffectFromTag(tag); - if(eff!=null) + if (eff != null) { - spellEffectList.add(eff); + spellEffectList.add(eff); } } - - return SpellParadigmTool.getParadigmForEffectArray(spellEffectList); - } - - public void setSilkTouch(ItemStack stack, boolean silkTouch) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setBoolean("silkTouch", silkTouch); - - stack.stackTagCompound.setTag(tagName, tag); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setBoolean("silkTouch", silkTouch); - - stack.stackTagCompound.setTag(tagName, tag); - } - } - - public boolean getSilkTouch(ItemStack stack) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - return tag.getBoolean("silkTouch"); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - return false; - } - } - - public void setFortuneLevel(ItemStack stack, int fortune) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setInteger("fortuneLevel", Math.max(fortune, 0)); - - stack.stackTagCompound.setTag(tagName, tag); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - tag.setInteger("fortuneLevel", Math.max(fortune, 0)); - - stack.stackTagCompound.setTag(tagName, tag); - } - } - - public int getFortuneLevel(ItemStack stack) - { - if(stack.hasTagCompound()) - { - NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); - - return tag.getInteger("fortuneLevel"); - } - else - { - stack.setTagCompound(new NBTTagCompound()); - - return 0; - } - } - - public List getToolListString(ItemStack container) - { - if(!container.hasTagCompound()) - { - container.setTagCompound(new NBTTagCompound()); - } - NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); - - NBTTagList tagList = tagiest.getTagList("ToolTips",Constants.NBT.TAG_COMPOUND); - - List toolTipList = new LinkedList(); - for (int i = 0; i < tagList.tagCount(); i++) + + return SpellParadigmTool.getParadigmForEffectArray(spellEffectList); + } + + public void setSilkTouch(ItemStack stack, boolean silkTouch) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setBoolean("silkTouch", silkTouch); + + stack.stackTagCompound.setTag(tagName, tag); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setBoolean("silkTouch", silkTouch); + + stack.stackTagCompound.setTag(tagName, tag); + } + } + + public boolean getSilkTouch(ItemStack stack) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + return tag.getBoolean("silkTouch"); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + return false; + } + } + + public void setFortuneLevel(ItemStack stack, int fortune) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setInteger("fortuneLevel", Math.max(fortune, 0)); + + stack.stackTagCompound.setTag(tagName, tag); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + tag.setInteger("fortuneLevel", Math.max(fortune, 0)); + + stack.stackTagCompound.setTag(tagName, tag); + } + } + + public int getFortuneLevel(ItemStack stack) + { + if (stack.hasTagCompound()) + { + NBTTagCompound tag = stack.getTagCompound().getCompoundTag(tagName); + + return tag.getInteger("fortuneLevel"); + } else + { + stack.setTagCompound(new NBTTagCompound()); + + return 0; + } + } + + public List getToolListString(ItemStack container) + { + if (!container.hasTagCompound()) + { + container.setTagCompound(new NBTTagCompound()); + } + NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); + + NBTTagList tagList = tagiest.getTagList("ToolTips", Constants.NBT.TAG_COMPOUND); + + List toolTipList = new LinkedList(); + for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); String str = tag.getString("tip"); - if(str!=null) + if (str != null) { - toolTipList.add(str); + toolTipList.add(str); } } - - return toolTipList; - } - - public void setToolListString(ItemStack container, List toolTipString) - { - if(!container.hasTagCompound()) - { - container.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); - - NBTTagList stringList = new NBTTagList(); - for(String str : toolTipString) - { - NBTTagCompound tag = new NBTTagCompound(); - tag.setString("tip", str); - - stringList.appendTag(tag); - } + return toolTipList; + } + + public void setToolListString(ItemStack container, List toolTipString) + { + if (!container.hasTagCompound()) + { + container.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tagiest = container.getTagCompound().getCompoundTag(tagName); + + NBTTagList stringList = new NBTTagList(); + + for (String str : toolTipString) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("tip", str); + + stringList.appendTag(tag); + } + + tagiest.setTag("ToolTips", stringList); - tagiest.setTag("ToolTips", stringList); - container.getTagCompound().setTag(tagName, tagiest); - } - - public void setCritChance(ItemStack container, float chance) - { - if(container.hasTagCompound()) - { - NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); - - tag.setFloat("critChance", Math.max(chance, 0)); - - container.stackTagCompound.setTag(tagName, tag); - } - else - { - container.setTagCompound(new NBTTagCompound()); - - NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); - - tag.setFloat("critChance", Math.max(chance, 0)); - - container.stackTagCompound.setTag(tagName, tag); - } - } - - public float getCritChance(ItemStack container) - { - if(container.hasTagCompound()) - { - NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); - - return tag.getFloat("critChance"); - } - else - { - container.setTagCompound(new NBTTagCompound()); - - return 0; - } - } + } + + public void setCritChance(ItemStack container, float chance) + { + if (container.hasTagCompound()) + { + NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); + + tag.setFloat("critChance", Math.max(chance, 0)); + + container.stackTagCompound.setTag(tagName, tag); + } else + { + container.setTagCompound(new NBTTagCompound()); + + NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); + + tag.setFloat("critChance", Math.max(chance, 0)); + + container.stackTagCompound.setTag(tagName, tag); + } + } + + public float getCritChance(ItemStack container) + { + if (container.hasTagCompound()) + { + NBTTagCompound tag = container.getTagCompound().getCompoundTag(tagName); + + return tag.getFloat("critChance"); + } else + { + container.setTagCompound(new NBTTagCompound()); + + return 0; + } + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java index d5eec374..7db973ca 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java @@ -1,33 +1,30 @@ package WayofTime.alchemicalWizardry.common.items.thaumcraft; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import net.minecraftforge.common.ISpecialArmor; import thaumcraft.api.IGoggles; import thaumcraft.api.IRepairable; import thaumcraft.api.IRunicArmor; import thaumcraft.api.IVisDiscountGear; -import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.nodes.IRevealer; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable { - private static IIcon helmetIcon; + private static IIcon helmetIcon; private static IIcon plateIcon; private static IIcon leggingsIcon; private static IIcon bootsIcon; @@ -49,7 +46,7 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundLeggings"); this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots"); } - + @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int par1) { @@ -83,7 +80,7 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog { return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png"; } - + if (this == ModItems.sanguineRobe || this == ModItems.sanguineBoots) { return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png"; @@ -101,37 +98,37 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - int discount = 0; - - switch(this.armorType) - { - case 0: - discount = 6; - break; - case 1: - discount = 3; - break; - case 2: - discount = 3; - break; - case 3: - discount = 2; - break; - } - - switch(this.armorType) - { - case 0: - par3List.add("A pair of goggles imbued with power"); - break; - case 1: + int discount = 0; - case 2: + switch (this.armorType) + { + case 0: + discount = 6; + break; + case 1: + discount = 3; + break; + case 2: + discount = 3; + break; + case 3: + discount = 2; + break; + } + + switch (this.armorType) + { + case 0: + par3List.add("A pair of goggles imbued with power"); + break; + case 1: + + case 2: + + case 3: + par3List.add("Robes imbued with forbidden power"); + } - case 3: - par3List.add("Robes imbued with forbidden power"); - } - par3List.add("Vis discount: " + discount + "%"); } @@ -153,34 +150,38 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog return 0; } - @Override - public boolean showNodes(ItemStack itemstack, EntityLivingBase player) - { - return true; - } + @Override + public boolean showNodes(ItemStack itemstack, EntityLivingBase player) + { + return true; + } - @Override - public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) - { - switch(this.armorType) - { - case 0: return 7; - case 1: return 3; - case 2: return 2; - case 3: return 2; - } - return 0; - } + @Override + public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) + { + switch (this.armorType) + { + case 0: + return 7; + case 1: + return 3; + case 2: + return 2; + case 3: + return 2; + } + return 0; + } - @Override - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) - { - return true; - } + @Override + public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) + { + return true; + } - @Override - public int getRunicCharge(ItemStack itemstack) { - // TODO Auto-generated method stub - return 0; - } + @Override + public int getRunicCharge(ItemStack itemstack) + { + return 0; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/mcmod.info b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/mcmod.info deleted file mode 100644 index cd89dc4c..00000000 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/mcmod.info +++ /dev/null @@ -1,22 +0,0 @@ -[ -{ - "modid": "AWWayofTime", - "name": "Blood Magic: Alchemical Wizardry", - "description": "Gruesome? Probably. Worth it? Definately!", - "version": "0.2.1c", - "url": "", - "updateUrl": "", - "logoFile": "", - "mcversion": "1.6.2", - "authorList": [ - "WayofTime" - ], - "credits": "", - "screenshots": [ - ], - "parent": "", - "dependencies": [ - ] -} -] - diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java index b885d240..46363b11 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java @@ -2,9 +2,9 @@ package WayofTime.alchemicalWizardry.common.potion; import net.minecraft.potion.Potion; -public class PotionFlameCloak extends Potion +public class PotionFlameCloak extends Potion { - public PotionFlameCloak(int par1, boolean par2, int par3) + public PotionFlameCloak(int par1, boolean par2, int par3) { super(par1, par2, par3); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java index d169b4d9..c2ba716a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java @@ -2,9 +2,9 @@ package WayofTime.alchemicalWizardry.common.potion; import net.minecraft.potion.Potion; -public class PotionIceCloak extends Potion +public class PotionIceCloak extends Potion { - public PotionIceCloak(int par1, boolean par2, int par3) + public PotionIceCloak(int par1, boolean par2, int par3) { super(par1, par2, par3); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java index eeae462b..f2e4d7bd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java @@ -1,13 +1,11 @@ package WayofTime.alchemicalWizardry.common.renderer; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; - public class AlchemyCircleRenderer extends MRSRenderer { private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/TransCircle.png"); @@ -21,72 +19,69 @@ public class AlchemyCircleRenderer extends MRSRenderer private double radius; private double initialY; private boolean renderWithoutReagents; - + public AlchemyCircleRenderer(ResourceLocation resource, int red, int green, int blue, int intensity, double xOff, double initialY, double yOff, double zOff, double radius, boolean renderWithoutReagents) { - this.resourceLocation = resource; - this.colourRed = red; - this.colourGreen = green; - this.colourBlue = blue; - this.colourIntensity = intensity; - this.xOffset = xOff; - this.initialY = initialY; - this.yOffset = yOff; - this.zOffset = zOff; - this.radius = radius; - this.renderWithoutReagents = renderWithoutReagents; + this.resourceLocation = resource; + this.colourRed = red; + this.colourGreen = green; + this.colourBlue = blue; + this.colourIntensity = intensity; + this.xOffset = xOff; + this.initialY = initialY; + this.yOffset = yOff; + this.zOffset = zOff; + this.radius = radius; + this.renderWithoutReagents = renderWithoutReagents; } - - @Override - public void renderAt(TEMasterStone tile, double x, double y, double z) - { - if(tile.areTanksEmpty() && !renderWithoutReagents) - { - return; - } - - GL11.glPushMatrix(); - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(resourceLocation); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); - - GL11.glTranslated(x+0.5+xOffset, y+0.5+(yOffset-initialY)*(tile.runningTime/100d)+initialY, z+0.5+zOffset); - - float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + @Override + public void renderAt(TEMasterStone tile, double x, double y, double z) + { + if (tile.areTanksEmpty() && !renderWithoutReagents) + { + return; + } - GL11.glRotatef(rotationAngle, 0F, 1F, 0F); //Rotate on planar axis - //GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis - //GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically - - tessellator.setBrightness(240); - - double finalRadius = (radius)*(tile.runningTime/100d); + GL11.glPushMatrix(); + float f1 = 1.0f; + Tessellator tessellator = Tessellator.instance; + this.bindTexture(resourceLocation); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + float f2 = 0; + float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - tessellator.addVertexWithUV(-finalRadius, 0, -finalRadius, 0.0d, 0.0d); - tessellator.addVertexWithUV(finalRadius, 0, -finalRadius, 1.0d, 0.0d); - tessellator.addVertexWithUV(finalRadius, 0, finalRadius, 1.0d, 1.0d); - tessellator.addVertexWithUV(-finalRadius, 0, finalRadius, 0.0d, 1.0d); + GL11.glDepthMask(false); - tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); - GL11.glDepthMask(true); + GL11.glTranslated(x + 0.5 + xOffset, y + 0.5 + (yOffset - initialY) * (tile.runningTime / 100d) + initialY, z + 0.5 + zOffset); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); - } + float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + + GL11.glRotatef(rotationAngle, 0F, 1F, 0F); //Rotate on planar axis + tessellator.setBrightness(240); + + double finalRadius = (radius) * (tile.runningTime / 100d); + + tessellator.addVertexWithUV(-finalRadius, 0, -finalRadius, 0.0d, 0.0d); + tessellator.addVertexWithUV(finalRadius, 0, -finalRadius, 1.0d, 0.0d); + tessellator.addVertexWithUV(finalRadius, 0, finalRadius, 1.0d, 1.0d); + tessellator.addVertexWithUV(-finalRadius, 0, finalRadius, 0.0d, 1.0d); + + tessellator.draw(); + + GL11.glDepthMask(true); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glPopMatrix(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java index 01f6d125..06ddafd3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java @@ -1,58 +1,56 @@ package WayofTime.alchemicalWizardry.common.renderer; +import WayofTime.alchemicalWizardry.api.ColourAndCoords; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.api.ColourAndCoords; - -public class BeamRenderer +public class BeamRenderer { private static final ResourceLocation field_110629_a = new ResourceLocation("textures/entity/beacon_beam.png"); - + public int xInit; public int yInit; public int zInit; - + public int xFinal; public int yFinal; public int zFinal; - + public int colourRed; public int colourGreen; public int colourBlue; public int colourIntensity; - + public double size; - + public void setInitialPosition(int x, int y, int z) { - this.xInit = x; - this.yInit = y; - this.zInit = z; + this.xInit = x; + this.yInit = y; + this.zInit = z; } - + public void setColourAndFinalPosition(ColourAndCoords col) { - this.colourRed = col.colourRed; - this.colourGreen = col.colourGreen; - this.colourBlue = col.colourBlue; - this.colourIntensity = col.colourIntensity; - - this.xFinal = col.xCoord; - this.yFinal = col.yCoord; - this.zFinal = col.zCoord; + this.colourRed = col.colourRed; + this.colourGreen = col.colourGreen; + this.colourBlue = col.colourBlue; + this.colourIntensity = col.colourIntensity; + + this.xFinal = col.xCoord; + this.yFinal = col.yCoord; + this.zFinal = col.zCoord; } - + public void setSize(double size) { - this.size = size; + this.size = size; } - + protected static void bindTexture(ResourceLocation p_147499_1_) { TextureManager texturemanager = TileEntityRendererDispatcher.instance.field_147553_e; @@ -62,94 +60,87 @@ public class BeamRenderer texturemanager.bindTexture(p_147499_1_); } } - - public void render(double d0, double d1, double d2) - { - int xDiff = this.xFinal - this.xInit; - int yDiff = this.yFinal - this.yInit; - int zDiff = this.zFinal - this.zInit; - - float planarAngle = (float)(Math.atan2(-zDiff, xDiff) * 180d / Math.PI); //Radians - float verticalAngle = (float)(Math.atan2(yDiff, Math.sqrt(xDiff*xDiff + zDiff+zDiff)) * 180d / Math.PI); - - float distance = (float) Math.sqrt(xDiff*xDiff + yDiff*yDiff + zDiff*zDiff); //Total distance - GL11.glPushMatrix(); - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - BeamRenderer.bindTexture(field_110629_a); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - + public void render(double d0, double d1, double d2) + { + int xDiff = this.xFinal - this.xInit; + int yDiff = this.yFinal - this.yInit; + int zDiff = this.zFinal - this.zInit; - GL11.glDepthMask(false); + float planarAngle = (float) (Math.atan2(-zDiff, xDiff) * 180d / Math.PI); //Radians + float verticalAngle = (float) (Math.atan2(yDiff, Math.sqrt(xDiff * xDiff + zDiff + zDiff)) * 180d / Math.PI); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); - //tessellator.setColorOpaque(255, 255, 255); - - double inside = -(this.size/2d); - double outside = 1.0d-(0.50d - this.size/2d)-0.5d; - - double d18 = inside; - double d19 = inside; - double d20 = outside; - double d21 = inside; - double d22 = inside; - double d23 = outside; - double d24 = outside; - double d25 = outside; - double d26 = (double)(distance * f1);// + 0.2; - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double)(-1.0F + f3); - double d30 = (double)(distance * f1) + d29; - - GL11.glTranslated(d0+0.5, d1+0.5, d2+0.5); + float distance = (float) Math.sqrt(xDiff * xDiff + yDiff * yDiff + zDiff * zDiff); //Total distance - GL11.glRotatef(planarAngle, 0F, 1F, 0F); //Rotate on planar axis - GL11.glRotatef(verticalAngle, 0F, 0F, 1F); //Rotate vertical axis - //GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically - - double offset = 0; - - tessellator.setBrightness(240); - float s = 1F / 16F; -// GL11.glTranslatef(0F, s, s); -// GL11.glScalef(1F, s * 14F, s * 14F); - tessellator.addVertexWithUV(d26, d18, d19, d28, d30); - tessellator.addVertexWithUV(offset, d18, d19, d28, d29); - tessellator.addVertexWithUV(offset, d20, d21, d27, d29); - tessellator.addVertexWithUV(d26, d20, d21, d27, d30); - tessellator.addVertexWithUV(d26, d24, d25, d28, d30); - tessellator.addVertexWithUV(offset, d24, d25, d28, d29); - tessellator.addVertexWithUV(offset, d22, d23, d27, d29); - tessellator.addVertexWithUV(d26, d22, d23, d27, d30); - tessellator.addVertexWithUV(d26, d20, d21, d28, d30); - tessellator.addVertexWithUV(offset, d20, d21, d28, d29); - tessellator.addVertexWithUV(offset, d24, d25, d27, d29); - tessellator.addVertexWithUV(d26, d24, d25, d27, d30); - tessellator.addVertexWithUV(d26, d22, d23, d28, d30); - tessellator.addVertexWithUV(offset, d22, d23, d28, d29); - tessellator.addVertexWithUV(offset, d18, d19, d27, d29); - tessellator.addVertexWithUV(d26, d18, d19, d27, d30); - - //ShaderHelper.useShaderWithProps(ShaderHelper.beam, "time", (int) tileAltar.getWorldObj().getTotalWorldTime()); - tessellator.draw(); - //ShaderHelper.releaseShader(); - - GL11.glDepthMask(true); + GL11.glPushMatrix(); + float f1 = 1.0f; + Tessellator tessellator = Tessellator.instance; + BeamRenderer.bindTexture(field_110629_a); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + float f2 = 0; + float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); - } + GL11.glDepthMask(false); + + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); + + double inside = -(this.size / 2d); + double outside = 1.0d - (0.50d - this.size / 2d) - 0.5d; + + double d18 = inside; + double d19 = inside; + double d20 = outside; + double d21 = inside; + double d22 = inside; + double d23 = outside; + double d24 = outside; + double d25 = outside; + double d26 = (double) (distance * f1);// + 0.2; + double d27 = 0.0D; + double d28 = 1.0D; + double d29 = (double) (-1.0F + f3); + double d30 = (double) (distance * f1) + d29; + + GL11.glTranslated(d0 + 0.5, d1 + 0.5, d2 + 0.5); + + GL11.glRotatef(planarAngle, 0F, 1F, 0F); //Rotate on planar axis + GL11.glRotatef(verticalAngle, 0F, 0F, 1F); //Rotate vertical axis + //GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically + + double offset = 0; + + tessellator.setBrightness(240); + float s = 1F / 16F; + tessellator.addVertexWithUV(d26, d18, d19, d28, d30); + tessellator.addVertexWithUV(offset, d18, d19, d28, d29); + tessellator.addVertexWithUV(offset, d20, d21, d27, d29); + tessellator.addVertexWithUV(d26, d20, d21, d27, d30); + tessellator.addVertexWithUV(d26, d24, d25, d28, d30); + tessellator.addVertexWithUV(offset, d24, d25, d28, d29); + tessellator.addVertexWithUV(offset, d22, d23, d27, d29); + tessellator.addVertexWithUV(d26, d22, d23, d27, d30); + tessellator.addVertexWithUV(d26, d20, d21, d28, d30); + tessellator.addVertexWithUV(offset, d20, d21, d28, d29); + tessellator.addVertexWithUV(offset, d24, d25, d27, d29); + tessellator.addVertexWithUV(d26, d24, d25, d27, d30); + tessellator.addVertexWithUV(d26, d22, d23, d28, d30); + tessellator.addVertexWithUV(offset, d22, d23, d28, d29); + tessellator.addVertexWithUV(offset, d18, d19, d27, d29); + tessellator.addVertexWithUV(d26, d18, d19, d27, d30); + + tessellator.draw(); + GL11.glDepthMask(true); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glPopMatrix(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/MRSRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/MRSRenderer.java index 4bf6de31..be239fd7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/MRSRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/MRSRenderer.java @@ -1,16 +1,15 @@ package WayofTime.alchemicalWizardry.common.renderer; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.ResourceLocation; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderMasterStone; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; -public abstract class MRSRenderer +public abstract class MRSRenderer { - public abstract void renderAt(TEMasterStone tile, double x, double y, double z); - - protected void bindTexture(ResourceLocation p_147499_1_) + public abstract void renderAt(TEMasterStone tile, double x, double y, double z); + + protected void bindTexture(ResourceLocation p_147499_1_) { TextureManager texturemanager = TileEntityRendererDispatcher.instance.field_147553_e; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java index 59c70a85..81121509 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java @@ -1,5 +1,11 @@ package WayofTime.alchemicalWizardry.common.renderer.block; +import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; @@ -12,21 +18,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; -import cpw.mods.fml.client.FMLClientHandler; - public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer { private final RenderItem customRenderItem; private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator(); - + private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png"); public RenderAlchemicCalcinator() @@ -50,25 +48,17 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); -// GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - + GL11.glPushMatrix(); if (tileAltar.getStackInSlot(1) != null) @@ -77,7 +67,6 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1)); - //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); float displacement = 0.2F; if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) @@ -85,10 +74,8 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F); } else { - GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f*2f); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f); } - - //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) @@ -98,7 +85,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); } - + GL11.glPopMatrix(); GL11.glPushMatrix(); @@ -109,7 +96,6 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); - //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); float displacement = -0.5F; if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) @@ -117,10 +103,8 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F); } else { - GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f*2f); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f); } - - //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) @@ -130,57 +114,21 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); } - + GL11.glPopMatrix(); - - ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN); - if(info.length >= 1 && info[0] != null) - { - ReagentStack reagentStack = info[0].reagent; - int capacity = info[0].capacity; - if(reagentStack != null && reagentStack.reagent != null) - { - Reagent reagent = reagentStack.reagent; - this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity); - } - } - - - -// for (int i = 0; i <= 1; i++) -// { -// GL11.glPushMatrix(); -// -// if (tileAltar.getStackInSlot(i) != null) -// { -// float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i)); -// float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); -// EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); -// ghostEntityItem.hoverStart = 0.0F; -// ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i)); -// //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); -// float displacementX = getXDisplacementForSlot(i); -// float displacementY = getYDisplacementForSlot(i); -// float displacementZ = getZDisplacementForSlot(i); -// -// if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) -// { -// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.7F, (float) d2 + 0.5F + displacementZ); -// } else -// { -// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.6F, (float) d2 + 0.5F + displacementZ); -// } -// -// //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); -// GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); -// GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); -// customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); -// } -// -// GL11.glPopMatrix(); -// } + ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN); + if (info.length >= 1 && info[0] != null) + { + ReagentStack reagentStack = info[0].reagent; + int capacity = info[0].capacity; + if (reagentStack != null && reagentStack.reagent != null) + { + Reagent reagent = reagentStack.reagent; + this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity); + } + } GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); } @@ -188,68 +136,64 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) { - GL11.glPushMatrix(); - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(resourceLocation); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glDepthMask(false); + GL11.glPushMatrix(); + float f1 = 1.0f; + Tessellator tessellator = Tessellator.instance; + this.bindTexture(resourceLocation); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + float f2 = 0; + float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); - - GL11.glTranslated(x+0.5, y+0.5, z+0.5); - //GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis - //GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically - - tessellator.setBrightness(240); - - double x1 = -7d/16d; - double x2 = 7d/16d; - double y1 = 1d/16d; - double y2 = 5d/16d; - double z1 = -7d/16d; - double z2 = 7d/16d; - - double resx1 = 0.0d; - double resx2 = 0.0d; - double resy1 = 1.0d; - double resy2 = 1.0d; - - tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); - tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2); - tessellator.draw(); + GL11.glDepthMask(false); - GL11.glDepthMask(true); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); + GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + tessellator.setBrightness(240); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); + double x1 = -7d / 16d; + double x2 = 7d / 16d; + double y1 = 1d / 16d; + double y2 = 5d / 16d; + double z1 = -7d / 16d; + double z2 = 7d / 16d; + + double resx1 = 0.0d; + double resx2 = 0.0d; + double resy1 = 1.0d; + double resy2 = 1.0d; + + tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); + tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2); + tessellator.draw(); + + GL11.glDepthMask(true); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glPopMatrix(); } - + private float getGhostItemScaleFactor(ItemStack itemStack) { float scaleFactor = 1.5F; @@ -258,7 +202,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer { if (itemStack.getItem() instanceof ItemBlock) { - switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) { case 1: return 0.90F * scaleFactor; @@ -280,7 +224,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer } } else { - switch (customRenderItem.getMiniItemCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) { case 1: return 0.65F * scaleFactor; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java index 6c93e00e..640eb075 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java @@ -21,19 +21,13 @@ public class RenderConduit extends TileEntitySpecialRenderer TEConduit tileConduit = (TEConduit) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection()); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java index c5d0a372..06273c5c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java @@ -1,30 +1,24 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator; import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar; import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.opengl.GL11; public class RenderCrystalBelljar extends TileEntitySpecialRenderer { private ModelCrystalBelljar modelConduit = new ModelCrystalBelljar(); - + private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png"); @@ -34,80 +28,30 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer if (tileEntity instanceof TEBellJar) { TEBellJar tileAltar = (TEBellJar) tileEntity; - GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); -// GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - - - + ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN); - if(info.length >= 1 && info[0] != null) + if (info.length >= 1 && info[0] != null) { - ReagentStack reagentStack = info[0].reagent; - int capacity = info[0].capacity; - if(reagentStack != null && reagentStack.reagent != null) - { - Reagent reagent = reagentStack.reagent; + ReagentStack reagentStack = info[0].reagent; + int capacity = info[0].capacity; + if (reagentStack != null && reagentStack.reagent != null) + { + Reagent reagent = reagentStack.reagent; this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity); - } + } } - -// this.renderTankContents(d0, d1, d2, 255, 0, 0, 200); - - - - -// for (int i = 0; i <= 1; i++) -// { -// GL11.glPushMatrix(); -// -// if (tileAltar.getStackInSlot(i) != null) -// { -// float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i)); -// float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); -// EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); -// ghostEntityItem.hoverStart = 0.0F; -// ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i)); -// //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); -// float displacementX = getXDisplacementForSlot(i); -// float displacementY = getYDisplacementForSlot(i); -// float displacementZ = getZDisplacementForSlot(i); -// -// if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) -// { -// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.7F, (float) d2 + 0.5F + displacementZ); -// } else -// { -// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.6F, (float) d2 + 0.5F + displacementZ); -// } -// -// //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); -// GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); -// GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); -// customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); -// } -// -// GL11.glPopMatrix(); -// } - GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); } @@ -115,70 +59,64 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) { - GL11.glPushMatrix(); - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(resourceLocation); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glDepthMask(false); + GL11.glPushMatrix(); + float f1 = 1.0f; + Tessellator tessellator = Tessellator.instance; + this.bindTexture(resourceLocation); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + float f2 = 0; + float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDepthMask(false); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); + GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + tessellator.setBrightness(240); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); - - GL11.glTranslated(x+0.5, y+0.5, z+0.5); - //GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis - //GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically - - tessellator.setBrightness(240); - - double x1 = -4d/16d; - double x2 = 4d/16d; - double y1 = -6d/16d; - double y2 = 4d/16d; - double z1 = -4d/16d; - double z2 = 4d/16d; - - double resx1 = 0.0d; - double resx2 = 0.0d; - double resy1 = 1.0d; - double resy2 = 1.0d; - - tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); - tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); - tessellator.draw(); + double x1 = -4d / 16d; + double x2 = 4d / 16d; + double y1 = -6d / 16d; + double y2 = 4d / 16d; + double z1 = -4d / 16d; + double z2 = 4d / 16d; - GL11.glDepthMask(true); + double resx1 = 0.0d; + double resx2 = 0.0d; + double resy1 = 1.0d; + double resy2 = 1.0d; - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); + tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); + tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); + tessellator.draw(); + + GL11.glDepthMask(true); + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glPopMatrix(); } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java index 0a54d29d..4de3904e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java @@ -1,15 +1,10 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.common.renderer.MRSRenderer; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; public class RenderMasterStone extends TileEntitySpecialRenderer { @@ -18,13 +13,13 @@ public class RenderMasterStone extends TileEntitySpecialRenderer { if (tileEntity instanceof TEMasterStone) { - String str = ((TEMasterStone) tileEntity).getCurrentRitual(); - MRSRenderer renderer = Rituals.getRendererForKey(str); - - if(renderer != null) - { - renderer.renderAt(((TEMasterStone) tileEntity), d0, d1, d2); - } + String str = ((TEMasterStone) tileEntity).getCurrentRitual(); + MRSRenderer renderer = Rituals.getRendererForKey(str); + + if (renderer != null) + { + renderer.renderAt(((TEMasterStone) tileEntity), d0, d1, d2); + } } } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java index 47e63753..654d29d7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java @@ -1,6 +1,8 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.Tessellator; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -9,16 +11,10 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; -import cpw.mods.fml.client.FMLClientHandler; - public class RenderPedestal extends TileEntitySpecialRenderer { private ModelPedestal modelPedestal = new ModelPedestal(); @@ -44,19 +40,13 @@ public class RenderPedestal extends TileEntitySpecialRenderer { TEPedestal tileAltar = (TEPedestal) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Pedestal.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelPedestal.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glPushMatrix(); @@ -68,7 +58,6 @@ public class RenderPedestal extends TileEntitySpecialRenderer EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); - //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); float displacement = 0.2F; if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) @@ -78,8 +67,6 @@ public class RenderPedestal extends TileEntitySpecialRenderer { GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F); } - - //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); @@ -88,24 +75,21 @@ public class RenderPedestal extends TileEntitySpecialRenderer GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); - GL11.glPushMatrix(); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); -// this.modelInputMirror.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); - GL11.glPopMatrix(); - - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - - + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glPopMatrix(); + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } } @@ -118,7 +102,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer { if (itemStack.getItem() instanceof ItemBlock) { - switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) { case 1: return 0.90F; @@ -140,7 +124,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer } } else { - switch (customRenderItem.getMiniItemCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) { case 1: return 0.65F; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java index 6a233520..9218a3d3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java @@ -1,5 +1,8 @@ package WayofTime.alchemicalWizardry.common.renderer.block; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -10,13 +13,8 @@ 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; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; -import cpw.mods.fml.client.FMLClientHandler; - public class RenderPlinth extends TileEntitySpecialRenderer { private ModelPlinth modelPlinth = new ModelPlinth(); @@ -42,19 +40,13 @@ public class RenderPlinth extends TileEntitySpecialRenderer { TEPlinth tileAltar = (TEPlinth) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Plinth.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelPlinth.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glPushMatrix(); @@ -65,7 +57,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); - //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); float displacement = 0.2F; if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) @@ -75,8 +66,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer { GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.1875f); } - - //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java index 66c743d7..97e83417 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java @@ -1,18 +1,16 @@ package WayofTime.alchemicalWizardry.common.renderer.block; +import WayofTime.alchemicalWizardry.common.Int3; +import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.Int3; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; - public class RenderReagentConduit extends TileEntitySpecialRenderer -{ +{ private static final ResourceLocation field_110629_a = new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"); @Override @@ -20,56 +18,44 @@ public class RenderReagentConduit extends TileEntitySpecialRenderer { if (tileEntity instanceof TEReagentConduit) { - int renderCount = ((TEReagentConduit)tileEntity).renderCount; - float key1 = (tileEntity.xCoord*54f - tileEntity.yCoord*38.72f + tileEntity.zCoord*10.432f); - float key2 = (tileEntity.xCoord*21.43f - tileEntity.yCoord*9.96f + tileEntity.zCoord*12.8f); - - Int3 colourMap = ((TEReagentConduit) tileEntity).getColour(); - - GL11.glPushMatrix(); - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(field_110629_a); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - + int renderCount = ((TEReagentConduit) tileEntity).renderCount; + float key1 = (tileEntity.xCoord * 54f - tileEntity.yCoord * 38.72f + tileEntity.zCoord * 10.432f); + float key2 = (tileEntity.xCoord * 21.43f - tileEntity.yCoord * 9.96f + tileEntity.zCoord * 12.8f); + Int3 colourMap = ((TEReagentConduit) tileEntity).getColour(); + GL11.glPushMatrix(); + float f1 = 1.0f; + Tessellator tessellator = Tessellator.instance; + this.bindTexture(field_110629_a); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + float f2 = 0; + float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDepthMask(false); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourMap.xCoord, colourMap.yCoord, colourMap.zCoord, 200); + GL11.glTranslated(d0 + 0.5, d1 + 0.5, d2 + 0.5); + GL11.glRotatef(tileEntity.getWorldObj().getWorldTime() / 3.0f, 0F, 1F, 0F); //Rotate on planar axis + GL11.glRotatef(renderCount + key1, 0F, 0F, 1F); //Rotate vertical axis + GL11.glRotatef(renderCount * 2f + key2, 1F, 0F, 0F); //Rotate cylindrically + double offset = 0; + tessellator.setBrightness(240); + tessellator.addVertexWithUV(-0.5d, 0, -0.5d, 0.0d, 0.0d); + tessellator.addVertexWithUV(0.5d, 0, -0.5d, 1.0d, 0.0d); + tessellator.addVertexWithUV(0.5d, 0, 0.5d, 1.0d, 1.0d); + tessellator.addVertexWithUV(-0.5d, 0, 0.5d, 0.0d, 1.0d); - GL11.glDepthMask(false); + tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(colourMap.xCoord, colourMap.yCoord, colourMap.zCoord, 200); - //tessellator.setColorOpaque(255, 255, 255); - - GL11.glTranslated(d0+0.5, d1+0.5, d2+0.5); + GL11.glDepthMask(true); - GL11.glRotatef(tileEntity.getWorldObj().getWorldTime()/3.0f, 0F, 1F, 0F); //Rotate on planar axis - GL11.glRotatef(renderCount + key1, 0F, 0F, 1F); //Rotate vertical axis - GL11.glRotatef(renderCount*2f + key2, 1F, 0F, 0F); //Rotate cylindrically - - double offset = 0; - - tessellator.setBrightness(240); -// GL11.glTranslatef(0F, s, s); -// GL11.glScalef(1F, s * 14F, s * 14F); - tessellator.addVertexWithUV(-0.5d, 0, -0.5d, 0.0d, 0.0d); - tessellator.addVertexWithUV(0.5d, 0, -0.5d, 1.0d, 0.0d); - tessellator.addVertexWithUV(0.5d, 0, 0.5d, 1.0d, 1.0d); - tessellator.addVertexWithUV(-0.5d, 0, 0.5d, 0.0d, 1.0d); - - tessellator.draw(); - - GL11.glDepthMask(true); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glPopMatrix(); } } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java index 644bb56b..3b52c41d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java @@ -1,15 +1,13 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellEffectBlock extends TileEntitySpecialRenderer { @@ -22,24 +20,17 @@ public class RenderSpellEffectBlock extends TileEntitySpecialRenderer { TESpellEffectBlock tileSpellBlock = (TESpellEffectBlock) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEffect.png"); int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); - + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelSpellEffectBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java index ad2b22ae..815474a8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java @@ -1,15 +1,13 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock; import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock; import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer { @@ -22,24 +20,17 @@ public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer { TESpellEnhancementBlock tileSpellBlock = (TESpellEnhancementBlock) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEnhancementPower1.png"); int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); - + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelSpellEnhancementBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java index e61a6123..3628499a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java @@ -1,15 +1,13 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock; import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellModifierBlock extends TileEntitySpecialRenderer { @@ -22,24 +20,17 @@ public class RenderSpellModifierBlock extends TileEntitySpecialRenderer { TESpellModifierBlock tileSpellBlock = (TESpellModifierBlock) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellModifier.png"); int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); - + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelSpellModifierBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java index 9b28f3fb..c48f45d9 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java @@ -1,15 +1,13 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock; import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer { @@ -22,24 +20,17 @@ public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer { TESpellParadigmBlock tileSpellBlock = (TESpellParadigmBlock) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellParadigm.png"); int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); - + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelSpellParadigmBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java index b53c496f..f2de6179 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java @@ -1,5 +1,8 @@ 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.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -10,13 +13,8 @@ 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; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; -import cpw.mods.fml.client.FMLClientHandler; - public class RenderWritingTable extends TileEntitySpecialRenderer { private ModelWritingTable modelWritingTable = new ModelWritingTable(); @@ -42,16 +40,13 @@ public class RenderWritingTable extends TileEntitySpecialRenderer { TEWritingTable tileAltar = (TEWritingTable) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/WritingTable.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelWritingTable.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); @@ -66,7 +61,6 @@ public class RenderWritingTable extends TileEntitySpecialRenderer EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i)); - //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); float displacementX = getXDisplacementForSlot(i); float displacementY = getYDisplacementForSlot(i); float displacementZ = getZDisplacementForSlot(i); @@ -78,8 +72,6 @@ public class RenderWritingTable extends TileEntitySpecialRenderer { GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.6F, (float) d2 + 0.5F + displacementZ); } - - //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); @@ -101,7 +93,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer { if (itemStack.getItem() instanceof ItemBlock) { - switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) { case 1: return 0.90F * scaleFactor; @@ -123,7 +115,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer } } else { - switch (customRenderItem.getMiniItemCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) { case 1: return 0.65F * scaleFactor; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/ShaderHelper.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/ShaderHelper.java index 46641497..7e72c42e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/ShaderHelper.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/ShaderHelper.java @@ -2,183 +2,195 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under a * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * + * * File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)] */ package WayofTime.alchemicalWizardry.common.renderer.block; -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.logging.Level; - import org.lwjgl.opengl.ARBFragmentShader; import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.ARBVertexShader; import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLLog; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; -public final class ShaderHelper { +public final class ShaderHelper +{ - private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB; - private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB; + private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB; + private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB; - public static int beam = 0; - - public static void initShaders() { -// if(!useShaders()) -// return; - - beam = createProgram(null, "/assets/alchemicalwizardry/shaders/beam.frag"); - } + public static int beam = 0; - public static void useShaderWithProps(int shader, Object... props) { -// if(!useShaders()) -// return; - - ARBShaderObjects.glUseProgramObjectARB(shader); + public static void initShaders() + { + beam = createProgram(null, "/assets/alchemicalwizardry/shaders/beam.frag"); + } - if(shader != 0 && props.length % 2 == 0) { - int propCount = props.length / 2; - for(int i = 0; i < propCount; i++) { - String propName = (String) props[i * 2]; - Object propVal = props[i * 2 + 1]; - - int uniform = ARBShaderObjects.glGetUniformLocationARB(shader, propName); - if(propVal instanceof Integer) - ARBShaderObjects.glUniform1iARB(uniform, (Integer) propVal); - if(propVal instanceof Float) - ARBShaderObjects.glUniform1fARB(uniform, (Float) propVal); - // Possible Vector2, Vector3 and Vector4, no need yet. - } - } - } - - public static void useShader(int shader) { - useShaderWithProps(shader); - } + public static void useShaderWithProps(int shader, Object... props) + { + ARBShaderObjects.glUseProgramObjectARB(shader); - public static void releaseShader() { - useShader(0); - } - - public static boolean useShaders() { - return true;//ConfigHandler.useShaders && OpenGlHelper.shadersSupported; - } - - // Most of the code taken from the LWJGL wiki - // http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL + if (shader != 0 && props.length % 2 == 0) + { + int propCount = props.length / 2; + for (int i = 0; i < propCount; i++) + { + String propName = (String) props[i * 2]; + Object propVal = props[i * 2 + 1]; - private static int createProgram(String vert, String frag) { - int vertId = 0, fragId = 0, program = 0; - if(vert != null) - vertId = createShader(vert, VERT); - if(frag != null) - fragId = createShader(frag, FRAG); + int uniform = ARBShaderObjects.glGetUniformLocationARB(shader, propName); + if (propVal instanceof Integer) + ARBShaderObjects.glUniform1iARB(uniform, (Integer) propVal); + if (propVal instanceof Float) + ARBShaderObjects.glUniform1fARB(uniform, (Float) propVal); + } + } + } - program = ARBShaderObjects.glCreateProgramObjectARB(); - if(program == 0) - return 0; + public static void useShader(int shader) + { + useShaderWithProps(shader); + } - if(vert != null) - ARBShaderObjects.glAttachObjectARB(program, vertId); - if(frag != null) - ARBShaderObjects.glAttachObjectARB(program, fragId); + public static void releaseShader() + { + useShader(0); + } - ARBShaderObjects.glLinkProgramARB(program); - if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) { -// FMLLog.log(Level.WARNING, getLogInfo(program)); - return 0; - } - - ARBShaderObjects.glValidateProgramARB(program); - if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) { -// FMLLog.log(Level.WARNING, getLogInfo(program)); - return 0; - } - - return program; - } + public static boolean useShaders() + { + return true; + } - private static int createShader(String filename, int shaderType){ - int shader = 0; - try { - shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType); + // Most of the code taken from the LWJGL wiki + // http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL + private static int createProgram(String vert, String frag) + { + int vertId = 0, fragId = 0, program = 0; + if (vert != null) + vertId = createShader(vert, VERT); + if (frag != null) + fragId = createShader(frag, FRAG); - if(shader == 0) - return 0; + program = ARBShaderObjects.glCreateProgramObjectARB(); + if (program == 0) + return 0; - ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename)); - ARBShaderObjects.glCompileShaderARB(shader); + if (vert != null) + ARBShaderObjects.glAttachObjectARB(program, vertId); + if (frag != null) + ARBShaderObjects.glAttachObjectARB(program, fragId); - if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) - throw new RuntimeException("Error creating shader: " + getLogInfo(shader)); + ARBShaderObjects.glLinkProgramARB(program); + if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) + { + return 0; + } - return shader; - } - catch(Exception e) { - ARBShaderObjects.glDeleteObjectARB(shader); - e.printStackTrace(); - return -1; - } - } + ARBShaderObjects.glValidateProgramARB(program); + if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) + { + return 0; + } - private static String getLogInfo(int obj) { - return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB)); - } + return program; + } - private static String readFileAsString(String filename) throws Exception { - StringBuilder source = new StringBuilder(); - InputStream in = ShaderHelper.class.getResourceAsStream(filename); - Exception exception = null; - BufferedReader reader; + private static int createShader(String filename, int shaderType) + { + int shader = 0; + try + { + shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType); - if(in == null) - return ""; - - try { - reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); + if (shader == 0) + return 0; - Exception innerExc= null; - try { - String line; - while((line = reader.readLine()) != null) - source.append(line).append('\n'); - } catch(Exception exc) { - exception = exc; - } finally { - try { - reader.close(); - } catch(Exception exc) { - if(innerExc == null) - innerExc = exc; - else exc.printStackTrace(); - } - } + ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename)); + ARBShaderObjects.glCompileShaderARB(shader); - if(innerExc != null) - throw innerExc; - } catch(Exception exc) { - exception = exc; - } finally { - try { - in.close(); - } catch(Exception exc) { - if(exception == null) - exception = exc; - else exc.printStackTrace(); - } + if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) + throw new RuntimeException("Error creating shader: " + getLogInfo(shader)); - if(exception != null) - throw exception; - } + return shader; + } catch (Exception e) + { + ARBShaderObjects.glDeleteObjectARB(shader); + e.printStackTrace(); + return -1; + } + } - return source.toString(); - } + private static String getLogInfo(int obj) + { + return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB)); + } + + private static String readFileAsString(String filename) throws Exception + { + StringBuilder source = new StringBuilder(); + InputStream in = ShaderHelper.class.getResourceAsStream(filename); + Exception exception = null; + BufferedReader reader; + + if (in == null) + return ""; + + try + { + reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); + + Exception innerExc = null; + try + { + String line; + while ((line = reader.readLine()) != null) + source.append(line).append('\n'); + } catch (Exception exc) + { + exception = exc; + } finally + { + try + { + reader.close(); + } catch (Exception exc) + { + if (innerExc == null) + innerExc = exc; + else exc.printStackTrace(); + } + } + + if (innerExc != null) + throw innerExc; + } catch (Exception exc) + { + exception = exc; + } finally + { + try + { + in.close(); + } catch (Exception exc) + { + if (exception == null) + exception = exc; + else exc.printStackTrace(); + } + + if (exception != null) + throw exception; + } + + return source.toString(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java index 4036f435..14010ef8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java @@ -1,5 +1,7 @@ package WayofTime.alchemicalWizardry.common.renderer.block; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -8,12 +10,8 @@ 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(); @@ -42,10 +40,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer { TEAltar tileAltar = (TEAltar) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); -// GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); if (tileAltar.getStackInSlot(0) != null) @@ -55,7 +49,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); - //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); float displacement = 0.2F; if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) @@ -65,8 +58,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer { GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F); } - - //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); @@ -86,7 +77,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer { if (itemStack.getItem() instanceof ItemBlock) { - switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) { case 1: return 0.90F; @@ -108,7 +99,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer } } else { - switch (customRenderItem.getMiniItemCount(itemStack,(byte)1)) + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) { case 1: return 0.65F; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java index 87b7cb94..56f0c936 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java @@ -1,5 +1,8 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -7,89 +10,81 @@ import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator; -import cpw.mods.fml.client.FMLClientHandler; - -public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer +public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer { - private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator(); + private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator(); - private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) - { - Tessellator tessellator = Tessellator.instance; - - Block block = ModBlocks.blockAlchemicCalcinator; - - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + Block block = ModBlocks.blockAlchemicCalcinator; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); - - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - } + + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + } - /** - * IItemRenderer implementation * - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch (type) { - case ENTITY: - return true; - case EQUIPPED: - return true; - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - return false; - } - } + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + switch (type) + { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - case EQUIPPED: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case EQUIPPED_FIRST_PERSON: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case INVENTORY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - default: - } - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + switch (type) + { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java index 72945f5a..1ec474f5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java @@ -6,7 +6,6 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; - import org.lwjgl.opengl.GL11; public class TEAltarItemRenderer implements IItemRenderer @@ -21,14 +20,12 @@ public class TEAltarItemRenderer implements IItemRenderer @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { - // TODO Auto-generated method stub return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - // TODO Auto-generated method stub return true; } @@ -36,22 +33,20 @@ public class TEAltarItemRenderer implements IItemRenderer public void renderItem(ItemRenderType type, ItemStack item, Object... data) { float scale = 0.08f; - - // TODO Auto-generated method stub switch (type) { - case ENTITY: - renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale); - break; - case EQUIPPED: - renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0.5f, scale); - break; - case EQUIPPED_FIRST_PERSON: - renderBloodAltar((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale); - break; - case INVENTORY: - renderBloodAltar((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale); - break; + case ENTITY: + renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale); + break; + case EQUIPPED: + renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0.5f, scale); + break; + case EQUIPPED_FIRST_PERSON: + renderBloodAltar((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale); + break; + case INVENTORY: + renderBloodAltar((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale); + break; default: return; @@ -63,16 +58,12 @@ public class TEAltarItemRenderer implements IItemRenderer GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glPushMatrix(); - // Disable Lighting Calculations GL11.glTranslatef(x, y, z); GL11.glScalef(scale, scale, scale); GL11.glRotatef(180f, 0f, 1f, 0f); - //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/OBJTutorial/textures/models/TutBox.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/altar.png"); - //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); modelBloodAltar.renderBloodAltar(); - // Re-enable Lighting Calculations GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java index 706d7305..d4396f94 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java @@ -1,206 +1,195 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar; import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import org.lwjgl.opengl.GL11; -public class TEBellJarItemRenderer implements IItemRenderer +public class TEBellJarItemRenderer implements IItemRenderer { - ItemRenderer d; - private ModelCrystalBelljar modelConduit = new ModelCrystalBelljar(); - private ResourceLocation mainResource = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png"); + ItemRenderer d; + private ModelCrystalBelljar modelConduit = new ModelCrystalBelljar(); + private ResourceLocation mainResource = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png"); private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png"); - private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) - { - GL11.glDepthMask(false); - Tessellator tessellator = Tessellator.instance; - - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + GL11.glDepthMask(false); + Tessellator tessellator = Tessellator.instance; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 0); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); - - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); ReagentContainerInfo[] info = TEBellJar.getContainerInfoFromItem(item); - if(info.length >= 1 && info[0] != null) + if (info.length >= 1 && info[0] != null) { - ReagentStack reagentStack = info[0].reagent; - int capacity = info[0].capacity; - if(reagentStack != null && reagentStack.reagent != null) - { - Reagent reagent = reagentStack.reagent; + ReagentStack reagentStack = info[0].reagent; + int capacity = info[0].capacity; + if (reagentStack != null && reagentStack.reagent != null) + { + Reagent reagent = reagentStack.reagent; this.renderTankContents(translateX, translateY, translateZ, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity); - } + } } - + GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 1); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); - - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); -// GL11.glEnable(GL11.GL_CULL_FACE); -// GL11.glEnable(GL11.GL_LIGHTING); + + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); - } - - private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) - { - GL11.glPushMatrix(); - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - FMLClientHandler.instance().getClient().renderEngine.bindTexture(resourceLocation); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_TEXTURE_2D); - float f2 = 0; - float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glDepthMask(false); - - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); - - GL11.glTranslated(x+0.5, y+0.5, z+0.5); - //GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis - //GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically - - tessellator.setBrightness(240); - - double x1 = -4d/16d; - double x2 = 4d/16d; - double y1 = -6d/16d; - double y2 = 4d/16d; - double z1 = -4d/16d; - double z2 = 4d/16d; - - double resx1 = 0.0d; - double resx2 = 0.0d; - double resy1 = 1.0d; - double resy2 = 1.0d; - - tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); - tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2); - tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1); - tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1); - tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); - tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); - tessellator.draw(); - - GL11.glDepthMask(true); - - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); } - - /** - * IItemRenderer implementation * - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch (type) { - case ENTITY: - return true; - case EQUIPPED: - return true; - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - return false; - } - } + + private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) + { + GL11.glPushMatrix(); + float f1 = 1.0f; + Tessellator tessellator = Tessellator.instance; + FMLClientHandler.instance().getClient().renderEngine.bindTexture(resourceLocation); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_TEXTURE_2D); + float f2 = 0; + float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + GL11.glDepthMask(false); + + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); + + GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + + tessellator.setBrightness(240); + + double x1 = -4d / 16d; + double x2 = 4d / 16d; + double y1 = -6d / 16d; + double y2 = 4d / 16d; + double z1 = -4d / 16d; + double z2 = 4d / 16d; + + double resx1 = 0.0d; + double resx2 = 0.0d; + double resy1 = 1.0d; + double resy2 = 1.0d; + + tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); + tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2); + tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1); + tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1); + tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2); + tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2); + tessellator.draw(); + + GL11.glDepthMask(true); + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glPopMatrix(); + } + + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + switch (type) + { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - case EQUIPPED: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case EQUIPPED_FIRST_PERSON: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case INVENTORY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - default: - } - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + switch (type) + { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java index 9e76b9f8..933b3c71 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java @@ -1,96 +1,89 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit; -import cpw.mods.fml.client.FMLClientHandler; - -public class TEConduitItemRenderer implements IItemRenderer +public class TEConduitItemRenderer implements IItemRenderer { - private ModelConduit modelConduit = new ModelConduit(); + private ModelConduit modelConduit = new ModelConduit(); - private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) - { - Tessellator tessellator = Tessellator.instance; - - Block block = ModBlocks.blockConduit; - - GL11.glDisable(GL11.GL_LIGHTING); + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + Block block = ModBlocks.blockConduit; + GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); - - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - } + } - /** - * IItemRenderer implementation * - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch (type) { - case ENTITY: - return true; - case EQUIPPED: - return true; - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - return false; - } - } + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + switch (type) + { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - case EQUIPPED: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case EQUIPPED_FIRST_PERSON: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case INVENTORY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - default: - } - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + switch (type) + { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java index 30cb938a..23224f21 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java @@ -1,5 +1,8 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -8,101 +11,96 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; -import cpw.mods.fml.client.FMLClientHandler; - -public class TESpellEffectBlockItemRenderer implements IItemRenderer +public class TESpellEffectBlockItemRenderer implements IItemRenderer { - private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock(); + private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock(); - private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) - { - Tessellator tessellator = Tessellator.instance; - - Block block = ModBlocks.blockSpellEffect; - //Icon icon = item.getItem().getIconFromDamage(0); - - GL11.glDisable(GL11.GL_LIGHTING); + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + Block block = ModBlocks.blockSpellEffect; + GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); - + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); - //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - } + } - /** - * IItemRenderer implementation * - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch (type) { - case ENTITY: - return true; - case EQUIPPED: - return true; - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - return false; - } - } - - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } - - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - case EQUIPPED: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case EQUIPPED_FIRST_PERSON: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case INVENTORY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - default: - } - } - - public String getResourceLocationForMeta(int meta) + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch(meta) - { - case 0: return "alchemicalwizardry:textures/models/SpellEffectFire.png"; - case 1: return "alchemicalwizardry:textures/models/SpellEffectIce.png"; - case 2: return "alchemicalwizardry:textures/models/SpellEffectWind.png"; - case 3: return "alchemicalwizardry:textures/models/SpellEffectEarth.png"; - } - return ""; + switch (type) + { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + switch (type) + { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } + + public String getResourceLocationForMeta(int meta) + { + switch (meta) + { + case 0: + return "alchemicalwizardry:textures/models/SpellEffectFire.png"; + case 1: + return "alchemicalwizardry:textures/models/SpellEffectIce.png"; + case 2: + return "alchemicalwizardry:textures/models/SpellEffectWind.png"; + case 3: + return "alchemicalwizardry:textures/models/SpellEffectEarth.png"; + } + return ""; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java index a25da6d7..79f1cb86 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java @@ -1,5 +1,8 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -8,107 +11,108 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock; -import cpw.mods.fml.client.FMLClientHandler; - -public class TESpellEnhancementBlockItemRenderer implements IItemRenderer +public class TESpellEnhancementBlockItemRenderer implements IItemRenderer { - private ModelSpellEnhancementBlock modelSpellBlock = new ModelSpellEnhancementBlock(); + private ModelSpellEnhancementBlock modelSpellBlock = new ModelSpellEnhancementBlock(); - private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) - { - Tessellator tessellator = Tessellator.instance; - - Block block = ModBlocks.blockSpellEffect; - //Icon icon = item.getItem().getIconFromDamage(0); - - GL11.glDisable(GL11.GL_LIGHTING); + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + Block block = ModBlocks.blockSpellEffect; + GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); - /** - * Render the ghost item inside of the Altar, slowly spinning - */ GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); - + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - } + } - /** - * IItemRenderer implementation * - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch (type) { - case ENTITY: - return true; - case EQUIPPED: - return true; - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - return false; - } - } + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + switch (type) + { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - case EQUIPPED: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case EQUIPPED_FIRST_PERSON: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case INVENTORY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - default: - } - } - - public String getResourceLocationForMeta(int meta) - { - switch(meta) - { - case 0: return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png"; - case 1: return "alchemicalwizardry:textures/models/SpellEnhancementPower2.png"; - case 2: return "alchemicalwizardry:textures/models/SpellEnhancementPower3.png"; - case 5: return "alchemicalwizardry:textures/models/SpellEnhancementCost1.png"; - case 6: return "alchemicalwizardry:textures/models/SpellEnhancementCost2.png"; - case 7: return "alchemicalwizardry:textures/models/SpellEnhancementCost3.png"; - case 10: return "alchemicalwizardry:textures/models/SpellEnhancementPotency1.png"; - case 11: return "alchemicalwizardry:textures/models/SpellEnhancementPotency2.png"; - case 12: return "alchemicalwizardry:textures/models/SpellEnhancementPotency3.png"; + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + switch (type) + { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } - } - return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png"; - } + public String getResourceLocationForMeta(int meta) + { + switch (meta) + { + case 0: + return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png"; + case 1: + return "alchemicalwizardry:textures/models/SpellEnhancementPower2.png"; + case 2: + return "alchemicalwizardry:textures/models/SpellEnhancementPower3.png"; + case 5: + return "alchemicalwizardry:textures/models/SpellEnhancementCost1.png"; + case 6: + return "alchemicalwizardry:textures/models/SpellEnhancementCost2.png"; + case 7: + return "alchemicalwizardry:textures/models/SpellEnhancementCost3.png"; + case 10: + return "alchemicalwizardry:textures/models/SpellEnhancementPotency1.png"; + case 11: + return "alchemicalwizardry:textures/models/SpellEnhancementPotency2.png"; + case 12: + return "alchemicalwizardry:textures/models/SpellEnhancementPotency3.png"; + + } + return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png"; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java index c7809540..d746e8dc 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java @@ -1,5 +1,8 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -8,25 +11,19 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock; -import cpw.mods.fml.client.FMLClientHandler; - -public class TESpellModifierBlockItemRenderer implements IItemRenderer +public class TESpellModifierBlockItemRenderer implements IItemRenderer { - private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock(); + private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock(); - private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) - { - Tessellator tessellator = Tessellator.instance; + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; - Block block = ModBlocks.blockSpellEffect; - //Icon icon = item.getItem().getIconFromDamage(0); - - GL11.glDisable(GL11.GL_LIGHTING); + Block block = ModBlocks.blockSpellEffect; + + GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); /** * Render the ghost item inside of the Altar, slowly spinning @@ -34,75 +31,82 @@ public class TESpellModifierBlockItemRenderer implements IItemRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); - + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); - //A reference to your Model file. Again, very important. this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); //Tell it to stop rendering for both the PushMatrix's GL11.glPopMatrix(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - } + } - /** - * IItemRenderer implementation * - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch (type) { - case ENTITY: - return true; - case EQUIPPED: - return true; - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - return false; - } - } - - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } - - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - case EQUIPPED: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case EQUIPPED_FIRST_PERSON: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case INVENTORY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - default: - } - } - - public String getResourceLocationForMeta(int meta) + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch(meta) - { - case 0: return "alchemicalwizardry:textures/models/SpellModifierDefault.png"; - case 1: return "alchemicalwizardry:textures/models/SpellModifierOffensive.png"; - case 2: return "alchemicalwizardry:textures/models/SpellModifierDefensive.png"; - case 3: return "alchemicalwizardry:textures/models/SpellModifierEnvironmental.png"; - } - return "alchemicalwizardry:textures/models/SpellModifierDefault.png"; + switch (type) + { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + switch (type) + { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } + + public String getResourceLocationForMeta(int meta) + { + switch (meta) + { + case 0: + return "alchemicalwizardry:textures/models/SpellModifierDefault.png"; + case 1: + return "alchemicalwizardry:textures/models/SpellModifierOffensive.png"; + case 2: + return "alchemicalwizardry:textures/models/SpellModifierDefensive.png"; + case 3: + return "alchemicalwizardry:textures/models/SpellModifierEnvironmental.png"; + } + return "alchemicalwizardry:textures/models/SpellModifierDefault.png"; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java index 848d36ae..f8c9a7b6 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java @@ -1,5 +1,8 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -8,25 +11,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.util.ForgeDirection; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock; -import cpw.mods.fml.client.FMLClientHandler; - -public class TESpellParadigmBlockItemRenderer implements IItemRenderer +public class TESpellParadigmBlockItemRenderer implements IItemRenderer { - private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock(); + private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock(); - private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) - { - Tessellator tessellator = Tessellator.instance; + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; - Block block = ModBlocks.blockSpellEffect; - //Icon icon = item.getItem().getIconFromDamage(0); - - GL11.glDisable(GL11.GL_LIGHTING); + Block block = ModBlocks.blockSpellEffect; + GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); /** * Render the ghost item inside of the Altar, slowly spinning @@ -34,11 +30,9 @@ public class TESpellParadigmBlockItemRenderer implements IItemRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); //A reference to your Model file. Again, very important. this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); //Tell it to stop rendering for both the PushMatrix's @@ -46,63 +40,72 @@ public class TESpellParadigmBlockItemRenderer implements IItemRenderer GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); - } + } - /** - * IItemRenderer implementation * - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch (type) { - case ENTITY: - return true; - case EQUIPPED: - return true; - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - return false; - } - } - - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } - - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - case EQUIPPED: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case EQUIPPED_FIRST_PERSON: - renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); - break; - case INVENTORY: - renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); - break; - default: - } - } - - public String getResourceLocationForMeta(int meta) + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { - switch(meta) - { - case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; - case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png"; - case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png"; - case 3: return "alchemicalwizardry:textures/models/SpellParadigmTool.png"; - } - return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; + switch (type) + { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + switch (type) + { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } + + public String getResourceLocationForMeta(int meta) + { + switch (meta) + { + case 0: + return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; + case 1: + return "alchemicalwizardry:textures/models/SpellParadigmSelf.png"; + case 2: + return "alchemicalwizardry:textures/models/SpellParadigmMelee.png"; + case 3: + return "alchemicalwizardry:textures/models/SpellParadigmTool.png"; + } + return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java index 9705879c..b618b248 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java @@ -10,24 +10,22 @@ import org.lwjgl.opengl.GL11; public class TEWritingTableItemRenderer implements IItemRenderer { - private ModelWritingTable modelBloodAltar; + private ModelWritingTable model; public TEWritingTableItemRenderer() { - modelBloodAltar = new ModelWritingTable(); + model = new ModelWritingTable(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { - // TODO Auto-generated method stub return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - // TODO Auto-generated method stub return true; } @@ -35,8 +33,6 @@ public class TEWritingTableItemRenderer implements IItemRenderer public void renderItem(ItemRenderType type, ItemStack item, Object... data) { float scale = 0.08f; - - // TODO Auto-generated method stub switch (type) { case ENTITY: @@ -70,11 +66,9 @@ public class TEWritingTableItemRenderer implements IItemRenderer GL11.glTranslatef(x, y, z); GL11.glScalef(scale, scale, scale); GL11.glRotatef(180f, 0f, 1f, 0f); - //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/OBJTutorial/textures/models/TutBox.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/WritingTable.png"); - //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); - modelBloodAltar.render((Entity) null, 0, 0, 0, 0, 0, 0); + model.render((Entity) null, 0, 0, 0, 0, 0, 0); // Re-enable Lighting Calculations GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java index b09c6ca7..6e7674a3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java @@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderBileDemon extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/BileDemon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/BileDemon.png"); public RenderBileDemon(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java index 6db35edd..8ff9516f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java @@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderBoulderFist extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/BoulderFist.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/BoulderFist.png"); public RenderBoulderFist(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java index 485adc3a..72f22b12 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java @@ -9,7 +9,7 @@ import net.minecraft.util.ResourceLocation; public class RenderElemental extends RenderLiving { - private static final ResourceLocation airBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/AirFloatingBeacon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation airBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/AirFloatingBeacon.png"); private static final ResourceLocation waterBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/WaterFloatingBeacon.png"); private static final ResourceLocation earthBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/EarthFloatingBeacon.png"); private static final ResourceLocation fireBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/FireFloatingBeacon.png"); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java index 28a18eaa..24c69cf9 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java @@ -11,7 +11,7 @@ import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class RenderFallenAngel extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/WingedAngel.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/WingedAngel.png"); public RenderFallenAngel(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java index e7dd7219..4b36e492 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java @@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderIceDemon extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/IceDemon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/IceDemon.png"); public RenderIceDemon(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java index 4eeaa4d3..a1c39675 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java @@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderLowerGuardian extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/LowerGuardian.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/LowerGuardian.png"); public RenderLowerGuardian(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java index 38868202..afd4f230 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java @@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderShade extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/ShadeMob.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/ShadeMob.png"); public RenderShade(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java index 16772df4..3e87ac76 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java @@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderSmallEarthGolem extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/SmallEarthGolem.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/SmallEarthGolem.png"); public RenderSmallEarthGolem(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java index 826f7832..8a385f76 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java @@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation; public class RenderWingedFireDemon extends RenderLiving { - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/WingedFireDemon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/WingedFireDemon.png"); public RenderWingedFireDemon(ModelBase par1ModelBase, float par2) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelAlchemicalCalcinator.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelAlchemicalCalcinator.java index 499d34c5..1724a715 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelAlchemicalCalcinator.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelAlchemicalCalcinator.java @@ -6,7 +6,7 @@ import net.minecraft.entity.Entity; public class ModelAlchemicalCalcinator extends ModelBase { - //fields + //fields ModelRenderer top1; ModelRenderer top2; ModelRenderer top3; @@ -20,121 +20,121 @@ public class ModelAlchemicalCalcinator extends ModelBase ModelRenderer Shape3; ModelRenderer Shape4; ModelRenderer Shape5; - - public ModelAlchemicalCalcinator() - { - textureWidth = 128; - textureHeight = 128; - - top1 = new ModelRenderer(this, 0, 34); - top1.addBox(4F, -8F, -8F, 4, 3, 16); - top1.setRotationPoint(0F, 16F, 0F); - top1.setTextureSize(128, 128); - top1.mirror = true; - setRotation(top1, 0F, 0F, 0F); - top2 = new ModelRenderer(this, 41, 34); - top2.addBox(-8F, -8F, -8F, 4, 3, 16); - top2.setRotationPoint(0F, 16F, 0F); - top2.setTextureSize(128, 128); - top2.mirror = true; - setRotation(top2, 0F, 0F, 0F); - top3 = new ModelRenderer(this, 25, 55); - top3.addBox(-4F, -8F, 4F, 8, 3, 4); - top3.setRotationPoint(0F, 16F, 0F); - top3.setTextureSize(128, 128); - top3.mirror = true; - setRotation(top3, 0F, 0F, 0F); - top4 = new ModelRenderer(this, 0, 55); - top4.addBox(-4F, -8F, -8F, 8, 3, 4); - top4.setRotationPoint(0F, 16F, 0F); - top4.setTextureSize(128, 128); - top4.mirror = true; - setRotation(top4, 0F, 0F, 0F); - tank = new ModelRenderer(this, 0, 0); - tank.addBox(-8F, -5F, -8F, 16, 4, 16); - tank.setRotationPoint(0F, 16F, 0F); - tank.setTextureSize(128, 128); - tank.mirror = true; - setRotation(tank, 0F, 0F, 0F); - centreCollumn = new ModelRenderer(this, 0, 21); - centreCollumn.addBox(-4F, -5F, -4F, 8, 4, 8); - centreCollumn.setRotationPoint(0F, 16F, 0F); - centreCollumn.setTextureSize(128, 128); - centreCollumn.mirror = true; - setRotation(centreCollumn, 0F, 0F, 0F); - furnaceShape = new ModelRenderer(this, 0, 63); - furnaceShape.addBox(-8F, -1F, -8F, 16, 5, 16); - furnaceShape.setRotationPoint(0F, 16F, 0F); - furnaceShape.setTextureSize(128, 128); - furnaceShape.mirror = true; - setRotation(furnaceShape, 0F, 0F, 0F); - glassWindow = new ModelRenderer(this, 0, 85); - glassWindow.addBox(-4F, -8F, -4F, 8, 0, 8); - glassWindow.setRotationPoint(0F, 16F, 0F); - glassWindow.setTextureSize(128, 128); - glassWindow.mirror = true; - setRotation(glassWindow, 0F, 0F, 0F); - Shape1 = new ModelRenderer(this, 0, 94); - Shape1.addBox(-8F, 4F, -8F, 4, 4, 4); - Shape1.setRotationPoint(0F, 16F, 0F); - Shape1.setTextureSize(128, 128); - Shape1.mirror = true; - setRotation(Shape1, 0F, 0F, 0F); - Shape2 = new ModelRenderer(this, 0, 103); - Shape2.addBox(-4F, 6F, -4F, 8, 1, 8); - Shape2.setRotationPoint(0F, 16F, 0F); - Shape2.setTextureSize(128, 128); - Shape2.mirror = true; - setRotation(Shape2, 0F, 0F, 0F); - Shape3 = new ModelRenderer(this, 0, 94); - Shape3.addBox(4F, 4F, -8F, 4, 4, 4); - Shape3.setRotationPoint(0F, 16F, 0F); - Shape3.setTextureSize(128, 128); - Shape3.mirror = true; - setRotation(Shape3, 0F, 0F, 0F); - Shape4 = new ModelRenderer(this, 0, 94); - Shape4.addBox(-8F, 4F, 4F, 4, 4, 4); - Shape4.setRotationPoint(0F, 16F, 0F); - Shape4.setTextureSize(128, 128); - Shape4.mirror = true; - setRotation(Shape4, 0F, 0F, 0F); - Shape5 = new ModelRenderer(this, 0, 94); - Shape5.addBox(4F, 4F, 4F, 4, 4, 4); - Shape5.setRotationPoint(0F, 16F, 0F); - Shape5.setTextureSize(128, 128); - Shape5.mirror = true; - setRotation(Shape5, 0F, 0F, 0F); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - top1.render(f5); - top2.render(f5); - top3.render(f5); - top4.render(f5); - tank.render(f5); - centreCollumn.render(f5); - furnaceShape.render(f5); - glassWindow.render(f5); - Shape1.render(f5); - Shape2.render(f5); - Shape3.render(f5); - Shape4.render(f5); - Shape5.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + + public ModelAlchemicalCalcinator() + { + textureWidth = 128; + textureHeight = 128; + + top1 = new ModelRenderer(this, 0, 34); + top1.addBox(4F, -8F, -8F, 4, 3, 16); + top1.setRotationPoint(0F, 16F, 0F); + top1.setTextureSize(128, 128); + top1.mirror = true; + setRotation(top1, 0F, 0F, 0F); + top2 = new ModelRenderer(this, 41, 34); + top2.addBox(-8F, -8F, -8F, 4, 3, 16); + top2.setRotationPoint(0F, 16F, 0F); + top2.setTextureSize(128, 128); + top2.mirror = true; + setRotation(top2, 0F, 0F, 0F); + top3 = new ModelRenderer(this, 25, 55); + top3.addBox(-4F, -8F, 4F, 8, 3, 4); + top3.setRotationPoint(0F, 16F, 0F); + top3.setTextureSize(128, 128); + top3.mirror = true; + setRotation(top3, 0F, 0F, 0F); + top4 = new ModelRenderer(this, 0, 55); + top4.addBox(-4F, -8F, -8F, 8, 3, 4); + top4.setRotationPoint(0F, 16F, 0F); + top4.setTextureSize(128, 128); + top4.mirror = true; + setRotation(top4, 0F, 0F, 0F); + tank = new ModelRenderer(this, 0, 0); + tank.addBox(-8F, -5F, -8F, 16, 4, 16); + tank.setRotationPoint(0F, 16F, 0F); + tank.setTextureSize(128, 128); + tank.mirror = true; + setRotation(tank, 0F, 0F, 0F); + centreCollumn = new ModelRenderer(this, 0, 21); + centreCollumn.addBox(-4F, -5F, -4F, 8, 4, 8); + centreCollumn.setRotationPoint(0F, 16F, 0F); + centreCollumn.setTextureSize(128, 128); + centreCollumn.mirror = true; + setRotation(centreCollumn, 0F, 0F, 0F); + furnaceShape = new ModelRenderer(this, 0, 63); + furnaceShape.addBox(-8F, -1F, -8F, 16, 5, 16); + furnaceShape.setRotationPoint(0F, 16F, 0F); + furnaceShape.setTextureSize(128, 128); + furnaceShape.mirror = true; + setRotation(furnaceShape, 0F, 0F, 0F); + glassWindow = new ModelRenderer(this, 0, 85); + glassWindow.addBox(-4F, -8F, -4F, 8, 0, 8); + glassWindow.setRotationPoint(0F, 16F, 0F); + glassWindow.setTextureSize(128, 128); + glassWindow.mirror = true; + setRotation(glassWindow, 0F, 0F, 0F); + Shape1 = new ModelRenderer(this, 0, 94); + Shape1.addBox(-8F, 4F, -8F, 4, 4, 4); + Shape1.setRotationPoint(0F, 16F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 103); + Shape2.addBox(-4F, 6F, -4F, 8, 1, 8); + Shape2.setRotationPoint(0F, 16F, 0F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 94); + Shape3.addBox(4F, 4F, -8F, 4, 4, 4); + Shape3.setRotationPoint(0F, 16F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 94); + Shape4.addBox(-8F, 4F, 4F, 4, 4, 4); + Shape4.setRotationPoint(0F, 16F, 0F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 94); + Shape5.addBox(4F, 4F, 4F, 4, 4, 4); + Shape5.setRotationPoint(0F, 16F, 0F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + top1.render(f5); + top2.render(f5); + top3.render(f5); + top4.render(f5); + tank.render(f5); + centreCollumn.render(f5); + furnaceShape.render(f5); + glassWindow.render(f5); + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java index eba407bb..a9e72f60 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java @@ -1,15 +1,13 @@ package WayofTime.alchemicalWizardry.common.renderer.model; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.client.model.ModelBase; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import cpw.mods.fml.client.FMLClientHandler; - public class ModelBloodAltar extends ModelBase { private IModelCustom modelBloodAltar; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelCrystalBelljar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelCrystalBelljar.java index ce6f7d52..58a9b1d1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelCrystalBelljar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelCrystalBelljar.java @@ -6,7 +6,7 @@ import net.minecraft.entity.Entity; public class ModelCrystalBelljar extends ModelBase { - //fields + //fields ModelRenderer handle1; ModelRenderer handle2; ModelRenderer jar1; @@ -15,105 +15,105 @@ public class ModelCrystalBelljar extends ModelBase ModelRenderer jar3; ModelRenderer jar4; ModelRenderer jar5; - - public ModelCrystalBelljar() - { - textureWidth = 128; - textureHeight = 64; - - handle1 = new ModelRenderer(this, 0, 17); - handle1.addBox(-2F, -7F, -2F, 4, 1, 4); - handle1.setRotationPoint(0F, 16F, 0F); - handle1.setTextureSize(128, 64); - handle1.mirror = true; - setRotation(handle1, 0F, 0F, 0F); - handle2 = new ModelRenderer(this, 0, 23); - handle2.addBox(-1F, -6F, -1F, 2, 1, 2); - handle2.setRotationPoint(0F, 16F, 0F); - handle2.setTextureSize(128, 64); - handle2.mirror = true; - setRotation(handle2, 0F, 0F, 0F); - jar1 = new ModelRenderer(this, 0, 27); - jar1.addBox(-4F, -5F, -4F, 8, 1, 8); - jar1.setRotationPoint(0F, 16F, 0F); - jar1.setTextureSize(128, 64); - jar1.mirror = true; - setRotation(jar1, 0F, 0F, 0F); - woodBottom = new ModelRenderer(this, 0, 0); - woodBottom.addBox(-7F, 6F, -7F, 14, 2, 14); - woodBottom.setRotationPoint(0F, 16F, 0F); - woodBottom.setTextureSize(128, 64); - woodBottom.mirror = true; - setRotation(woodBottom, 0F, 0F, 0F); - jar2 = new ModelRenderer(this, 0, 38); - jar2.addBox(-5F, -4F, 4F, 10, 10, 1); - jar2.setRotationPoint(0F, 16F, 0F); - jar2.setTextureSize(128, 64); - jar2.mirror = true; - setRotation(jar2, 0F, 0F, 0F); - jar3 = new ModelRenderer(this, 46, 38); - jar3.addBox(4F, -4F, -4F, 1, 10, 8); - jar3.setRotationPoint(0F, 16F, 0F); - jar3.setTextureSize(128, 64); - jar3.mirror = true; - setRotation(jar3, 0F, 0F, 0F); - jar4 = new ModelRenderer(this, 23, 38); - jar4.addBox(-5F, -4F, -5F, 10, 10, 1); - jar4.setRotationPoint(0F, 16F, 0F); - jar4.setTextureSize(128, 64); - jar4.mirror = true; - setRotation(jar4, 0F, 0F, 0F); - jar5 = new ModelRenderer(this, 65, 38); - jar5.addBox(-5F, -4F, -4F, 1, 10, 8); - jar5.setRotationPoint(0F, 16F, 0F); - jar5.setTextureSize(128, 64); - jar5.mirror = true; - setRotation(jar5, 0F, 0F, 0F); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - handle1.render(f5); - handle2.render(f5); - jar1.render(f5); - woodBottom.render(f5); - jar2.render(f5); - jar3.render(f5); - jar4.render(f5); - jar5.render(f5); - } - - public void renderSpecialItem(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, int part) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if(part == 0) - { - woodBottom.render(f5); - }else - { - handle1.render(f5); - handle2.render(f5); - jar1.render(f5); - jar2.render(f5); - jar3.render(f5); - jar4.render(f5); - jar5.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + + public ModelCrystalBelljar() + { + textureWidth = 128; + textureHeight = 64; + + handle1 = new ModelRenderer(this, 0, 17); + handle1.addBox(-2F, -7F, -2F, 4, 1, 4); + handle1.setRotationPoint(0F, 16F, 0F); + handle1.setTextureSize(128, 64); + handle1.mirror = true; + setRotation(handle1, 0F, 0F, 0F); + handle2 = new ModelRenderer(this, 0, 23); + handle2.addBox(-1F, -6F, -1F, 2, 1, 2); + handle2.setRotationPoint(0F, 16F, 0F); + handle2.setTextureSize(128, 64); + handle2.mirror = true; + setRotation(handle2, 0F, 0F, 0F); + jar1 = new ModelRenderer(this, 0, 27); + jar1.addBox(-4F, -5F, -4F, 8, 1, 8); + jar1.setRotationPoint(0F, 16F, 0F); + jar1.setTextureSize(128, 64); + jar1.mirror = true; + setRotation(jar1, 0F, 0F, 0F); + woodBottom = new ModelRenderer(this, 0, 0); + woodBottom.addBox(-7F, 6F, -7F, 14, 2, 14); + woodBottom.setRotationPoint(0F, 16F, 0F); + woodBottom.setTextureSize(128, 64); + woodBottom.mirror = true; + setRotation(woodBottom, 0F, 0F, 0F); + jar2 = new ModelRenderer(this, 0, 38); + jar2.addBox(-5F, -4F, 4F, 10, 10, 1); + jar2.setRotationPoint(0F, 16F, 0F); + jar2.setTextureSize(128, 64); + jar2.mirror = true; + setRotation(jar2, 0F, 0F, 0F); + jar3 = new ModelRenderer(this, 46, 38); + jar3.addBox(4F, -4F, -4F, 1, 10, 8); + jar3.setRotationPoint(0F, 16F, 0F); + jar3.setTextureSize(128, 64); + jar3.mirror = true; + setRotation(jar3, 0F, 0F, 0F); + jar4 = new ModelRenderer(this, 23, 38); + jar4.addBox(-5F, -4F, -5F, 10, 10, 1); + jar4.setRotationPoint(0F, 16F, 0F); + jar4.setTextureSize(128, 64); + jar4.mirror = true; + setRotation(jar4, 0F, 0F, 0F); + jar5 = new ModelRenderer(this, 65, 38); + jar5.addBox(-5F, -4F, -4F, 1, 10, 8); + jar5.setRotationPoint(0F, 16F, 0F); + jar5.setTextureSize(128, 64); + jar5.mirror = true; + setRotation(jar5, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + handle1.render(f5); + handle2.render(f5); + jar1.render(f5); + woodBottom.render(f5); + jar2.render(f5); + jar3.render(f5); + jar4.render(f5); + jar5.render(f5); + } + + public void renderSpecialItem(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, int part) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + if (part == 0) + { + woodBottom.render(f5); + } else + { + handle1.render(f5); + handle2.render(f5); + jar1.render(f5); + jar2.render(f5); + jar3.render(f5); + jar4.render(f5); + jar5.render(f5); + } + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelOmegaArmour.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelOmegaArmour.java index f583149e..f09589aa 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelOmegaArmour.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelOmegaArmour.java @@ -6,13 +6,13 @@ import net.minecraft.entity.Entity; public class ModelOmegaArmour extends ModelBiped { -// ModelRenderer head; + // ModelRenderer head; // ModelRenderer body; // ModelRenderer rightarm; // ModelRenderer leftarm; // ModelRenderer rightleg; // ModelRenderer leftleg; - ModelRenderer leftFacePlate; + ModelRenderer leftFacePlate; ModelRenderer rightFacePlate; ModelRenderer facePlate1; ModelRenderer facePlate2; @@ -85,20 +85,20 @@ public class ModelOmegaArmour extends ModelBiped ModelRenderer rightLegPlate2; ModelRenderer rightLegPlate3; ModelRenderer rightLegPlate4; - - public ModelOmegaArmour(float f, boolean addHelmet, boolean addChestPiece, boolean addLeggings, boolean addBoots) - { - super(f, 0.0f, 128, 128); - textureWidth = 128; - textureHeight = 128; - + + public ModelOmegaArmour(float f, boolean addHelmet, boolean addChestPiece, boolean addLeggings, boolean addBoots) + { + super(f, 0.0f, 128, 128); + textureWidth = 128; + textureHeight = 128; + // boolean addHelmet = true; // boolean addChestPiece = true; // boolean addLeggings = true; // boolean addBoots = true; /* Duplicate player model */ - { + { // head = new ModelRenderer(this, 0, 0); // head.addBox(-4F, -8F, -4F, 8, 8, 8); // head.setRotationPoint(0F, 0F, 0F); @@ -135,688 +135,687 @@ public class ModelOmegaArmour extends ModelBiped // leftleg.setTextureSize(128, 128); // leftleg.mirror = true; // setRotation(leftleg, 0F, 0F, 0F); - } - + } + /* Helmet */ - { - leftFacePlate = new ModelRenderer(this, 66, 52); - leftFacePlate.addBox(-2F, -5F, -5F, 5, 4, 1); - leftFacePlate.setRotationPoint(0F, 0F, 0F); - leftFacePlate.setTextureSize(128, 128); - leftFacePlate.mirror = true; - setRotation(leftFacePlate, 0.296706F, -0.3490659F, -0.0872665F); - - rightFacePlate = new ModelRenderer(this, 66, 52); - rightFacePlate.mirror = true; - rightFacePlate.addBox(-3F, -5F, -5F, 5, 4, 1); - rightFacePlate.setRotationPoint(0F, 0F, 0F); - rightFacePlate.setTextureSize(128, 128); - rightFacePlate.mirror = true; - setRotation(rightFacePlate, 0.296706F, 0.3490659F, 0.0872665F); - rightFacePlate.mirror = false; - - facePlate1 = new ModelRenderer(this, 79, 52); - facePlate1.addBox(-5F, -8F, -5F, 10, 3, 1); - facePlate1.setRotationPoint(0F, 0F, 0F); - facePlate1.setTextureSize(128, 128); - facePlate1.mirror = true; - setRotation(facePlate1, 0F, 0F, 0F); - - facePlate2 = new ModelRenderer(this, 79, 57); - facePlate2.addBox(-1F, -5F, -5F, 2, 1, 1); - facePlate2.setRotationPoint(0F, 0F, 0F); - facePlate2.setTextureSize(128, 128); - facePlate2.mirror = true; - setRotation(facePlate2, 0F, 0F, 0F); - - facePlate3 = new ModelRenderer(this, 79, 60); - facePlate3.addBox(-3F, -4F, -5F, 6, 1, 1); - facePlate3.setRotationPoint(0F, 0F, 0F); - facePlate3.setTextureSize(128, 128); - facePlate3.mirror = true; - setRotation(facePlate3, 0F, 0F, 0F); - - leftWingPlate1 = new ModelRenderer(this, 66, 58); - leftWingPlate1.addBox(5F, -5F, -2.5F, 1, 5, 8); - leftWingPlate1.setRotationPoint(0F, 0F, 0F); - leftWingPlate1.setTextureSize(128, 128); - leftWingPlate1.mirror = true; - setRotation(leftWingPlate1, 0.2617994F, 0.1745329F, 0F); - - leftWingPlate2 = new ModelRenderer(this, 66, 72); - leftWingPlate2.addBox(5F, -8F, -2F, 1, 3, 10); - leftWingPlate2.setRotationPoint(0F, 0F, 0F); - leftWingPlate2.setTextureSize(128, 128); - leftWingPlate2.mirror = true; - setRotation(leftWingPlate2, 0.2617994F, 0.1745329F, 0F); - - rightWingPlate1 = new ModelRenderer(this, 66, 58); - rightWingPlate1.mirror = true; - rightWingPlate1.addBox(-6F, -5F, -2.5F, 1, 5, 8); - rightWingPlate1.setRotationPoint(0F, 0F, 0F); - rightWingPlate1.setTextureSize(128, 128); - rightWingPlate1.mirror = true; - setRotation(rightWingPlate1, 0.2617994F, -0.1745329F, 0F); - rightWingPlate1.mirror = false; - - rightWingPlate2 = new ModelRenderer(this, 66, 72); - rightWingPlate2.mirror = true; - rightWingPlate2.addBox(-6F, -8F, -2F, 1, 3, 10); - rightWingPlate2.setRotationPoint(0F, 0F, 0F); - rightWingPlate2.setTextureSize(128, 128); - rightWingPlate2.mirror = true; - setRotation(rightWingPlate2, 0.2617994F, -0.1745329F, 0F); - rightWingPlate2.mirror = false; - - topPlate1 = new ModelRenderer(this, 79, 72); - topPlate1.addBox(-5F, -9F, -0.5F, 10, 1, 5); - topPlate1.setRotationPoint(0F, 0F, 0F); - topPlate1.setTextureSize(128, 128); - topPlate1.mirror = true; - setRotation(topPlate1, 0.4363323F, 0F, 0F); - - topPlate2 = new ModelRenderer(this, 79, 72); - topPlate2.addBox(-5F, -8F, 1.5F, 10, 1, 5); - topPlate2.setRotationPoint(0F, 0F, 0F); - topPlate2.setTextureSize(128, 128); - topPlate2.mirror = true; - setRotation(topPlate2, 0.4363323F, 0F, 0F); - - topPlate3 = new ModelRenderer(this, 79, 72); - topPlate3.addBox(-5F, -7F, 3.5F, 10, 1, 5); - topPlate3.setRotationPoint(0F, 0F, 0F); - topPlate3.setTextureSize(128, 128); - topPlate3.mirror = true; - setRotation(topPlate3, 0.4363323F, 0F, 0F); - - backPlate1 = new ModelRenderer(this, 66, 86); - backPlate1.mirror = true; - backPlate1.addBox(-4.5F, -7F, 6F, 6, 4, 1); - backPlate1.setRotationPoint(0F, 0F, 0F); - backPlate1.setTextureSize(128, 128); - backPlate1.mirror = true; - setRotation(backPlate1, 0.2617994F, -0.2617994F, 0F); - backPlate1.mirror = false; - - backPlate2 = new ModelRenderer(this, 66, 86); - backPlate2.mirror = true; - backPlate2.addBox(-4.5F, -6.5F, 6F, 6, 4, 1); - backPlate2.setRotationPoint(0F, 2F, 0F); - backPlate2.setTextureSize(128, 128); - backPlate2.mirror = true; - setRotation(backPlate2, 0.2617994F, -0.2617994F, 0F); - backPlate2.mirror = false; - - backPlate3 = new ModelRenderer(this, 66, 86); - backPlate3.mirror = true; - backPlate3.addBox(-4.5F, -6F, 6F, 6, 4, 1); - backPlate3.setRotationPoint(0F, 4F, 0F); - backPlate3.setTextureSize(128, 128); - backPlate3.mirror = true; - setRotation(backPlate3, 0.2617994F, -0.2617994F, 0F); - backPlate3.mirror = false; - - backPlate4 = new ModelRenderer(this, 66, 86); - backPlate4.addBox(-1.5F, -7F, 6F, 6, 4, 1); - backPlate4.setRotationPoint(0F, 0F, 0F); - backPlate4.setTextureSize(128, 128); - backPlate4.mirror = true; - setRotation(backPlate4, 0.2617994F, 0.2617994F, 0F); - - backPlate5 = new ModelRenderer(this, 66, 86); - backPlate5.addBox(-1.5F, -7F, 6F, 6, 4, 1); - backPlate5.setRotationPoint(0F, 2.5F, 0F); - backPlate5.setTextureSize(128, 128); - backPlate5.mirror = true; - setRotation(backPlate5, 0.2617994F, 0.2617994F, 0F); - - backPlate6 = new ModelRenderer(this, 66, 86); - backPlate6.addBox(-1.5F, -7F, 6F, 6, 4, 1); - backPlate6.setRotationPoint(0F, 5F, 0F); - backPlate6.setTextureSize(128, 128); - backPlate6.mirror = true; - setRotation(backPlate6, 0.2617994F, 0.2617994F, 0F); - - eyePlate = new ModelRenderer(this, 63, 38); - eyePlate.addBox(-4F, -5F, -4.5F, 8, 2, 1); - eyePlate.setRotationPoint(0F, 0F, 0F); - eyePlate.setTextureSize(128, 128); - eyePlate.mirror = true; - setRotation(eyePlate, 0F, 0F, 0F); - } + { + leftFacePlate = new ModelRenderer(this, 66, 52); + leftFacePlate.addBox(-2F, -5F, -5F, 5, 4, 1); + leftFacePlate.setRotationPoint(0F, 0F, 0F); + leftFacePlate.setTextureSize(128, 128); + leftFacePlate.mirror = true; + setRotation(leftFacePlate, 0.296706F, -0.3490659F, -0.0872665F); + + rightFacePlate = new ModelRenderer(this, 66, 52); + rightFacePlate.mirror = true; + rightFacePlate.addBox(-3F, -5F, -5F, 5, 4, 1); + rightFacePlate.setRotationPoint(0F, 0F, 0F); + rightFacePlate.setTextureSize(128, 128); + rightFacePlate.mirror = true; + setRotation(rightFacePlate, 0.296706F, 0.3490659F, 0.0872665F); + rightFacePlate.mirror = false; + + facePlate1 = new ModelRenderer(this, 79, 52); + facePlate1.addBox(-5F, -8F, -5F, 10, 3, 1); + facePlate1.setRotationPoint(0F, 0F, 0F); + facePlate1.setTextureSize(128, 128); + facePlate1.mirror = true; + setRotation(facePlate1, 0F, 0F, 0F); + + facePlate2 = new ModelRenderer(this, 79, 57); + facePlate2.addBox(-1F, -5F, -5F, 2, 1, 1); + facePlate2.setRotationPoint(0F, 0F, 0F); + facePlate2.setTextureSize(128, 128); + facePlate2.mirror = true; + setRotation(facePlate2, 0F, 0F, 0F); + + facePlate3 = new ModelRenderer(this, 79, 60); + facePlate3.addBox(-3F, -4F, -5F, 6, 1, 1); + facePlate3.setRotationPoint(0F, 0F, 0F); + facePlate3.setTextureSize(128, 128); + facePlate3.mirror = true; + setRotation(facePlate3, 0F, 0F, 0F); + + leftWingPlate1 = new ModelRenderer(this, 66, 58); + leftWingPlate1.addBox(5F, -5F, -2.5F, 1, 5, 8); + leftWingPlate1.setRotationPoint(0F, 0F, 0F); + leftWingPlate1.setTextureSize(128, 128); + leftWingPlate1.mirror = true; + setRotation(leftWingPlate1, 0.2617994F, 0.1745329F, 0F); + + leftWingPlate2 = new ModelRenderer(this, 66, 72); + leftWingPlate2.addBox(5F, -8F, -2F, 1, 3, 10); + leftWingPlate2.setRotationPoint(0F, 0F, 0F); + leftWingPlate2.setTextureSize(128, 128); + leftWingPlate2.mirror = true; + setRotation(leftWingPlate2, 0.2617994F, 0.1745329F, 0F); + + rightWingPlate1 = new ModelRenderer(this, 66, 58); + rightWingPlate1.mirror = true; + rightWingPlate1.addBox(-6F, -5F, -2.5F, 1, 5, 8); + rightWingPlate1.setRotationPoint(0F, 0F, 0F); + rightWingPlate1.setTextureSize(128, 128); + rightWingPlate1.mirror = true; + setRotation(rightWingPlate1, 0.2617994F, -0.1745329F, 0F); + rightWingPlate1.mirror = false; + + rightWingPlate2 = new ModelRenderer(this, 66, 72); + rightWingPlate2.mirror = true; + rightWingPlate2.addBox(-6F, -8F, -2F, 1, 3, 10); + rightWingPlate2.setRotationPoint(0F, 0F, 0F); + rightWingPlate2.setTextureSize(128, 128); + rightWingPlate2.mirror = true; + setRotation(rightWingPlate2, 0.2617994F, -0.1745329F, 0F); + rightWingPlate2.mirror = false; + + topPlate1 = new ModelRenderer(this, 79, 72); + topPlate1.addBox(-5F, -9F, -0.5F, 10, 1, 5); + topPlate1.setRotationPoint(0F, 0F, 0F); + topPlate1.setTextureSize(128, 128); + topPlate1.mirror = true; + setRotation(topPlate1, 0.4363323F, 0F, 0F); + + topPlate2 = new ModelRenderer(this, 79, 72); + topPlate2.addBox(-5F, -8F, 1.5F, 10, 1, 5); + topPlate2.setRotationPoint(0F, 0F, 0F); + topPlate2.setTextureSize(128, 128); + topPlate2.mirror = true; + setRotation(topPlate2, 0.4363323F, 0F, 0F); + + topPlate3 = new ModelRenderer(this, 79, 72); + topPlate3.addBox(-5F, -7F, 3.5F, 10, 1, 5); + topPlate3.setRotationPoint(0F, 0F, 0F); + topPlate3.setTextureSize(128, 128); + topPlate3.mirror = true; + setRotation(topPlate3, 0.4363323F, 0F, 0F); + + backPlate1 = new ModelRenderer(this, 66, 86); + backPlate1.mirror = true; + backPlate1.addBox(-4.5F, -7F, 6F, 6, 4, 1); + backPlate1.setRotationPoint(0F, 0F, 0F); + backPlate1.setTextureSize(128, 128); + backPlate1.mirror = true; + setRotation(backPlate1, 0.2617994F, -0.2617994F, 0F); + backPlate1.mirror = false; + + backPlate2 = new ModelRenderer(this, 66, 86); + backPlate2.mirror = true; + backPlate2.addBox(-4.5F, -6.5F, 6F, 6, 4, 1); + backPlate2.setRotationPoint(0F, 2F, 0F); + backPlate2.setTextureSize(128, 128); + backPlate2.mirror = true; + setRotation(backPlate2, 0.2617994F, -0.2617994F, 0F); + backPlate2.mirror = false; + + backPlate3 = new ModelRenderer(this, 66, 86); + backPlate3.mirror = true; + backPlate3.addBox(-4.5F, -6F, 6F, 6, 4, 1); + backPlate3.setRotationPoint(0F, 4F, 0F); + backPlate3.setTextureSize(128, 128); + backPlate3.mirror = true; + setRotation(backPlate3, 0.2617994F, -0.2617994F, 0F); + backPlate3.mirror = false; + + backPlate4 = new ModelRenderer(this, 66, 86); + backPlate4.addBox(-1.5F, -7F, 6F, 6, 4, 1); + backPlate4.setRotationPoint(0F, 0F, 0F); + backPlate4.setTextureSize(128, 128); + backPlate4.mirror = true; + setRotation(backPlate4, 0.2617994F, 0.2617994F, 0F); + + backPlate5 = new ModelRenderer(this, 66, 86); + backPlate5.addBox(-1.5F, -7F, 6F, 6, 4, 1); + backPlate5.setRotationPoint(0F, 2.5F, 0F); + backPlate5.setTextureSize(128, 128); + backPlate5.mirror = true; + setRotation(backPlate5, 0.2617994F, 0.2617994F, 0F); + + backPlate6 = new ModelRenderer(this, 66, 86); + backPlate6.addBox(-1.5F, -7F, 6F, 6, 4, 1); + backPlate6.setRotationPoint(0F, 5F, 0F); + backPlate6.setTextureSize(128, 128); + backPlate6.mirror = true; + setRotation(backPlate6, 0.2617994F, 0.2617994F, 0F); + + eyePlate = new ModelRenderer(this, 63, 38); + eyePlate.addBox(-4F, -5F, -4.5F, 8, 2, 1); + eyePlate.setRotationPoint(0F, 0F, 0F); + eyePlate.setTextureSize(128, 128); + eyePlate.mirror = true; + setRotation(eyePlate, 0F, 0F, 0F); + } /* Right arm */ - { - rightArmMain = new ModelRenderer(this, 0, 33); - rightArmMain.mirror = true; - rightArmMain.addBox(-3.5F, -2.5F, -2.5F, 5, 11, 5); - rightArmMain.setRotationPoint(0F, 0F, 0F); - rightArmMain.setTextureSize(128, 128); - rightArmMain.mirror = true; - setRotation(rightArmMain, 0F, 0F, 0F); - - rightKnucklePlate = new ModelRenderer(this, 0, 50); - rightKnucklePlate.addBox(-4F, 4F, -1.5F, 1, 5, 3); - rightKnucklePlate.setRotationPoint(0F, 0F, 0F); - rightKnucklePlate.setTextureSize(128, 128); - rightKnucklePlate.mirror = true; - setRotation(rightKnucklePlate, 0F, 0F, 0F); + { + rightArmMain = new ModelRenderer(this, 0, 33); + rightArmMain.mirror = true; + rightArmMain.addBox(-3.5F, -2.5F, -2.5F, 5, 11, 5); + rightArmMain.setRotationPoint(0F, 0F, 0F); + rightArmMain.setTextureSize(128, 128); + rightArmMain.mirror = true; + setRotation(rightArmMain, 0F, 0F, 0F); - rightKnuckleBrace = new ModelRenderer(this, 9, 50); - rightKnuckleBrace.mirror = true; - rightKnuckleBrace.addBox(-4F, 3F, -3F, 2, 1, 6); - rightKnuckleBrace.setRotationPoint(0F, 0F, 0F); - rightKnuckleBrace.setTextureSize(128, 128); - setRotation(rightKnuckleBrace, 0F, 0F, 0F); + rightKnucklePlate = new ModelRenderer(this, 0, 50); + rightKnucklePlate.addBox(-4F, 4F, -1.5F, 1, 5, 3); + rightKnucklePlate.setRotationPoint(0F, 0F, 0F); + rightKnucklePlate.setTextureSize(128, 128); + rightKnucklePlate.mirror = true; + setRotation(rightKnucklePlate, 0F, 0F, 0F); - rightKnuckle1 = new ModelRenderer(this, 0, 59); - rightKnuckle1.mirror = true; - rightKnuckle1.addBox(-4F, 7F, -2.5F, 1, 6, 1); - rightKnuckle1.setRotationPoint(0F, 0F, 0F); - rightKnuckle1.setTextureSize(128, 128); - setRotation(rightKnuckle1, 0F, 0F, 0F); + rightKnuckleBrace = new ModelRenderer(this, 9, 50); + rightKnuckleBrace.mirror = true; + rightKnuckleBrace.addBox(-4F, 3F, -3F, 2, 1, 6); + rightKnuckleBrace.setRotationPoint(0F, 0F, 0F); + rightKnuckleBrace.setTextureSize(128, 128); + setRotation(rightKnuckleBrace, 0F, 0F, 0F); - rightKnuckle2 = new ModelRenderer(this, 5, 59); - rightKnuckle2.mirror = true; - rightKnuckle2.addBox(-3F, 11F, -2.5F, 1, 3, 1); - rightKnuckle2.setRotationPoint(0F, 0F, 0F); - rightKnuckle2.setTextureSize(128, 128); - setRotation(rightKnuckle2, 0F, 0F, 0F); + rightKnuckle1 = new ModelRenderer(this, 0, 59); + rightKnuckle1.mirror = true; + rightKnuckle1.addBox(-4F, 7F, -2.5F, 1, 6, 1); + rightKnuckle1.setRotationPoint(0F, 0F, 0F); + rightKnuckle1.setTextureSize(128, 128); + setRotation(rightKnuckle1, 0F, 0F, 0F); - rightKnuckle3 = new ModelRenderer(this, 0, 59); - rightKnuckle3.mirror = true; - rightKnuckle3.addBox(-4.5F, 8F, -0.5F, 1, 6, 1); - rightKnuckle3.setRotationPoint(0F, 0F, 0F); - rightKnuckle3.setTextureSize(128, 128); - setRotation(rightKnuckle3, 0F, 0F, 0F); - - rightKnuckle4 = new ModelRenderer(this, 5, 59); - rightKnuckle4.mirror = true; - rightKnuckle4.addBox(-3.5F, 12F, -0.5F, 1, 3, 1); - rightKnuckle4.setRotationPoint(0F, 0F, 0F); - rightKnuckle4.setTextureSize(128, 128); - setRotation(rightKnuckle4, 0F, 0F, 0F); + rightKnuckle2 = new ModelRenderer(this, 5, 59); + rightKnuckle2.mirror = true; + rightKnuckle2.addBox(-3F, 11F, -2.5F, 1, 3, 1); + rightKnuckle2.setRotationPoint(0F, 0F, 0F); + rightKnuckle2.setTextureSize(128, 128); + setRotation(rightKnuckle2, 0F, 0F, 0F); - rightKnuckle5 = new ModelRenderer(this, 0, 59); - rightKnuckle5.mirror = true; - rightKnuckle5.addBox(-4F, 7F, 1.5F, 1, 6, 1); - rightKnuckle5.setRotationPoint(0F, 0F, 0F); - rightKnuckle5.setTextureSize(128, 128); - setRotation(rightKnuckle5, 0F, 0F, 0F); - - rightKnuckle6 = new ModelRenderer(this, 5, 59); - rightKnuckle6.mirror = true; - rightKnuckle6.addBox(-3F, 11F, 1.5F, 1, 3, 1); - rightKnuckle6.setRotationPoint(0F, 0F, 0F); - rightKnuckle6.setTextureSize(128, 128); - setRotation(rightKnuckle6, 0F, 0F, 0F); - - rightShoulder1 = new ModelRenderer(this, 10, 59); - rightShoulder1.mirror = true; - rightShoulder1.addBox(-5F, -3F, -4F, 1, 4, 8); - rightShoulder1.setRotationPoint(0F, 0F, 0F); - rightShoulder1.setTextureSize(128, 128); - setRotation(rightShoulder1, 0F, 0F, 0.6981317F); + rightKnuckle3 = new ModelRenderer(this, 0, 59); + rightKnuckle3.mirror = true; + rightKnuckle3.addBox(-4.5F, 8F, -0.5F, 1, 6, 1); + rightKnuckle3.setRotationPoint(0F, 0F, 0F); + rightKnuckle3.setTextureSize(128, 128); + setRotation(rightKnuckle3, 0F, 0F, 0F); - rightShoulder2 = new ModelRenderer(this, 10, 59); - rightShoulder2.mirror = true; - rightShoulder2.addBox(-4F, -1.5F, -4F, 1, 4, 8); - rightShoulder2.setRotationPoint(0F, 0F, 0F); - rightShoulder2.setTextureSize(128, 128); - setRotation(rightShoulder2, 0F, 0F, 0.6981317F); + rightKnuckle4 = new ModelRenderer(this, 5, 59); + rightKnuckle4.mirror = true; + rightKnuckle4.addBox(-3.5F, 12F, -0.5F, 1, 3, 1); + rightKnuckle4.setRotationPoint(0F, 0F, 0F); + rightKnuckle4.setTextureSize(128, 128); + setRotation(rightKnuckle4, 0F, 0F, 0F); - rightShoulder3 = new ModelRenderer(this, 10, 59); - rightShoulder3.mirror = true; - rightShoulder3.addBox(-3F, 0F, -4F, 1, 4, 8); - rightShoulder3.setRotationPoint(0F, 0F, 0F); - rightShoulder3.setTextureSize(128, 128); - setRotation(rightShoulder3, 0F, 0F, 0.6981317F); - } + rightKnuckle5 = new ModelRenderer(this, 0, 59); + rightKnuckle5.mirror = true; + rightKnuckle5.addBox(-4F, 7F, 1.5F, 1, 6, 1); + rightKnuckle5.setRotationPoint(0F, 0F, 0F); + rightKnuckle5.setTextureSize(128, 128); + setRotation(rightKnuckle5, 0F, 0F, 0F); + + rightKnuckle6 = new ModelRenderer(this, 5, 59); + rightKnuckle6.mirror = true; + rightKnuckle6.addBox(-3F, 11F, 1.5F, 1, 3, 1); + rightKnuckle6.setRotationPoint(0F, 0F, 0F); + rightKnuckle6.setTextureSize(128, 128); + setRotation(rightKnuckle6, 0F, 0F, 0F); + + rightShoulder1 = new ModelRenderer(this, 10, 59); + rightShoulder1.mirror = true; + rightShoulder1.addBox(-5F, -3F, -4F, 1, 4, 8); + rightShoulder1.setRotationPoint(0F, 0F, 0F); + rightShoulder1.setTextureSize(128, 128); + setRotation(rightShoulder1, 0F, 0F, 0.6981317F); + + rightShoulder2 = new ModelRenderer(this, 10, 59); + rightShoulder2.mirror = true; + rightShoulder2.addBox(-4F, -1.5F, -4F, 1, 4, 8); + rightShoulder2.setRotationPoint(0F, 0F, 0F); + rightShoulder2.setTextureSize(128, 128); + setRotation(rightShoulder2, 0F, 0F, 0.6981317F); + + rightShoulder3 = new ModelRenderer(this, 10, 59); + rightShoulder3.mirror = true; + rightShoulder3.addBox(-3F, 0F, -4F, 1, 4, 8); + rightShoulder3.setRotationPoint(0F, 0F, 0F); + rightShoulder3.setTextureSize(128, 128); + setRotation(rightShoulder3, 0F, 0F, 0.6981317F); + } /* Chest piece main body */ - { - mainPlate = new ModelRenderer(this, 31, 33); - mainPlate.addBox(-4.5F, -0.5F, -3F, 9, 12, 6); - mainPlate.setRotationPoint(0F, 0F, 0F); - mainPlate.setTextureSize(128, 128); - mainPlate.mirror = true; - setRotation(mainPlate, 0F, 0F, 0F); - - chestPlate1 = new ModelRenderer(this, 63, 33); - chestPlate1.addBox(-1.5F, 3F, -4.5F, 6, 2, 1); - chestPlate1.setRotationPoint(0F, -3F, -1F); - chestPlate1.setTextureSize(128, 128); - setRotation(chestPlate1, 0.3490659F, 0F, -0.2617994F); - - chestPlate2 = new ModelRenderer(this, 63, 33); - chestPlate2.addBox(-1.5F, 3F, -4.5F, 6, 2, 1); - chestPlate2.setRotationPoint(0F, -1.5F, -1F); - chestPlate2.setTextureSize(128, 128); - setRotation(chestPlate2, 0.3490659F, 0F, -0.2617994F); - - chestPlate3 = new ModelRenderer(this, 63, 33); - chestPlate3.addBox(-1.5F, 3F, -4.5F, 6, 2, 1); - chestPlate3.setRotationPoint(0F, 0F, -1F); - chestPlate3.setTextureSize(128, 128); - setRotation(chestPlate3, 0.3490659F, 0F, -0.2617994F); - - chestPlate4 = new ModelRenderer(this, 63, 33); - chestPlate4.mirror = true; - chestPlate4.addBox(-4.5F, 3F, -4.5F, 6, 2, 1); - chestPlate4.setRotationPoint(0F, -3F, -1F); - chestPlate4.setTextureSize(128, 128); - setRotation(chestPlate4, 0.3490659F, 0F, 0.2617994F); + { + mainPlate = new ModelRenderer(this, 31, 33); + mainPlate.addBox(-4.5F, -0.5F, -3F, 9, 12, 6); + mainPlate.setRotationPoint(0F, 0F, 0F); + mainPlate.setTextureSize(128, 128); + mainPlate.mirror = true; + setRotation(mainPlate, 0F, 0F, 0F); - chestPlate5 = new ModelRenderer(this, 63, 33); - chestPlate5.mirror = true; - chestPlate5.addBox(-4.5F, 3F, -4.5F, 6, 2, 1); - chestPlate5.setRotationPoint(0F, -1.5F, -1F); - chestPlate5.setTextureSize(128, 128); - setRotation(chestPlate5, 0.3490659F, 0F, 0.2617994F); + chestPlate1 = new ModelRenderer(this, 63, 33); + chestPlate1.addBox(-1.5F, 3F, -4.5F, 6, 2, 1); + chestPlate1.setRotationPoint(0F, -3F, -1F); + chestPlate1.setTextureSize(128, 128); + setRotation(chestPlate1, 0.3490659F, 0F, -0.2617994F); - chestPlate6 = new ModelRenderer(this, 63, 33); - chestPlate6.mirror = true; - chestPlate6.addBox(-4.5F, 3F, -4.5F, 6, 2, 1); - chestPlate6.setRotationPoint(0F, 0F, -1F); - chestPlate6.setTextureSize(128, 128); - setRotation(chestPlate6, 0.3490659F, 0F, 0.2617994F); - } + chestPlate2 = new ModelRenderer(this, 63, 33); + chestPlate2.addBox(-1.5F, 3F, -4.5F, 6, 2, 1); + chestPlate2.setRotationPoint(0F, -1.5F, -1F); + chestPlate2.setTextureSize(128, 128); + setRotation(chestPlate2, 0.3490659F, 0F, -0.2617994F); + + chestPlate3 = new ModelRenderer(this, 63, 33); + chestPlate3.addBox(-1.5F, 3F, -4.5F, 6, 2, 1); + chestPlate3.setRotationPoint(0F, 0F, -1F); + chestPlate3.setTextureSize(128, 128); + setRotation(chestPlate3, 0.3490659F, 0F, -0.2617994F); + + chestPlate4 = new ModelRenderer(this, 63, 33); + chestPlate4.mirror = true; + chestPlate4.addBox(-4.5F, 3F, -4.5F, 6, 2, 1); + chestPlate4.setRotationPoint(0F, -3F, -1F); + chestPlate4.setTextureSize(128, 128); + setRotation(chestPlate4, 0.3490659F, 0F, 0.2617994F); + + chestPlate5 = new ModelRenderer(this, 63, 33); + chestPlate5.mirror = true; + chestPlate5.addBox(-4.5F, 3F, -4.5F, 6, 2, 1); + chestPlate5.setRotationPoint(0F, -1.5F, -1F); + chestPlate5.setTextureSize(128, 128); + setRotation(chestPlate5, 0.3490659F, 0F, 0.2617994F); + + chestPlate6 = new ModelRenderer(this, 63, 33); + chestPlate6.mirror = true; + chestPlate6.addBox(-4.5F, 3F, -4.5F, 6, 2, 1); + chestPlate6.setRotationPoint(0F, 0F, -1F); + chestPlate6.setTextureSize(128, 128); + setRotation(chestPlate6, 0.3490659F, 0F, 0.2617994F); + } /* Left arm */ - { - leftArmMain = new ModelRenderer(this, 0, 33); - leftArmMain.addBox(-1.5F, -2.533333F, -2.5F, 5, 11, 5); - leftArmMain.setRotationPoint(0F, 0F, 0F); - leftArmMain.setTextureSize(128, 128); - leftArmMain.mirror = true; - setRotation(leftArmMain, 0F, 0F, 0F); - - leftKnucklePlate = new ModelRenderer(this, 0, 50); - leftKnucklePlate.addBox(3F, 4F, -1.5F, 1, 5, 3); - leftKnucklePlate.setRotationPoint(0F, 0F, 0F); - leftKnucklePlate.setTextureSize(128, 128); - leftKnucklePlate.mirror = true; - setRotation(leftKnucklePlate, 0F, 0F, 0F); - - leftKnuckleBrace = new ModelRenderer(this, 9, 50); - leftKnuckleBrace.addBox(2F, 3F, -3F, 2, 1, 6); - leftKnuckleBrace.setRotationPoint(0F, 0F, 0F); - leftKnuckleBrace.setTextureSize(128, 128); - leftKnuckleBrace.mirror = true; - setRotation(leftKnuckleBrace, 0F, 0F, 0F); - - leftKnuckle1 = new ModelRenderer(this, 0, 59); - leftKnuckle1.addBox(3F, 7F, -2.5F, 1, 6, 1); - leftKnuckle1.setRotationPoint(0F, 0F, 0F); - leftKnuckle1.setTextureSize(128, 128); - leftKnuckle1.mirror = true; - setRotation(leftKnuckle1, 0F, 0F, 0F); - - leftKnuckle2 = new ModelRenderer(this, 5, 59); - leftKnuckle2.addBox(2F, 11F, -2.5F, 1, 3, 1); - leftKnuckle2.setRotationPoint(0F, 0F, 0F); - leftKnuckle2.setTextureSize(128, 128); - leftKnuckle2.mirror = true; - setRotation(leftKnuckle2, 0F, 0F, 0F); - - leftKnuckle3 = new ModelRenderer(this, 0, 59); - leftKnuckle3.addBox(3.5F, 8F, -0.5F, 1, 6, 1); - leftKnuckle3.setRotationPoint(0F, 0F, 0F); - leftKnuckle3.setTextureSize(128, 128); - leftKnuckle3.mirror = true; - setRotation(leftKnuckle3, 0F, 0F, 0F); - - leftKnuckle4 = new ModelRenderer(this, 5, 59); - leftKnuckle4.addBox(2.5F, 12F, -0.5F, 1, 3, 1); - leftKnuckle4.setRotationPoint(0F, 0F, 0F); - leftKnuckle4.setTextureSize(128, 128); - leftKnuckle4.mirror = true; - setRotation(leftKnuckle4, 0F, 0F, 0F); - - leftKnuckle5 = new ModelRenderer(this, 0, 59); - leftKnuckle5.addBox(3F, 7F, 1.5F, 1, 6, 1); - leftKnuckle5.setRotationPoint(0F, 0F, 0F); - leftKnuckle5.setTextureSize(128, 128); - leftKnuckle5.mirror = true; - setRotation(leftKnuckle5, 0F, 0F, 0F); - - leftKnuckle6 = new ModelRenderer(this, 5, 59); - leftKnuckle6.addBox(2F, 11F, 1.5F, 1, 3, 1); - leftKnuckle6.setRotationPoint(0F, 0F, 0F); - leftKnuckle6.setTextureSize(128, 128); - leftKnuckle6.mirror = true; - setRotation(leftKnuckle6, 0F, 0F, 0F); - - leftShoulder1 = new ModelRenderer(this, 10, 59); - leftShoulder1.addBox(4F, -3F, -4F, 1, 4, 8); - leftShoulder1.setRotationPoint(0F, 0F, 0F); - leftShoulder1.setTextureSize(128, 128); - leftShoulder1.mirror = true; - setRotation(leftShoulder1, 0F, 0F, -0.6981317F); - - leftShoulder2 = new ModelRenderer(this, 10, 59); - leftShoulder2.addBox(3F, -1.5F, -4F, 1, 4, 8); - leftShoulder2.setRotationPoint(0F, 0F, 0F); - leftShoulder2.setTextureSize(128, 128); - leftShoulder2.mirror = true; - setRotation(leftShoulder2, 0F, 0F, -0.6981317F); - - leftShoulder3 = new ModelRenderer(this, 10, 59); - leftShoulder3.addBox(2F, 0F, -4F, 1, 4, 8); - leftShoulder3.setRotationPoint(0F, 0F, 0F); - leftShoulder3.setTextureSize(128, 128); - leftShoulder3.mirror = true; - setRotation(leftShoulder3, 0F, 0F, -0.6981317F); - } + { + leftArmMain = new ModelRenderer(this, 0, 33); + leftArmMain.addBox(-1.5F, -2.533333F, -2.5F, 5, 11, 5); + leftArmMain.setRotationPoint(0F, 0F, 0F); + leftArmMain.setTextureSize(128, 128); + leftArmMain.mirror = true; + setRotation(leftArmMain, 0F, 0F, 0F); + + leftKnucklePlate = new ModelRenderer(this, 0, 50); + leftKnucklePlate.addBox(3F, 4F, -1.5F, 1, 5, 3); + leftKnucklePlate.setRotationPoint(0F, 0F, 0F); + leftKnucklePlate.setTextureSize(128, 128); + leftKnucklePlate.mirror = true; + setRotation(leftKnucklePlate, 0F, 0F, 0F); + + leftKnuckleBrace = new ModelRenderer(this, 9, 50); + leftKnuckleBrace.addBox(2F, 3F, -3F, 2, 1, 6); + leftKnuckleBrace.setRotationPoint(0F, 0F, 0F); + leftKnuckleBrace.setTextureSize(128, 128); + leftKnuckleBrace.mirror = true; + setRotation(leftKnuckleBrace, 0F, 0F, 0F); + + leftKnuckle1 = new ModelRenderer(this, 0, 59); + leftKnuckle1.addBox(3F, 7F, -2.5F, 1, 6, 1); + leftKnuckle1.setRotationPoint(0F, 0F, 0F); + leftKnuckle1.setTextureSize(128, 128); + leftKnuckle1.mirror = true; + setRotation(leftKnuckle1, 0F, 0F, 0F); + + leftKnuckle2 = new ModelRenderer(this, 5, 59); + leftKnuckle2.addBox(2F, 11F, -2.5F, 1, 3, 1); + leftKnuckle2.setRotationPoint(0F, 0F, 0F); + leftKnuckle2.setTextureSize(128, 128); + leftKnuckle2.mirror = true; + setRotation(leftKnuckle2, 0F, 0F, 0F); + + leftKnuckle3 = new ModelRenderer(this, 0, 59); + leftKnuckle3.addBox(3.5F, 8F, -0.5F, 1, 6, 1); + leftKnuckle3.setRotationPoint(0F, 0F, 0F); + leftKnuckle3.setTextureSize(128, 128); + leftKnuckle3.mirror = true; + setRotation(leftKnuckle3, 0F, 0F, 0F); + + leftKnuckle4 = new ModelRenderer(this, 5, 59); + leftKnuckle4.addBox(2.5F, 12F, -0.5F, 1, 3, 1); + leftKnuckle4.setRotationPoint(0F, 0F, 0F); + leftKnuckle4.setTextureSize(128, 128); + leftKnuckle4.mirror = true; + setRotation(leftKnuckle4, 0F, 0F, 0F); + + leftKnuckle5 = new ModelRenderer(this, 0, 59); + leftKnuckle5.addBox(3F, 7F, 1.5F, 1, 6, 1); + leftKnuckle5.setRotationPoint(0F, 0F, 0F); + leftKnuckle5.setTextureSize(128, 128); + leftKnuckle5.mirror = true; + setRotation(leftKnuckle5, 0F, 0F, 0F); + + leftKnuckle6 = new ModelRenderer(this, 5, 59); + leftKnuckle6.addBox(2F, 11F, 1.5F, 1, 3, 1); + leftKnuckle6.setRotationPoint(0F, 0F, 0F); + leftKnuckle6.setTextureSize(128, 128); + leftKnuckle6.mirror = true; + setRotation(leftKnuckle6, 0F, 0F, 0F); + + leftShoulder1 = new ModelRenderer(this, 10, 59); + leftShoulder1.addBox(4F, -3F, -4F, 1, 4, 8); + leftShoulder1.setRotationPoint(0F, 0F, 0F); + leftShoulder1.setTextureSize(128, 128); + leftShoulder1.mirror = true; + setRotation(leftShoulder1, 0F, 0F, -0.6981317F); + + leftShoulder2 = new ModelRenderer(this, 10, 59); + leftShoulder2.addBox(3F, -1.5F, -4F, 1, 4, 8); + leftShoulder2.setRotationPoint(0F, 0F, 0F); + leftShoulder2.setTextureSize(128, 128); + leftShoulder2.mirror = true; + setRotation(leftShoulder2, 0F, 0F, -0.6981317F); + + leftShoulder3 = new ModelRenderer(this, 10, 59); + leftShoulder3.addBox(2F, 0F, -4F, 1, 4, 8); + leftShoulder3.setRotationPoint(0F, 0F, 0F); + leftShoulder3.setTextureSize(128, 128); + leftShoulder3.mirror = true; + setRotation(leftShoulder3, 0F, 0F, -0.6981317F); + } /* Left boot */ - { - leftBootBottom = new ModelRenderer(this, 0, 84); - leftBootBottom.addBox(-2.5F, 9.5F, -5.5F, 6, 3, 8); - leftBootBottom.setRotationPoint(0F, 0F, 0F); - leftBootBottom.setTextureSize(128, 128); - leftBootBottom.mirror = true; - setRotation(leftBootBottom, 0F, 0F, 0F); - - leftBootPlate = new ModelRenderer(this, 0, 96); - leftBootPlate.addBox(-2F, 6F, 6F, 5, 3, 1); - leftBootPlate.setRotationPoint(0F, 0F, 0F); - leftBootPlate.setTextureSize(128, 128); - leftBootPlate.mirror = true; - setRotation(leftBootPlate, -1.151917F, 0F, 0F); - - leftBootBrace = new ModelRenderer(this, 0, 72); - leftBootBrace.addBox(-2F, 7F, -3F, 5, 3, 6); - leftBootBrace.setRotationPoint(0F, 0F, 0F); - leftBootBrace.setTextureSize(128, 128); - leftBootBrace.mirror = true; - setRotation(leftBootBrace, 0F, 0F, 0F); - - leftBootWing1 = new ModelRenderer(this, 13, 96); - leftBootWing1.addBox(3F, 7F, -4F, 1, 1, 7); - leftBootWing1.setRotationPoint(0F, 0F, 0F); - leftBootWing1.setTextureSize(128, 128); - leftBootWing1.mirror = true; - setRotation(leftBootWing1, 0.2617994F, 0.1745329F, 0F); - - leftBootWing2 = new ModelRenderer(this, 13, 96); - leftBootWing2.addBox(3F, 8F, -5F, 1, 1, 7); - leftBootWing2.setRotationPoint(0F, 0F, 0F); - leftBootWing2.setTextureSize(128, 128); - leftBootWing2.mirror = true; - setRotation(leftBootWing2, 0.2617994F, 0.1745329F, 0F); - } + { + leftBootBottom = new ModelRenderer(this, 0, 84); + leftBootBottom.addBox(-2.5F, 9.5F, -5.5F, 6, 3, 8); + leftBootBottom.setRotationPoint(0F, 0F, 0F); + leftBootBottom.setTextureSize(128, 128); + leftBootBottom.mirror = true; + setRotation(leftBootBottom, 0F, 0F, 0F); + + leftBootPlate = new ModelRenderer(this, 0, 96); + leftBootPlate.addBox(-2F, 6F, 6F, 5, 3, 1); + leftBootPlate.setRotationPoint(0F, 0F, 0F); + leftBootPlate.setTextureSize(128, 128); + leftBootPlate.mirror = true; + setRotation(leftBootPlate, -1.151917F, 0F, 0F); + + leftBootBrace = new ModelRenderer(this, 0, 72); + leftBootBrace.addBox(-2F, 7F, -3F, 5, 3, 6); + leftBootBrace.setRotationPoint(0F, 0F, 0F); + leftBootBrace.setTextureSize(128, 128); + leftBootBrace.mirror = true; + setRotation(leftBootBrace, 0F, 0F, 0F); + + leftBootWing1 = new ModelRenderer(this, 13, 96); + leftBootWing1.addBox(3F, 7F, -4F, 1, 1, 7); + leftBootWing1.setRotationPoint(0F, 0F, 0F); + leftBootWing1.setTextureSize(128, 128); + leftBootWing1.mirror = true; + setRotation(leftBootWing1, 0.2617994F, 0.1745329F, 0F); + + leftBootWing2 = new ModelRenderer(this, 13, 96); + leftBootWing2.addBox(3F, 8F, -5F, 1, 1, 7); + leftBootWing2.setRotationPoint(0F, 0F, 0F); + leftBootWing2.setTextureSize(128, 128); + leftBootWing2.mirror = true; + setRotation(leftBootWing2, 0.2617994F, 0.1745329F, 0F); + } /* Right boot */ - { - rightBootBottom = new ModelRenderer(this, 0, 84); - rightBootBottom.mirror = true; - rightBootBottom.addBox(-3.5F, 9.5F, -5.5F, 6, 3, 8); - rightBootBottom.setRotationPoint(0F, 0F, 0F); - rightBootBottom.setTextureSize(128, 128); - setRotation(rightBootBottom, 0F, 0F, 0F); + { + rightBootBottom = new ModelRenderer(this, 0, 84); + rightBootBottom.mirror = true; + rightBootBottom.addBox(-3.5F, 9.5F, -5.5F, 6, 3, 8); + rightBootBottom.setRotationPoint(0F, 0F, 0F); + rightBootBottom.setTextureSize(128, 128); + setRotation(rightBootBottom, 0F, 0F, 0F); - rightBootPlate = new ModelRenderer(this, 0, 96); - rightBootPlate.mirror = true; - rightBootPlate.addBox(-3F, 6F, 6F, 5, 3, 1); - rightBootPlate.setRotationPoint(0F, 0F, 0F); - rightBootPlate.setTextureSize(128, 128); - setRotation(rightBootPlate, -1.151917F, 0F, 0F); + rightBootPlate = new ModelRenderer(this, 0, 96); + rightBootPlate.mirror = true; + rightBootPlate.addBox(-3F, 6F, 6F, 5, 3, 1); + rightBootPlate.setRotationPoint(0F, 0F, 0F); + rightBootPlate.setTextureSize(128, 128); + setRotation(rightBootPlate, -1.151917F, 0F, 0F); - rightBootBrace = new ModelRenderer(this, 0, 72); - rightBootBrace.mirror = true; - rightBootBrace.addBox(-3F, 7F, -3F, 5, 3, 6); - rightBootBrace.setRotationPoint(0F, 0F, 0F); - rightBootBrace.setTextureSize(128, 128); - setRotation(rightBootBrace, 0F, 0F, 0F); - - rightBootWing1 = new ModelRenderer(this, 13, 96); - rightBootWing1.mirror = true; - rightBootWing1.addBox(-4F, 7F, -4F, 1, 1, 7); - rightBootWing1.setRotationPoint(0F, 0F, 0F); - rightBootWing1.setTextureSize(128, 128); - setRotation(rightBootWing1, 0.2617994F, -0.1745329F, 0F); - - rightBootWing2 = new ModelRenderer(this, 13, 96); - rightBootWing2.mirror = true; - rightBootWing2.addBox(-4F, 8F, -5F, 1, 1, 7); - rightBootWing2.setRotationPoint(0F, 0F, 0F); - rightBootWing2.setTextureSize(128, 128); - setRotation(rightBootWing2, 0.2617994F, -0.1745329F, 0F); - } + rightBootBrace = new ModelRenderer(this, 0, 72); + rightBootBrace.mirror = true; + rightBootBrace.addBox(-3F, 7F, -3F, 5, 3, 6); + rightBootBrace.setRotationPoint(0F, 0F, 0F); + rightBootBrace.setTextureSize(128, 128); + setRotation(rightBootBrace, 0F, 0F, 0F); + + rightBootWing1 = new ModelRenderer(this, 13, 96); + rightBootWing1.mirror = true; + rightBootWing1.addBox(-4F, 7F, -4F, 1, 1, 7); + rightBootWing1.setRotationPoint(0F, 0F, 0F); + rightBootWing1.setTextureSize(128, 128); + setRotation(rightBootWing1, 0.2617994F, -0.1745329F, 0F); + + rightBootWing2 = new ModelRenderer(this, 13, 96); + rightBootWing2.mirror = true; + rightBootWing2.addBox(-4F, 8F, -5F, 1, 1, 7); + rightBootWing2.setRotationPoint(0F, 0F, 0F); + rightBootWing2.setTextureSize(128, 128); + setRotation(rightBootWing2, 0.2617994F, -0.1745329F, 0F); + } /* Main legs */ - { - belt = new ModelRenderer(this, 31, 52); - belt.addBox(-5F, 9.5F, -3.5F, 10, 2, 7); - belt.setRotationPoint(0F, 0F, 0F); - belt.setTextureSize(128, 128); - belt.mirror = true; - setRotation(belt, 0F, 0F, 0F); - } + { + belt = new ModelRenderer(this, 31, 52); + belt.addBox(-5F, 9.5F, -3.5F, 10, 2, 7); + belt.setRotationPoint(0F, 0F, 0F); + belt.setTextureSize(128, 128); + belt.mirror = true; + setRotation(belt, 0F, 0F, 0F); + } /* Left leg */ - { - leftLegSidePlate = new ModelRenderer(this, 40, 93); - leftLegSidePlate.addBox(-0.5F, 12F, -3F, 1, 6, 6); - leftLegSidePlate.setRotationPoint(-2F, -12F, 0F); - leftLegSidePlate.setTextureSize(128, 128); - leftLegSidePlate.mirror = true; - setRotation(leftLegSidePlate, 0F, 0F, -0.3490659F); - - leftLegMain = new ModelRenderer(this, 40, 93); - leftLegMain.addBox(-0.5F, 11F, -2.5F, 5, 9, 5); - leftLegMain.setRotationPoint(-2F, -12F, 0F); - leftLegMain.setTextureSize(128, 128); - leftLegMain.mirror = true; - setRotation(leftLegMain, 0F, 0F, 0F); - - leftLegPlate1 = new ModelRenderer(this, 46, 71); - leftLegPlate1.addBox(-2.5F, 11F, -3F, 2, 6, 1); - leftLegPlate1.setRotationPoint(-2F, -12F, 0F); - leftLegPlate1.setTextureSize(128, 128); - leftLegPlate1.mirror = true; - setRotation(leftLegPlate1, 0F, 0F, -0.3490659F); - - leftLegPlate2 = new ModelRenderer(this, 46, 71); - leftLegPlate2.addBox(-2.5F, 11F, 2F, 2, 6, 1); - leftLegPlate2.setRotationPoint(-2F, -12F, 0F); - leftLegPlate2.setTextureSize(128, 128); - leftLegPlate2.mirror = true; - setRotation(leftLegPlate2, 0F, 0F, -0.3490659F); - - leftLegPlate3 = new ModelRenderer(this, 31, 62); - leftLegPlate3.addBox(0F, 11.9F, -1F, 4, 7, 1); - leftLegPlate3.setRotationPoint(-2F, -12F, 0F); - leftLegPlate3.setTextureSize(128, 128); - leftLegPlate3.mirror = true; - setRotation(leftLegPlate3, -0.1745329F, 0F, 0F); - - leftLegPlate4 = new ModelRenderer(this, 42, 62); - leftLegPlate4.addBox(0F, 11.9F, 0F, 4, 7, 1); - leftLegPlate4.setRotationPoint(-2F, -12F, 0F); - leftLegPlate4.setTextureSize(128, 128); - leftLegPlate4.mirror = true; - setRotation(leftLegPlate4, 0.1745329F, 0F, 0F); - } + { + leftLegSidePlate = new ModelRenderer(this, 40, 93); + leftLegSidePlate.addBox(-0.5F, 12F, -3F, 1, 6, 6); + leftLegSidePlate.setRotationPoint(-2F, -12F, 0F); + leftLegSidePlate.setTextureSize(128, 128); + leftLegSidePlate.mirror = true; + setRotation(leftLegSidePlate, 0F, 0F, -0.3490659F); + + leftLegMain = new ModelRenderer(this, 40, 93); + leftLegMain.addBox(-0.5F, 11F, -2.5F, 5, 9, 5); + leftLegMain.setRotationPoint(-2F, -12F, 0F); + leftLegMain.setTextureSize(128, 128); + leftLegMain.mirror = true; + setRotation(leftLegMain, 0F, 0F, 0F); + + leftLegPlate1 = new ModelRenderer(this, 46, 71); + leftLegPlate1.addBox(-2.5F, 11F, -3F, 2, 6, 1); + leftLegPlate1.setRotationPoint(-2F, -12F, 0F); + leftLegPlate1.setTextureSize(128, 128); + leftLegPlate1.mirror = true; + setRotation(leftLegPlate1, 0F, 0F, -0.3490659F); + + leftLegPlate2 = new ModelRenderer(this, 46, 71); + leftLegPlate2.addBox(-2.5F, 11F, 2F, 2, 6, 1); + leftLegPlate2.setRotationPoint(-2F, -12F, 0F); + leftLegPlate2.setTextureSize(128, 128); + leftLegPlate2.mirror = true; + setRotation(leftLegPlate2, 0F, 0F, -0.3490659F); + + leftLegPlate3 = new ModelRenderer(this, 31, 62); + leftLegPlate3.addBox(0F, 11.9F, -1F, 4, 7, 1); + leftLegPlate3.setRotationPoint(-2F, -12F, 0F); + leftLegPlate3.setTextureSize(128, 128); + leftLegPlate3.mirror = true; + setRotation(leftLegPlate3, -0.1745329F, 0F, 0F); + + leftLegPlate4 = new ModelRenderer(this, 42, 62); + leftLegPlate4.addBox(0F, 11.9F, 0F, 4, 7, 1); + leftLegPlate4.setRotationPoint(-2F, -12F, 0F); + leftLegPlate4.setTextureSize(128, 128); + leftLegPlate4.mirror = true; + setRotation(leftLegPlate4, 0.1745329F, 0F, 0F); + } /* Right leg */ - { - rightLegSidePlate = new ModelRenderer(this, 31, 71); - rightLegSidePlate.mirror = true; - rightLegSidePlate.addBox(-0.5F, 12F, -3F, 1, 6, 6); - rightLegSidePlate.setRotationPoint(2F, -12F, 0F); - rightLegSidePlate.setTextureSize(128, 128); - setRotation(rightLegSidePlate, 0F, 0F, 0.3490659F); + { + rightLegSidePlate = new ModelRenderer(this, 31, 71); + rightLegSidePlate.mirror = true; + rightLegSidePlate.addBox(-0.5F, 12F, -3F, 1, 6, 6); + rightLegSidePlate.setRotationPoint(2F, -12F, 0F); + rightLegSidePlate.setTextureSize(128, 128); + setRotation(rightLegSidePlate, 0F, 0F, 0.3490659F); - rightLegMain = new ModelRenderer(this, 40, 93); - rightLegMain.mirror = true; - rightLegMain.addBox(-4.5F, 11F, -2.5F, 5, 9, 5); - rightLegMain.setRotationPoint(2F, -12F, 0F); - rightLegMain.setTextureSize(128, 128); - setRotation(rightLegMain, 0F, 0F, 0F); + rightLegMain = new ModelRenderer(this, 40, 93); + rightLegMain.mirror = true; + rightLegMain.addBox(-4.5F, 11F, -2.5F, 5, 9, 5); + rightLegMain.setRotationPoint(2F, -12F, 0F); + rightLegMain.setTextureSize(128, 128); + setRotation(rightLegMain, 0F, 0F, 0F); - rightLegPlate1 = new ModelRenderer(this, 46, 71); - rightLegPlate1.mirror = true; - rightLegPlate1.addBox(0.5F, 11F, -3F, 2, 6, 1); - rightLegPlate1.setRotationPoint(2F, -12F, 0F); - rightLegPlate1.setTextureSize(128, 128); - setRotation(rightLegPlate1, 0F, 0F, 0.3490659F); + rightLegPlate1 = new ModelRenderer(this, 46, 71); + rightLegPlate1.mirror = true; + rightLegPlate1.addBox(0.5F, 11F, -3F, 2, 6, 1); + rightLegPlate1.setRotationPoint(2F, -12F, 0F); + rightLegPlate1.setTextureSize(128, 128); + setRotation(rightLegPlate1, 0F, 0F, 0.3490659F); - rightLegPlate2 = new ModelRenderer(this, 46, 71); - rightLegPlate2.mirror = true; - rightLegPlate2.addBox(0.5F, 11F, 2F, 2, 6, 1); - rightLegPlate2.setRotationPoint(2F, -12F, 0F); - rightLegPlate2.setTextureSize(128, 128); - setRotation(rightLegPlate2, 0F, 0F, 0.3490659F); + rightLegPlate2 = new ModelRenderer(this, 46, 71); + rightLegPlate2.mirror = true; + rightLegPlate2.addBox(0.5F, 11F, 2F, 2, 6, 1); + rightLegPlate2.setRotationPoint(2F, -12F, 0F); + rightLegPlate2.setTextureSize(128, 128); + setRotation(rightLegPlate2, 0F, 0F, 0.3490659F); - rightLegPlate3 = new ModelRenderer(this, 31, 62); - rightLegPlate3.mirror = true; - rightLegPlate3.addBox(-4F, 11.9F, -1F, 4, 7, 1); - rightLegPlate3.setRotationPoint(2F, -12F, 0F); - rightLegPlate3.setTextureSize(128, 128); - setRotation(rightLegPlate3, -0.1745329F, 0F, 0F); + rightLegPlate3 = new ModelRenderer(this, 31, 62); + rightLegPlate3.mirror = true; + rightLegPlate3.addBox(-4F, 11.9F, -1F, 4, 7, 1); + rightLegPlate3.setRotationPoint(2F, -12F, 0F); + rightLegPlate3.setTextureSize(128, 128); + setRotation(rightLegPlate3, -0.1745329F, 0F, 0F); - rightLegPlate4 = new ModelRenderer(this, 42, 62); - rightLegPlate4.mirror = true; - rightLegPlate4.addBox(-4F, 11.9F, 0F, 4, 7, 1); - rightLegPlate4.setRotationPoint(2F, -12F, 0F); - rightLegPlate4.setTextureSize(128, 128); - setRotation(rightLegPlate4, 0.1745329F, 0F, 0F); - } - - this.bipedHead.cubeList.clear(); - this.bipedHeadwear.cubeList.clear(); - if(addHelmet) - { - this.bipedHead.addChild(this.leftFacePlate); - this.bipedHead.addChild(this.rightFacePlate); - this.bipedHead.addChild(this.facePlate1); - this.bipedHead.addChild(this.facePlate2); - this.bipedHead.addChild(this.facePlate3); - this.bipedHead.addChild(this.leftWingPlate1); - this.bipedHead.addChild(this.leftWingPlate2); - this.bipedHead.addChild(this.rightWingPlate1); - this.bipedHead.addChild(this.rightWingPlate2); - this.bipedHead.addChild(this.topPlate1); - this.bipedHead.addChild(this.topPlate2); - this.bipedHead.addChild(this.topPlate3); - this.bipedHead.addChild(this.backPlate1); - this.bipedHead.addChild(this.backPlate2); - this.bipedHead.addChild(this.backPlate3); - this.bipedHead.addChild(this.backPlate4); - this.bipedHead.addChild(this.backPlate5); - this.bipedHead.addChild(this.backPlate6); - this.bipedHead.addChild(this.eyePlate); - } - - this.bipedBody.cubeList.clear(); - if(addChestPiece) - { - this.bipedBody.addChild(this.chestPlate1); - this.bipedBody.addChild(this.chestPlate2); - this.bipedBody.addChild(this.chestPlate3); - this.bipedBody.addChild(this.chestPlate4); - this.bipedBody.addChild(this.chestPlate5); - this.bipedBody.addChild(this.chestPlate6); - this.bipedBody.addChild(this.mainPlate); - } - if(addLeggings) - { - this.bipedBody.addChild(this.belt); - } - - this.bipedRightArm.cubeList.clear(); - if(addChestPiece) - { - this.bipedRightArm.addChild(rightArmMain); - this.bipedRightArm.addChild(this.rightKnucklePlate); - this.bipedRightArm.addChild(this.rightKnuckleBrace); - this.bipedRightArm.addChild(this.rightKnuckle1); - this.bipedRightArm.addChild(this.rightKnuckle2); - this.bipedRightArm.addChild(this.rightKnuckle3); - this.bipedRightArm.addChild(this.rightKnuckle4); - this.bipedRightArm.addChild(this.rightKnuckle5); - this.bipedRightArm.addChild(this.rightKnuckle6); - this.bipedRightArm.addChild(this.rightArmMain); - this.bipedRightArm.addChild(this.rightShoulder1); - this.bipedRightArm.addChild(this.rightShoulder2); - this.bipedRightArm.addChild(this.rightShoulder3); - } - - this.bipedLeftArm.cubeList.clear(); - if(addChestPiece) - { - this.bipedLeftArm.addChild(leftArmMain); - this.bipedLeftArm.addChild(this.leftKnucklePlate); - this.bipedLeftArm.addChild(this.leftKnuckleBrace); - this.bipedLeftArm.addChild(this.leftKnuckle1); - this.bipedLeftArm.addChild(this.leftKnuckle2); - this.bipedLeftArm.addChild(this.leftKnuckle3); - this.bipedLeftArm.addChild(this.leftKnuckle4); - this.bipedLeftArm.addChild(this.leftKnuckle5); - this.bipedLeftArm.addChild(this.leftKnuckle6); - this.bipedLeftArm.addChild(this.leftArmMain); - this.bipedLeftArm.addChild(this.leftShoulder1); - this.bipedLeftArm.addChild(this.leftShoulder2); - this.bipedLeftArm.addChild(this.leftShoulder3); - } - - this.bipedLeftLeg.cubeList.clear(); - if(addBoots) - { - this.bipedLeftLeg.addChild(this.leftBootBottom); - this.bipedLeftLeg.addChild(this.leftBootBrace); - this.bipedLeftLeg.addChild(this.leftBootPlate); - this.bipedLeftLeg.addChild(this.leftBootWing1); - this.bipedLeftLeg.addChild(this.leftBootWing2); - } - if(addLeggings) - { - this.bipedLeftLeg.addChild(this.leftLegMain); - this.bipedLeftLeg.addChild(this.leftLegSidePlate); - this.bipedLeftLeg.addChild(this.leftLegPlate1); - this.bipedLeftLeg.addChild(this.leftLegPlate2); - this.bipedLeftLeg.addChild(this.leftLegPlate3); - this.bipedLeftLeg.addChild(this.leftLegPlate4); - } - - this.bipedRightLeg.cubeList.clear(); - if(addBoots) - { - this.bipedRightLeg.addChild(this.rightBootBottom); - this.bipedRightLeg.addChild(this.rightBootBrace); - this.bipedRightLeg.addChild(this.rightBootPlate); - this.bipedRightLeg.addChild(this.rightBootWing1); - this.bipedRightLeg.addChild(this.rightBootWing2); - } - if(addLeggings) - { - this.bipedRightLeg.addChild(this.rightLegMain); - this.bipedRightLeg.addChild(this.rightLegSidePlate); - this.bipedRightLeg.addChild(this.rightLegPlate1); - this.bipedRightLeg.addChild(this.rightLegPlate2); - this.bipedRightLeg.addChild(this.rightLegPlate3); - this.bipedRightLeg.addChild(this.rightLegPlate4); - } - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { + rightLegPlate4 = new ModelRenderer(this, 42, 62); + rightLegPlate4.mirror = true; + rightLegPlate4.addBox(-4F, 11.9F, 0F, 4, 7, 1); + rightLegPlate4.setRotationPoint(2F, -12F, 0F); + rightLegPlate4.setTextureSize(128, 128); + setRotation(rightLegPlate4, 0.1745329F, 0F, 0F); + } + + this.bipedHead.cubeList.clear(); + this.bipedHeadwear.cubeList.clear(); + if (addHelmet) + { + this.bipedHead.addChild(this.leftFacePlate); + this.bipedHead.addChild(this.rightFacePlate); + this.bipedHead.addChild(this.facePlate1); + this.bipedHead.addChild(this.facePlate2); + this.bipedHead.addChild(this.facePlate3); + this.bipedHead.addChild(this.leftWingPlate1); + this.bipedHead.addChild(this.leftWingPlate2); + this.bipedHead.addChild(this.rightWingPlate1); + this.bipedHead.addChild(this.rightWingPlate2); + this.bipedHead.addChild(this.topPlate1); + this.bipedHead.addChild(this.topPlate2); + this.bipedHead.addChild(this.topPlate3); + this.bipedHead.addChild(this.backPlate1); + this.bipedHead.addChild(this.backPlate2); + this.bipedHead.addChild(this.backPlate3); + this.bipedHead.addChild(this.backPlate4); + this.bipedHead.addChild(this.backPlate5); + this.bipedHead.addChild(this.backPlate6); + this.bipedHead.addChild(this.eyePlate); + } + + this.bipedBody.cubeList.clear(); + if (addChestPiece) + { + this.bipedBody.addChild(this.chestPlate1); + this.bipedBody.addChild(this.chestPlate2); + this.bipedBody.addChild(this.chestPlate3); + this.bipedBody.addChild(this.chestPlate4); + this.bipedBody.addChild(this.chestPlate5); + this.bipedBody.addChild(this.chestPlate6); + this.bipedBody.addChild(this.mainPlate); + } + if (addLeggings) + { + this.bipedBody.addChild(this.belt); + } + + this.bipedRightArm.cubeList.clear(); + if (addChestPiece) + { + this.bipedRightArm.addChild(rightArmMain); + this.bipedRightArm.addChild(this.rightKnucklePlate); + this.bipedRightArm.addChild(this.rightKnuckleBrace); + this.bipedRightArm.addChild(this.rightKnuckle1); + this.bipedRightArm.addChild(this.rightKnuckle2); + this.bipedRightArm.addChild(this.rightKnuckle3); + this.bipedRightArm.addChild(this.rightKnuckle4); + this.bipedRightArm.addChild(this.rightKnuckle5); + this.bipedRightArm.addChild(this.rightKnuckle6); + this.bipedRightArm.addChild(this.rightArmMain); + this.bipedRightArm.addChild(this.rightShoulder1); + this.bipedRightArm.addChild(this.rightShoulder2); + this.bipedRightArm.addChild(this.rightShoulder3); + } + + this.bipedLeftArm.cubeList.clear(); + if (addChestPiece) + { + this.bipedLeftArm.addChild(leftArmMain); + this.bipedLeftArm.addChild(this.leftKnucklePlate); + this.bipedLeftArm.addChild(this.leftKnuckleBrace); + this.bipedLeftArm.addChild(this.leftKnuckle1); + this.bipedLeftArm.addChild(this.leftKnuckle2); + this.bipedLeftArm.addChild(this.leftKnuckle3); + this.bipedLeftArm.addChild(this.leftKnuckle4); + this.bipedLeftArm.addChild(this.leftKnuckle5); + this.bipedLeftArm.addChild(this.leftKnuckle6); + this.bipedLeftArm.addChild(this.leftArmMain); + this.bipedLeftArm.addChild(this.leftShoulder1); + this.bipedLeftArm.addChild(this.leftShoulder2); + this.bipedLeftArm.addChild(this.leftShoulder3); + } + + this.bipedLeftLeg.cubeList.clear(); + if (addBoots) + { + this.bipedLeftLeg.addChild(this.leftBootBottom); + this.bipedLeftLeg.addChild(this.leftBootBrace); + this.bipedLeftLeg.addChild(this.leftBootPlate); + this.bipedLeftLeg.addChild(this.leftBootWing1); + this.bipedLeftLeg.addChild(this.leftBootWing2); + } + if (addLeggings) + { + this.bipedLeftLeg.addChild(this.leftLegMain); + this.bipedLeftLeg.addChild(this.leftLegSidePlate); + this.bipedLeftLeg.addChild(this.leftLegPlate1); + this.bipedLeftLeg.addChild(this.leftLegPlate2); + this.bipedLeftLeg.addChild(this.leftLegPlate3); + this.bipedLeftLeg.addChild(this.leftLegPlate4); + } + + this.bipedRightLeg.cubeList.clear(); + if (addBoots) + { + this.bipedRightLeg.addChild(this.rightBootBottom); + this.bipedRightLeg.addChild(this.rightBootBrace); + this.bipedRightLeg.addChild(this.rightBootPlate); + this.bipedRightLeg.addChild(this.rightBootWing1); + this.bipedRightLeg.addChild(this.rightBootWing2); + } + if (addLeggings) + { + this.bipedRightLeg.addChild(this.rightLegMain); + this.bipedRightLeg.addChild(this.rightLegSidePlate); + this.bipedRightLeg.addChild(this.rightLegPlate1); + this.bipedRightLeg.addChild(this.rightLegPlate2); + this.bipedRightLeg.addChild(this.rightLegPlate3); + this.bipedRightLeg.addChild(this.rightLegPlate4); + } + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { // super.render(entity, f, f1, f2, f3, f4, f5); - - - - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - this.bipedHead.render(f5); - this.bipedBody.render(f5); - this.bipedLeftArm.render(f5); - this.bipedRightArm.render(f5); - this.bipedLeftLeg.render(f5); - this.bipedRightLeg.render(f5); - + + + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.bipedHead.render(f5); + this.bipedBody.render(f5); + this.bipedLeftArm.render(f5); + this.bipedRightArm.render(f5); + this.bipedLeftLeg.render(f5); + this.bipedRightLeg.render(f5); + // head.render(f5); // body.render(f5); // rightarm.render(f5); @@ -883,17 +882,17 @@ public class ModelOmegaArmour extends ModelBiped // rightLegPlate3.render(f5); // rightLegPlate4.render(f5); // } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java index 61110926..d816ae3d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java @@ -7,7 +7,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellEffectBlock extends ModelBase { - //fields + //fields ModelRenderer core; ModelRenderer frame1; ModelRenderer frame2; @@ -32,301 +32,301 @@ public class ModelSpellEffectBlock extends ModelBase ModelRenderer outputSpacer2; ModelRenderer outputSpacer3; ModelRenderer outputSpacer4; - - public ModelSpellEffectBlock() - { - textureWidth = 64; - textureHeight = 64; - - core = new ModelRenderer(this, 0, 0); - core.addBox(-3F, -3F, -3F, 6, 6, 6); - core.setRotationPoint(0F, 16F, 0F); - core.setTextureSize(64, 64); - core.mirror = true; - setRotation(core, 0F, 0F, 0F); - frame1 = new ModelRenderer(this, 16, 18); - frame1.addBox(3F, -3F, -5F, 2, 6, 2); - frame1.setRotationPoint(0F, 16F, 0F); - frame1.setTextureSize(64, 64); - frame1.mirror = true; - setRotation(frame1, 0F, 0F, 0F); - frame2 = new ModelRenderer(this, 0, 18); - frame2.addBox(-5F, -3F, -5F, 2, 6, 2); - frame2.setRotationPoint(0F, 16F, 0F); - frame2.setTextureSize(64, 64); - frame2.mirror = true; - setRotation(frame2, 0F, 0F, 0F); - frame3 = new ModelRenderer(this, 0, 13); - frame3.addBox(-5F, -5F, -5F, 10, 2, 2); - frame3.setRotationPoint(0F, 16F, 0F); - frame3.setTextureSize(64, 64); - frame3.mirror = true; - setRotation(frame3, 0F, 0F, 0F); - frame4 = new ModelRenderer(this, 0, 27); - frame4.addBox(-5F, 3F, -5F, 10, 2, 2); - frame4.setRotationPoint(0F, 16F, 0F); - frame4.setTextureSize(64, 64); - frame4.mirror = true; - setRotation(frame4, 0F, 0F, 0F); - frame5 = new ModelRenderer(this, 0, 34); - frame5.addBox(-5F, -5F, 3F, 10, 2, 2); - frame5.setRotationPoint(0F, 16F, 0F); - frame5.setTextureSize(64, 64); - frame5.mirror = true; - setRotation(frame5, 0F, 0F, 0F); - frame6 = new ModelRenderer(this, 0, 48); - frame6.addBox(-5F, 3F, 3F, 10, 2, 2); - frame6.setRotationPoint(0F, 16F, 0F); - frame6.setTextureSize(64, 64); - frame6.mirror = true; - setRotation(frame6, 0F, 0F, 0F); - frame7 = new ModelRenderer(this, 16, 39); - frame7.addBox(-5F, -3F, 3F, 2, 6, 2); - frame7.setRotationPoint(0F, 16F, 0F); - frame7.setTextureSize(64, 64); - frame7.mirror = true; - setRotation(frame7, 0F, 0F, 0F); - frame8 = new ModelRenderer(this, 0, 39); - frame8.addBox(3F, -3F, 3F, 2, 6, 2); - frame8.setRotationPoint(0F, 16F, 0F); - frame8.setTextureSize(64, 64); - frame8.mirror = true; - setRotation(frame8, 0F, 0F, 0F); - frame9 = new ModelRenderer(this, 25, 9); - frame9.addBox(-5F, 3F, -3F, 2, 2, 6); - frame9.setRotationPoint(0F, 16F, 0F); - frame9.setTextureSize(64, 64); - frame9.mirror = true; - setRotation(frame9, 0F, 0F, 0F); - frame10 = new ModelRenderer(this, 25, 0); - frame10.addBox(-5F, -5F, -3F, 2, 2, 6); - frame10.setRotationPoint(0F, 16F, 0F); - frame10.setTextureSize(64, 64); - frame10.mirror = true; - setRotation(frame10, 0F, 0F, 0F); - frame11 = new ModelRenderer(this, 42, 0); - frame11.addBox(3F, -5F, -3F, 2, 2, 6); - frame11.setRotationPoint(0F, 16F, 0F); - frame11.setTextureSize(64, 64); - frame11.mirror = true; - setRotation(frame11, 0F, 0F, 0F); - frame12 = new ModelRenderer(this, 42, 9); - frame12.addBox(3F, 3F, -3F, 2, 2, 6); - frame12.setRotationPoint(0F, 16F, 0F); - frame12.setTextureSize(64, 64); - frame12.mirror = true; - setRotation(frame12, 0F, 0F, 0F); - inputSpacer1 = new ModelRenderer(this, 25, 27); - inputSpacer1.addBox(3F, -5F, -8F, 2, 2, 3); - inputSpacer1.setRotationPoint(0F, 16F, 0F); - inputSpacer1.setTextureSize(64, 64); - inputSpacer1.mirror = true; - setRotation(inputSpacer1, 0F, 0F, 0F); - inputFace = new ModelRenderer(this, 38, 27); - inputFace.addBox(-2F, -2F, -8F, 4, 4, 5); - inputFace.setRotationPoint(0F, 16F, 0F); - inputFace.setTextureSize(64, 64); - inputFace.mirror = true; - setRotation(inputFace, 0F, 0F, 0F); - inputSpacer2 = new ModelRenderer(this, 25, 27); - inputSpacer2.addBox(-5F, -5F, -8F, 2, 2, 3); - inputSpacer2.setRotationPoint(0F, 16F, 0F); - inputSpacer2.setTextureSize(64, 64); - inputSpacer2.mirror = true; - setRotation(inputSpacer2, 0F, 0F, 0F); - inputSpacer3 = new ModelRenderer(this, 25, 27); - inputSpacer3.addBox(3F, 3F, -8F, 2, 2, 3); - inputSpacer3.setRotationPoint(0F, 16F, 0F); - inputSpacer3.setTextureSize(64, 64); - inputSpacer3.mirror = true; - setRotation(inputSpacer3, 0F, 0F, 0F); - inputSpacer4 = new ModelRenderer(this, 25, 27); - inputSpacer4.addBox(-5F, 3F, -8F, 2, 2, 3); - inputSpacer4.setRotationPoint(0F, 16F, 0F); - inputSpacer4.setTextureSize(64, 64); - inputSpacer4.mirror = true; - setRotation(inputSpacer4, 0F, 0F, 0F); - outputFace = new ModelRenderer(this, 38, 37); - outputFace.addBox(6F, -2F, -2F, 2, 4, 4); - outputFace.setRotationPoint(0F, 16F, 0F); - outputFace.setTextureSize(64, 64); - outputFace.mirror = true; - setRotation(outputFace, 0F, 0F, 0F); - outputPlug = new ModelRenderer(this, 36, 48); - outputPlug.addBox(3F, -3F, -3F, 2, 6, 6); - outputPlug.setRotationPoint(0F, 16F, 0F); - outputPlug.setTextureSize(64, 64); - outputPlug.mirror = true; - setRotation(outputPlug, 0F, 0F, 0F); - outputSpacer1 = new ModelRenderer(this, 25, 48); - outputSpacer1.addBox(5F, -5F, -5F, 3, 2, 2); - outputSpacer1.setRotationPoint(0F, 16F, 0F); - outputSpacer1.setTextureSize(64, 64); - outputSpacer1.mirror = true; - setRotation(outputSpacer1, 0F, 0F, 0F); - outputSpacer2 = new ModelRenderer(this, 25, 48); - outputSpacer2.addBox(5F, -5F, 3F, 3, 2, 2); - outputSpacer2.setRotationPoint(0F, 16F, 0F); - outputSpacer2.setTextureSize(64, 64); - outputSpacer2.mirror = true; - setRotation(outputSpacer2, 0F, 0F, 0F); - outputSpacer3 = new ModelRenderer(this, 25, 48); - outputSpacer3.addBox(5F, 3F, -5F, 3, 2, 2); - outputSpacer3.setRotationPoint(0F, 16F, 0F); - outputSpacer3.setTextureSize(64, 64); - outputSpacer3.mirror = true; - setRotation(outputSpacer3, 0F, 0F, 0F); - outputSpacer4 = new ModelRenderer(this, 25, 48); - outputSpacer4.addBox(5F, 3F, 3F, 3, 2, 2); - outputSpacer4.setRotationPoint(0F, 16F, 0F); - outputSpacer4.setTextureSize(64, 64); - outputSpacer4.mirror = true; - setRotation(outputSpacer4, 0F, 0F, 0F); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float xInputRot = 0.0f; - float yInputRot = 0.0f; - float zInputRot = 0.0f; - float xOutputRot = 0.0f; - float yOutputRot = 0.0f; - float zOutputRot = 0.0f; - switch (input) + public ModelSpellEffectBlock() { - case NORTH: - xInputRot = 0.0f; - yInputRot = 0.0f; - zInputRot = 0.0f; - break; + textureWidth = 64; + textureHeight = 64; - case EAST: - xInputRot = 0.0f; - yInputRot = (float) (0.5f * Math.PI); - zInputRot = 0.0f; - break; - - case SOUTH: - xInputRot = 0.0f; - yInputRot = (float) (1.0f * Math.PI); - zInputRot = 0.0f; - break; - - case WEST: - xInputRot = 0.0f; - yInputRot = (float) (-0.5f * Math.PI); - zInputRot = 0.0f; - break; - - case UP: - xInputRot = (float) (-0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; - - case DOWN: - xInputRot = (float) (0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; - - default: - break; + core = new ModelRenderer(this, 0, 0); + core.addBox(-3F, -3F, -3F, 6, 6, 6); + core.setRotationPoint(0F, 16F, 0F); + core.setTextureSize(64, 64); + core.mirror = true; + setRotation(core, 0F, 0F, 0F); + frame1 = new ModelRenderer(this, 16, 18); + frame1.addBox(3F, -3F, -5F, 2, 6, 2); + frame1.setRotationPoint(0F, 16F, 0F); + frame1.setTextureSize(64, 64); + frame1.mirror = true; + setRotation(frame1, 0F, 0F, 0F); + frame2 = new ModelRenderer(this, 0, 18); + frame2.addBox(-5F, -3F, -5F, 2, 6, 2); + frame2.setRotationPoint(0F, 16F, 0F); + frame2.setTextureSize(64, 64); + frame2.mirror = true; + setRotation(frame2, 0F, 0F, 0F); + frame3 = new ModelRenderer(this, 0, 13); + frame3.addBox(-5F, -5F, -5F, 10, 2, 2); + frame3.setRotationPoint(0F, 16F, 0F); + frame3.setTextureSize(64, 64); + frame3.mirror = true; + setRotation(frame3, 0F, 0F, 0F); + frame4 = new ModelRenderer(this, 0, 27); + frame4.addBox(-5F, 3F, -5F, 10, 2, 2); + frame4.setRotationPoint(0F, 16F, 0F); + frame4.setTextureSize(64, 64); + frame4.mirror = true; + setRotation(frame4, 0F, 0F, 0F); + frame5 = new ModelRenderer(this, 0, 34); + frame5.addBox(-5F, -5F, 3F, 10, 2, 2); + frame5.setRotationPoint(0F, 16F, 0F); + frame5.setTextureSize(64, 64); + frame5.mirror = true; + setRotation(frame5, 0F, 0F, 0F); + frame6 = new ModelRenderer(this, 0, 48); + frame6.addBox(-5F, 3F, 3F, 10, 2, 2); + frame6.setRotationPoint(0F, 16F, 0F); + frame6.setTextureSize(64, 64); + frame6.mirror = true; + setRotation(frame6, 0F, 0F, 0F); + frame7 = new ModelRenderer(this, 16, 39); + frame7.addBox(-5F, -3F, 3F, 2, 6, 2); + frame7.setRotationPoint(0F, 16F, 0F); + frame7.setTextureSize(64, 64); + frame7.mirror = true; + setRotation(frame7, 0F, 0F, 0F); + frame8 = new ModelRenderer(this, 0, 39); + frame8.addBox(3F, -3F, 3F, 2, 6, 2); + frame8.setRotationPoint(0F, 16F, 0F); + frame8.setTextureSize(64, 64); + frame8.mirror = true; + setRotation(frame8, 0F, 0F, 0F); + frame9 = new ModelRenderer(this, 25, 9); + frame9.addBox(-5F, 3F, -3F, 2, 2, 6); + frame9.setRotationPoint(0F, 16F, 0F); + frame9.setTextureSize(64, 64); + frame9.mirror = true; + setRotation(frame9, 0F, 0F, 0F); + frame10 = new ModelRenderer(this, 25, 0); + frame10.addBox(-5F, -5F, -3F, 2, 2, 6); + frame10.setRotationPoint(0F, 16F, 0F); + frame10.setTextureSize(64, 64); + frame10.mirror = true; + setRotation(frame10, 0F, 0F, 0F); + frame11 = new ModelRenderer(this, 42, 0); + frame11.addBox(3F, -5F, -3F, 2, 2, 6); + frame11.setRotationPoint(0F, 16F, 0F); + frame11.setTextureSize(64, 64); + frame11.mirror = true; + setRotation(frame11, 0F, 0F, 0F); + frame12 = new ModelRenderer(this, 42, 9); + frame12.addBox(3F, 3F, -3F, 2, 2, 6); + frame12.setRotationPoint(0F, 16F, 0F); + frame12.setTextureSize(64, 64); + frame12.mirror = true; + setRotation(frame12, 0F, 0F, 0F); + inputSpacer1 = new ModelRenderer(this, 25, 27); + inputSpacer1.addBox(3F, -5F, -8F, 2, 2, 3); + inputSpacer1.setRotationPoint(0F, 16F, 0F); + inputSpacer1.setTextureSize(64, 64); + inputSpacer1.mirror = true; + setRotation(inputSpacer1, 0F, 0F, 0F); + inputFace = new ModelRenderer(this, 38, 27); + inputFace.addBox(-2F, -2F, -8F, 4, 4, 5); + inputFace.setRotationPoint(0F, 16F, 0F); + inputFace.setTextureSize(64, 64); + inputFace.mirror = true; + setRotation(inputFace, 0F, 0F, 0F); + inputSpacer2 = new ModelRenderer(this, 25, 27); + inputSpacer2.addBox(-5F, -5F, -8F, 2, 2, 3); + inputSpacer2.setRotationPoint(0F, 16F, 0F); + inputSpacer2.setTextureSize(64, 64); + inputSpacer2.mirror = true; + setRotation(inputSpacer2, 0F, 0F, 0F); + inputSpacer3 = new ModelRenderer(this, 25, 27); + inputSpacer3.addBox(3F, 3F, -8F, 2, 2, 3); + inputSpacer3.setRotationPoint(0F, 16F, 0F); + inputSpacer3.setTextureSize(64, 64); + inputSpacer3.mirror = true; + setRotation(inputSpacer3, 0F, 0F, 0F); + inputSpacer4 = new ModelRenderer(this, 25, 27); + inputSpacer4.addBox(-5F, 3F, -8F, 2, 2, 3); + inputSpacer4.setRotationPoint(0F, 16F, 0F); + inputSpacer4.setTextureSize(64, 64); + inputSpacer4.mirror = true; + setRotation(inputSpacer4, 0F, 0F, 0F); + outputFace = new ModelRenderer(this, 38, 37); + outputFace.addBox(6F, -2F, -2F, 2, 4, 4); + outputFace.setRotationPoint(0F, 16F, 0F); + outputFace.setTextureSize(64, 64); + outputFace.mirror = true; + setRotation(outputFace, 0F, 0F, 0F); + outputPlug = new ModelRenderer(this, 36, 48); + outputPlug.addBox(3F, -3F, -3F, 2, 6, 6); + outputPlug.setRotationPoint(0F, 16F, 0F); + outputPlug.setTextureSize(64, 64); + outputPlug.mirror = true; + setRotation(outputPlug, 0F, 0F, 0F); + outputSpacer1 = new ModelRenderer(this, 25, 48); + outputSpacer1.addBox(5F, -5F, -5F, 3, 2, 2); + outputSpacer1.setRotationPoint(0F, 16F, 0F); + outputSpacer1.setTextureSize(64, 64); + outputSpacer1.mirror = true; + setRotation(outputSpacer1, 0F, 0F, 0F); + outputSpacer2 = new ModelRenderer(this, 25, 48); + outputSpacer2.addBox(5F, -5F, 3F, 3, 2, 2); + outputSpacer2.setRotationPoint(0F, 16F, 0F); + outputSpacer2.setTextureSize(64, 64); + outputSpacer2.mirror = true; + setRotation(outputSpacer2, 0F, 0F, 0F); + outputSpacer3 = new ModelRenderer(this, 25, 48); + outputSpacer3.addBox(5F, 3F, -5F, 3, 2, 2); + outputSpacer3.setRotationPoint(0F, 16F, 0F); + outputSpacer3.setTextureSize(64, 64); + outputSpacer3.mirror = true; + setRotation(outputSpacer3, 0F, 0F, 0F); + outputSpacer4 = new ModelRenderer(this, 25, 48); + outputSpacer4.addBox(5F, 3F, 3F, 3, 2, 2); + outputSpacer4.setRotationPoint(0F, 16F, 0F); + outputSpacer4.setTextureSize(64, 64); + outputSpacer4.mirror = true; + setRotation(outputSpacer4, 0F, 0F, 0F); } - switch (output) + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) { - case NORTH: - xOutputRot = 0.0f; - yOutputRot = (float) (0.5f * Math.PI); - zOutputRot = 0.0f; - break; + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float xInputRot = 0.0f; + float yInputRot = 0.0f; + float zInputRot = 0.0f; + float xOutputRot = 0.0f; + float yOutputRot = 0.0f; + float zOutputRot = 0.0f; - case EAST: - xOutputRot = 0.0f; - yOutputRot = (float) (1.0f * Math.PI); - zOutputRot = 0.0f; - break; + switch (input) + { + case NORTH: + xInputRot = 0.0f; + yInputRot = 0.0f; + zInputRot = 0.0f; + break; - case SOUTH: - xOutputRot = 0.0f; - yOutputRot = (float) (-0.5f * Math.PI); - zOutputRot = 0.0f; - break; + case EAST: + xInputRot = 0.0f; + yInputRot = (float) (0.5f * Math.PI); + zInputRot = 0.0f; + break; - case WEST: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = 0.0f; - break; + case SOUTH: + xInputRot = 0.0f; + yInputRot = (float) (1.0f * Math.PI); + zInputRot = 0.0f; + break; - case UP: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (-0.5f * Math.PI); - break; + case WEST: + xInputRot = 0.0f; + yInputRot = (float) (-0.5f * Math.PI); + zInputRot = 0.0f; + break; - case DOWN: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (0.5f * Math.PI); - break; + case UP: + xInputRot = (float) (-0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; - default: - break; + case DOWN: + xInputRot = (float) (0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + default: + break; + } + + switch (output) + { + case NORTH: + xOutputRot = 0.0f; + yOutputRot = (float) (0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case EAST: + xOutputRot = 0.0f; + yOutputRot = (float) (1.0f * Math.PI); + zOutputRot = 0.0f; + break; + + case SOUTH: + xOutputRot = 0.0f; + yOutputRot = (float) (-0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case WEST: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = 0.0f; + break; + + case UP: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (-0.5f * Math.PI); + break; + + case DOWN: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (0.5f * Math.PI); + break; + + default: + break; + } + + this.setRotation(inputFace, xInputRot, yInputRot, zInputRot); + this.setRotation(outputFace, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(inputSpacer1, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer2, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer3, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer4, xInputRot, yInputRot, zInputRot); + this.setRotation(outputPlug, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer1, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer2, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer3, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer4, xOutputRot, yOutputRot, zOutputRot); + + core.render(f5); + frame1.render(f5); + frame2.render(f5); + frame3.render(f5); + frame4.render(f5); + frame5.render(f5); + frame6.render(f5); + frame7.render(f5); + frame8.render(f5); + frame9.render(f5); + frame10.render(f5); + frame11.render(f5); + frame12.render(f5); + inputSpacer1.render(f5); + inputFace.render(f5); + inputSpacer2.render(f5); + inputSpacer3.render(f5); + inputSpacer4.render(f5); + outputFace.render(f5); + outputPlug.render(f5); + outputSpacer1.render(f5); + outputSpacer2.render(f5); + outputSpacer3.render(f5); + outputSpacer4.render(f5); } - this.setRotation(inputFace, xInputRot, yInputRot, zInputRot); - this.setRotation(outputFace, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(inputSpacer1, xInputRot, yInputRot, zInputRot); - this.setRotation(inputSpacer2, xInputRot, yInputRot, zInputRot); - this.setRotation(inputSpacer3, xInputRot, yInputRot, zInputRot); - this.setRotation(inputSpacer4, xInputRot, yInputRot, zInputRot); - this.setRotation(outputPlug, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(outputSpacer1, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(outputSpacer2, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(outputSpacer3, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(outputSpacer4, xOutputRot, yOutputRot, zOutputRot); - - core.render(f5); - frame1.render(f5); - frame2.render(f5); - frame3.render(f5); - frame4.render(f5); - frame5.render(f5); - frame6.render(f5); - frame7.render(f5); - frame8.render(f5); - frame9.render(f5); - frame10.render(f5); - frame11.render(f5); - frame12.render(f5); - inputSpacer1.render(f5); - inputFace.render(f5); - inputSpacer2.render(f5); - inputSpacer3.render(f5); - inputSpacer4.render(f5); - outputFace.render(f5); - outputPlug.render(f5); - outputSpacer1.render(f5); - outputSpacer2.render(f5); - outputSpacer3.render(f5); - outputSpacer4.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java index f56dca24..e83b4084 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java @@ -8,7 +8,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellEnhancementBlock extends ModelBase { - //fields + //fields ModelRenderer core; ModelRenderer frame1; ModelRenderer frame2; @@ -33,302 +33,302 @@ public class ModelSpellEnhancementBlock extends ModelBase ModelRenderer input3; ModelRenderer input4; ModelRenderer outputSecond; - - public ModelSpellEnhancementBlock() - { - textureWidth = 128; - textureHeight = 64; - - core = new ModelRenderer(this, 0, 0); - core.addBox(-3F, -3F, -3F, 6, 6, 6); - core.setRotationPoint(0F, 16F, 0F); - core.setTextureSize(128, 64); - core.mirror = true; - setRotation(core, 0F, 0F, 0F); - frame1 = new ModelRenderer(this, 0, 32); - frame1.addBox(-7F, 5F, -7F, 14, 2, 2); - frame1.setRotationPoint(0F, 16F, 0F); - frame1.setTextureSize(128, 64); - frame1.mirror = true; - setRotation(frame1, 0F, 0F, 0F); - frame2 = new ModelRenderer(this, 24, 19); - frame2.addBox(5F, -5F, -7F, 2, 10, 2); - frame2.setRotationPoint(0F, 16F, 0F); - frame2.setTextureSize(128, 64); - frame2.mirror = true; - setRotation(frame2, 0F, 0F, 0F); - frame3 = new ModelRenderer(this, 0, 19); - frame3.addBox(-7F, -5F, -7F, 2, 10, 2); - frame3.setRotationPoint(0F, 16F, 0F); - frame3.setTextureSize(128, 64); - frame3.mirror = true; - setRotation(frame3, 0F, 0F, 0F); - frame4 = new ModelRenderer(this, 0, 14); - frame4.addBox(-7F, -7F, -7F, 14, 2, 2); - frame4.setRotationPoint(0F, 16F, 0F); - frame4.setTextureSize(128, 64); - frame4.mirror = true; - setRotation(frame4, 0F, 0F, 0F); - frame5 = new ModelRenderer(this, 0, 57); - frame5.addBox(-7F, 5F, 5F, 14, 2, 2); - frame5.setRotationPoint(0F, 16F, 0F); - frame5.setTextureSize(128, 64); - frame5.mirror = true; - setRotation(frame5, 0F, 0F, 0F); - frame6 = new ModelRenderer(this, 0, 44); - frame6.addBox(5F, -5F, 5F, 2, 10, 2); - frame6.setRotationPoint(0F, 16F, 0F); - frame6.setTextureSize(128, 64); - frame6.mirror = true; - setRotation(frame6, 0F, 0F, 0F); - frame7 = new ModelRenderer(this, 24, 44); - frame7.addBox(-7F, -5F, 5F, 2, 10, 2); - frame7.setRotationPoint(0F, 16F, 0F); - frame7.setTextureSize(128, 64); - frame7.mirror = true; - setRotation(frame7, 0F, 0F, 0F); - frame8 = new ModelRenderer(this, 0, 39); - frame8.addBox(-7F, -7F, 5F, 14, 2, 2); - frame8.setRotationPoint(0F, 16F, 0F); - frame8.setTextureSize(128, 64); - frame8.mirror = true; - setRotation(frame8, 0F, 0F, 0F); - frame9 = new ModelRenderer(this, 66, 14); - frame9.addBox(5F, 5F, -5F, 2, 2, 10); - frame9.setRotationPoint(0F, 16F, 0F); - frame9.setTextureSize(128, 64); - frame9.mirror = true; - setRotation(frame9, 0F, 0F, 0F); - frame10 = new ModelRenderer(this, 40, 14); - frame10.addBox(-7F, 5F, -5F, 2, 2, 10); - frame10.setRotationPoint(0F, 16F, 0F); - frame10.setTextureSize(128, 64); - frame10.mirror = true; - setRotation(frame10, 0F, 0F, 0F); - frame11 = new ModelRenderer(this, 66, 0); - frame11.addBox(5F, -7F, -5F, 2, 2, 10); - frame11.setRotationPoint(0F, 16F, 0F); - frame11.setTextureSize(128, 64); - frame11.mirror = true; - setRotation(frame11, 0F, 0F, 0F); - frame12 = new ModelRenderer(this, 40, 0); - frame12.addBox(-7F, -7F, -5F, 2, 2, 10); - frame12.setRotationPoint(0F, 16F, 0F); - frame12.setTextureSize(128, 64); - frame12.mirror = true; - setRotation(frame12, 0F, 0F, 0F); - outputMain = new ModelRenderer(this, 78, 36); - outputMain.addBox(6F, -2F, -2F, 2, 4, 4); - outputMain.setRotationPoint(0F, 16F, 0F); - outputMain.setTextureSize(128, 64); - outputMain.mirror = true; - setRotation(outputMain, 0F, 0F, 0F); - inputMain = new ModelRenderer(this, 40, 36); - inputMain.addBox(-2F, -2F, -8F, 4, 4, 5); - inputMain.setRotationPoint(0F, 16F, 0F); - inputMain.setTextureSize(128, 64); - inputMain.mirror = true; - setRotation(inputMain, 0F, 0F, 0F); - output1 = new ModelRenderer(this, 80, 30); - output1.addBox(5F, -5F, -5F, 3, 2, 2); - output1.setRotationPoint(0F, 16F, 0F); - output1.setTextureSize(128, 64); - output1.mirror = true; - setRotation(output1, 0F, 0F, 0F); - output2 = new ModelRenderer(this, 80, 30); - output2.addBox(5F, -5F, 3F, 3, 2, 2); - output2.setRotationPoint(0F, 16F, 0F); - output2.setTextureSize(128, 64); - output2.mirror = true; - setRotation(output2, 0F, 0F, 0F); - output3 = new ModelRenderer(this, 80, 30); - output3.addBox(5F, 3F, -5F, 3, 2, 2); - output3.setRotationPoint(0F, 16F, 0F); - output3.setTextureSize(128, 64); - output3.mirror = true; - setRotation(output3, 0F, 0F, 0F); - output4 = new ModelRenderer(this, 80, 30); - output4.addBox(5F, 3F, 3F, 3, 2, 2); - output4.setRotationPoint(0F, 16F, 0F); - output4.setTextureSize(128, 64); - output4.mirror = true; - setRotation(output4, 0F, 0F, 0F); - input1 = new ModelRenderer(this, 40, 27); - input1.addBox(3F, -5F, -8F, 2, 2, 5); - input1.setRotationPoint(0F, 16F, 0F); - input1.setTextureSize(128, 64); - input1.mirror = true; - setRotation(input1, 0F, 0F, 0F); - input2 = new ModelRenderer(this, 40, 27); - input2.addBox(-5F, -5F, -8F, 2, 2, 5); - input2.setRotationPoint(0F, 16F, 0F); - input2.setTextureSize(128, 64); - input2.mirror = true; - setRotation(input2, 0F, 0F, 0F); - input3 = new ModelRenderer(this, 40, 27); - input3.addBox(3F, 3F, -8F, 2, 2, 5); - input3.setRotationPoint(0F, 16F, 0F); - input3.setTextureSize(128, 64); - input3.mirror = true; - setRotation(input3, 0F, 0F, 0F); - input4 = new ModelRenderer(this, 40, 27); - input4.addBox(-5F, 3F, -8F, 2, 2, 5); - input4.setRotationPoint(0F, 16F, 0F); - input4.setTextureSize(128, 64); - input4.mirror = true; - setRotation(input4, 0F, 0F, 0F); - outputSecond = new ModelRenderer(this, 78, 47); - outputSecond.addBox(4F, -3F, -3F, 1, 6, 6); - outputSecond.setRotationPoint(0F, 16F, 0F); - outputSecond.setTextureSize(128, 64); - outputSecond.mirror = true; - setRotation(outputSecond, 0F, 0F, 0F); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float xInputRot = 0.0f; - float yInputRot = 0.0f; - float zInputRot = 0.0f; - float xOutputRot = 0.0f; - float yOutputRot = 0.0f; - float zOutputRot = 0.0f; - switch (input) + public ModelSpellEnhancementBlock() { - case NORTH: - xInputRot = 0.0f; - yInputRot = 0.0f; - zInputRot = 0.0f; - break; + textureWidth = 128; + textureHeight = 64; - case EAST: - xInputRot = 0.0f; - yInputRot = (float) (0.5f * Math.PI); - zInputRot = 0.0f; - break; - - case SOUTH: - xInputRot = 0.0f; - yInputRot = (float) (1.0f * Math.PI); - zInputRot = 0.0f; - break; - - case WEST: - xInputRot = 0.0f; - yInputRot = (float) (-0.5f * Math.PI); - zInputRot = 0.0f; - break; - - case UP: - xInputRot = (float) (-0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; - - case DOWN: - xInputRot = (float) (0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; - - default: - break; + core = new ModelRenderer(this, 0, 0); + core.addBox(-3F, -3F, -3F, 6, 6, 6); + core.setRotationPoint(0F, 16F, 0F); + core.setTextureSize(128, 64); + core.mirror = true; + setRotation(core, 0F, 0F, 0F); + frame1 = new ModelRenderer(this, 0, 32); + frame1.addBox(-7F, 5F, -7F, 14, 2, 2); + frame1.setRotationPoint(0F, 16F, 0F); + frame1.setTextureSize(128, 64); + frame1.mirror = true; + setRotation(frame1, 0F, 0F, 0F); + frame2 = new ModelRenderer(this, 24, 19); + frame2.addBox(5F, -5F, -7F, 2, 10, 2); + frame2.setRotationPoint(0F, 16F, 0F); + frame2.setTextureSize(128, 64); + frame2.mirror = true; + setRotation(frame2, 0F, 0F, 0F); + frame3 = new ModelRenderer(this, 0, 19); + frame3.addBox(-7F, -5F, -7F, 2, 10, 2); + frame3.setRotationPoint(0F, 16F, 0F); + frame3.setTextureSize(128, 64); + frame3.mirror = true; + setRotation(frame3, 0F, 0F, 0F); + frame4 = new ModelRenderer(this, 0, 14); + frame4.addBox(-7F, -7F, -7F, 14, 2, 2); + frame4.setRotationPoint(0F, 16F, 0F); + frame4.setTextureSize(128, 64); + frame4.mirror = true; + setRotation(frame4, 0F, 0F, 0F); + frame5 = new ModelRenderer(this, 0, 57); + frame5.addBox(-7F, 5F, 5F, 14, 2, 2); + frame5.setRotationPoint(0F, 16F, 0F); + frame5.setTextureSize(128, 64); + frame5.mirror = true; + setRotation(frame5, 0F, 0F, 0F); + frame6 = new ModelRenderer(this, 0, 44); + frame6.addBox(5F, -5F, 5F, 2, 10, 2); + frame6.setRotationPoint(0F, 16F, 0F); + frame6.setTextureSize(128, 64); + frame6.mirror = true; + setRotation(frame6, 0F, 0F, 0F); + frame7 = new ModelRenderer(this, 24, 44); + frame7.addBox(-7F, -5F, 5F, 2, 10, 2); + frame7.setRotationPoint(0F, 16F, 0F); + frame7.setTextureSize(128, 64); + frame7.mirror = true; + setRotation(frame7, 0F, 0F, 0F); + frame8 = new ModelRenderer(this, 0, 39); + frame8.addBox(-7F, -7F, 5F, 14, 2, 2); + frame8.setRotationPoint(0F, 16F, 0F); + frame8.setTextureSize(128, 64); + frame8.mirror = true; + setRotation(frame8, 0F, 0F, 0F); + frame9 = new ModelRenderer(this, 66, 14); + frame9.addBox(5F, 5F, -5F, 2, 2, 10); + frame9.setRotationPoint(0F, 16F, 0F); + frame9.setTextureSize(128, 64); + frame9.mirror = true; + setRotation(frame9, 0F, 0F, 0F); + frame10 = new ModelRenderer(this, 40, 14); + frame10.addBox(-7F, 5F, -5F, 2, 2, 10); + frame10.setRotationPoint(0F, 16F, 0F); + frame10.setTextureSize(128, 64); + frame10.mirror = true; + setRotation(frame10, 0F, 0F, 0F); + frame11 = new ModelRenderer(this, 66, 0); + frame11.addBox(5F, -7F, -5F, 2, 2, 10); + frame11.setRotationPoint(0F, 16F, 0F); + frame11.setTextureSize(128, 64); + frame11.mirror = true; + setRotation(frame11, 0F, 0F, 0F); + frame12 = new ModelRenderer(this, 40, 0); + frame12.addBox(-7F, -7F, -5F, 2, 2, 10); + frame12.setRotationPoint(0F, 16F, 0F); + frame12.setTextureSize(128, 64); + frame12.mirror = true; + setRotation(frame12, 0F, 0F, 0F); + outputMain = new ModelRenderer(this, 78, 36); + outputMain.addBox(6F, -2F, -2F, 2, 4, 4); + outputMain.setRotationPoint(0F, 16F, 0F); + outputMain.setTextureSize(128, 64); + outputMain.mirror = true; + setRotation(outputMain, 0F, 0F, 0F); + inputMain = new ModelRenderer(this, 40, 36); + inputMain.addBox(-2F, -2F, -8F, 4, 4, 5); + inputMain.setRotationPoint(0F, 16F, 0F); + inputMain.setTextureSize(128, 64); + inputMain.mirror = true; + setRotation(inputMain, 0F, 0F, 0F); + output1 = new ModelRenderer(this, 80, 30); + output1.addBox(5F, -5F, -5F, 3, 2, 2); + output1.setRotationPoint(0F, 16F, 0F); + output1.setTextureSize(128, 64); + output1.mirror = true; + setRotation(output1, 0F, 0F, 0F); + output2 = new ModelRenderer(this, 80, 30); + output2.addBox(5F, -5F, 3F, 3, 2, 2); + output2.setRotationPoint(0F, 16F, 0F); + output2.setTextureSize(128, 64); + output2.mirror = true; + setRotation(output2, 0F, 0F, 0F); + output3 = new ModelRenderer(this, 80, 30); + output3.addBox(5F, 3F, -5F, 3, 2, 2); + output3.setRotationPoint(0F, 16F, 0F); + output3.setTextureSize(128, 64); + output3.mirror = true; + setRotation(output3, 0F, 0F, 0F); + output4 = new ModelRenderer(this, 80, 30); + output4.addBox(5F, 3F, 3F, 3, 2, 2); + output4.setRotationPoint(0F, 16F, 0F); + output4.setTextureSize(128, 64); + output4.mirror = true; + setRotation(output4, 0F, 0F, 0F); + input1 = new ModelRenderer(this, 40, 27); + input1.addBox(3F, -5F, -8F, 2, 2, 5); + input1.setRotationPoint(0F, 16F, 0F); + input1.setTextureSize(128, 64); + input1.mirror = true; + setRotation(input1, 0F, 0F, 0F); + input2 = new ModelRenderer(this, 40, 27); + input2.addBox(-5F, -5F, -8F, 2, 2, 5); + input2.setRotationPoint(0F, 16F, 0F); + input2.setTextureSize(128, 64); + input2.mirror = true; + setRotation(input2, 0F, 0F, 0F); + input3 = new ModelRenderer(this, 40, 27); + input3.addBox(3F, 3F, -8F, 2, 2, 5); + input3.setRotationPoint(0F, 16F, 0F); + input3.setTextureSize(128, 64); + input3.mirror = true; + setRotation(input3, 0F, 0F, 0F); + input4 = new ModelRenderer(this, 40, 27); + input4.addBox(-5F, 3F, -8F, 2, 2, 5); + input4.setRotationPoint(0F, 16F, 0F); + input4.setTextureSize(128, 64); + input4.mirror = true; + setRotation(input4, 0F, 0F, 0F); + outputSecond = new ModelRenderer(this, 78, 47); + outputSecond.addBox(4F, -3F, -3F, 1, 6, 6); + outputSecond.setRotationPoint(0F, 16F, 0F); + outputSecond.setTextureSize(128, 64); + outputSecond.mirror = true; + setRotation(outputSecond, 0F, 0F, 0F); } - switch (output) + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) { - case NORTH: - xOutputRot = 0.0f; - yOutputRot = (float) (0.5f * Math.PI); - zOutputRot = 0.0f; - break; + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); - case EAST: - xOutputRot = 0.0f; - yOutputRot = (float) (1.0f * Math.PI); - zOutputRot = 0.0f; - break; + float xInputRot = 0.0f; + float yInputRot = 0.0f; + float zInputRot = 0.0f; + float xOutputRot = 0.0f; + float yOutputRot = 0.0f; + float zOutputRot = 0.0f; - case SOUTH: - xOutputRot = 0.0f; - yOutputRot = (float) (-0.5f * Math.PI); - zOutputRot = 0.0f; - break; + switch (input) + { + case NORTH: + xInputRot = 0.0f; + yInputRot = 0.0f; + zInputRot = 0.0f; + break; - case WEST: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = 0.0f; - break; + case EAST: + xInputRot = 0.0f; + yInputRot = (float) (0.5f * Math.PI); + zInputRot = 0.0f; + break; - case UP: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (-0.5f * Math.PI); - break; + case SOUTH: + xInputRot = 0.0f; + yInputRot = (float) (1.0f * Math.PI); + zInputRot = 0.0f; + break; - case DOWN: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (0.5f * Math.PI); - break; + case WEST: + xInputRot = 0.0f; + yInputRot = (float) (-0.5f * Math.PI); + zInputRot = 0.0f; + break; - default: - break; + case UP: + xInputRot = (float) (-0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case DOWN: + xInputRot = (float) (0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + default: + break; + } + + switch (output) + { + case NORTH: + xOutputRot = 0.0f; + yOutputRot = (float) (0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case EAST: + xOutputRot = 0.0f; + yOutputRot = (float) (1.0f * Math.PI); + zOutputRot = 0.0f; + break; + + case SOUTH: + xOutputRot = 0.0f; + yOutputRot = (float) (-0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case WEST: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = 0.0f; + break; + + case UP: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (-0.5f * Math.PI); + break; + + case DOWN: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (0.5f * Math.PI); + break; + + default: + break; + } + + this.setRotation(inputMain, xInputRot, yInputRot, zInputRot); + this.setRotation(outputMain, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(input1, xInputRot, yInputRot, zInputRot); + this.setRotation(input2, xInputRot, yInputRot, zInputRot); + this.setRotation(input3, xInputRot, yInputRot, zInputRot); + this.setRotation(input4, xInputRot, yInputRot, zInputRot); + this.setRotation(outputSecond, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot); + + core.render(f5); + frame1.render(f5); + frame2.render(f5); + frame3.render(f5); + frame4.render(f5); + frame5.render(f5); + frame6.render(f5); + frame7.render(f5); + frame8.render(f5); + frame9.render(f5); + frame10.render(f5); + frame11.render(f5); + frame12.render(f5); + outputMain.render(f5); + inputMain.render(f5); + output1.render(f5); + output2.render(f5); + output3.render(f5); + output4.render(f5); + input1.render(f5); + input2.render(f5); + input3.render(f5); + input4.render(f5); + outputSecond.render(f5); } - this.setRotation(inputMain, xInputRot, yInputRot, zInputRot); - this.setRotation(outputMain, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(input1, xInputRot, yInputRot, zInputRot); - this.setRotation(input2, xInputRot, yInputRot, zInputRot); - this.setRotation(input3, xInputRot, yInputRot, zInputRot); - this.setRotation(input4, xInputRot, yInputRot, zInputRot); - this.setRotation(outputSecond, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot); - - core.render(f5); - frame1.render(f5); - frame2.render(f5); - frame3.render(f5); - frame4.render(f5); - frame5.render(f5); - frame6.render(f5); - frame7.render(f5); - frame8.render(f5); - frame9.render(f5); - frame10.render(f5); - frame11.render(f5); - frame12.render(f5); - outputMain.render(f5); - inputMain.render(f5); - output1.render(f5); - output2.render(f5); - output3.render(f5); - output4.render(f5); - input1.render(f5); - input2.render(f5); - input3.render(f5); - input4.render(f5); - outputSecond.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java index 3ceed7e9..a879889b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java @@ -7,7 +7,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellModifierBlock extends ModelBase { - //fields + //fields ModelRenderer core; ModelRenderer inputMain; ModelRenderer Shape2; @@ -27,277 +27,277 @@ public class ModelSpellModifierBlock extends ModelBase ModelRenderer output2; ModelRenderer output3; ModelRenderer output4; - - public ModelSpellModifierBlock() - { - textureWidth = 64; - textureHeight = 64; - - core = new ModelRenderer(this, 0, 0); - core.addBox(-3F, -3F, -3F, 6, 6, 6); - core.setRotationPoint(0F, 16F, 0F); - core.setTextureSize(64, 64); - core.mirror = true; - setRotation(core, 0F, 0F, 0F); - inputMain = new ModelRenderer(this, 25, 18); - inputMain.addBox(-2F, -2F, -8F, 4, 4, 1); - inputMain.setRotationPoint(0F, 16F, 0F); - inputMain.setTextureSize(64, 64); - inputMain.mirror = true; - setRotation(inputMain, 0F, 0F, 0F); - Shape2 = new ModelRenderer(this, 0, 13); - Shape2.addBox(-5F, -5F, -8F, 10, 2, 2); - Shape2.setRotationPoint(0F, 16F, 0F); - Shape2.setTextureSize(64, 64); - Shape2.mirror = true; - setRotation(Shape2, 0F, 0F, 0F); - Shape3 = new ModelRenderer(this, 0, 27); - Shape3.addBox(-5F, 3F, -8F, 10, 2, 2); - Shape3.setRotationPoint(0F, 16F, 0F); - Shape3.setTextureSize(64, 64); - Shape3.mirror = true; - setRotation(Shape3, 0F, 0F, 0F); - Shape4 = new ModelRenderer(this, 16, 18); - Shape4.addBox(3F, -3F, -8F, 2, 6, 2); - Shape4.setRotationPoint(0F, 16F, 0F); - Shape4.setTextureSize(64, 64); - Shape4.mirror = true; - setRotation(Shape4, 0F, 0F, 0F); - Shape5 = new ModelRenderer(this, 0, 18); - Shape5.addBox(-5F, -3F, -8F, 2, 6, 2); - Shape5.setRotationPoint(0F, 16F, 0F); - Shape5.setTextureSize(64, 64); - Shape5.mirror = true; - setRotation(Shape5, 0F, 0F, 0F); - Shape6 = new ModelRenderer(this, 0, 32); - Shape6.addBox(-1F, -6F, -7F, 2, 1, 5); - Shape6.setRotationPoint(0F, 16F, 0F); - Shape6.setTextureSize(64, 64); - Shape6.mirror = true; - setRotation(Shape6, 0F, 0F, 0F); - Shape7 = new ModelRenderer(this, 15, 32); - Shape7.addBox(-2F, -6F, -2F, 4, 1, 4); - Shape7.setRotationPoint(0F, 16F, 0F); - Shape7.setTextureSize(64, 64); - Shape7.mirror = true; - setRotation(Shape7, 0F, 0F, 0F); - Shape8 = new ModelRenderer(this, 15, 39); - Shape8.addBox(-2F, 5F, -2F, 4, 1, 4); - Shape8.setRotationPoint(0F, 16F, 0F); - Shape8.setTextureSize(64, 64); - Shape8.mirror = true; - setRotation(Shape8, 0F, 0F, 0F); - Shape9 = new ModelRenderer(this, 0, 39); - Shape9.addBox(-1F, 5F, -7F, 2, 1, 5); - Shape9.setRotationPoint(0F, 16F, 0F); - Shape9.setTextureSize(64, 64); - Shape9.mirror = true; - setRotation(Shape9, 0F, 0F, 0F); - outputMain = new ModelRenderer(this, 51, 23); - outputMain.addBox(7F, -2F, -2F, 1, 4, 4); - outputMain.setRotationPoint(0F, 16F, 0F); - outputMain.setTextureSize(64, 64); - outputMain.mirror = true; - setRotation(outputMain, 0F, 0F, 0F); - Shape11 = new ModelRenderer(this, 13, 46); - Shape11.addBox(5F, -2F, -2F, 1, 4, 4); - Shape11.setRotationPoint(0F, 16F, 0F); - Shape11.setTextureSize(64, 64); - Shape11.mirror = true; - setRotation(Shape11, 0F, 0F, 0F); - Shape12 = new ModelRenderer(this, 0, 46); - Shape12.addBox(5F, -1F, -7F, 1, 2, 5); - Shape12.setRotationPoint(0F, 16F, 0F); - Shape12.setTextureSize(64, 64); - Shape12.mirror = true; - setRotation(Shape12, 0F, 0F, 0F); - Shape13 = new ModelRenderer(this, 0, 56); - Shape13.addBox(-6F, -1F, -7F, 1, 2, 5); - Shape13.setRotationPoint(0F, 16F, 0F); - Shape13.setTextureSize(64, 64); - Shape13.mirror = true; - setRotation(Shape13, 0F, 0F, 0F); - Shape14 = new ModelRenderer(this, 13, 56); - Shape14.addBox(-6F, -2F, -2F, 1, 4, 4); - Shape14.setRotationPoint(0F, 16F, 0F); - Shape14.setTextureSize(64, 64); - Shape14.mirror = true; - setRotation(Shape14, 0F, 0F, 0F); - output1 = new ModelRenderer(this, 51, 18); - output1.addBox(5F, -5F, -5F, 3, 2, 2); - output1.setRotationPoint(0F, 16F, 0F); - output1.setTextureSize(64, 64); - output1.mirror = true; - setRotation(output1, 0F, 0F, 0F); - output2 = new ModelRenderer(this, 51, 18); - output2.addBox(5F, -5F, 3F, 3, 2, 2); - output2.setRotationPoint(0F, 16F, 0F); - output2.setTextureSize(64, 64); - output2.mirror = true; - setRotation(output2, 0F, 0F, 0F); - output3 = new ModelRenderer(this, 51, 18); - output3.addBox(5F, 3F, -5F, 3, 2, 2); - output3.setRotationPoint(0F, 16F, 0F); - output3.setTextureSize(64, 64); - output3.mirror = true; - setRotation(output3, 0F, 0F, 0F); - output4 = new ModelRenderer(this, 51, 18); - output4.addBox(5F, 3F, 3F, 3, 2, 2); - output4.setRotationPoint(0F, 16F, 0F); - output4.setTextureSize(64, 64); - output4.mirror = true; - setRotation(output4, 0F, 0F, 0F); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float xInputRot = 0.0f; - float yInputRot = 0.0f; - float zInputRot = 0.0f; - float xOutputRot = 0.0f; - float yOutputRot = 0.0f; - float zOutputRot = 0.0f; - - switch (input) + + public ModelSpellModifierBlock() { - case NORTH: - xInputRot = 0.0f; - yInputRot = 0.0f; - zInputRot = 0.0f; - break; + textureWidth = 64; + textureHeight = 64; - case EAST: - xInputRot = 0.0f; - yInputRot = (float) (0.5f * Math.PI); - zInputRot = 0.0f; - break; - - case SOUTH: - xInputRot = 0.0f; - yInputRot = (float) (1.0f * Math.PI); - zInputRot = 0.0f; - break; - - case WEST: - xInputRot = 0.0f; - yInputRot = (float) (-0.5f * Math.PI); - zInputRot = 0.0f; - break; - - case UP: - xInputRot = (float) (-0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; - - case DOWN: - xInputRot = (float) (0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; - - default: - break; + core = new ModelRenderer(this, 0, 0); + core.addBox(-3F, -3F, -3F, 6, 6, 6); + core.setRotationPoint(0F, 16F, 0F); + core.setTextureSize(64, 64); + core.mirror = true; + setRotation(core, 0F, 0F, 0F); + inputMain = new ModelRenderer(this, 25, 18); + inputMain.addBox(-2F, -2F, -8F, 4, 4, 1); + inputMain.setRotationPoint(0F, 16F, 0F); + inputMain.setTextureSize(64, 64); + inputMain.mirror = true; + setRotation(inputMain, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 13); + Shape2.addBox(-5F, -5F, -8F, 10, 2, 2); + Shape2.setRotationPoint(0F, 16F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 27); + Shape3.addBox(-5F, 3F, -8F, 10, 2, 2); + Shape3.setRotationPoint(0F, 16F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 16, 18); + Shape4.addBox(3F, -3F, -8F, 2, 6, 2); + Shape4.setRotationPoint(0F, 16F, 0F); + Shape4.setTextureSize(64, 64); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 18); + Shape5.addBox(-5F, -3F, -8F, 2, 6, 2); + Shape5.setRotationPoint(0F, 16F, 0F); + Shape5.setTextureSize(64, 64); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 0, 32); + Shape6.addBox(-1F, -6F, -7F, 2, 1, 5); + Shape6.setRotationPoint(0F, 16F, 0F); + Shape6.setTextureSize(64, 64); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 15, 32); + Shape7.addBox(-2F, -6F, -2F, 4, 1, 4); + Shape7.setRotationPoint(0F, 16F, 0F); + Shape7.setTextureSize(64, 64); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 15, 39); + Shape8.addBox(-2F, 5F, -2F, 4, 1, 4); + Shape8.setRotationPoint(0F, 16F, 0F); + Shape8.setTextureSize(64, 64); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + Shape9 = new ModelRenderer(this, 0, 39); + Shape9.addBox(-1F, 5F, -7F, 2, 1, 5); + Shape9.setRotationPoint(0F, 16F, 0F); + Shape9.setTextureSize(64, 64); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + outputMain = new ModelRenderer(this, 51, 23); + outputMain.addBox(7F, -2F, -2F, 1, 4, 4); + outputMain.setRotationPoint(0F, 16F, 0F); + outputMain.setTextureSize(64, 64); + outputMain.mirror = true; + setRotation(outputMain, 0F, 0F, 0F); + Shape11 = new ModelRenderer(this, 13, 46); + Shape11.addBox(5F, -2F, -2F, 1, 4, 4); + Shape11.setRotationPoint(0F, 16F, 0F); + Shape11.setTextureSize(64, 64); + Shape11.mirror = true; + setRotation(Shape11, 0F, 0F, 0F); + Shape12 = new ModelRenderer(this, 0, 46); + Shape12.addBox(5F, -1F, -7F, 1, 2, 5); + Shape12.setRotationPoint(0F, 16F, 0F); + Shape12.setTextureSize(64, 64); + Shape12.mirror = true; + setRotation(Shape12, 0F, 0F, 0F); + Shape13 = new ModelRenderer(this, 0, 56); + Shape13.addBox(-6F, -1F, -7F, 1, 2, 5); + Shape13.setRotationPoint(0F, 16F, 0F); + Shape13.setTextureSize(64, 64); + Shape13.mirror = true; + setRotation(Shape13, 0F, 0F, 0F); + Shape14 = new ModelRenderer(this, 13, 56); + Shape14.addBox(-6F, -2F, -2F, 1, 4, 4); + Shape14.setRotationPoint(0F, 16F, 0F); + Shape14.setTextureSize(64, 64); + Shape14.mirror = true; + setRotation(Shape14, 0F, 0F, 0F); + output1 = new ModelRenderer(this, 51, 18); + output1.addBox(5F, -5F, -5F, 3, 2, 2); + output1.setRotationPoint(0F, 16F, 0F); + output1.setTextureSize(64, 64); + output1.mirror = true; + setRotation(output1, 0F, 0F, 0F); + output2 = new ModelRenderer(this, 51, 18); + output2.addBox(5F, -5F, 3F, 3, 2, 2); + output2.setRotationPoint(0F, 16F, 0F); + output2.setTextureSize(64, 64); + output2.mirror = true; + setRotation(output2, 0F, 0F, 0F); + output3 = new ModelRenderer(this, 51, 18); + output3.addBox(5F, 3F, -5F, 3, 2, 2); + output3.setRotationPoint(0F, 16F, 0F); + output3.setTextureSize(64, 64); + output3.mirror = true; + setRotation(output3, 0F, 0F, 0F); + output4 = new ModelRenderer(this, 51, 18); + output4.addBox(5F, 3F, 3F, 3, 2, 2); + output4.setRotationPoint(0F, 16F, 0F); + output4.setTextureSize(64, 64); + output4.mirror = true; + setRotation(output4, 0F, 0F, 0F); } - switch (output) + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) { - case NORTH: - xOutputRot = 0.0f; - yOutputRot = (float) (0.5f * Math.PI); - zOutputRot = 0.0f; - break; + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); - case EAST: - xOutputRot = 0.0f; - yOutputRot = (float) (1.0f * Math.PI); - zOutputRot = 0.0f; - break; + float xInputRot = 0.0f; + float yInputRot = 0.0f; + float zInputRot = 0.0f; + float xOutputRot = 0.0f; + float yOutputRot = 0.0f; + float zOutputRot = 0.0f; - case SOUTH: - xOutputRot = 0.0f; - yOutputRot = (float) (-0.5f * Math.PI); - zOutputRot = 0.0f; - break; + switch (input) + { + case NORTH: + xInputRot = 0.0f; + yInputRot = 0.0f; + zInputRot = 0.0f; + break; - case WEST: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = 0.0f; - break; + case EAST: + xInputRot = 0.0f; + yInputRot = (float) (0.5f * Math.PI); + zInputRot = 0.0f; + break; - case UP: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (-0.5f * Math.PI); - break; + case SOUTH: + xInputRot = 0.0f; + yInputRot = (float) (1.0f * Math.PI); + zInputRot = 0.0f; + break; - case DOWN: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (0.5f * Math.PI); - break; + case WEST: + xInputRot = 0.0f; + yInputRot = (float) (-0.5f * Math.PI); + zInputRot = 0.0f; + break; - default: - break; + case UP: + xInputRot = (float) (-0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case DOWN: + xInputRot = (float) (0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + default: + break; + } + + switch (output) + { + case NORTH: + xOutputRot = 0.0f; + yOutputRot = (float) (0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case EAST: + xOutputRot = 0.0f; + yOutputRot = (float) (1.0f * Math.PI); + zOutputRot = 0.0f; + break; + + case SOUTH: + xOutputRot = 0.0f; + yOutputRot = (float) (-0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case WEST: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = 0.0f; + break; + + case UP: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (-0.5f * Math.PI); + break; + + case DOWN: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (0.5f * Math.PI); + break; + + default: + break; + } + + this.setRotation(inputMain, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape2, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape3, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape4, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape5, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape6, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape7, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape8, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape9, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape12, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape11, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape13, xInputRot, yInputRot, zInputRot); + this.setRotation(Shape14, xInputRot, yInputRot, zInputRot); + + this.setRotation(outputMain, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot); + + + core.render(f5); + inputMain.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + Shape7.render(f5); + Shape8.render(f5); + Shape9.render(f5); + outputMain.render(f5); + Shape11.render(f5); + Shape12.render(f5); + Shape13.render(f5); + Shape14.render(f5); + output1.render(f5); + output2.render(f5); + output3.render(f5); + output4.render(f5); } - - this.setRotation(inputMain, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape2, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape3, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape4, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape5, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape6, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape7, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape8, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape9, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape12, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape11, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape13, xInputRot, yInputRot, zInputRot); - this.setRotation(Shape14, xInputRot, yInputRot, zInputRot); - this.setRotation(outputMain, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot); + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } - - core.render(f5); - inputMain.render(f5); - Shape2.render(f5); - Shape3.render(f5); - Shape4.render(f5); - Shape5.render(f5); - Shape6.render(f5); - Shape7.render(f5); - Shape8.render(f5); - Shape9.render(f5); - outputMain.render(f5); - Shape11.render(f5); - Shape12.render(f5); - Shape13.render(f5); - Shape14.render(f5); - output1.render(f5); - output2.render(f5); - output3.render(f5); - output4.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java index da48b87d..9fd4d551 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java @@ -7,7 +7,6 @@ package WayofTime.alchemicalWizardry.common.renderer.model; //- ZeuX - import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; @@ -15,220 +14,220 @@ import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellParadigmBlock extends ModelBase { -//fields - ModelRenderer core; - ModelRenderer outputMain; - ModelRenderer output1; - ModelRenderer output2; - ModelRenderer output3; - ModelRenderer output4; - ModelRenderer Shape1; - ModelRenderer Shape2; - ModelRenderer Shape3; - ModelRenderer Shape4; - ModelRenderer Shape5; + //fields + ModelRenderer core; + ModelRenderer outputMain; + ModelRenderer output1; + ModelRenderer output2; + ModelRenderer output3; + ModelRenderer output4; + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; -public ModelSpellParadigmBlock() -{ - textureWidth = 64; - textureHeight = 64; - - core = new ModelRenderer(this, 0, 0); - core.addBox(-3F, -3F, -3F, 6, 6, 6); - core.setRotationPoint(0F, 16F, 0F); - core.setTextureSize(64, 64); - core.mirror = true; - setRotation(core, 0F, 0F, 0F); - outputMain = new ModelRenderer(this, 0, 13); - outputMain.addBox(6F, -2F, -2F, 2, 4, 4); - outputMain.setRotationPoint(0F, 16F, 0F); - outputMain.setTextureSize(64, 64); - outputMain.mirror = true; - setRotation(outputMain, 0F, 0F, 0F); - output1 = new ModelRenderer(this, 0, 22); - output1.addBox(5F, -5F, -5F, 3, 2, 2); - output1.setRotationPoint(0F, 16F, 0F); - output1.setTextureSize(64, 64); - output1.mirror = true; - setRotation(output1, 0F, 0F, 0F); - output2 = new ModelRenderer(this, 0, 22); - output2.addBox(5F, -5F, 3F, 3, 2, 2); - output2.setRotationPoint(0F, 16F, 0F); - output2.setTextureSize(64, 64); - output2.mirror = true; - setRotation(output2, 0F, 0F, 0F); - output3 = new ModelRenderer(this, 0, 22); - output3.addBox(5F, 3F, -5F, 3, 2, 2); - output3.setRotationPoint(0F, 16F, 0F); - output3.setTextureSize(64, 64); - output3.mirror = true; - setRotation(output3, 0F, 0F, 0F); - output4 = new ModelRenderer(this, 0, 22); - output4.addBox(5F, 3F, 3F, 3, 2, 2); - output4.setRotationPoint(0F, 16F, 0F); - output4.setTextureSize(64, 64); - output4.mirror = true; - setRotation(output4, 0F, 0F, 0F); - Shape1 = new ModelRenderer(this, 0, 28); - Shape1.addBox(-5F, -5F, -1F, 10, 1, 2); - Shape1.setRotationPoint(0F, 16F, 0F); - Shape1.setTextureSize(64, 64); - Shape1.mirror = true; - setRotation(Shape1, 0F, 0F, 0F); - Shape2 = new ModelRenderer(this, 25, 28); - Shape2.addBox(-5F, -4F, -4F, 1, 8, 8); - Shape2.setRotationPoint(0F, 16F, 0F); - Shape2.setTextureSize(64, 64); - Shape2.mirror = true; - setRotation(Shape2, 0F, 0F, 0F); - Shape3 = new ModelRenderer(this, 0, 33); - Shape3.addBox(-5F, 4F, -1F, 10, 1, 2); - Shape3.setRotationPoint(0F, 16F, 0F); - Shape3.setTextureSize(64, 64); - Shape3.mirror = true; - setRotation(Shape3, 0F, 0F, 0F); - Shape4 = new ModelRenderer(this, 0, 38); - Shape4.addBox(-5F, -1F, -5F, 10, 2, 1); - Shape4.setRotationPoint(0F, 16F, 0F); - Shape4.setTextureSize(64, 64); - Shape4.mirror = true; - setRotation(Shape4, 0F, 0F, 0F); - Shape5 = new ModelRenderer(this, 0, 43); - Shape5.addBox(-5F, -1F, 4F, 10, 2, 1); - Shape5.setRotationPoint(0F, 16F, 0F); - Shape5.setTextureSize(64, 64); - Shape5.mirror = true; - setRotation(Shape5, 0F, 0F, 0F); -} + public ModelSpellParadigmBlock() + { + textureWidth = 64; + textureHeight = 64; -public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) -{ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float xInputRot = 0.0f; - float yInputRot = 0.0f; - float zInputRot = 0.0f; - float xOutputRot = 0.0f; - float yOutputRot = 0.0f; - float zOutputRot = 0.0f; - - switch (input) - { - case NORTH: - xInputRot = 0.0f; - yInputRot = 0.0f; - zInputRot = 0.0f; - break; + core = new ModelRenderer(this, 0, 0); + core.addBox(-3F, -3F, -3F, 6, 6, 6); + core.setRotationPoint(0F, 16F, 0F); + core.setTextureSize(64, 64); + core.mirror = true; + setRotation(core, 0F, 0F, 0F); + outputMain = new ModelRenderer(this, 0, 13); + outputMain.addBox(6F, -2F, -2F, 2, 4, 4); + outputMain.setRotationPoint(0F, 16F, 0F); + outputMain.setTextureSize(64, 64); + outputMain.mirror = true; + setRotation(outputMain, 0F, 0F, 0F); + output1 = new ModelRenderer(this, 0, 22); + output1.addBox(5F, -5F, -5F, 3, 2, 2); + output1.setRotationPoint(0F, 16F, 0F); + output1.setTextureSize(64, 64); + output1.mirror = true; + setRotation(output1, 0F, 0F, 0F); + output2 = new ModelRenderer(this, 0, 22); + output2.addBox(5F, -5F, 3F, 3, 2, 2); + output2.setRotationPoint(0F, 16F, 0F); + output2.setTextureSize(64, 64); + output2.mirror = true; + setRotation(output2, 0F, 0F, 0F); + output3 = new ModelRenderer(this, 0, 22); + output3.addBox(5F, 3F, -5F, 3, 2, 2); + output3.setRotationPoint(0F, 16F, 0F); + output3.setTextureSize(64, 64); + output3.mirror = true; + setRotation(output3, 0F, 0F, 0F); + output4 = new ModelRenderer(this, 0, 22); + output4.addBox(5F, 3F, 3F, 3, 2, 2); + output4.setRotationPoint(0F, 16F, 0F); + output4.setTextureSize(64, 64); + output4.mirror = true; + setRotation(output4, 0F, 0F, 0F); + Shape1 = new ModelRenderer(this, 0, 28); + Shape1.addBox(-5F, -5F, -1F, 10, 1, 2); + Shape1.setRotationPoint(0F, 16F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 25, 28); + Shape2.addBox(-5F, -4F, -4F, 1, 8, 8); + Shape2.setRotationPoint(0F, 16F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 33); + Shape3.addBox(-5F, 4F, -1F, 10, 1, 2); + Shape3.setRotationPoint(0F, 16F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 38); + Shape4.addBox(-5F, -1F, -5F, 10, 2, 1); + Shape4.setRotationPoint(0F, 16F, 0F); + Shape4.setTextureSize(64, 64); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 43); + Shape5.addBox(-5F, -1F, 4F, 10, 2, 1); + Shape5.setRotationPoint(0F, 16F, 0F); + Shape5.setTextureSize(64, 64); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + } - case EAST: - xInputRot = 0.0f; - yInputRot = (float) (0.5f * Math.PI); - zInputRot = 0.0f; - break; + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float xInputRot = 0.0f; + float yInputRot = 0.0f; + float zInputRot = 0.0f; + float xOutputRot = 0.0f; + float yOutputRot = 0.0f; + float zOutputRot = 0.0f; - case SOUTH: - xInputRot = 0.0f; - yInputRot = (float) (1.0f * Math.PI); - zInputRot = 0.0f; - break; + switch (input) + { + case NORTH: + xInputRot = 0.0f; + yInputRot = 0.0f; + zInputRot = 0.0f; + break; - case WEST: - xInputRot = 0.0f; - yInputRot = (float) (-0.5f * Math.PI); - zInputRot = 0.0f; - break; + case EAST: + xInputRot = 0.0f; + yInputRot = (float) (0.5f * Math.PI); + zInputRot = 0.0f; + break; - case UP: - xInputRot = (float) (-0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; + case SOUTH: + xInputRot = 0.0f; + yInputRot = (float) (1.0f * Math.PI); + zInputRot = 0.0f; + break; - case DOWN: - xInputRot = (float) (0.5f * Math.PI); - yInputRot = 0.0f; - zInputRot = 0.0f; - break; + case WEST: + xInputRot = 0.0f; + yInputRot = (float) (-0.5f * Math.PI); + zInputRot = 0.0f; + break; - default: - break; - } + case UP: + xInputRot = (float) (-0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; - switch (output) - { - case NORTH: - xOutputRot = 0.0f; - yOutputRot = (float) (0.5f * Math.PI); - zOutputRot = 0.0f; - break; + case DOWN: + xInputRot = (float) (0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; - case EAST: - xOutputRot = 0.0f; - yOutputRot = (float) (1.0f * Math.PI); - zOutputRot = 0.0f; - break; + default: + break; + } - case SOUTH: - xOutputRot = 0.0f; - yOutputRot = (float) (-0.5f * Math.PI); - zOutputRot = 0.0f; - break; + switch (output) + { + case NORTH: + xOutputRot = 0.0f; + yOutputRot = (float) (0.5f * Math.PI); + zOutputRot = 0.0f; + break; - case WEST: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = 0.0f; - break; + case EAST: + xOutputRot = 0.0f; + yOutputRot = (float) (1.0f * Math.PI); + zOutputRot = 0.0f; + break; - case UP: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (-0.5f * Math.PI); - break; + case SOUTH: + xOutputRot = 0.0f; + yOutputRot = (float) (-0.5f * Math.PI); + zOutputRot = 0.0f; + break; - case DOWN: - xOutputRot = 0.0f; - yOutputRot = 0.0f; - zOutputRot = (float) (0.5f * Math.PI); - break; + case WEST: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = 0.0f; + break; - default: - break; - } - - this.setRotation(outputMain, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(Shape1, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(Shape2, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(Shape3, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(Shape4, xOutputRot, yOutputRot, zOutputRot); - this.setRotation(Shape5, xOutputRot, yOutputRot, zOutputRot); - core.render(f5); - outputMain.render(f5); - output1.render(f5); - output2.render(f5); - output3.render(f5); - output4.render(f5); - Shape1.render(f5); - Shape2.render(f5); - Shape3.render(f5); - Shape4.render(f5); - Shape5.render(f5); -} + case UP: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (-0.5f * Math.PI); + break; -private void setRotation(ModelRenderer model, float x, float y, float z) -{ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; -} + case DOWN: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (0.5f * Math.PI); + break; -public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) -{ - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); -} + default: + break; + } + + this.setRotation(outputMain, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(Shape1, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(Shape2, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(Shape3, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(Shape4, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(Shape5, xOutputRot, yOutputRot, zOutputRot); + core.render(f5); + outputMain.render(f5); + output1.render(f5); + output2.render(f5); + output3.render(f5); + output4.render(f5); + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java index 57df9912..fce17323 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java @@ -11,7 +11,7 @@ import org.lwjgl.opengl.GL12; public class RenderEnergyBazookaMainProjectile extends Render { public ModelBase model = new ModelEnergyBazookaMainProjectile(); - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/EnergyBazookaMainProjectile.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/EnergyBazookaMainProjectile.png"); private float scale = 1.0f; @Override @@ -25,7 +25,6 @@ public class RenderEnergyBazookaMainProjectile extends Render GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1, 0.0F, 1.0F, 0.0F); GL11.glRotatef(180.0f - entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 1.0F, 0.0F, 0.0f); model.render(entity, 0, (float) d0, (float) d1, (float) d2, f, f1); - //GL11.glRotatef(entity.getRotationYawHead(), 0.0F, 1.0F, 0.0F); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java index 5e988929..d0e067e1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java @@ -1,25 +1,16 @@ package WayofTime.alchemicalWizardry.common.renderer.projectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.entity.IProjectile; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile; -import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - @SideOnly(Side.CLIENT) public class RenderEnergyBlastProjectile extends Render { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java index c39dcb11..95c6bd49 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java @@ -11,7 +11,7 @@ import org.lwjgl.opengl.GL12; public class RenderMeteor extends Render { public ModelBase model = new ModelMeteor(); - private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/Meteor.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/Meteor.png"); private float scale = 1.0f; @Override @@ -25,7 +25,6 @@ public class RenderMeteor extends Render GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1, 0.0F, 1.0F, 0.0F); GL11.glRotatef(180.0f - entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 1.0F, 0.0F, 0.0f); model.render(entity, 0, (float) d0, (float) d1, (float) d2, f, f1); - //GL11.glRotatef(entity.getRotationYawHead(), 0.0F, 1.0F, 0.0F); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } @@ -33,7 +32,6 @@ public class RenderMeteor extends Render @Override protected ResourceLocation getEntityTexture(Entity entity) { - // TODO Auto-generated method stub return field_110833_a; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java index ed0e7130..865a5f14 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java @@ -1,34 +1,27 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityAgeable; -import net.minecraft.entity.passive.EntityAnimal; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectAnimalGrowth extends RitualEffect { - public static final int breedingCost = 50; - public static final int reductusDrain = 1; - public static final int virtusDrain = 10; - + public static final int breedingCost = 50; + public static final int reductusDrain = 1; + public static final int virtusDrain = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -46,7 +39,7 @@ public class RitualEffectAnimalGrowth extends RitualEffect } double range = 2; - + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 3), (double) (z + 1)).expand(range, 0, range); List list = world.getEntitiesWithinAABB(EntityAgeable.class, axisalignedbb); @@ -60,74 +53,74 @@ public class RitualEffectAnimalGrowth extends RitualEffect { boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); - for(EntityAgeable entity : list) + for (EntityAgeable entity : list) { if (entity.getGrowingAge() < 0) { entity.addGrowth(5); entityCount++; - }else + } else { - hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); - if(hasReductus && entity instanceof EntityAnimal && entity.getGrowingAge() > 0) - { - EntityAnimal animal = (EntityAnimal)entity; - entity.setGrowingAge(Math.max(0, animal.getGrowingAge() - 20*2)); - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - entityCount++; - } - } + hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); + if (hasReductus && entity instanceof EntityAnimal && entity.getGrowingAge() > 0) + { + EntityAnimal animal = (EntityAnimal) entity; + entity.setGrowingAge(Math.max(0, animal.getGrowingAge() - 20 * 2)); + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + entityCount++; + } + } } SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * entityCount); } - + boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); - - if(hasVirtus && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, breedingCost)) + + if (hasVirtus && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, breedingCost)) { - List animalList = world.getEntitiesWithinAABB(EntityAnimal.class, axisalignedbb); - TileEntity tile = world.getTileEntity(x, y+1, z); - IInventory inventory = null; - if(tile instanceof IInventory) - { - inventory = (IInventory)tile; - }else - { - tile = world.getTileEntity(x, y-1, z); - if(tile instanceof IInventory) - { - inventory = (IInventory)tile; - } - } - - if(inventory != null) - { - for(EntityAnimal entityAnimal : animalList) - { - if(entityAnimal.isInLove() || entityAnimal.isChild() || entityAnimal.getGrowingAge() > 0) - { - continue; - } - - hasVirtus = hasVirtus && this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); - boolean hasLP = SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, breedingCost); - - for(int i=0; i animalList = world.getEntitiesWithinAABB(EntityAnimal.class, axisalignedbb); + TileEntity tile = world.getTileEntity(x, y + 1, z); + IInventory inventory = null; + if (tile instanceof IInventory) + { + inventory = (IInventory) tile; + } else + { + tile = world.getTileEntity(x, y - 1, z); + if (tile instanceof IInventory) + { + inventory = (IInventory) tile; + } + } + + if (inventory != null) + { + for (EntityAnimal entityAnimal : animalList) + { + if (entityAnimal.isInLove() || entityAnimal.isChild() || entityAnimal.getGrowingAge() > 0) + { + continue; + } + + hasVirtus = hasVirtus && this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); + boolean hasLP = SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, breedingCost); + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack stack = inventory.getStackInSlot(i); + + if (stack != null && entityAnimal.isBreedingItem(stack)) + { + inventory.decrStackSize(i, 1); + entityAnimal.func_146082_f(null); + this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); + SoulNetworkHandler.syphonFromNetwork(owner, breedingCost); + break; + } + } + } + } } } @@ -139,9 +132,9 @@ public class RitualEffectAnimalGrowth extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList animalGrowthRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList animalGrowthRitual = new ArrayList(); animalGrowthRitual.add(new RitualComponent(0, 0, 2, RitualComponent.DUSK)); animalGrowthRitual.add(new RitualComponent(2, 0, 0, RitualComponent.DUSK)); animalGrowthRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK)); @@ -159,5 +152,5 @@ public class RitualEffectAnimalGrowth extends RitualEffect animalGrowthRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR)); animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); return animalGrowthRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java index 58977230..f222840d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java @@ -1,18 +1,18 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectApiaryOverclock extends RitualEffect { @@ -35,7 +35,7 @@ public class RitualEffectApiaryOverclock extends RitualEffect int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - + if (currentEssence < this.getCostPerRefresh()) { EntityPlayer entityOwner = SpellHelper.getPlayerForUsername(owner); @@ -46,55 +46,27 @@ public class RitualEffectApiaryOverclock extends RitualEffect } entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); - } else - { -// TileEntity tile = world.getTileEntity(x, y+1, z); -// -// try{ -// if(tile instanceof IBeeHousing && tile.getClass().getName().contains("Apiary")) -// { -// for (int i = 0; i < 10; i++) -// { -// PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(x, y+1, z, (short) 3)); -// } -// -// for(int i=0; i<9; i++) -// { -// tile.updateEntity(); -// } -// -// data.currentEssence = currentEssence - this.getCostPerRefresh(); -// data.markDirty(); -// } -// }catch (Exception e) -// { -// -// } - - } - } @Override public int getCostPerRefresh() { - // TODO Auto-generated method stub return 10; } @Override - public List getRitualComponentList() - { - ArrayList apiaryRitual = new ArrayList(); - apiaryRitual.add(new RitualComponent(1,0,0, RitualComponent.DUSK)); - apiaryRitual.add(new RitualComponent(1,0,1, RitualComponent.DUSK)); - apiaryRitual.add(new RitualComponent(1,0,-1, RitualComponent.DUSK)); - apiaryRitual.add(new RitualComponent(-1,0,-1, RitualComponent.DUSK)); - apiaryRitual.add(new RitualComponent(-1,0,1, RitualComponent.DUSK)); - apiaryRitual.add(new RitualComponent(-1,0,0, RitualComponent.DUSK)); - apiaryRitual.add(new RitualComponent(0,0,-1, RitualComponent.DUSK)); - apiaryRitual.add(new RitualComponent(0,0,1, RitualComponent.DUSK)); + public List getRitualComponentList() + { + ArrayList apiaryRitual = new ArrayList(); + apiaryRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(0, 0, -1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); return apiaryRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java index 29d8cd4a..11c9a419 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java @@ -1,34 +1,28 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectAutoAlchemy extends RitualEffect { - public static final boolean fillToOne = true; - - public static final int potentiaDrain = 2; - + public static final boolean fillToOne = true; + + public static final int potentiaDrain = 2; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -40,358 +34,355 @@ public class RitualEffectAutoAlchemy extends RitualEffect int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - if (currentEssence < this.getCostPerRefresh()*6) + if (currentEssence < this.getCostPerRefresh() * 6) { SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); - + boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); + int flag = 0; - - TileEntity topEntity = world.getTileEntity(x, y+1, z); - if(!(topEntity instanceof TEAltar)) + + TileEntity topEntity = world.getTileEntity(x, y + 1, z); + if (!(topEntity instanceof TEAltar)) { - return; + return; } - - TEAltar tileAltar = (TEAltar)topEntity; + + TEAltar tileAltar = (TEAltar) topEntity; ItemStack targetStack = tileAltar.getStackInSlot(0); - if(targetStack == null) + if (targetStack == null) { - return; + return; } - + ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(targetStack); - if(recipe!=null) + if (recipe != null) { - TEWritingTable alchemyEntity; - IInventory outputInv = null; - IInventory inputInv1 = null; - IInventory inputInv2 = null; - - TileEntity northEntity = world.getTileEntity(x,y,z-1); - TileEntity southEntity = world.getTileEntity(x,y,z+1); - TileEntity eastEntity = world.getTileEntity(x+1,y,z); - TileEntity westEntity = world.getTileEntity(x-1,y,z); - - if(northEntity instanceof TEWritingTable) - { - alchemyEntity = (TEWritingTable)northEntity; - if(southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable)) - { - outputInv = (IInventory)southEntity; - } - if(eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable)) - { - inputInv1 = (IInventory)eastEntity; - } - if(westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable)) - { - inputInv2 = (IInventory)westEntity; - } - }else if(southEntity instanceof TEWritingTable) - { - alchemyEntity = (TEWritingTable)southEntity; - if(northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable)) - { - outputInv = (IInventory)northEntity; - } - if(eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable)) - { - inputInv1 = (IInventory)eastEntity; - } - if(westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable)) - { - inputInv2 = (IInventory)westEntity; - } - }else if(eastEntity instanceof TEWritingTable) - { - alchemyEntity = (TEWritingTable)eastEntity; - if(westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable)) - { - outputInv = (IInventory)westEntity; - } - if(northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable)) - { - inputInv1 = (IInventory)northEntity; - } - if(southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable)) - { - inputInv2 = (IInventory)southEntity; - } - }else if(westEntity instanceof TEWritingTable) - { - alchemyEntity = (TEWritingTable)westEntity; - if(eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable)) - { - outputInv = (IInventory)eastEntity; - } - if(northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable)) - { - inputInv1 = (IInventory)northEntity; - } - if(southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable)) - { - inputInv2 = (IInventory)southEntity; - } - }else - { - return; - } - - if(alchemyEntity != null && hasPotentia) - { - alchemyEntity.setAccelerationTime(5); - if(alchemyEntity.isWorking()) - { - this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); - } - } - - if(outputInv!=null) - { - ItemStack outputStack = alchemyEntity.getStackInSlot(6); - if(outputStack!=null) - { - for(int i=0; i=(fillToOne ? 1 : alchStack.getMaxStackSize()))) - { - continue; - } - - for(int j=0;j=(fillToOne ? 1 : alchStack.getMaxStackSize()))) - { - continue; - } - - for(int j=0;j= (fillToOne ? 1 : alchStack.getMaxStackSize()))) + { + continue; + } + + for (int j = 0; j < inputInv1.getSizeInventory(); j++) + { + ItemStack curItem = inputInv1.getStackInSlot(j); + if (curItem == null) + { + continue; + } + if (areItemStacksEqualWithWildcard(recItem, curItem)) + { + if (alchStack == null) + { + ItemStack copyStack = recItem.copy(); + copyStack.stackSize = 1; + alchemyEntity.setInventorySlotContents(i + 1, copyStack); + + curItem.stackSize--; + if (curItem.stackSize <= 0) + { + inputInv1.setInventorySlotContents(j, null); + } else + { + inputInv1.setInventorySlotContents(j, curItem); + } + + flag++; + break; + + } else + { + alchStack.stackSize++; + alchemyEntity.setInventorySlotContents(i + 1, alchStack); + + curItem.stackSize--; + if (curItem.stackSize <= 0) + { + inputInv1.setInventorySlotContents(j, null); + } else + { + inputInv1.setInventorySlotContents(j, curItem); + } + + flag++; + break; + } + } + } + } + } + if (flag == 0 && inputInv2 != null) + { + for (int i = 0; i < recipe.length; i++) + { + ItemStack recItem = recipe[i]; + if (recItem == null) + { + continue; + } + ItemStack alchStack = alchemyEntity.getStackInSlot(i + 1); + if (alchStack != null && ((!areItemStacksEqualWithWildcard(recItem, alchStack)) || alchStack.stackSize >= (fillToOne ? 1 : alchStack.getMaxStackSize()))) + { + continue; + } + + for (int j = 0; j < inputInv2.getSizeInventory(); j++) + { + ItemStack curItem = inputInv2.getStackInSlot(j); + if (curItem == null) + { + continue; + } + if (areItemStacksEqualWithWildcard(recItem, curItem)) + { + if (alchStack == null) + { + ItemStack copyStack = recItem.copy(); + copyStack.stackSize = 1; + alchemyEntity.setInventorySlotContents(i + 1, copyStack); + + curItem.stackSize--; + if (curItem.stackSize <= 0) + { + inputInv2.setInventorySlotContents(j, null); + } else + { + inputInv2.setInventorySlotContents(j, curItem); + } + + flag++; + break; + + } else + { + alchStack.stackSize++; + alchemyEntity.setInventorySlotContents(i + 1, alchStack); + + curItem.stackSize--; + if (curItem.stackSize <= 0) + { + inputInv2.setInventorySlotContents(j, null); + } else + { + inputInv2.setInventorySlotContents(j, curItem); + } + + flag++; + break; + } + } + } + } + } + } } - if (flag>0) + if (flag > 0) { - world.markBlockForUpdate(x, y, z+1); - world.markBlockForUpdate(x, y, z-1); - world.markBlockForUpdate(x+1, y, z); - world.markBlockForUpdate(x-1, y, z); - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*flag); + world.markBlockForUpdate(x, y, z + 1); + world.markBlockForUpdate(x, y, z - 1); + world.markBlockForUpdate(x + 1, y, z); + world.markBlockForUpdate(x - 1, y, z); + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * flag); } } } @@ -402,31 +393,31 @@ public class RitualEffectAutoAlchemy extends RitualEffect return 10; } - @Override - public List getRitualComponentList() - { - ArrayList autoAlchemyRitual = new ArrayList(); - autoAlchemyRitual.add(new RitualComponent(1,0,1, RitualComponent.DUSK)); - autoAlchemyRitual.add(new RitualComponent(1,0,-1, RitualComponent.DUSK)); - autoAlchemyRitual.add(new RitualComponent(-1,0,-1, RitualComponent.DUSK)); - autoAlchemyRitual.add(new RitualComponent(-1,0,1, RitualComponent.DUSK)); - autoAlchemyRitual.add(new RitualComponent(2,0,2, RitualComponent.WATER)); - autoAlchemyRitual.add(new RitualComponent(2,0,-2, RitualComponent.WATER)); - autoAlchemyRitual.add(new RitualComponent(-2,0,-2, RitualComponent.WATER)); - autoAlchemyRitual.add(new RitualComponent(-2,0,2, RitualComponent.WATER)); - autoAlchemyRitual.add(new RitualComponent(-3,0,-2, RitualComponent.FIRE)); - autoAlchemyRitual.add(new RitualComponent(-2,0,-3, RitualComponent.FIRE)); - autoAlchemyRitual.add(new RitualComponent(-3,0,2, RitualComponent.FIRE)); - autoAlchemyRitual.add(new RitualComponent(-2,0,3, RitualComponent.FIRE)); - autoAlchemyRitual.add(new RitualComponent(3,0,-2, RitualComponent.FIRE)); - autoAlchemyRitual.add(new RitualComponent(2,0,-3, RitualComponent.FIRE)); - autoAlchemyRitual.add(new RitualComponent(3,0,2, RitualComponent.FIRE)); - autoAlchemyRitual.add(new RitualComponent(2,0,3, RitualComponent.FIRE)); + @Override + public List getRitualComponentList() + { + ArrayList autoAlchemyRitual = new ArrayList(); + autoAlchemyRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); + autoAlchemyRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); + autoAlchemyRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); + autoAlchemyRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); + autoAlchemyRitual.add(new RitualComponent(2, 0, 2, RitualComponent.WATER)); + autoAlchemyRitual.add(new RitualComponent(2, 0, -2, RitualComponent.WATER)); + autoAlchemyRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.WATER)); + autoAlchemyRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.WATER)); + autoAlchemyRitual.add(new RitualComponent(-3, 0, -2, RitualComponent.FIRE)); + autoAlchemyRitual.add(new RitualComponent(-2, 0, -3, RitualComponent.FIRE)); + autoAlchemyRitual.add(new RitualComponent(-3, 0, 2, RitualComponent.FIRE)); + autoAlchemyRitual.add(new RitualComponent(-2, 0, 3, RitualComponent.FIRE)); + autoAlchemyRitual.add(new RitualComponent(3, 0, -2, RitualComponent.FIRE)); + autoAlchemyRitual.add(new RitualComponent(2, 0, -3, RitualComponent.FIRE)); + autoAlchemyRitual.add(new RitualComponent(3, 0, 2, RitualComponent.FIRE)); + autoAlchemyRitual.add(new RitualComponent(2, 0, 3, RitualComponent.FIRE)); return autoAlchemyRitual; - } - - public boolean areItemStacksEqualWithWildcard(ItemStack recipeStack, ItemStack comparedStack) - { - return recipeStack.isItemEqual(comparedStack) || (recipeStack.getItemDamage() == OreDictionary.WILDCARD_VALUE && recipeStack.getItem() == comparedStack.getItem()); - } + } + + public boolean areItemStacksEqualWithWildcard(ItemStack recipeStack, ItemStack comparedStack) + { + return recipeStack.isItemEqual(comparedStack) || (recipeStack.getItemDamage() == OreDictionary.WILDCARD_VALUE && recipeStack.getItem() == comparedStack.getItem()); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java index bf3da6b7..399ee3e5 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java @@ -1,8 +1,12 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.ModBlocks; +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.common.tileEntity.TEPlinth; import net.minecraft.block.Block; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; @@ -13,19 +17,13 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; -import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectBiomeChanger extends RitualEffect { @@ -52,8 +50,8 @@ public class RitualEffectBiomeChanger extends RitualEffect } int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - - + + int range = 10; if (currentEssence < this.getCostPerRefresh()) @@ -171,7 +169,7 @@ public class RitualEffectBiomeChanger extends RitualEffect { if (itemTest instanceof ItemBlock) { - Block item = ((ItemBlock)itemTest).field_150939_a; + Block item = ((ItemBlock) itemTest).field_150939_a; if (item == (Blocks.sand)) { humidity -= 0.1f; @@ -258,11 +256,8 @@ public class RitualEffectBiomeChanger extends RitualEffect if (Math.abs(rainfall - humidity) < acceptableRange && Math.abs(temperature - temp) < acceptableRange) { - //if(biome.getEnableSnow()==wantsSnow) - { - biomeID = iteration; - break; - } + biomeID = iteration; + break; } iteration++; @@ -272,7 +267,6 @@ public class RitualEffectBiomeChanger extends RitualEffect { for (int j = 0; j < 2 * range + 1; j++) { - //Testing of traversal of boolean matrix if (boolList[i][j]) { Chunk chunk = world.getChunkFromBlockCoords(x - range + i, z - range + j); @@ -292,7 +286,6 @@ public class RitualEffectBiomeChanger extends RitualEffect byteArray[moduZ * 16 + moduX] = (byte) biomeID; chunk.setBiomeArray(byteArray); - //world.setBlock(x-range+i, y+1, z-range+j, Block.blockClay); } } } @@ -305,7 +298,6 @@ public class RitualEffectBiomeChanger extends RitualEffect @Override public int getCostPerRefresh() { - // TODO Auto-generated method stub return 0; } @@ -316,9 +308,9 @@ public class RitualEffectBiomeChanger extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList biomeChangerRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList biomeChangerRitual = new ArrayList(); biomeChangerRitual.add(new RitualComponent(1, 0, -2, RitualComponent.AIR)); biomeChangerRitual.add(new RitualComponent(1, 0, -3, RitualComponent.AIR)); biomeChangerRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR)); @@ -436,5 +428,5 @@ public class RitualEffectBiomeChanger extends RitualEffect biomeChangerRitual.add(new RitualComponent(-4, 0, -8, RitualComponent.WATER)); biomeChangerRitual.add(new RitualComponent(-4, 0, -9, RitualComponent.WATER)); return biomeChangerRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java index 99b04e9a..1a6b225a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java @@ -1,37 +1,35 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import cpw.mods.fml.relauncher.ReflectionHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectContainment extends RitualEffect { - public static final String[] TIME_SINCE_IGNITED = new String[] { "timeSinceIgnited", "field_70833_d", "bq" }; - public static final int crepitousDrain = 1; - public static final int terraeDrain = 3; - public static final int magicalesDrain = 10; - + public static final String[] TIME_SINCE_IGNITED = new String[]{"timeSinceIgnited", "field_70833_d", "bq"}; + public static final int crepitousDrain = 1; + public static final int terraeDrain = 3; + public static final int magicalesDrain = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { String owner = ritualStone.getOwner(); - + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); World world = ritualStone.getWorld(); int x = ritualStone.getXCoord(); @@ -40,31 +38,31 @@ public class RitualEffectContainment extends RitualEffect if (currentEssence < this.getCostPerRefresh()) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { int d0 = 5; - List entityList = SpellHelper.getEntitiesInRange(world, x+0.5, y+0.5, z+0.5, d0, d0); + List entityList = SpellHelper.getEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, d0, d0); boolean flag = false; boolean hasCrepitous = this.canDrainReagent(ritualStone, ReagentRegistry.crepitousReagent, crepitousDrain, false); boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); boolean hasMagicales = this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false); - - for(Entity entity : entityList) + + for (Entity entity : entityList) { - if(!(entity instanceof EntityLivingBase)) - { - continue; - } - - EntityLivingBase livingEntity = (EntityLivingBase)entity; + if (!(entity instanceof EntityLivingBase)) + { + continue; + } + + EntityLivingBase livingEntity = (EntityLivingBase) entity; if (livingEntity instanceof EntityPlayer) { continue; } - + double xDif = livingEntity.posX - (x + 0.5); double yDif = livingEntity.posY - (y + 3); double zDif = livingEntity.posZ - (z + 0.5); @@ -74,30 +72,30 @@ public class RitualEffectContainment extends RitualEffect flag = true; livingEntity.fallDistance = 0; - - if(hasMagicales && this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false)) + + if (hasMagicales && this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false)) { - if(!livingEntity.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding)) - { - livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionPlanarBinding.id,100,0)); - this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true); - } + if (!livingEntity.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding)) + { + livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionPlanarBinding.id, 100, 0)); + this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true); + } } - - if(hasCrepitous && this.canDrainReagent(ritualStone, ReagentRegistry.crepitousReagent, crepitousDrain, false)) + + if (hasCrepitous && this.canDrainReagent(ritualStone, ReagentRegistry.crepitousReagent, crepitousDrain, false)) { - if(entity instanceof EntityCreeper) - { - ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper) entity, 2, TIME_SINCE_IGNITED); - ((EntityCreeper)entity).setAttackTarget(null); - this.canDrainReagent(ritualStone, ReagentRegistry.crepitousReagent, crepitousDrain, true); - } + if (entity instanceof EntityCreeper) + { + ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper) entity, 2, TIME_SINCE_IGNITED); + ((EntityCreeper) entity).setAttackTarget(null); + this.canDrainReagent(ritualStone, ReagentRegistry.crepitousReagent, crepitousDrain, true); + } } } if (world.getWorldTime() % 2 == 0 && flag) { - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } } } @@ -108,10 +106,10 @@ public class RitualEffectContainment extends RitualEffect return 1; } - @Override - public List getRitualComponentList() - { - ArrayList containmentRitual = new ArrayList(); + @Override + public List getRitualComponentList() + { + ArrayList containmentRitual = new ArrayList(); containmentRitual.add(new RitualComponent(1, 0, 0, 3)); containmentRitual.add(new RitualComponent(-1, 0, 0, 3)); containmentRitual.add(new RitualComponent(0, 0, 1, 3)); @@ -129,5 +127,5 @@ public class RitualEffectContainment extends RitualEffect containmentRitual.add(new RitualComponent(-2, 5, 2, 3)); containmentRitual.add(new RitualComponent(-2, 5, -2, 3)); return containmentRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java index 2b7a4643..ce0cc54c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java @@ -1,8 +1,12 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.ModBlocks; +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; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; @@ -10,26 +14,20 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; -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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectCrushing extends RitualEffect { - public static final int crystallosDrain = 10; - public static final int orbisTerraeDrain = 10; - public static final int potentiaDrain = 10; - public static final int virtusDrain = 10; - public static final int incendiumDrain = 10; - + public static final int crystallosDrain = 10; + public static final int orbisTerraeDrain = 10; + public static final int potentiaDrain = 10; + public static final int virtusDrain = 10; + public static final int incendiumDrain = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -62,39 +60,47 @@ public class RitualEffectCrushing extends RitualEffect return; } - boolean hasRoom = false; - for(int i=0; i 0) { world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); - //flag=true; } - - if(hasCrystallos) + + if (hasCrystallos) { - this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, true); + } + } else + { + ArrayList itemDropList = block.getDrops(world, x + i, y + j, z + k, meta, fortuneLevel); + + if (itemDropList != null) + { + int invSize = tileEntity.getSizeInventory(); + + for (ItemStack item : itemDropList) + { + hasIncendium = hasIncendium && this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, false); + ItemStack copyStack = item.copyItemStack(item); + + if (this.usesIncendium(copyStack)) + { + copyStack = this.transformToNewItem(copyStack, hasIncendium, false); + this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, true); + } + + SpellHelper.insertStackIntoInventory(copyStack, tileEntity); + if (copyStack.stackSize > 0) + { + world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); + } + + if (hasOrbisTerrae) + { + this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true); + } + if (hasPotentia) + { + this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); + } + if (hasVirtus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); + } + } } } - else - { - ArrayList itemDropList = block.getDrops(world, x + i, y + j, z + k, meta, fortuneLevel); - - if (itemDropList != null) - { - int invSize = tileEntity.getSizeInventory(); - - for (ItemStack item : itemDropList) - { - hasIncendium = hasIncendium && this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, false); - ItemStack copyStack = item.copyItemStack(item); - - if(this.usesIncendium(copyStack)) - { - copyStack = this.transformToNewItem(copyStack, hasIncendium, false); - this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, true); - } - - SpellHelper.insertStackIntoInventory(copyStack, tileEntity); - -// for (int n = 0; n < invSize; n++) -// { -// if (tileEntity.isItemValidForSlot(n, copyStack) && copyStack.stackSize != 0) -// { -// ItemStack itemStack = tileEntity.getStackInSlot(n); -// -// if (itemStack == null) -// { -// tileEntity.setInventorySlotContents(n, item); -// copyStack.stackSize = 0; -// } else -// { -// if (itemStack.getItem().equals(copyStack.getItem()) && itemStack.getItemDamage() == copyStack.getItemDamage()) -// { -// int itemSize = itemStack.stackSize; -// int copySize = copyStack.stackSize; -// int maxSize = itemStack.getMaxStackSize(); -// -// if (copySize + itemSize < maxSize) -// { -// copyStack.stackSize = 0; -// itemStack.stackSize = itemSize + copySize; -// tileEntity.setInventorySlotContents(n, itemStack); -// } else -// { -// copyStack.stackSize = itemSize + copySize - maxSize; -// itemStack.stackSize = maxSize; -// } -// } -// } -// } -// } - - if (copyStack.stackSize > 0) - { - world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); - //flag=true; - } - - if(hasOrbisTerrae){this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true);} - if(hasPotentia){this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true);} - if(hasVirtus){this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true);} - } - } - - } - - //if(flag) world.setBlockToAir(x + i, y + j, z + k); world.playSoundEffect(x + i, y + j, z + k, "mob.endermen.portal", 1.0F, 1.0F); - + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); - + return; } } @@ -212,114 +185,114 @@ public class RitualEffectCrushing extends RitualEffect } } } - + private boolean usesIncendium(ItemStack stack) { - if(stack != null) - { - Item item = stack.getItem(); - if(item instanceof ItemBlock) - { - Block block = ((ItemBlock)item).field_150939_a; + if (stack != null) + { + Item item = stack.getItem(); + if (item instanceof ItemBlock) + { + Block block = ((ItemBlock) item).field_150939_a; - if(block == Blocks.cobblestone || block == Blocks.stone) - { - return true; - } - }else - { - - } - } - return false; + if (block == Blocks.cobblestone || block == Blocks.stone) + { + return true; + } + } else + { + + } + } + return false; } - + private ItemStack transformToNewItem(ItemStack stack, boolean hasIncendium, boolean hasCrepitous) { - if(stack != null) - { - ItemStack copyStack = ItemStack.copyItemStack(stack); - int stackSize = copyStack.stackSize; - - Item item = stack.getItem(); - if(item instanceof ItemBlock) - { - Block block = ((ItemBlock)item).field_150939_a; - - if(hasIncendium) - { - if(block == Blocks.cobblestone || block == Blocks.stone) - { - copyStack = new ItemStack(Blocks.netherrack, stackSize, 0); - } - } - }else - { - - } - - return copyStack; - } - return stack; + if (stack != null) + { + ItemStack copyStack = ItemStack.copyItemStack(stack); + int stackSize = copyStack.stackSize; + + Item item = stack.getItem(); + if (item instanceof ItemBlock) + { + Block block = ((ItemBlock) item).field_150939_a; + + if (hasIncendium) + { + if (block == Blocks.cobblestone || block == Blocks.stone) + { + copyStack = new ItemStack(Blocks.netherrack, stackSize, 0); + } + } + } else + { + + } + + return copyStack; + } + return stack; } - + public boolean isSilkTouch(World world, int x, int y, int z) { - int index = 0; - for(int i=-2; i<=2; i++) - { - for(int j=-2; j<=2; j++) - { - int index1 = Math.abs(i); - int index2 = Math.abs(j); - - if((index1 == 2 && (index2 == 2 || index2 == 1)) || (index1 == 1 && index2 == 2)) - { - Block block = world.getBlock(x + i, y + 1, z + j); - if(block == Blocks.gold_block) + int index = 0; + for (int i = -2; i <= 2; i++) + { + for (int j = -2; j <= 2; j++) + { + int index1 = Math.abs(i); + int index2 = Math.abs(j); + + if ((index1 == 2 && (index2 == 2 || index2 == 1)) || (index1 == 1 && index2 == 2)) + { + Block block = world.getBlock(x + i, y + 1, z + j); + if (block == Blocks.gold_block) { - index++; + index++; } - } - } - } - - return index>=12; + } + } + } + + return index >= 12; } - + public int getFortuneLevel(World world, int x, int y, int z) { - int index = 0; - for(int i=-2; i<=2; i++) - { - for(int j=-2; j<=2; j++) - { - int index1 = Math.abs(i); - int index2 = Math.abs(j); - - if((index1 == 2 && (index2 == 2 || index2 == 1)) || (index1 == 1 && index2 == 2)) - { - Block block = world.getBlock(x + i, y + 1, z + j); - if(block == Blocks.emerald_block || block == Blocks.diamond_block) + int index = 0; + for (int i = -2; i <= 2; i++) + { + for (int j = -2; j <= 2; j++) + { + int index1 = Math.abs(i); + int index2 = Math.abs(j); + + if ((index1 == 2 && (index2 == 2 || index2 == 1)) || (index1 == 1 && index2 == 2)) + { + Block block = world.getBlock(x + i, y + 1, z + j); + if (block == Blocks.emerald_block || block == Blocks.diamond_block) { - index++; + index++; } - } - } - } - - if(index>=12) - { - return 3; - }else if(index>=8) - { - return 2; - }else if(index>=4) - { - return 1; - } - - return 0; + } + } + } + + if (index >= 12) + { + return 3; + } else if (index >= 8) + { + return 2; + } else if (index >= 4) + { + return 1; + } + + return 0; } @Override @@ -329,9 +302,9 @@ public class RitualEffectCrushing extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList crushingRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList crushingRitual = new ArrayList(); crushingRitual.add(new RitualComponent(0, 0, 1, RitualComponent.EARTH)); crushingRitual.add(new RitualComponent(1, 0, 0, RitualComponent.EARTH)); crushingRitual.add(new RitualComponent(0, 0, -1, RitualComponent.EARTH)); @@ -349,5 +322,5 @@ public class RitualEffectCrushing extends RitualEffect crushingRitual.add(new RitualComponent(0, 1, 2, RitualComponent.AIR)); crushingRitual.add(new RitualComponent(0, 1, -2, RitualComponent.AIR)); return crushingRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java index ec6c24ef..ca2ccfcd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java @@ -1,26 +1,22 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +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.common.tileEntity.TESpectralBlock; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; -import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectEllipsoid extends RitualEffect { @@ -34,24 +30,24 @@ public class RitualEffectEllipsoid extends RitualEffect int x = ritualStone.getXCoord(); int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - - TileEntity tile = world.getTileEntity(x, y+1, z); - - if(!(tile instanceof IInventory) || ((IInventory)tile).getSizeInventory() < 3) - { - return; - } - - ItemStack item1 = ((IInventory) tile).getStackInSlot(0); - ItemStack item2 = ((IInventory) tile).getStackInSlot(1); - ItemStack item3 = ((IInventory) tile).getStackInSlot(2); - - int xSize = item1 == null ? 0 : item1.stackSize; - int ySize = item2 == null ? 0 : item2.stackSize; - int zSize = item3 == null ? 0 : item3.stackSize; - int cost = (int)Math.pow((xSize+1)*(ySize+1)*(zSize+1),0.333); - + TileEntity tile = world.getTileEntity(x, y + 1, z); + + if (!(tile instanceof IInventory) || ((IInventory) tile).getSizeInventory() < 3) + { + return; + } + + ItemStack item1 = ((IInventory) tile).getStackInSlot(0); + ItemStack item2 = ((IInventory) tile).getStackInSlot(1); + ItemStack item3 = ((IInventory) tile).getStackInSlot(2); + + int xSize = item1 == null ? 0 : item1.stackSize; + int ySize = item2 == null ? 0 : item2.stackSize; + int zSize = item3 == null ? 0 : item3.stackSize; + + int cost = (int) Math.pow((xSize + 1) * (ySize + 1) * (zSize + 1), 0.333); + if (currentEssence < cost) { EntityPlayer entityOwner = SpellHelper.getPlayerForUsername(owner); @@ -64,48 +60,41 @@ public class RitualEffectEllipsoid extends RitualEffect entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); } else { - //if(tile instanceof IInventory) + int refresh = 1000; + int j = (int) (world.getWorldTime() % (ySize * 2 + 1)) - ySize; + for (int i = -xSize; i <= xSize; i++) { - int refresh = 1000; - - int j = (int)(world.getWorldTime()%(ySize*2+1)) - ySize; - - for (int i = -xSize; i <= xSize; i++) { -// for (int j = -ySize; j <= ySize; j++) + for (int k = -zSize; k <= zSize; k++) { - for(int k = -zSize; k <= zSize; k++) + if (Math.pow(i * (ySize - 0.50f) * (zSize - 0.50f), 2) + Math.pow(j * (xSize - 0.50f) * (zSize - 0.50f), 2) + Math.pow(k * (xSize - 0.50f) * (ySize - 0.50f), 2) <= Math.pow((xSize - 1 + 0.50f) * (ySize - 1 + 0.50f) * (zSize - 1 + 0.50f), 2)) { - if (Math.pow(i*(ySize - 0.50f)*(zSize - 0.50f),2) + Math.pow(j*(xSize - 0.50f)*(zSize - 0.50f),2) + Math.pow(k*(xSize - 0.50f)*(ySize - 0.50f),2) <= Math.pow((xSize - 1 + 0.50f)*(ySize - 1 + 0.50f)*(zSize - 1 + 0.50f), 2)) + continue; + } + + if (Math.pow(i * (ySize + 0.50f) * (zSize + 0.50f), 2) + Math.pow(j * (xSize + 0.50f) * (zSize + 0.50f), 2) + Math.pow(k * (xSize + 0.50f) * (ySize + 0.50f), 2) >= Math.pow((xSize + 0.50f) * (ySize + 0.50f) * (zSize + 0.50f), 2)) + { + continue; + } + + Block block = world.getBlock(x + i, y + j, z + k); + + if (block.isAir(world, x + i, y + j, z + k)) + { + TESpectralBlock.createSpectralBlockAtLocation(world, x + i, y + j, z + k, refresh); + } else + { + TileEntity tile1 = world.getTileEntity(x + i, y + j, z + k); + if (tile instanceof TESpectralBlock) { - continue; + ((TESpectralBlock) tile1).resetDuration(refresh); } - - if (Math.pow(i*(ySize + 0.50f)*(zSize + 0.50f),2) + Math.pow(j*(xSize + 0.50f)*(zSize + 0.50f),2) + Math.pow(k*(xSize + 0.50f)*(ySize + 0.50f),2) >= Math.pow((xSize + 0.50f)*(ySize + 0.50f)*(zSize + 0.50f), 2)) - { - continue; - } - - Block block = world.getBlock(x+i, y+j, z+k); - - if(block.isAir(world, x+i, y+j, z+k)) - { - //world.setBlock(x+i, y+j, z+k, Blocks.stone); - TESpectralBlock.createSpectralBlockAtLocation(world, x+i, y+j, z+k, refresh); - } - else - { - TileEntity tile1 = world.getTileEntity(x+i, y+j, z+k); - if(tile instanceof TESpectralBlock) - { - ((TESpectralBlock) tile1).resetDuration(refresh); - } - } } } } } + SoulNetworkHandler.syphonFromNetwork(owner, cost); } } @@ -117,51 +106,51 @@ public class RitualEffectEllipsoid extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList ellipsoidRitual = new ArrayList(); - - ellipsoidRitual.add(new RitualComponent(-1,0,-1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-1,0,1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(1,0,-1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(1,0,1,RitualComponent.DUSK)); - - ellipsoidRitual.add(new RitualComponent(4,0,0,RitualComponent.FIRE)); - ellipsoidRitual.add(new RitualComponent(5,0,0,RitualComponent.FIRE)); - ellipsoidRitual.add(new RitualComponent(5,0,-1,RitualComponent.FIRE)); - ellipsoidRitual.add(new RitualComponent(5,0,-2,RitualComponent.FIRE)); - ellipsoidRitual.add(new RitualComponent(-4,0,0,RitualComponent.FIRE)); - ellipsoidRitual.add(new RitualComponent(-5,0,0,RitualComponent.FIRE)); - ellipsoidRitual.add(new RitualComponent(-5,0,1,RitualComponent.FIRE)); - ellipsoidRitual.add(new RitualComponent(-5,0,2,RitualComponent.FIRE)); - - ellipsoidRitual.add(new RitualComponent(0,0,4,RitualComponent.AIR)); - ellipsoidRitual.add(new RitualComponent(0,0,5,RitualComponent.AIR)); - ellipsoidRitual.add(new RitualComponent(1,0,5,RitualComponent.AIR)); - ellipsoidRitual.add(new RitualComponent(2,0,5,RitualComponent.AIR)); - ellipsoidRitual.add(new RitualComponent(0,0,-4,RitualComponent.AIR)); - ellipsoidRitual.add(new RitualComponent(0,0,-5,RitualComponent.AIR)); - ellipsoidRitual.add(new RitualComponent(-1,0,-5,RitualComponent.AIR)); - ellipsoidRitual.add(new RitualComponent(-2,0,-5,RitualComponent.AIR)); - - ellipsoidRitual.add(new RitualComponent(3,0,1,RitualComponent.EARTH)); - ellipsoidRitual.add(new RitualComponent(3,0,2,RitualComponent.EARTH)); - ellipsoidRitual.add(new RitualComponent(3,0,3,RitualComponent.EARTH)); - ellipsoidRitual.add(new RitualComponent(2,0,3,RitualComponent.EARTH)); - ellipsoidRitual.add(new RitualComponent(-3,0,-1,RitualComponent.EARTH)); - ellipsoidRitual.add(new RitualComponent(-3,0,-2,RitualComponent.EARTH)); - ellipsoidRitual.add(new RitualComponent(-3,0,-3,RitualComponent.EARTH)); - ellipsoidRitual.add(new RitualComponent(-2,0,-3,RitualComponent.EARTH)); - - ellipsoidRitual.add(new RitualComponent(1,0,-3,RitualComponent.WATER)); - ellipsoidRitual.add(new RitualComponent(2,0,-3,RitualComponent.WATER)); - ellipsoidRitual.add(new RitualComponent(3,0,-3,RitualComponent.WATER)); - ellipsoidRitual.add(new RitualComponent(3,0,-2,RitualComponent.WATER)); - ellipsoidRitual.add(new RitualComponent(-1,0,3,RitualComponent.WATER)); - ellipsoidRitual.add(new RitualComponent(-2,0,3,RitualComponent.WATER)); - ellipsoidRitual.add(new RitualComponent(-3,0,3,RitualComponent.WATER)); - ellipsoidRitual.add(new RitualComponent(-3,0,2,RitualComponent.WATER)); - + public List getRitualComponentList() + { + ArrayList ellipsoidRitual = new ArrayList(); + + ellipsoidRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); + + ellipsoidRitual.add(new RitualComponent(4, 0, 0, RitualComponent.FIRE)); + ellipsoidRitual.add(new RitualComponent(5, 0, 0, RitualComponent.FIRE)); + ellipsoidRitual.add(new RitualComponent(5, 0, -1, RitualComponent.FIRE)); + ellipsoidRitual.add(new RitualComponent(5, 0, -2, RitualComponent.FIRE)); + ellipsoidRitual.add(new RitualComponent(-4, 0, 0, RitualComponent.FIRE)); + ellipsoidRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.FIRE)); + ellipsoidRitual.add(new RitualComponent(-5, 0, 1, RitualComponent.FIRE)); + ellipsoidRitual.add(new RitualComponent(-5, 0, 2, RitualComponent.FIRE)); + + ellipsoidRitual.add(new RitualComponent(0, 0, 4, RitualComponent.AIR)); + ellipsoidRitual.add(new RitualComponent(0, 0, 5, RitualComponent.AIR)); + ellipsoidRitual.add(new RitualComponent(1, 0, 5, RitualComponent.AIR)); + ellipsoidRitual.add(new RitualComponent(2, 0, 5, RitualComponent.AIR)); + ellipsoidRitual.add(new RitualComponent(0, 0, -4, RitualComponent.AIR)); + ellipsoidRitual.add(new RitualComponent(0, 0, -5, RitualComponent.AIR)); + ellipsoidRitual.add(new RitualComponent(-1, 0, -5, RitualComponent.AIR)); + ellipsoidRitual.add(new RitualComponent(-2, 0, -5, RitualComponent.AIR)); + + ellipsoidRitual.add(new RitualComponent(3, 0, 1, RitualComponent.EARTH)); + ellipsoidRitual.add(new RitualComponent(3, 0, 2, RitualComponent.EARTH)); + ellipsoidRitual.add(new RitualComponent(3, 0, 3, RitualComponent.EARTH)); + ellipsoidRitual.add(new RitualComponent(2, 0, 3, RitualComponent.EARTH)); + ellipsoidRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.EARTH)); + ellipsoidRitual.add(new RitualComponent(-3, 0, -2, RitualComponent.EARTH)); + ellipsoidRitual.add(new RitualComponent(-3, 0, -3, RitualComponent.EARTH)); + ellipsoidRitual.add(new RitualComponent(-2, 0, -3, RitualComponent.EARTH)); + + ellipsoidRitual.add(new RitualComponent(1, 0, -3, RitualComponent.WATER)); + ellipsoidRitual.add(new RitualComponent(2, 0, -3, RitualComponent.WATER)); + ellipsoidRitual.add(new RitualComponent(3, 0, -3, RitualComponent.WATER)); + ellipsoidRitual.add(new RitualComponent(3, 0, -2, RitualComponent.WATER)); + ellipsoidRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.WATER)); + ellipsoidRitual.add(new RitualComponent(-2, 0, 3, RitualComponent.WATER)); + ellipsoidRitual.add(new RitualComponent(-3, 0, 3, RitualComponent.WATER)); + ellipsoidRitual.add(new RitualComponent(-3, 0, 2, RitualComponent.WATER)); + return ellipsoidRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java index 9392e863..5c447a02 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java @@ -1,32 +1,20 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.MaterialLiquid; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.Int3; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectEvaporation extends RitualEffect { @@ -40,7 +28,7 @@ public class RitualEffectEvaporation extends RitualEffect int x = ritualStone.getXCoord(); int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - + if (currentEssence < 0) { EntityPlayer entityOwner = SpellHelper.getPlayerForUsername(owner); @@ -53,22 +41,22 @@ public class RitualEffectEvaporation extends RitualEffect entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); } else { - Block block1 = world.getBlock(x, y-1, z); - int range = this.getRadiusForModifierBlock(block1); - - boolean[][][] boolList = new boolean[range * 2 + 1][range * 2 + 1][range * 2 + 1]; + Block block1 = world.getBlock(x, y - 1, z); + int range = this.getRadiusForModifierBlock(block1); + + boolean[][][] boolList = new boolean[range * 2 + 1][range * 2 + 1][range * 2 + 1]; for (int i = 0; i < 2 * range + 1; i++) { for (int j = 0; j < 2 * range + 1; j++) { - for(int k = 0; k < 2 * range + 1; k++) - { + for (int k = 0; k < 2 * range + 1; k++) + { boolList[i][j][k] = false; - } + } } } - + boolList[range][range][range] = true; boolean isReady = false; @@ -80,14 +68,14 @@ public class RitualEffectEvaporation extends RitualEffect { for (int j = 0; j < 2 * range + 1; j++) { - for(int k=0; k<2*range+1;k++) - { + for (int k = 0; k < 2 * range + 1; k++) + { if (boolList[i][j][k]) { if (i - 1 >= 0 && !boolList[i - 1][j][k]) { Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k); - if(world.isAirBlock(x - range + i - 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer) + if (world.isAirBlock(x - range + i - 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer) { boolList[i - 1][j][k] = true; isReady = false; @@ -97,17 +85,17 @@ public class RitualEffectEvaporation extends RitualEffect if (j - 1 >= 0 && !boolList[i][j - 1][k]) { Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k); - if(world.isAirBlock(x - range + i, y - range + j - 1, z - range + k) || block == ModBlocks.blockSpectralContainer) + if (world.isAirBlock(x - range + i, y - range + j - 1, z - range + k) || block == ModBlocks.blockSpectralContainer) { boolList[i][j - 1][k] = true; isReady = false; } } - - if(k - 1 >=0 && !boolList[i][j][k - 1]) + + if (k - 1 >= 0 && !boolList[i][j][k - 1]) { - Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1); - if(world.isAirBlock(x - range + i, y - range + j, z - range + k - 1) || block == ModBlocks.blockSpectralContainer) + Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1); + if (world.isAirBlock(x - range + i, y - range + j, z - range + k - 1) || block == ModBlocks.blockSpectralContainer) { boolList[i][j][k - 1] = true; isReady = false; @@ -117,7 +105,7 @@ public class RitualEffectEvaporation extends RitualEffect if (i + 1 <= 2 * range && !boolList[i + 1][j][k]) { Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k); - if(world.isAirBlock(x - range + i + 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer) + if (world.isAirBlock(x - range + i + 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer) { boolList[i + 1][j][k] = true; isReady = false; @@ -127,52 +115,52 @@ public class RitualEffectEvaporation extends RitualEffect if (j + 1 <= 2 * range && !boolList[i][j + 1][k]) { Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k); - if(world.isAirBlock(x - range + i, y - range + j + 1, z - range + k) || block == ModBlocks.blockSpectralContainer) + if (world.isAirBlock(x - range + i, y - range + j + 1, z - range + k) || block == ModBlocks.blockSpectralContainer) { boolList[i][j + 1][k] = true; isReady = false; } } - - if(k + 1 <= 2*range && !boolList[i][j][k+1]) + + if (k + 1 <= 2 * range && !boolList[i][j][k + 1]) { - Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1); - if(world.isAirBlock(x - range + i, y - range + j, z - range + k + 1) || block == ModBlocks.blockSpectralContainer) + Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1); + if (world.isAirBlock(x - range + i, y - range + j, z - range + k + 1) || block == ModBlocks.blockSpectralContainer) { - boolList[i][j][k+1] = true; + boolList[i][j][k + 1] = true; isReady = false; } } } - } + } } } } - + for (int i = 0; i < 2 * range + 1; i++) { for (int j = 0; j < 2 * range + 1; j++) { - for(int k=0; k<2*range+1;k++) - { - if(!boolList[i][j][k]) - { - continue; - } - - Block block = world.getBlock(x+i-range, y+j-range, z+k-range); - - if(block == ModBlocks.blockSpectralContainer) - { - world.setBlockToAir(x+i-range, y+j-range, z+k-range); - } - } + for (int k = 0; k < 2 * range + 1; k++) + { + if (!boolList[i][j][k]) + { + continue; + } + + Block block = world.getBlock(x + i - range, y + j - range, z + k - range); + + if (block == ModBlocks.blockSpectralContainer) + { + world.setBlockToAir(x + i - range, y + j - range, z + k - range); + } + } } } - + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); - - ritualStone.setActive(false); + + ritualStone.setActive(false); } } @@ -183,76 +171,76 @@ public class RitualEffectEvaporation extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList ellipsoidRitual = new ArrayList(); - - ellipsoidRitual.add(new RitualComponent(-1,0,-1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-1,0,1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(1,0,-1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(1,0,1,RitualComponent.DUSK)); - - ellipsoidRitual.add(new RitualComponent(4,0,0,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(5,0,0,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(5,0,-1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(5,0,-2,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-4,0,0,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-5,0,0,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-5,0,1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-5,0,2,RitualComponent.DUSK)); - - ellipsoidRitual.add(new RitualComponent(0,0,4,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(0,0,5,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(1,0,5,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(2,0,5,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(0,0,-4,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(0,0,-5,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-1,0,-5,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-2,0,-5,RitualComponent.DUSK)); - - ellipsoidRitual.add(new RitualComponent(3,0,1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(3,0,2,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(3,0,3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(2,0,3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-3,0,-1,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-3,0,-2,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-3,0,-3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-2,0,-3,RitualComponent.DUSK)); - - ellipsoidRitual.add(new RitualComponent(1,0,-3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(2,0,-3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(3,0,-3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(3,0,-2,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-1,0,3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-2,0,3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-3,0,3,RitualComponent.DUSK)); - ellipsoidRitual.add(new RitualComponent(-3,0,2,RitualComponent.DUSK)); - + public List getRitualComponentList() + { + ArrayList ellipsoidRitual = new ArrayList(); + + ellipsoidRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); + + ellipsoidRitual.add(new RitualComponent(4, 0, 0, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(5, 0, 0, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(5, 0, -1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(5, 0, -2, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-4, 0, 0, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-5, 0, 1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-5, 0, 2, RitualComponent.DUSK)); + + ellipsoidRitual.add(new RitualComponent(0, 0, 4, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(0, 0, 5, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(1, 0, 5, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(2, 0, 5, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(0, 0, -4, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(0, 0, -5, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-1, 0, -5, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-2, 0, -5, RitualComponent.DUSK)); + + ellipsoidRitual.add(new RitualComponent(3, 0, 1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(3, 0, 2, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(3, 0, 3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(2, 0, 3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-3, 0, -2, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-3, 0, -3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-2, 0, -3, RitualComponent.DUSK)); + + ellipsoidRitual.add(new RitualComponent(1, 0, -3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(2, 0, -3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(3, 0, -3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(3, 0, -2, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-2, 0, 3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-3, 0, 3, RitualComponent.DUSK)); + ellipsoidRitual.add(new RitualComponent(-3, 0, 2, RitualComponent.DUSK)); + return ellipsoidRitual; - } - + } + public int getRadiusForModifierBlock(Block block) - { - if(block == null) - { - return 10; - } - - if(block == Blocks.diamond_block) - { - return 30; - } - - if(block == Blocks.gold_block) - { - return 20; - } - - if(block == Blocks.iron_block) - { - return 15; - } - - return 10; - } + { + if (block == null) + { + return 10; + } + + if (block == Blocks.diamond_block) + { + return 30; + } + + if (block == Blocks.gold_block) + { + return 20; + } + + if (block == Blocks.iron_block) + { + return 15; + } + + return 10; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java index 08f3c2da..23616ae2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java @@ -1,9 +1,14 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +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.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -11,31 +16,22 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; -import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; public class RitualEffectExpulsion extends RitualEffect { - public static final int virtusDrain = 10; - public static final int potentiaDrain = 10; - public static final int tennebraeDrain = 5; - + public static final int virtusDrain = 10; + public static final int potentiaDrain = 10; + public static final int tennebraeDrain = 5; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -52,99 +48,93 @@ public class RitualEffectExpulsion extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); - boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); - - int teleportDistance = hasVirtus ? 300 : 100; + boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); + boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); + + int teleportDistance = hasVirtus ? 300 : 100; int range = hasPotentia ? 50 : 25; List playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); boolean flag = false; - TileEntity tile = world.getTileEntity(x, y+1, z); + TileEntity tile = world.getTileEntity(x, y + 1, z); IInventory inventoryTile = null; - if(tile instanceof IInventory) + if (tile instanceof IInventory) { - inventoryTile = (IInventory)tile; + inventoryTile = (IInventory) tile; } - - for(EntityPlayer entityplayer : playerList) + + for (EntityPlayer entityplayer : playerList) { - String playerString = SpellHelper.getUsername(entityplayer); + String playerString = SpellHelper.getUsername(entityplayer); if (!playerString.equals(owner)) { - if(inventoryTile != null) - { - for(int i=0; i livingList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); boolean flag = false; - - for(EntityLivingBase livingEntity : livingList) + + for (EntityLivingBase livingEntity : livingList) { - if(livingEntity instanceof EntityPlayer) - { - continue; - } - - flag = teleportRandomly(livingEntity, teleportDistance) || flag; + if (livingEntity instanceof EntityPlayer) + { + continue; + } + + flag = teleportRandomly(livingEntity, teleportDistance) || flag; } - - if(flag) + + if (flag) { - if(hasVirtus) - { - this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); - } - - if(hasPotentia) - { - this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); - } - - this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tennebraeDrain, true); - - SoulNetworkHandler.syphonFromNetwork(owner, 1000); + if (hasVirtus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); + } + + if (hasPotentia) + { + this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); + } + + this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tennebraeDrain, true); + + SoulNetworkHandler.syphonFromNetwork(owner, 1000); } } } @@ -154,7 +144,7 @@ public class RitualEffectExpulsion extends RitualEffect { return 1000; } - + public boolean teleportRandomly(EntityLivingBase entityLiving, double distance) { double x = entityLiving.posX; @@ -180,7 +170,6 @@ public class RitualEffectExpulsion extends RitualEffect } return true; - //return SpellTeleport.teleportTo(entityLiving, d0, d1, d2,x,y,z); } public boolean teleportTo(EntityLivingBase entityLiving, double par1, double par3, double par5, double lastX, double lastY, double lastZ) @@ -250,9 +239,6 @@ public class RitualEffectExpulsion extends RitualEffect double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2); } - -// this.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F); -// this.playSound("mob.endermen.portal", 1.0F, 1.0F); return true; } } @@ -275,10 +261,7 @@ public class RitualEffectExpulsion extends RitualEffect { entityLiving.mountEntity((Entity) null); } - entityLiving.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); -// this.getThrower().fallDistance = 0.0F; -// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); } } } @@ -288,58 +271,58 @@ public class RitualEffectExpulsion extends RitualEffect } } - @Override - public List getRitualComponentList() - { - ArrayList expulsionRitual = new ArrayList(); - expulsionRitual.add(new RitualComponent(2,0,2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(2,0,1, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(1,0,2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(2,0,-2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(2,0,-1, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-1,0,2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-2,0,2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-2,0,1, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(1,0,-2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-2,0,-2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-2,0,-1, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-1,0,-2, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(4,0,2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(5,0,2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(4,0,-2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(5,0,-2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-4,0,2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-5,0,2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-4,0,-2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-5,0,-2, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(2,0,4, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(2,0,5, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-2,0,4, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-2,0,5, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(2,0,-4, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(2,0,-5, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-2,0,-4, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(-2,0,-5, RitualComponent.AIR)); - expulsionRitual.add(new RitualComponent(0,0,6, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(0,0,-6, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(6,0,0, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-6,0,0, RitualComponent.EARTH)); - expulsionRitual.add(new RitualComponent(-5,0,0, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(-6,0,1, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(-6,0,-1, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(5,0,0, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(6,0,1, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(6,0,-1, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(0,0,5, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(1,0,6, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(-1,0,6, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(0,0,-5, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(1,0,-6, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(-1,0,-6, RitualComponent.DUSK)); - expulsionRitual.add(new RitualComponent(4,0,4, RitualComponent.FIRE)); - expulsionRitual.add(new RitualComponent(4,0,-4, RitualComponent.FIRE)); - expulsionRitual.add(new RitualComponent(-4,0,4, RitualComponent.FIRE)); - expulsionRitual.add(new RitualComponent(-4,0,-4, RitualComponent.FIRE)); + @Override + public List getRitualComponentList() + { + ArrayList expulsionRitual = new ArrayList(); + expulsionRitual.add(new RitualComponent(2, 0, 2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(2, 0, 1, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(1, 0, 2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(2, 0, -2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(2, 0, -1, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(1, 0, -2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(4, 0, 2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(5, 0, 2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(4, 0, -2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(5, 0, -2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-4, 0, 2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-5, 0, 2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-4, 0, -2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-5, 0, -2, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(2, 0, 4, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(2, 0, 5, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-2, 0, 4, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-2, 0, 5, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(2, 0, -4, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(2, 0, -5, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-2, 0, -4, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(-2, 0, -5, RitualComponent.AIR)); + expulsionRitual.add(new RitualComponent(0, 0, 6, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(0, 0, -6, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(6, 0, 0, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-6, 0, 0, RitualComponent.EARTH)); + expulsionRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(-6, 0, 1, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(-6, 0, -1, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(5, 0, 0, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(6, 0, 1, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(6, 0, -1, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(0, 0, 5, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(1, 0, 6, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(-1, 0, 6, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(0, 0, -5, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(1, 0, -6, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(-1, 0, -6, RitualComponent.DUSK)); + expulsionRitual.add(new RitualComponent(4, 0, 4, RitualComponent.FIRE)); + expulsionRitual.add(new RitualComponent(4, 0, -4, RitualComponent.FIRE)); + expulsionRitual.add(new RitualComponent(-4, 0, 4, RitualComponent.FIRE)); + expulsionRitual.add(new RitualComponent(-4, 0, -4, RitualComponent.FIRE)); return expulsionRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java index d20906f5..a72bc0af 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java @@ -1,32 +1,26 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fall damage in the area of effect { - public static final int terraeDrain = 1; - public static final int orbisTerraeDrain = 1; - public static final int aetherDrain = 1; - - public static final int costCooldown = 10; - + public static final int terraeDrain = 1; + public static final int orbisTerraeDrain = 1; + public static final int aetherDrain = 1; + + public static final int costCooldown = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -48,9 +42,9 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal } boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); - boolean hasOrbisTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, false); - boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); - + boolean hasOrbisTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, false); + boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); + int range = this.getHorizontalRangeForReagent(hasTerrae, hasOrbisTerrae); int verticalRange = hasAether ? 60 : 30; List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(range, verticalRange, range)); @@ -74,21 +68,21 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal } SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * entityCount); - - if(flag && world.getWorldTime() % costCooldown == 0) + + if (flag && world.getWorldTime() % costCooldown == 0) { - if(hasTerrae) - { - this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); - } - if(hasOrbisTerrae) - { - this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true); - } - if(hasAether) - { - this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); - } + if (hasTerrae) + { + this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); + } + if (hasOrbisTerrae) + { + this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true); + } + if (hasAether) + { + this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); + } } } } @@ -106,9 +100,9 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal } @Override - public List getRitualComponentList() - { - ArrayList featheredEarthRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList featheredEarthRitual = new ArrayList(); featheredEarthRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); featheredEarthRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); featheredEarthRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); @@ -150,28 +144,28 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal featheredEarthRitual.add(new RitualComponent(-5, 5, -4, RitualComponent.AIR)); featheredEarthRitual.add(new RitualComponent(-3, 5, -4, RitualComponent.AIR)); return featheredEarthRitual; - } - + } + public int getHorizontalRangeForReagent(boolean hasTerrae, boolean hasOrbisTerrae) { - if(hasOrbisTerrae) - { - if(hasTerrae) - { - return 64; - }else - { - return 45; - } - }else - { - if(hasTerrae) - { - return 30; - }else - { - return 20; - } - } + if (hasOrbisTerrae) + { + if (hasTerrae) + { + return 64; + } else + { + return 45; + } + } else + { + if (hasTerrae) + { + return 30; + } else + { + return 20; + } + } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java index ba8d6782..8961b779 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java @@ -1,29 +1,22 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectFeatheredKnife extends RitualEffect { public final int amount = 100; - + public static final int sanctusDrain = 5; public static final int reductusDrain = 3; public static final int magicalesDrain = 2; @@ -34,14 +27,14 @@ public class RitualEffectFeatheredKnife extends RitualEffect { String owner = ritualStone.getOwner(); - int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); World world = ritualStone.getWorld(); int x = ritualStone.getXCoord(); int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - + boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); - + int timeDelay = hasPotentia ? 10 : 20; if (world.getWorldTime() % timeDelay != 0) @@ -71,65 +64,65 @@ public class RitualEffectFeatheredKnife extends RitualEffect { return; } - + boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); double range = hasReductus ? 8 : 15; double vertRange = hasReductus ? 8 : 20; - List list = SpellHelper.getPlayersInRange(world, x+0.5, y+0.5, z+0.5, range, vertRange); + List list = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, range, vertRange); int entityCount = 0; boolean flag = false; - + if (currentEssence < this.getCostPerRefresh() * list.size()) { SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - boolean hasMagicales = this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false); - boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); - - EntityPlayer ownerPlayer = SpellHelper.getPlayerForUsername(owner); - for(EntityPlayer player : list) + boolean hasMagicales = this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false); + boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); + + EntityPlayer ownerPlayer = SpellHelper.getPlayerForUsername(owner); + for (EntityPlayer player : list) { - hasSanctus = hasSanctus && this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); + hasSanctus = hasSanctus && this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); double threshold = hasSanctus ? 0.7d : 0.3d; - if((hasMagicales && player == ownerPlayer) || !hasMagicales) - { - if (!SpellHelper.isFakePlayer(world, player)) + if ((hasMagicales && player == ownerPlayer) || !hasMagicales) + { + if (!SpellHelper.isFakePlayer(world, player)) { - if (player.getHealth()/player.getMaxHealth() > threshold) + if (player.getHealth() / player.getMaxHealth() > threshold) { player.setHealth(player.getHealth() - 1); entityCount++; tileAltar.sacrificialDaggerCall(this.amount, false); - if(hasSanctus) + if (hasSanctus) { - this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); } - if(hasMagicales) + if (hasMagicales) { - this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true); - break; + this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true); + break; } } } - } + } } - if(entityCount > 0) + if (entityCount > 0) { - if(hasReductus) - { - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - } - if(hasPotentia) - { - this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); - } - - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * entityCount); + if (hasReductus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + } + if (hasPotentia) + { + this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); + } + + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * entityCount); } } } @@ -141,9 +134,9 @@ public class RitualEffectFeatheredKnife extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList featheredKnifeRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList featheredKnifeRitual = new ArrayList(); featheredKnifeRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); featheredKnifeRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); featheredKnifeRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); @@ -185,5 +178,5 @@ public class RitualEffectFeatheredKnife extends RitualEffect featheredKnifeRitual.add(new RitualComponent(-3, 0, 3, RitualComponent.AIR)); featheredKnifeRitual.add(new RitualComponent(-3, 0, -3, RitualComponent.AIR)); return featheredKnifeRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java index ae4031d8..705eaf1d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java @@ -1,29 +1,26 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectFlight extends RitualEffect { - public static final int aetherDrain = 10; - public static final int reductusDrain = 5; - public static final int reagentCooldown = 50; - + public static final int aetherDrain = 10; + public static final int reductusDrain = 5; + public static final int reagentCooldown = 50; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -42,7 +39,7 @@ public class RitualEffectFlight extends RitualEffect axis.minY = 0; List entities = world.getEntitiesWithinAABB(EntityPlayer.class, axis); int entityCount = 0; - + boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); @@ -56,30 +53,30 @@ public class RitualEffectFlight extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - entityCount = 0; - EntityPlayer ownerEntity = SpellHelper.getPlayerForUsername(owner); + entityCount = 0; + EntityPlayer ownerEntity = SpellHelper.getPlayerForUsername(owner); for (EntityPlayer entity : entities) { - if(hasReductus && entity != ownerEntity) - { - continue; - } - entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlight.id, hasAether ? 30*20 : 20, 0)); - entityCount ++; + if (hasReductus && entity != ownerEntity) + { + continue; + } + entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlight.id, hasAether ? 30 * 20 : 20, 0)); + entityCount++; } - - if(entityCount > 0 && world.getWorldTime() % reagentCooldown == 0) + + if (entityCount > 0 && world.getWorldTime() % reagentCooldown == 0) { - if(hasAether) - { + if (hasAether) + { this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); - } - if(hasReductus) - { - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - } + } + if (hasReductus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + } } - + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * entityCount); } } @@ -97,90 +94,90 @@ public class RitualEffectFlight extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList flightRitual = new ArrayList(); - flightRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); - flightRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); - flightRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); - flightRitual.add(new RitualComponent(0, 0, -1, RitualComponent.DUSK)); - flightRitual.add(new RitualComponent(2, 0, 2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(2, 0, -2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(1, 0, 3, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(0, 0, 3, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(1, 0, -3, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(0, 0, -3, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(3, 0, 1, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(3, 0, 0, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(3, 0, -1, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(-3, 0, 0, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(-3, 0, -4, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(-4, 0, -3, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(-3, 0, 4, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(4, 0, -3, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(3, 0, -4, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(-4, 0, 3, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(3, 0, 4, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(4, 0, 3, RitualComponent.WATER)); - flightRitual.add(new RitualComponent(-1, 1, 0, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(1, 1, 0, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(0, 1, -1, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(0, 1, 1, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(-2, 1, 0, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(2, 1, 0, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(0, 1, -2, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(0, 1, 2, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(-4, 1, 0, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(4, 1, 0, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(0, 1, -4, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(0, 1, 4, RitualComponent.BLANK)); - flightRitual.add(new RitualComponent(-5, 1, 0, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(5, 1, 0, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(0, 1, -5, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(0, 1, 5, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(5, 0, 0, RitualComponent.DUSK)); - flightRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.DUSK)); - flightRitual.add(new RitualComponent(0, 0, 5, RitualComponent.DUSK)); - flightRitual.add(new RitualComponent(0, 0, -5, RitualComponent.DUSK)); + public List getRitualComponentList() + { + ArrayList flightRitual = new ArrayList(); + flightRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, -1, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(2, 0, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(2, 0, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(1, 0, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 0, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(1, 0, -3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 0, -3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(3, 0, 1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(3, 0, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(3, 0, -1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, -4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-4, 0, -3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-3, 0, 4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(4, 0, -3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(3, 0, -4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-4, 0, 3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(3, 0, 4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(4, 0, 3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-1, 1, 0, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(1, 1, 0, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(0, 1, -1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(0, 1, 1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-2, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(2, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, -2, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, 2, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(-4, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(4, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, -4, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, 4, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(-5, 1, 0, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(5, 1, 0, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(0, 1, -5, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(0, 1, 5, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(5, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, 5, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, -5, RitualComponent.DUSK)); - for (int i = 2; i <= 4; i++) - { - flightRitual.add(new RitualComponent(-i, 2, 0, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(i, 2, 0, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(0, 2, -i, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(0, 2, i, RitualComponent.EARTH)); - } + for (int i = 2; i <= 4; i++) + { + flightRitual.add(new RitualComponent(-i, 2, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(i, 2, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 2, -i, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 2, i, RitualComponent.EARTH)); + } - flightRitual.add(new RitualComponent(2, 4, 1, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(1, 4, 2, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(-2, 4, 1, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(1, 4, -2, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(2, 4, -1, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(-1, 4, 2, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(-2, 4, -1, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(-1, 4, -2, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(2, 4, 2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(-2, 4, 2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(2, 4, -2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(-2, 4, -2, RitualComponent.AIR)); - flightRitual.add(new RitualComponent(-4, 2, -4, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(4, 2, 4, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(4, 2, -4, RitualComponent.FIRE)); - flightRitual.add(new RitualComponent(-4, 2, 4, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(2, 4, 1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(1, 4, 2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-2, 4, 1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(1, 4, -2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(2, 4, -1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-1, 4, 2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-2, 4, -1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-1, 4, -2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(2, 4, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 4, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(2, 4, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 4, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-4, 2, -4, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(4, 2, 4, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(4, 2, -4, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-4, 2, 4, RitualComponent.FIRE)); - for (int i = -1; i <= 1; i++) - { - flightRitual.add(new RitualComponent(3, 4, i, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(-3, 4, i, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(i, 4, 3, RitualComponent.EARTH)); - flightRitual.add(new RitualComponent(i, 4, -3, RitualComponent.EARTH)); - } - return flightRitual; - } + for (int i = -1; i <= 1; i++) + { + flightRitual.add(new RitualComponent(3, 4, i, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 4, i, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(i, 4, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(i, 4, -3, RitualComponent.EARTH)); + } + return flightRitual; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java index 2753a118..e4504f54 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java @@ -1,8 +1,10 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +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 net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemFood; @@ -10,15 +12,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.FoodStats; import net.minecraft.world.World; -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 java.util.ArrayList; +import java.util.List; public class RitualEffectFullStomach extends RitualEffect { - + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -34,15 +34,15 @@ public class RitualEffectFullStomach extends RitualEffect { return; } - + double horizRange = 16; double vertRange = 16; - - List playerList = SpellHelper.getPlayersInRange(world, x+0.5, y+0.5, z+0.5, horizRange, vertRange); - - if(playerList == null) + + List playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, horizRange, vertRange); + + if (playerList == null) { - return; + return; } if (currentEssence < this.getCostPerRefresh() * playerList.size()) @@ -50,52 +50,52 @@ public class RitualEffectFullStomach extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - TileEntity tile = world.getTileEntity(x, y+1, z); - IInventory inventory = null; - if(tile instanceof IInventory) - { - inventory = (IInventory)tile; - }else - { - tile = world.getTileEntity(x, y-1, z); - if(tile instanceof IInventory) - { - inventory = (IInventory)tile; - } - } - - int count = 0; - - if(inventory != null) - { - for(EntityPlayer player : playerList) - { - FoodStats foodStats = player.getFoodStats(); - float satLevel = foodStats.getSaturationLevel(); - - for(int i=0; i getRitualComponentList() - { - ArrayList fullRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList fullRitual = new ArrayList(); fullRitual.add(new RitualComponent(0, 0, 3, RitualComponent.FIRE)); fullRitual.add(new RitualComponent(0, 0, -3, RitualComponent.FIRE)); fullRitual.add(new RitualComponent(3, 0, 0, RitualComponent.FIRE)); @@ -118,7 +118,7 @@ public class RitualEffectFullStomach extends RitualEffect fullRitual.add(new RitualComponent(1, 0, -1, RitualComponent.AIR)); fullRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.AIR)); fullRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.AIR)); - + fullRitual.add(new RitualComponent(2, 0, 1, RitualComponent.AIR)); fullRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR)); fullRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); @@ -127,12 +127,12 @@ public class RitualEffectFullStomach extends RitualEffect fullRitual.add(new RitualComponent(1, 0, -2, RitualComponent.AIR)); fullRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.AIR)); fullRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.AIR)); - + fullRitual.add(new RitualComponent(4, 0, 4, RitualComponent.WATER)); fullRitual.add(new RitualComponent(4, 0, -4, RitualComponent.WATER)); fullRitual.add(new RitualComponent(-4, 0, -4, RitualComponent.WATER)); fullRitual.add(new RitualComponent(-4, 0, 4, RitualComponent.WATER)); - + fullRitual.add(new RitualComponent(4, 0, 3, RitualComponent.EARTH)); fullRitual.add(new RitualComponent(3, 0, 4, RitualComponent.EARTH)); fullRitual.add(new RitualComponent(-4, 0, 3, RitualComponent.EARTH)); @@ -143,5 +143,5 @@ public class RitualEffectFullStomach extends RitualEffect fullRitual.add(new RitualComponent(-3, 0, 4, RitualComponent.EARTH)); return fullRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java index 91d24751..c3272f09 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java @@ -1,29 +1,25 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFarmland; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectGrowth extends RitualEffect { - private static final int aquasalusDrain = 10; - private static final int terraeDrain = 20; - private static final int orbisTerraeDrain = 20; - private static final int virtusDrain = 10; - + private static final int aquasalusDrain = 10; + private static final int terraeDrain = 20; + private static final int orbisTerraeDrain = 20; + private static final int virtusDrain = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -35,38 +31,38 @@ public class RitualEffectGrowth extends RitualEffect int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - if (currentEssence < this.getCostPerRefresh()*9) + if (currentEssence < this.getCostPerRefresh() * 9) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); - boolean hasOrbisTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, false); - boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); + boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); + boolean hasOrbisTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, false); + boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); - int speed = this.getSpeedForReagents(hasTerrae, hasOrbisTerrae); + int speed = this.getSpeedForReagents(hasTerrae, hasOrbisTerrae); if (world.getWorldTime() % speed != 0) { return; } - - if(this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false)) - { - int hydrationRange = hasVirtus ? 4 : 1; - for(int i=-hydrationRange; i<=hydrationRange; i++) - { - for(int j=-hydrationRange; j<=hydrationRange; j++) - { - if(this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false)) - { - if(SpellHelper.hydrateSoil(world, x + i, y + 1, z + j)) - { - this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); - } - } - } - } - } + + if (this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false)) + { + int hydrationRange = hasVirtus ? 4 : 1; + for (int i = -hydrationRange; i <= hydrationRange; i++) + { + for (int j = -hydrationRange; j <= hydrationRange; j++) + { + if (this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false)) + { + if (SpellHelper.hydrateSoil(world, x + i, y + 1, z + j)) + { + this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); + } + } + } + } + } int flag = 0; @@ -90,14 +86,14 @@ public class RitualEffectGrowth extends RitualEffect if (flag > 0) { - if(hasTerrae) - this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); - if(hasOrbisTerrae) - this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true); - if(hasVirtus) - this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); + if (hasTerrae) + this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); + if (hasOrbisTerrae) + this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true); + if (hasVirtus) + this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*flag); + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * flag); } } } @@ -109,9 +105,9 @@ public class RitualEffectGrowth extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList growthRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList growthRitual = new ArrayList(); growthRitual.add(new RitualComponent(1, 0, 0, 1)); growthRitual.add(new RitualComponent(-1, 0, 0, 1)); growthRitual.add(new RitualComponent(0, 0, 1, 1)); @@ -121,28 +117,28 @@ public class RitualEffectGrowth extends RitualEffect growthRitual.add(new RitualComponent(-1, 0, -1, 3)); growthRitual.add(new RitualComponent(1, 0, -1, 3)); return growthRitual; - } - + } + public int getSpeedForReagents(boolean hasTerrae, boolean hasOrbisTerrae) { - if(hasOrbisTerrae) - { - if(hasTerrae) - { - return 10; - }else - { - return 15; - } - }else - { - if(hasTerrae) - { - return 20; - }else - { - return 30; - } - } + if (hasOrbisTerrae) + { + if (hasTerrae) + { + return 10; + } else + { + return 15; + } + } else + { + if (hasTerrae) + { + return 20; + } else + { + return 30; + } + } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java index f85d611e..02803953 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java @@ -1,30 +1,27 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; +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 net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; -import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; -import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; -import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectHarvest extends RitualEffect { - @Override - public void performEffect(IMasterRitualStone ritualStone) - { - String owner = ritualStone.getOwner(); + @Override + public void performEffect(IMasterRitualStone ritualStone) + { + String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); World world = ritualStone.getWorld(); @@ -49,23 +46,23 @@ public class RitualEffectHarvest extends RitualEffect { return; } - - Block block = world.getBlock(x, y-1, z); + + Block block = world.getBlock(x, y - 1, z); int flag = 0; int range = this.getRadiusForModifierBlock(block); - int vertRange = 4; + int vertRange = 4; for (int i = -range; i <= range; i++) { for (int j = -vertRange; j <= vertRange; j++) { - for(int k = -range; k<=range; k++) - { - if(HarvestRegistry.harvestBlock(world, x + i, y + j, z + k) && flag < maxCount) + for (int k = -range; k <= range; k++) + { + if (HarvestRegistry.harvestBlock(world, x + i, y + j, z + k) && flag < maxCount) { - flag++; + flag++; } - } + } } } @@ -74,70 +71,70 @@ public class RitualEffectHarvest extends RitualEffect SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * Math.min(maxCount, flag)); } } - } + } - @Override - public int getCostPerRefresh() - { - return 20; - } + @Override + public int getCostPerRefresh() + { + return 20; + } - public int getRadiusForModifierBlock(Block block) - { - if(block == null) - { - return 4; - } - - if(block == Blocks.diamond_block) - { - return 15; - } - - if(block == Blocks.gold_block) - { - return 10; - } - - if(block == Blocks.iron_block) - { - return 6; - } - - return 4; - } - - @Override - public List getRitualComponentList() - { - ArrayList harvestRitual = new ArrayList(); + public int getRadiusForModifierBlock(Block block) + { + if (block == null) + { + return 4; + } + + if (block == Blocks.diamond_block) + { + return 15; + } + + if (block == Blocks.gold_block) + { + return 10; + } + + if (block == Blocks.iron_block) + { + return 6; + } + + return 4; + } + + @Override + public List getRitualComponentList() + { + ArrayList harvestRitual = new ArrayList(); + + harvestRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(2, 0, 0, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(0, 0, 2, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(0, 0, -2, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(3, 0, 1, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(3, 0, -1, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(1, 0, 3, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(1, 0, -3, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(2, 0, 3, RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(3, 0, 2, RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(2, 0, -3, RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-3, 0, 2, RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-2, 0, 3, RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(3, 0, -2, RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-2, 0, -3, RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-3, 0, -2, RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(1,0,1,RitualComponent.DUSK)); - harvestRitual.add(new RitualComponent(1,0,-1,RitualComponent.DUSK)); - harvestRitual.add(new RitualComponent(-1,0,-1,RitualComponent.DUSK)); - harvestRitual.add(new RitualComponent(-1,0,1,RitualComponent.DUSK)); - harvestRitual.add(new RitualComponent(2,0,0,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(-2,0,0,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(0,0,2,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(0,0,-2,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(3,0,1,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(3,0,-1,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(-3,0,1,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(-3,0,-1,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(1,0,3,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(-1,0,3,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(1,0,-3,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(-1,0,-3,RitualComponent.EARTH)); - harvestRitual.add(new RitualComponent(2,0,3,RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(3,0,2,RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(2,0,-3,RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(-3,0,2,RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(-2,0,3,RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(3,0,-2,RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(-2,0,-3,RitualComponent.WATER)); - harvestRitual.add(new RitualComponent(-3,0,-2,RitualComponent.WATER)); - return harvestRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java index a0c86f27..c8e45fbe 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java @@ -1,30 +1,26 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectHealing extends RitualEffect { - public static final int reductusDrain = 10; - public static final int virtusDrain = 10; - public static final int praesidiumDrain = 2; - + public static final int reductusDrain = 10; + public static final int virtusDrain = 10; + public static final int praesidiumDrain = 2; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -37,22 +33,22 @@ public class RitualEffectHealing extends RitualEffect int z = ritualStone.getZCoord(); int timeDelay = 50; - + if (world.getWorldTime() % timeDelay != 0) { return; } - + boolean hasPraesidium = this.canDrainReagent(ritualStone, ReagentRegistry.praesidiumReagent, praesidiumDrain, false); - + int range = 15 * (hasPraesidium ? 3 : 1); int vertRange = 15 * (hasPraesidium ? 3 : 1); - List list = SpellHelper.getLivingEntitiesInRange(world, x+0.5, y+0.5, z+0.5, range, vertRange); + List list = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, vertRange); int entityCount = 0; boolean flag = false; - for(EntityLivingBase livingEntity : list) + for (EntityLivingBase livingEntity : list) { if (livingEntity instanceof EntityPlayer) { @@ -62,64 +58,64 @@ public class RitualEffectHealing extends RitualEffect entityCount++; } } - + boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); - + int cost = this.getCostPerRefresh() * (hasVirtus ? 3 : 1); - int potency = hasVirtus ? 1 : 0; + int potency = hasVirtus ? 1 : 0; if (currentEssence < cost * entityCount) { SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - entityCount = 0; - - boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); - - for(EntityLivingBase livingEntity : list) + entityCount = 0; + + boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); + + for (EntityLivingBase livingEntity : list) { - hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); - if(hasReductus && !(livingEntity instanceof EntityPlayer)) - { - continue; - } - + hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); + if (hasReductus && !(livingEntity instanceof EntityPlayer)) + { + continue; + } + if (livingEntity.getHealth() + 0.1f < livingEntity.getMaxHealth()) { - PotionEffect effect = livingEntity.getActivePotionEffect(Potion.regeneration); - if(effect == null || (effect != null && effect.getAmplifier() <= potency && effect.getDuration() <= timeDelay)) - { - if(!hasVirtus || (this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false))) - { - livingEntity.addPotionEffect(new PotionEffect(Potion.regeneration.id, timeDelay + 2, potency)); - if(hasReductus) - { - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - } - if(hasVirtus) - { - this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); - } - - if (livingEntity instanceof EntityPlayer) + PotionEffect effect = livingEntity.getActivePotionEffect(Potion.regeneration); + if (effect == null || (effect != null && effect.getAmplifier() <= potency && effect.getDuration() <= timeDelay)) + { + if (!hasVirtus || (this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false))) + { + livingEntity.addPotionEffect(new PotionEffect(Potion.regeneration.id, timeDelay + 2, potency)); + if (hasReductus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + } + if (hasVirtus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); + } + + if (livingEntity instanceof EntityPlayer) { entityCount += 10; } else { entityCount++; } - } - } + } + } } } - if(entityCount > 0) + if (entityCount > 0) { - if(hasPraesidium) - { - this.canDrainReagent(ritualStone, ReagentRegistry.praesidiumReagent, praesidiumDrain, true); - } + if (hasPraesidium) + { + this.canDrainReagent(ritualStone, ReagentRegistry.praesidiumReagent, praesidiumDrain, true); + } SoulNetworkHandler.syphonFromNetwork(owner, cost * entityCount); } } @@ -128,14 +124,13 @@ public class RitualEffectHealing extends RitualEffect @Override public int getCostPerRefresh() { - // TODO Auto-generated method stub return 20; } @Override - public List getRitualComponentList() - { - ArrayList healingRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList healingRitual = new ArrayList(); healingRitual.add(new RitualComponent(4, 0, 0, RitualComponent.AIR)); healingRitual.add(new RitualComponent(5, 0, -1, RitualComponent.AIR)); healingRitual.add(new RitualComponent(5, 0, 1, RitualComponent.AIR)); @@ -181,5 +176,5 @@ public class RitualEffectHealing extends RitualEffect healingRitual.add(new RitualComponent(-5, -1, -4, RitualComponent.EARTH)); healingRitual.add(new RitualComponent(-5, 0, -5, RitualComponent.EARTH)); return healingRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java index 12fc1b63..0a1b9711 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java @@ -1,30 +1,25 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectInterdiction extends RitualEffect { - public static final int aetherDrain = 1; - public static final int magicalesDrain = 1; - + public static final int aetherDrain = 1; + public static final int magicalesDrain = 1; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -43,15 +38,15 @@ public class RitualEffectInterdiction extends RitualEffect { int d0 = 5; - List list = SpellHelper.getLivingEntitiesInRange(world, x+0.5, y+0.5, z+0.5, d0, d0); + List list = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, d0, d0); boolean flag = false; - + boolean hasOffensa = this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false); boolean playerFlag = false; - for(EntityLivingBase entityLiving : list) + for (EntityLivingBase entityLiving : list) { - if (!((!hasOffensa && entityLiving instanceof EntityPlayer) && (SpellHelper.getUsername((EntityPlayer)entityLiving).equals(owner)))) + if (!((!hasOffensa && entityLiving instanceof EntityPlayer) && (SpellHelper.getUsername((EntityPlayer) entityLiving).equals(owner)))) { double xDif = entityLiving.posX - x; double yDif = entityLiving.posY - (y + 1); @@ -59,65 +54,59 @@ public class RitualEffectInterdiction extends RitualEffect entityLiving.motionX = 0.1 * xDif; entityLiving.motionY = 0.1 * yDif; entityLiving.motionZ = 0.1 * zDif; - - if(hasOffensa && entityLiving instanceof EntityPlayer) + + if (hasOffensa && entityLiving instanceof EntityPlayer) { - SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityLiving, 0.1 * xDif, 0.1 * yDif, 0.1 * zDif); - playerFlag = true; + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) entityLiving, 0.1 * xDif, 0.1 * yDif, 0.1 * zDif); + playerFlag = true; } - entityLiving.fallDistance = 0; - - flag = true; - - - //entityLiving.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); } } - - if(playerFlag) + + if (playerFlag) { - this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true); } - + boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); - - if(hasAether) + + if (hasAether) { - int aetherDrainRate = 10; - - int horizontalRadius = 5; - int verticalRadius = 5; - List itemList = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(horizontalRadius, verticalRadius, horizontalRadius)); - - if(itemList != null) - { - boolean itemFlag = false; - - for(EntityItem entity : itemList) - { - double xDif = entity.posX - x; + int aetherDrainRate = 10; + + int horizontalRadius = 5; + int verticalRadius = 5; + List itemList = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(horizontalRadius, verticalRadius, horizontalRadius)); + + if (itemList != null) + { + boolean itemFlag = false; + + for (EntityItem entity : itemList) + { + double xDif = entity.posX - x; double yDif = entity.posY - (y + 1); double zDif = entity.posZ - z; entity.motionX = 0.1 * xDif; entity.motionY = 0.1 * yDif; entity.motionZ = 0.1 * zDif; - + itemFlag = true; - } - - if(itemFlag) - { - flag = true; - if(world.getWorldTime() % aetherDrainRate == 0) - { - this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); - } - } - } + } + + if (itemFlag) + { + flag = true; + if (world.getWorldTime() % aetherDrainRate == 0) + { + this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); + } + } + } } - + if (world.getWorldTime() % 2 == 0 && flag) { @@ -133,9 +122,9 @@ public class RitualEffectInterdiction extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList interdictionRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList interdictionRitual = new ArrayList(); interdictionRitual.add(new RitualComponent(1, 0, 0, 4)); interdictionRitual.add(new RitualComponent(-1, 0, 0, 4)); interdictionRitual.add(new RitualComponent(0, 0, 1, 4)); @@ -145,5 +134,5 @@ public class RitualEffectInterdiction extends RitualEffect interdictionRitual.add(new RitualComponent(-1, 0, -1, 4)); interdictionRitual.add(new RitualComponent(1, 0, -1, 4)); return interdictionRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java index f4800145..8bccb2e2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java @@ -1,40 +1,32 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFurnace; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.block.BlockFurnace; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectItemSuction extends RitualEffect { - public static final int reductusDrain = 1; - - public static final int timeDelayMin = 60; - + public static final int reductusDrain = 1; + + public static final int timeDelayMin = 60; + @Override public void performEffect(IMasterRitualStone ritualStone) { String owner = ritualStone.getOwner(); - + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); World world = ritualStone.getWorld(); @@ -56,99 +48,63 @@ public class RitualEffectItemSuction extends RitualEffect { return; } - - if (currentEssence < this.getCostPerRefresh()*100) + + if (currentEssence < this.getCostPerRefresh() * 100) { SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - List itemDropList = SpellHelper.getItemsInRange(world, x+0.5f, y+0.5f, z+0.5f, 10, 10); - + List itemDropList = SpellHelper.getItemsInRange(world, x + 0.5f, y + 0.5f, z + 0.5f, 10, 10); + boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); int count = 0; - + if (itemDropList != null) { int invSize = tileEntity.getSizeInventory(); for (EntityItem itemEntity : itemDropList) { - hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); - if(hasReductus && itemEntity.age < this.timeDelayMin) - { - continue; - } - ItemStack item = itemEntity.getEntityItem(); - ItemStack copyStack = itemEntity.getEntityItem().copy(); - - int pastAmount = copyStack.stackSize; - -// for (int n = 0; n < invSize; n++) -// { -// if (tileEntity.isItemValidForSlot(n, copyStack) && copyStack.stackSize != 0) -// { -// ItemStack itemStack = tileEntity.getStackInSlot(n); -// -// if (itemStack == null) -// { -// tileEntity.setInventorySlotContents(n, item); -// copyStack.stackSize = 0; -// } else -// { -// if (itemStack.getItem().equals(copyStack.getItem()) && itemStack.getItemDamage() == copyStack.getItemDamage()) -// { -// int itemSize = itemStack.stackSize; -// int copySize = copyStack.stackSize; -// int maxSize = itemStack.getMaxStackSize(); -// -// if (copySize + itemSize < maxSize) -// { -// copyStack.stackSize = 0; -// itemStack.stackSize = itemSize + copySize; -// tileEntity.setInventorySlotContents(n, itemStack); -// } else -// { -// copyStack.stackSize = itemSize + copySize - maxSize; -// itemStack.stackSize = maxSize; -// } -// } -// } -// } -// } - - //count++; - - ItemStack newStack = SpellHelper.insertStackIntoInventory(copyStack, tileEntity); - - if(newStack != null && newStack.stackSize < pastAmount) + hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); + if (hasReductus && itemEntity.age < this.timeDelayMin) { - count++; - if(newStack.stackSize<=0) + continue; + } + ItemStack item = itemEntity.getEntityItem(); + ItemStack copyStack = itemEntity.getEntityItem().copy(); + + int pastAmount = copyStack.stackSize; + ItemStack newStack = SpellHelper.insertStackIntoInventory(copyStack, tileEntity); + + if (newStack != null && newStack.stackSize < pastAmount) + { + count++; + if (newStack.stackSize <= 0) { - itemEntity.setDead(); - itemEntity.getEntityItem().stackSize = newStack.stackSize; + itemEntity.setDead(); + itemEntity.getEntityItem().stackSize = newStack.stackSize; } - + if (newStack.stackSize > 0) { itemEntity.getEntityItem().stackSize = newStack.stackSize; } - if(hasReductus) + if (hasReductus) { - BlockFurnace d; - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - } - } + BlockFurnace d; + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + } + } } } - - if(count>0) + + if (count > 0) { - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*Math.min(count, 100)); + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * Math.min(count, 100)); return; } - } + } } @Override @@ -158,9 +114,9 @@ public class RitualEffectItemSuction extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList suctionRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList suctionRitual = new ArrayList(); suctionRitual.add(new RitualComponent(2, 0, 0, RitualComponent.AIR)); suctionRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.AIR)); suctionRitual.add(new RitualComponent(0, 0, 2, RitualComponent.AIR)); @@ -174,5 +130,5 @@ public class RitualEffectItemSuction extends RitualEffect suctionRitual.add(new RitualComponent(0, -1, 1, RitualComponent.AIR)); suctionRitual.add(new RitualComponent(0, -1, -1, RitualComponent.AIR)); return suctionRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java index 69ffe1a0..4c6dc431 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java @@ -1,27 +1,25 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectJumping extends RitualEffect { - public static final int aetherDrain = 10; - public static final int terraeDrain = 10; - + public static final int aetherDrain = 10; + public static final int terraeDrain = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -32,9 +30,9 @@ public class RitualEffectJumping extends RitualEffect int x = ritualStone.getXCoord(); int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - - double range = 0.5; - List livingList = SpellHelper.getLivingEntitiesInRange(world, x+0.5, y+1.5, z+0.5, range, range); + + double range = 0.5; + List livingList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 1.5, z + 0.5, range, range); if (currentEssence < this.getCostPerRefresh() * livingList.size()) { @@ -42,25 +40,25 @@ public class RitualEffectJumping extends RitualEffect } else { int flag = 0; - + boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); - - for(EntityLivingBase livingEntity : livingList) + + for (EntityLivingBase livingEntity : livingList) { - if(livingEntity.isSneaking()) - { - continue; - } - - hasAether = hasAether && this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); - hasTerrae = hasTerrae && this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); - + if (livingEntity.isSneaking()) + { + continue; + } + + hasAether = hasAether && this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); + hasTerrae = hasTerrae && this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); + double motionY = 1.5 * (hasAether ? 2 : 1); - + if (livingEntity instanceof EntityPlayer) { - SpellHelper.setPlayerSpeedFromServer((EntityPlayer)livingEntity, livingEntity.motionX, motionY, livingEntity.motionZ); + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, livingEntity.motionX, motionY, livingEntity.motionZ); livingEntity.motionY = motionY; livingEntity.fallDistance = 0; flag++; @@ -70,24 +68,24 @@ public class RitualEffectJumping extends RitualEffect livingEntity.fallDistance = 0; flag++; } - - if(hasAether) + + if (hasAether) { - this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); } - if(hasTerrae) + if (hasTerrae) { - if(!livingEntity.isPotionActive(AlchemicalWizardry.customPotionFeatherFall)) - { - livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFeatherFall.id, 5 * 20, 0)); - this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); - } + if (!livingEntity.isPotionActive(AlchemicalWizardry.customPotionFeatherFall)) + { + livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFeatherFall.id, 5 * 20, 0)); + this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); + } } } if (flag > 0) { - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*flag); + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * flag); } } } @@ -99,9 +97,9 @@ public class RitualEffectJumping extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList jumpingRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList jumpingRitual = new ArrayList(); for (int i = -1; i <= 1; i++) { @@ -111,5 +109,5 @@ public class RitualEffectJumping extends RitualEffect jumpingRitual.add(new RitualComponent(1, i, -1, RitualComponent.AIR)); } return jumpingRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java index 96576e8b..8826b267 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java @@ -1,38 +1,36 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +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; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectLava extends RitualEffect { - public static final int sanctusDrain = 20; - public static final int offensaDrain = 50; - public static final int reductusDrain = 5; - - public static final int fireFuseCost = 1000; - + public static final int sanctusDrain = 20; + public static final int offensaDrain = 50; + public static final int reductusDrain = 5; + + public static final int fireFuseCost = 1000; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -44,47 +42,47 @@ public class RitualEffectLava extends RitualEffect int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - - if(this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost)) + + if (this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost)) { - boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); - boolean drainReductus = world.getWorldTime() % 100 == 0; - - int range = 5; + boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); + boolean drainReductus = world.getWorldTime() % 100 == 0; + + int range = 5; List entityList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); EntityPlayer player = SpellHelper.getPlayerForUsername(owner); - - for(EntityLivingBase entity : entityList) + + for (EntityLivingBase entity : entityList) { - if(entity != player && this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost) && !entity.isPotionActive(AlchemicalWizardry.customPotionFireFuse)) - { - if(hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) - { - if(entity instanceof EntityPlayer) - { - if(drainReductus) - { - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - } - - continue; - } - } - - entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFireFuse.id,100,0)); - this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true); - SoulNetworkHandler.syphonFromNetwork(owner, fireFuseCost); - } + if (entity != player && this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost) && !entity.isPotionActive(AlchemicalWizardry.customPotionFireFuse)) + { + if (hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) + { + if (entity instanceof EntityPlayer) + { + if (drainReductus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + } + + continue; + } + } + + entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFireFuse.id, 100, 0)); + this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true); + SoulNetworkHandler.syphonFromNetwork(owner, fireFuseCost); + } } } - + Block block = world.getBlock(x, y + 1, z); - + if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) { if (currentEssence < this.getCostPerRefresh()) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { for (int i = 0; i < 10; i++) @@ -95,47 +93,45 @@ public class RitualEffectLava extends RitualEffect world.setBlock(x, y + 1, z, Blocks.lava, 0, 3); SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } - }else + } else { - boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); - if(!hasSanctus) - { - return; - } - TileEntity tile = world.getTileEntity(x, y + 1, z); - if(tile instanceof IFluidHandler) - { - int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false); - if(amount >= 1000) - { - ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true); - - this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); - + boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); + if (!hasSanctus) + { + return; + } + TileEntity tile = world.getTileEntity(x, y + 1, z); + if (tile instanceof IFluidHandler) + { + int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false); + if (amount >= 1000) + { + ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true); + + this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); - } - } - } - - - + } + } + } + + } @Override public int getCostPerRefresh() { - // TODO Auto-generated method stub return 500; } @Override - public List getRitualComponentList() - { - ArrayList lavaRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList lavaRitual = new ArrayList(); lavaRitual.add(new RitualComponent(1, 0, 0, 2)); lavaRitual.add(new RitualComponent(-1, 0, 0, 2)); lavaRitual.add(new RitualComponent(0, 0, 1, 2)); lavaRitual.add(new RitualComponent(0, 0, -1, 2)); return lavaRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java index cde539ff..95712054 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java @@ -1,31 +1,28 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.EntityAgeable; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectLeap extends RitualEffect { - public static final int aetherDrain = 10; - public static final int terraeDrain = 10; - public static final int reductusDrain = 10; - public static final int tenebraeDrain = 10; - public static final int sanctusDrain = 10; - + public static final int aetherDrain = 10; + public static final int terraeDrain = 10; + public static final int reductusDrain = 10; + public static final int tenebraeDrain = 10; + public static final int sanctusDrain = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -38,43 +35,46 @@ public class RitualEffectLeap extends RitualEffect int z = ritualStone.getZCoord(); double range = 2.0; - - List livingList = SpellHelper.getLivingEntitiesInRange(world, x+0.5, y+0.5, z+0.5, range, range); - - if(livingList == null){return;} - + + List livingList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); + + if (livingList == null) + { + return; + } + if (currentEssence < this.getCostPerRefresh() * livingList.size()) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); + boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); boolean hasTenebrae = this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tenebraeDrain, false); boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); - - int direction = ritualStone.getDirection(); + + int direction = ritualStone.getDirection(); int flag = 0; - for(EntityLivingBase livingEntity : livingList) + for (EntityLivingBase livingEntity : livingList) { - if(livingEntity.isSneaking()) + if (livingEntity.isSneaking()) { - continue; + continue; } - - hasAether = hasAether && this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); + + hasAether = hasAether && this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); hasTerrae = hasTerrae && this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); hasTenebrae = hasTenebrae && this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tenebraeDrain, false); hasSanctus = hasSanctus && this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); - - double motionY = hasTerrae ? 0.6 : 1.2; - double speed = hasAether ? 6.0 : 3.0; - if (!(hasTenebrae || hasSanctus)|| livingEntity instanceof EntityPlayer) + double motionY = hasTerrae ? 0.6 : 1.2; + double speed = hasAether ? 6.0 : 3.0; + + if (!(hasTenebrae || hasSanctus) || livingEntity instanceof EntityPlayer) { livingEntity.motionY = motionY; livingEntity.fallDistance = 0; @@ -82,30 +82,30 @@ public class RitualEffectLeap extends RitualEffect switch (direction) { case 1: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer)livingEntity, 0, motionY, -speed); + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, 0, motionY, -speed); break; case 2: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer)livingEntity, speed, motionY, 0); + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, speed, motionY, 0); break; case 3: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer)livingEntity, 0, motionY, speed); + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, 0, motionY, speed); break; case 4: - SpellHelper.setPlayerSpeedFromServer((EntityPlayer)livingEntity, -speed, motionY, 0); + SpellHelper.setPlayerSpeedFromServer((EntityPlayer) livingEntity, -speed, motionY, 0); break; } flag++; } else { - if((hasSanctus && !livingEntity.isChild()) || (hasTenebrae && livingEntity.isChild())) - { - continue; - } - + if ((hasSanctus && !livingEntity.isChild()) || (hasTenebrae && livingEntity.isChild())) + { + continue; + } + livingEntity.motionY = motionY; switch (direction) @@ -131,36 +131,36 @@ public class RitualEffectLeap extends RitualEffect break; } - if(hasTenebrae) + if (hasTenebrae) { - this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tenebraeDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, tenebraeDrain, true); } - if(hasSanctus) + if (hasSanctus) { - this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); } - + livingEntity.fallDistance = 0; flag++; } - - if(hasAether) + + if (hasAether) { - this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); } - if(hasTerrae) + if (hasTerrae) { - this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); } - if(hasReductus) + if (hasReductus) { - if(!livingEntity.isPotionActive(AlchemicalWizardry.customPotionFeatherFall)) - { - livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFeatherFall.id, 3*20, 0)); - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - } + if (!livingEntity.isPotionActive(AlchemicalWizardry.customPotionFeatherFall)) + { + livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFeatherFall.id, 3 * 20, 0)); + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + } } - + } if (flag > 0) @@ -177,9 +177,9 @@ public class RitualEffectLeap extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList leapingRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList leapingRitual = new ArrayList(); leapingRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK)); leapingRitual.add(new RitualComponent(1, 0, -1, RitualComponent.AIR)); leapingRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.AIR)); @@ -190,5 +190,5 @@ public class RitualEffectLeap extends RitualEffect leapingRitual.add(new RitualComponent(-2, 0, i, RitualComponent.AIR)); } return leapingRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java index fab7e120..126a8375 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java @@ -1,23 +1,19 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; 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.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +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; public class RitualEffectLifeConduit extends RitualEffect { @@ -54,120 +50,118 @@ public class RitualEffectLifeConduit extends RitualEffect { return; } - - //tileAltar = (TEAltar)world.getBlockTileEntity(x,y-1,z); int d0 = 15; int vertRange = 20; - + EntityPlayer entityOwner = null; List list = SpellHelper.getPlayersInRange(world, x, y, z, d0, vertRange); - - for(EntityPlayer player : list) + + for (EntityPlayer player : list) { - if(SpellHelper.getUsername(player).equals(owner)) - { - entityOwner = player; - } + if (SpellHelper.getUsername(player).equals(owner)) + { + entityOwner = player; + } } if (entityOwner == null) { return; } - - int fillAmount = Math.min(currentEssence/2,tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid,10000), false)); - + + int fillAmount = Math.min(currentEssence / 2, tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 10000), false)); + { - tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid,fillAmount), true); - if(entityOwner.getHealth() > 2.0f && fillAmount != 0) - { - entityOwner.setHealth(2.0f); - } - SoulNetworkHandler.syphonFromNetwork(owner, fillAmount*2); + tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, fillAmount), true); + if (entityOwner.getHealth() > 2.0f && fillAmount != 0) + { + entityOwner.setHealth(2.0f); + } + SoulNetworkHandler.syphonFromNetwork(owner, fillAmount * 2); } } @Override public int getCostPerRefresh() { - return 0; + return 0; } @Override - public List getRitualComponentList() - { - ArrayList conduitRitual = new ArrayList(); - - conduitRitual.add(new RitualComponent(-1,0,-1,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(-1,0,1,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(1,0,1,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(1,0,-1,RitualComponent.FIRE)); - - for(int i=0; i<4; i++) - { - conduitRitual.add(new RitualComponent(-2,i,-2,RitualComponent.AIR)); - conduitRitual.add(new RitualComponent(-2,i,2,RitualComponent.AIR)); - conduitRitual.add(new RitualComponent(2,i,2,RitualComponent.AIR)); - conduitRitual.add(new RitualComponent(2,i,-2,RitualComponent.AIR)); - } - - conduitRitual.add(new RitualComponent(4,1,4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(4,1,-4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(-4,1,-4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(-4,1,4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(3,1,4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(4,1,3,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(-3,1,4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(-4,1,3,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(3,1,-4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(4,1,-3,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(-3,1,-4,RitualComponent.EARTH)); - conduitRitual.add(new RitualComponent(-4,1,-3,RitualComponent.EARTH)); + public List getRitualComponentList() + { + ArrayList conduitRitual = new ArrayList(); - - for(int i=0; i<2; i++) - { - conduitRitual.add(new RitualComponent(4,i+2,4,RitualComponent.WATER)); - conduitRitual.add(new RitualComponent(4,i+2,-4,RitualComponent.WATER)); - conduitRitual.add(new RitualComponent(-4,i+2,-4,RitualComponent.WATER)); - conduitRitual.add(new RitualComponent(-4,i+2,4,RitualComponent.WATER)); - } - - conduitRitual.add(new RitualComponent(4,4,4,RitualComponent.DUSK)); - conduitRitual.add(new RitualComponent(4,4,-4,RitualComponent.DUSK)); - conduitRitual.add(new RitualComponent(-4,4,-4,RitualComponent.DUSK)); - conduitRitual.add(new RitualComponent(-4,4,4,RitualComponent.DUSK)); - - conduitRitual.add(new RitualComponent(6,0,5,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(5,0,6,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(-6,0,5,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(-5,0,6,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(6,0,-5,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(5,0,-6,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(-6,0,-5,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(-5,0,-6,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(1, 0, 1, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(1, 0, -1, RitualComponent.FIRE)); + + for (int i = 0; i < 4; i++) + { + conduitRitual.add(new RitualComponent(-2, i, -2, RitualComponent.AIR)); + conduitRitual.add(new RitualComponent(-2, i, 2, RitualComponent.AIR)); + conduitRitual.add(new RitualComponent(2, i, 2, RitualComponent.AIR)); + conduitRitual.add(new RitualComponent(2, i, -2, RitualComponent.AIR)); + } + + conduitRitual.add(new RitualComponent(4, 1, 4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(4, 1, -4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4, 1, -4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4, 1, 4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(3, 1, 4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(4, 1, 3, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-3, 1, 4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4, 1, 3, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(3, 1, -4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(4, 1, -3, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-3, 1, -4, RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4, 1, -3, RitualComponent.EARTH)); + + + for (int i = 0; i < 2; i++) + { + conduitRitual.add(new RitualComponent(4, i + 2, 4, RitualComponent.WATER)); + conduitRitual.add(new RitualComponent(4, i + 2, -4, RitualComponent.WATER)); + conduitRitual.add(new RitualComponent(-4, i + 2, -4, RitualComponent.WATER)); + conduitRitual.add(new RitualComponent(-4, i + 2, 4, RitualComponent.WATER)); + } + + conduitRitual.add(new RitualComponent(4, 4, 4, RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(4, 4, -4, RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-4, 4, -4, RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-4, 4, 4, RitualComponent.DUSK)); + + conduitRitual.add(new RitualComponent(6, 0, 5, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(5, 0, 6, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6, 0, 5, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-5, 0, 6, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(6, 0, -5, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(5, 0, -6, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6, 0, -5, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-5, 0, -6, RitualComponent.FIRE)); + + for (int i = 0; i < 2; i++) + { + conduitRitual.add(new RitualComponent(6, i, 6, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(6, i, -6, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6, i, 6, RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6, i, -6, RitualComponent.FIRE)); + } + + for (int i = 0; i < 3; i++) + { + conduitRitual.add(new RitualComponent(6, i + 2, 6, RitualComponent.BLANK)); + conduitRitual.add(new RitualComponent(6, i + 2, -6, RitualComponent.BLANK)); + conduitRitual.add(new RitualComponent(-6, i + 2, 6, RitualComponent.BLANK)); + conduitRitual.add(new RitualComponent(-6, i + 2, -6, RitualComponent.BLANK)); + } + + conduitRitual.add(new RitualComponent(6, 5, 6, RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(6, 5, -6, RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-6, 5, 6, RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-6, 5, -6, RitualComponent.DUSK)); - for(int i=0; i<2; i++) - { - conduitRitual.add(new RitualComponent(6,i,6,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(6,i,-6,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(-6,i,6,RitualComponent.FIRE)); - conduitRitual.add(new RitualComponent(-6,i,-6,RitualComponent.FIRE)); - } - - for(int i=0; i<3; i++) - { - conduitRitual.add(new RitualComponent(6,i+2,6,RitualComponent.BLANK)); - conduitRitual.add(new RitualComponent(6,i+2,-6,RitualComponent.BLANK)); - conduitRitual.add(new RitualComponent(-6,i+2,6,RitualComponent.BLANK)); - conduitRitual.add(new RitualComponent(-6,i+2,-6,RitualComponent.BLANK)); - } - - conduitRitual.add(new RitualComponent(6,5,6,RitualComponent.DUSK)); - conduitRitual.add(new RitualComponent(6,5,-6,RitualComponent.DUSK)); - conduitRitual.add(new RitualComponent(-6,5,6,RitualComponent.DUSK)); - conduitRitual.add(new RitualComponent(-6,5,-6,RitualComponent.DUSK)); - return conduitRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java index 01e289eb..1c710b8f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java @@ -1,37 +1,30 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectMagnetic extends RitualEffect { - private static final int potentiaDrain = 10; - private static final int terraeDrain = 10; - private static final int orbisTerraeDrain = 10; - + private static final int potentiaDrain = 10; + private static final int terraeDrain = 10; + private static final int orbisTerraeDrain = 10; + @Override public void performEffect(IMasterRitualStone ritualStone) { String owner = ritualStone.getOwner(); - + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); World world = ritualStone.getWorld(); int x = ritualStone.getXCoord(); @@ -39,20 +32,20 @@ public class RitualEffectMagnetic extends RitualEffect int z = ritualStone.getZCoord(); boolean hasPotentia = this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, false); - - if(world.getWorldTime() % (hasPotentia ? 10 : 40) != 0) + + if (world.getWorldTime() % (hasPotentia ? 10 : 40) != 0) { - return; + return; } boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); boolean hasOrbisTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, false); int radius = this.getRadiusForReagents(hasTerrae, hasOrbisTerrae); - + if (currentEssence < this.getCostPerRefresh()) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { int xRep = 0; @@ -79,7 +72,6 @@ public class RitualEffectMagnetic extends RitualEffect if (replace) { - //boolean hasReplaced = false; for (int j = y - 1; j >= 0; j--) { for (int i = -radius; i <= radius; i++) @@ -103,26 +95,25 @@ public class RitualEffectMagnetic extends RitualEffect if (oreName.contains("ore")) { - //TODO //Allow swapping code. This means the searched block is an ore. BlockTeleposer.swapBlocks(world, world, x + i, j, z + k, xRep, yRep, zRep); SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); - - if(hasPotentia) + + if (hasPotentia) { this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); } - - if(hasTerrae) + + if (hasTerrae) { this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true); } - - if(hasOrbisTerrae) + + if (hasOrbisTerrae) { this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true); } - + return; } } @@ -140,9 +131,9 @@ public class RitualEffectMagnetic extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList magneticRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList magneticRitual = new ArrayList(); magneticRitual.add(new RitualComponent(1, 0, 1, RitualComponent.EARTH)); magneticRitual.add(new RitualComponent(1, 0, -1, RitualComponent.EARTH)); magneticRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.EARTH)); @@ -160,28 +151,28 @@ public class RitualEffectMagnetic extends RitualEffect magneticRitual.add(new RitualComponent(-2, 2, 0, RitualComponent.FIRE)); magneticRitual.add(new RitualComponent(0, 2, -2, RitualComponent.FIRE)); return magneticRitual; - } - + } + public int getRadiusForReagents(boolean hasTerrae, boolean hasOrbisTerrae) - { - if(hasTerrae) - { - if(hasOrbisTerrae) - { - return 31; - }else - { - return 7; - } - }else - { - if(hasOrbisTerrae) - { - return 12; - }else - { - return 3; - } - } - } + { + if (hasTerrae) + { + if (hasOrbisTerrae) + { + return 31; + } else + { + return 7; + } + } else + { + if (hasOrbisTerrae) + { + return 12; + } else + { + return 3; + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java index 2099ca3d..820b9d69 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java @@ -1,26 +1,23 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; public class RitualEffectSoulBound extends RitualEffect { @@ -58,9 +55,6 @@ public class RitualEffectSoulBound extends RitualEffect while (iterator.hasNext()) { item = (EntityItem) iterator.next(); -// double xDif = item.posX - (xCoord+0.5); -// double yDif = item.posY - (yCoord+1); -// double zDif = item.posZ - (zCoord+0.5); ItemStack itemStack = item.getEntityItem(); if (itemStack == null) @@ -69,13 +63,13 @@ public class RitualEffectSoulBound extends RitualEffect } - if(BindingRegistry.isRequiredItemValid(itemStack)) + if (BindingRegistry.isRequiredItemValid(itemStack)) { - ritualStone.setVar1(BindingRegistry.getIndexForItem(itemStack)+1); - world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); + ritualStone.setVar1(BindingRegistry.getIndexForItem(itemStack) + 1); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); ritualStone.setCooldown(ritualStone.getCooldown() - 1); - item.setDead(); - break; + item.setDead(); + break; } if (world.rand.nextInt(10) == 0) @@ -131,8 +125,8 @@ public class RitualEffectSoulBound extends RitualEffect if (ritualStone.getCooldown() <= 0) { - - ItemStack spawnedItem = BindingRegistry.getOutputForIndex(ritualStone.getVar1()-1); + + ItemStack spawnedItem = BindingRegistry.getOutputForIndex(ritualStone.getVar1() - 1); if (spawnedItem != null) { @@ -159,9 +153,9 @@ public class RitualEffectSoulBound extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList boundSoulRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList boundSoulRitual = new ArrayList(); boundSoulRitual.add(new RitualComponent(3, 0, 0, 2)); boundSoulRitual.add(new RitualComponent(-3, 0, 0, 2)); boundSoulRitual.add(new RitualComponent(0, 0, 3, 2)); @@ -187,5 +181,5 @@ public class RitualEffectSoulBound extends RitualEffect boundSoulRitual.add(new RitualComponent(-3, 1, 3, 0)); boundSoulRitual.add(new RitualComponent(-3, 1, -3, 0)); return boundSoulRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java index 0d69aa0e..396b7779 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java @@ -1,23 +1,17 @@ package WayofTime.alchemicalWizardry.common.rituals; +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.AlchemicalWizardryEventHooks; +import WayofTime.alchemicalWizardry.common.CoordAndRange; +import net.minecraft.world.World; + import java.util.ArrayList; import java.util.LinkedList; import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; -import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks; -import WayofTime.alchemicalWizardry.common.CoordAndRange; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; - public class RitualEffectSpawnWard extends RitualEffect { @Override @@ -31,57 +25,52 @@ public class RitualEffectSpawnWard extends RitualEffect int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); -// if (world.getWorldTime() % 20 != 0) -// { -// return; -// } - if (currentEssence < this.getCostPerRefresh()) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - int horizRange = 32; - int vertRange = 32; - - int dimension = world.provider.dimensionId; - - if(AlchemicalWizardryEventHooks.respawnMap.containsKey(new Integer(dimension))) - { - List list = AlchemicalWizardryEventHooks.respawnMap.get(new Integer(dimension)); - if(list != null) - { - if(!list.contains(new CoordAndRange(x,y,z,horizRange,vertRange))) - { - boolean hasFoundAndRemoved = false; - for(CoordAndRange coords : list) - { - int xLocation = coords.xCoord; - int yLocation = coords.yCoord; - int zLocation = coords.zCoord; - - if(xLocation == x && yLocation == y && zLocation == z) - { - list.remove(coords); - hasFoundAndRemoved = true; - break; - } - } - list.add(new CoordAndRange(x,y,z,horizRange,vertRange)); - } - }else - { - list = new LinkedList(); - list.add(new CoordAndRange(x,y,z,horizRange,vertRange)); - AlchemicalWizardryEventHooks.respawnMap.put(new Integer(dimension), list); - } - }else - { - List list = new LinkedList(); - list.add(new CoordAndRange(x,y,z,horizRange,vertRange)); - AlchemicalWizardryEventHooks.respawnMap.put(new Integer(dimension), list); - } - + int horizRange = 32; + int vertRange = 32; + + int dimension = world.provider.dimensionId; + + if (AlchemicalWizardryEventHooks.respawnMap.containsKey(new Integer(dimension))) + { + List list = AlchemicalWizardryEventHooks.respawnMap.get(new Integer(dimension)); + if (list != null) + { + if (!list.contains(new CoordAndRange(x, y, z, horizRange, vertRange))) + { + boolean hasFoundAndRemoved = false; + for (CoordAndRange coords : list) + { + int xLocation = coords.xCoord; + int yLocation = coords.yCoord; + int zLocation = coords.zCoord; + + if (xLocation == x && yLocation == y && zLocation == z) + { + list.remove(coords); + hasFoundAndRemoved = true; + break; + } + } + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + } + } else + { + list = new LinkedList(); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + AlchemicalWizardryEventHooks.respawnMap.put(new Integer(dimension), list); + } + } else + { + List list = new LinkedList(); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + AlchemicalWizardryEventHooks.respawnMap.put(new Integer(dimension), list); + } + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } @@ -94,26 +83,26 @@ public class RitualEffectSpawnWard extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList wardRitualRitual = new ArrayList(); - - for(int i=2; i<=4; i++) - { - if(i <= 3) - { - wardRitualRitual.add(new RitualComponent(0, 0, i, RitualComponent.AIR)); - wardRitualRitual.add(new RitualComponent(0, 0, -i, RitualComponent.AIR)); - wardRitualRitual.add(new RitualComponent(i, 0, 0, RitualComponent.AIR)); - wardRitualRitual.add(new RitualComponent(-i, 0, 0, RitualComponent.AIR)); - } - - wardRitualRitual.add(new RitualComponent(i, 0, i, RitualComponent.FIRE)); - wardRitualRitual.add(new RitualComponent(i, 0, -i, RitualComponent.FIRE)); - wardRitualRitual.add(new RitualComponent(-i, 0, -i, RitualComponent.FIRE)); - wardRitualRitual.add(new RitualComponent(-i, 0, i, RitualComponent.FIRE)); - } - + public List getRitualComponentList() + { + ArrayList wardRitualRitual = new ArrayList(); + + for (int i = 2; i <= 4; i++) + { + if (i <= 3) + { + wardRitualRitual.add(new RitualComponent(0, 0, i, RitualComponent.AIR)); + wardRitualRitual.add(new RitualComponent(0, 0, -i, RitualComponent.AIR)); + wardRitualRitual.add(new RitualComponent(i, 0, 0, RitualComponent.AIR)); + wardRitualRitual.add(new RitualComponent(-i, 0, 0, RitualComponent.AIR)); + } + + wardRitualRitual.add(new RitualComponent(i, 0, i, RitualComponent.FIRE)); + wardRitualRitual.add(new RitualComponent(i, 0, -i, RitualComponent.FIRE)); + wardRitualRitual.add(new RitualComponent(-i, 0, -i, RitualComponent.FIRE)); + wardRitualRitual.add(new RitualComponent(-i, 0, i, RitualComponent.FIRE)); + } + wardRitualRitual.add(new RitualComponent(0, 0, 5, RitualComponent.DUSK)); wardRitualRitual.add(new RitualComponent(0, 0, -5, RitualComponent.DUSK)); wardRitualRitual.add(new RitualComponent(5, 0, 0, RitualComponent.DUSK)); @@ -127,7 +116,7 @@ public class RitualEffectSpawnWard extends RitualEffect wardRitualRitual.add(new RitualComponent(5, 0, -6, RitualComponent.WATER)); wardRitualRitual.add(new RitualComponent(-6, 0, -5, RitualComponent.WATER)); wardRitualRitual.add(new RitualComponent(-5, 0, -6, RitualComponent.WATER)); - + return wardRitualRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java index 70985878..94f769d6 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java @@ -1,24 +1,22 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectSummonMeteor extends RitualEffect { @@ -64,35 +62,35 @@ public class RitualEffectSummonMeteor extends RitualEffect int meteorID = MeteorRegistry.getParadigmIDForItem(entityItem.getEntityItem()); EntityMeteor meteor = new EntityMeteor(world, x + 0.5f, 257, z + 0.5f, meteorID); meteor.motionY = -1.0f; - - if(this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, 1000, true)) + + if (this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, 1000, true)) { - meteor.hasTerrae = true; + meteor.hasTerrae = true; } - if(this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, 1000, true)) + if (this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, 1000, true)) { - meteor.hasOrbisTerrae = true; + meteor.hasOrbisTerrae = true; } - if(this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, 1000, true)) + if (this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, 1000, true)) { - meteor.hasCrystallos = true; + meteor.hasCrystallos = true; } - if(this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, 1000, true)) + if (this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, 1000, true)) { - meteor.hasIncendium = true; + meteor.hasIncendium = true; } - if(this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, 1000, true)) + if (this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, 1000, true)) { - meteor.hasTennebrae = true; + meteor.hasTennebrae = true; } - + entityItem.setDead(); world.spawnEntityInWorld(meteor); ritualStone.setActive(false); break; } } - + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } } @@ -104,9 +102,9 @@ public class RitualEffectSummonMeteor extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList meteorRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList meteorRitual = new ArrayList(); meteorRitual.add(new RitualComponent(2, 0, 0, RitualComponent.FIRE)); meteorRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.FIRE)); meteorRitual.add(new RitualComponent(0, 0, 2, RitualComponent.FIRE)); @@ -210,5 +208,5 @@ public class RitualEffectSummonMeteor extends RitualEffect meteorRitual.add(new RitualComponent(-3, 4, -2, RitualComponent.FIRE)); meteorRitual.add(new RitualComponent(-3, 4, -3, RitualComponent.FIRE)); return meteorRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java index 9a93eb98..c04b4a2a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java @@ -1,30 +1,27 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; 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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectSupression extends RitualEffect { - public static final int aquasalusDrain = 15; - public static final int aetherDrain = 15; - + public static final int aquasalusDrain = 15; + public static final int aetherDrain = 15; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -35,27 +32,27 @@ public class RitualEffectSupression extends RitualEffect int x = ritualStone.getXCoord(); int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); - - Block blockish = world.getBlock(x, y-1, z); - + + Block blockish = world.getBlock(x, y - 1, z); + boolean hasAquasalus = this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false); boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false); - + int costMod = this.getCostModifier(blockish); int radius = this.getRadiusForReagents(hasAether, hasAquasalus); int masterRadius = radius; - - int yIndex = (int)(world.getWorldTime() % (2*radius + 1))-radius; + + int yIndex = (int) (world.getWorldTime() % (2 * radius + 1)) - radius; boolean expansion = false; - - if(ritualStone.getVar1()<(radius+1)) + + if (ritualStone.getVar1() < (radius + 1)) { - expansion = true; - radius = ritualStone.getVar1(); - ritualStone.setVar1(ritualStone.getVar1() + 1); + expansion = true; + radius = ritualStone.getVar1(); + ritualStone.setVar1(ritualStone.getVar1() + 1); } - - if (currentEssence < this.getCostPerRefresh()*costMod) + + if (currentEssence < this.getCostPerRefresh() * costMod) { EntityPlayer entityOwner = SpellHelper.getPlayerForUsername(owner); @@ -71,46 +68,45 @@ public class RitualEffectSupression extends RitualEffect { for (int j = (expansion ? -radius : yIndex); j <= (expansion ? radius : yIndex); j++) { - for(int k = -radius; k <= radius; k++) + for (int k = -radius; k <= radius; k++) { - if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) + if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) { continue; } - - Block block = world.getBlock(x+i, y+j, z+k); - - - if(SpellHelper.isBlockFluid(block)) - { - TESpectralContainer.createSpectralBlockAtLocation(world, x+i, y+j, z+k, 3*masterRadius); - } - else - { - TileEntity tile = world.getTileEntity(x+i, y+j, z+k); - if(tile instanceof TESpectralContainer) - { - ((TESpectralContainer) tile).resetDuration(3*masterRadius); - } - } + + Block block = world.getBlock(x + i, y + j, z + k); + + + if (SpellHelper.isBlockFluid(block)) + { + TESpectralContainer.createSpectralBlockAtLocation(world, x + i, y + j, z + k, 3 * masterRadius); + } else + { + TileEntity tile = world.getTileEntity(x + i, y + j, z + k); + if (tile instanceof TESpectralContainer) + { + ((TESpectralContainer) tile).resetDuration(3 * masterRadius); + } + } } } } - - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()*costMod); - - if(world.getWorldTime() % 100 == 0) + + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * costMod); + + if (world.getWorldTime() % 100 == 0) { - if(hasAquasalus) + if (hasAquasalus) { - this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); } - if(hasAether) + if (hasAether) { - this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); + this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true); } - } + } } } @@ -120,70 +116,50 @@ public class RitualEffectSupression extends RitualEffect return 2; } - @Override - public List getRitualComponentList() - { - ArrayList supressionRitual = new ArrayList(); - supressionRitual.add(new RitualComponent(2,0,2, RitualComponent.WATER)); - supressionRitual.add(new RitualComponent(2,0,-2, RitualComponent.WATER)); - supressionRitual.add(new RitualComponent(-2,0,2, RitualComponent.WATER)); - supressionRitual.add(new RitualComponent(-2,0,-2, RitualComponent.WATER)); - supressionRitual.add(new RitualComponent(-2,0,-1, RitualComponent.AIR)); - supressionRitual.add(new RitualComponent(-1,0,-2, RitualComponent.AIR)); - supressionRitual.add(new RitualComponent(-2,0,1, RitualComponent.AIR)); - supressionRitual.add(new RitualComponent(1,0,-2, RitualComponent.AIR)); - supressionRitual.add(new RitualComponent(2,0,1, RitualComponent.AIR)); - supressionRitual.add(new RitualComponent(1,0,2, RitualComponent.AIR)); - supressionRitual.add(new RitualComponent(2,0,-1, RitualComponent.AIR)); - supressionRitual.add(new RitualComponent(-1,0,2, RitualComponent.AIR)); + @Override + public List getRitualComponentList() + { + ArrayList supressionRitual = new ArrayList(); + supressionRitual.add(new RitualComponent(2, 0, 2, RitualComponent.WATER)); + supressionRitual.add(new RitualComponent(2, 0, -2, RitualComponent.WATER)); + supressionRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.WATER)); + supressionRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.WATER)); + supressionRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); + supressionRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.AIR)); + supressionRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR)); + supressionRitual.add(new RitualComponent(1, 0, -2, RitualComponent.AIR)); + supressionRitual.add(new RitualComponent(2, 0, 1, RitualComponent.AIR)); + supressionRitual.add(new RitualComponent(1, 0, 2, RitualComponent.AIR)); + supressionRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR)); + supressionRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.AIR)); return supressionRitual; - } - - public int getCostModifier(Block block) - { -// if(block == null) -// { -// return 1; -// } -// -// if(block == Blocks.diamond_block) -// { -// return 20; -// } -// -// if(block == Blocks.gold_block) -// { -// return 10; -// } -// -// if(block == Blocks.iron_block) -// { -// return 5; -// } - - return 1; - } - - public int getRadiusForReagents(boolean hasAether, boolean hasAquasalus) - { - if(hasAether) - { - if(hasAquasalus) - { - return 30; - }else - { - return 20; - } - }else - { - if(hasAquasalus) - { - return 15; - }else - { - return 10; - } - } - } + } + + public int getCostModifier(Block block) + { + return 1; + } + + public int getRadiusForReagents(boolean hasAether, boolean hasAquasalus) + { + if (hasAether) + { + if (hasAquasalus) + { + return 30; + } else + { + return 20; + } + } else + { + if (hasAquasalus) + { + return 15; + } else + { + return 10; + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java index fdcd8d86..ccbdf4b1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java @@ -1,16 +1,5 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; @@ -18,17 +7,26 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.items.BoundArmour; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; public class RitualEffectUnbinding extends RitualEffect { - public static final int sanctusDrain = 1000; - + public static final int sanctusDrain = 1000; + @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -50,38 +48,35 @@ public class RitualEffectUnbinding extends RitualEffect List list = world.getEntitiesWithinAABB(EntityItem.class, axisalignedbb); Iterator iterator = list.iterator(); EntityItem item; - + boolean drain = false; while (iterator.hasNext()) { item = (EntityItem) iterator.next(); -// double xDif = item.posX - (xCoord+0.5); -// double yDif = item.posY - (yCoord+1); -// double zDif = item.posZ - (zCoord+0.5); ItemStack itemStack = item.getEntityItem(); if (itemStack == null) { continue; } - + boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); - if(hasSanctus) + if (hasSanctus) { - if(itemStack.getItem() instanceof IBindable && !EnergyItems.getOwnerName(itemStack).equals("")) - { - world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z - 5)); + if (itemStack.getItem() instanceof IBindable && !EnergyItems.getOwnerName(itemStack).equals("")) + { + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z - 5)); world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z + 5)); world.addWeatherEffect(new EntityLightningBolt(world, x - 5, y + 1, z)); world.addWeatherEffect(new EntityLightningBolt(world, x + 5, y + 1, z)); - - EnergyItems.setItemOwner(itemStack, ""); - this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); - drain = true; - ritualStone.setActive(false); - break; - } + + EnergyItems.setItemOwner(itemStack, ""); + this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); + drain = true; + ritualStone.setActive(false); + break; + } } if (itemStack.getItem() == ModItems.boundHelmet) @@ -157,16 +152,15 @@ public class RitualEffectUnbinding extends RitualEffect break; } - - + } - if(drain) + if (drain) { - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); - } + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); + } } - + if (world.rand.nextInt(10) == 0) { SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 1, x, y, z); @@ -176,14 +170,13 @@ public class RitualEffectUnbinding extends RitualEffect @Override public int getCostPerRefresh() { - // TODO Auto-generated method stub return 0; } @Override - public List getRitualComponentList() - { - ArrayList unbindingRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList unbindingRitual = new ArrayList(); unbindingRitual.add(new RitualComponent(-2, 0, 0, 4)); unbindingRitual.add(new RitualComponent(2, 0, 0, 4)); unbindingRitual.add(new RitualComponent(0, 0, 2, 4)); @@ -217,5 +210,5 @@ public class RitualEffectUnbinding extends RitualEffect unbindingRitual.add(new RitualComponent(0, 0, 5, 2)); unbindingRitual.add(new RitualComponent(0, 0, -5, 2)); return unbindingRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java index 362b608f..f8dc5c70 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java @@ -1,23 +1,17 @@ package WayofTime.alchemicalWizardry.common.rituals; +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.AlchemicalWizardryEventHooks; +import WayofTime.alchemicalWizardry.common.CoordAndRange; +import net.minecraft.world.World; + import java.util.ArrayList; import java.util.LinkedList; import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; -import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks; -import WayofTime.alchemicalWizardry.common.CoordAndRange; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; - public class RitualEffectVeilOfEvil extends RitualEffect { @Override @@ -31,57 +25,52 @@ public class RitualEffectVeilOfEvil extends RitualEffect int y = ritualStone.getYCoord(); int z = ritualStone.getZCoord(); -// if (world.getWorldTime() % 20 != 0) -// { -// return; -// } - if (currentEssence < this.getCostPerRefresh()) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - int horizRange = 32; - int vertRange = 32; - - int dimension = world.provider.dimensionId; - - if(AlchemicalWizardryEventHooks.forceSpawnMap.containsKey(new Integer(dimension))) - { - List list = AlchemicalWizardryEventHooks.forceSpawnMap.get(new Integer(dimension)); - if(list != null) - { - if(!list.contains(new CoordAndRange(x,y,z,horizRange,vertRange))) - { - boolean hasFoundAndRemoved = false; - for(CoordAndRange coords : list) - { - int xLocation = coords.xCoord; - int yLocation = coords.yCoord; - int zLocation = coords.zCoord; - - if(xLocation == x && yLocation == y && zLocation == z) - { - list.remove(coords); - hasFoundAndRemoved = true; - break; - } - } - list.add(new CoordAndRange(x,y,z,horizRange,vertRange)); - } - }else - { - list = new LinkedList(); - list.add(new CoordAndRange(x,y,z,horizRange,vertRange)); - AlchemicalWizardryEventHooks.forceSpawnMap.put(new Integer(dimension), list); - } - }else - { - List list = new LinkedList(); - list.add(new CoordAndRange(x,y,z,horizRange,vertRange)); - AlchemicalWizardryEventHooks.forceSpawnMap.put(new Integer(dimension), list); - } - + int horizRange = 32; + int vertRange = 32; + + int dimension = world.provider.dimensionId; + + if (AlchemicalWizardryEventHooks.forceSpawnMap.containsKey(new Integer(dimension))) + { + List list = AlchemicalWizardryEventHooks.forceSpawnMap.get(new Integer(dimension)); + if (list != null) + { + if (!list.contains(new CoordAndRange(x, y, z, horizRange, vertRange))) + { + boolean hasFoundAndRemoved = false; + for (CoordAndRange coords : list) + { + int xLocation = coords.xCoord; + int yLocation = coords.yCoord; + int zLocation = coords.zCoord; + + if (xLocation == x && yLocation == y && zLocation == z) + { + list.remove(coords); + hasFoundAndRemoved = true; + break; + } + } + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + } + } else + { + list = new LinkedList(); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + AlchemicalWizardryEventHooks.forceSpawnMap.put(new Integer(dimension), list); + } + } else + { + List list = new LinkedList(); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + AlchemicalWizardryEventHooks.forceSpawnMap.put(new Integer(dimension), list); + } + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } @@ -94,10 +83,10 @@ public class RitualEffectVeilOfEvil extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList veilRitual = new ArrayList(); - + public List getRitualComponentList() + { + ArrayList veilRitual = new ArrayList(); + veilRitual.add(new RitualComponent(1, 0, 2, RitualComponent.DUSK)); veilRitual.add(new RitualComponent(2, 0, 1, RitualComponent.DUSK)); veilRitual.add(new RitualComponent(1, 0, -2, RitualComponent.DUSK)); @@ -106,30 +95,30 @@ public class RitualEffectVeilOfEvil extends RitualEffect veilRitual.add(new RitualComponent(2, 0, -1, RitualComponent.DUSK)); veilRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.DUSK)); veilRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.DUSK)); - + veilRitual.add(new RitualComponent(3, 0, 3, RitualComponent.FIRE)); veilRitual.add(new RitualComponent(-3, 0, 3, RitualComponent.FIRE)); veilRitual.add(new RitualComponent(3, 0, -3, RitualComponent.FIRE)); veilRitual.add(new RitualComponent(-3, 0, -3, RitualComponent.FIRE)); - - for(int i=0; i<=1; i++) - { - veilRitual.add(new RitualComponent((4+i), i, 0, RitualComponent.DUSK)); - veilRitual.add(new RitualComponent((4+i), i, -1, RitualComponent.BLANK)); - veilRitual.add(new RitualComponent((4+i), i, 1, RitualComponent.BLANK)); - veilRitual.add(new RitualComponent(-(4+i), i, 0, RitualComponent.DUSK)); - veilRitual.add(new RitualComponent(-(4+i), i, -1, RitualComponent.BLANK)); - veilRitual.add(new RitualComponent(-(4+i), i, 1, RitualComponent.BLANK)); - - veilRitual.add(new RitualComponent(0, i, (4+i), RitualComponent.DUSK)); - veilRitual.add(new RitualComponent(1, i, (4+i), RitualComponent.BLANK)); - veilRitual.add(new RitualComponent(-1, i, (4+i), RitualComponent.BLANK)); - - veilRitual.add(new RitualComponent(0, i, -(4+i), RitualComponent.DUSK)); - veilRitual.add(new RitualComponent(1, i, -(4+i), RitualComponent.BLANK)); - veilRitual.add(new RitualComponent(-1, i, -(4+i), RitualComponent.BLANK)); - + for (int i = 0; i <= 1; i++) + { + veilRitual.add(new RitualComponent((4 + i), i, 0, RitualComponent.DUSK)); + veilRitual.add(new RitualComponent((4 + i), i, -1, RitualComponent.BLANK)); + veilRitual.add(new RitualComponent((4 + i), i, 1, RitualComponent.BLANK)); + + veilRitual.add(new RitualComponent(-(4 + i), i, 0, RitualComponent.DUSK)); + veilRitual.add(new RitualComponent(-(4 + i), i, -1, RitualComponent.BLANK)); + veilRitual.add(new RitualComponent(-(4 + i), i, 1, RitualComponent.BLANK)); + + veilRitual.add(new RitualComponent(0, i, (4 + i), RitualComponent.DUSK)); + veilRitual.add(new RitualComponent(1, i, (4 + i), RitualComponent.BLANK)); + veilRitual.add(new RitualComponent(-1, i, (4 + i), RitualComponent.BLANK)); + + veilRitual.add(new RitualComponent(0, i, -(4 + i), RitualComponent.DUSK)); + veilRitual.add(new RitualComponent(1, i, -(4 + i), RitualComponent.BLANK)); + veilRitual.add(new RitualComponent(-1, i, -(4 + i), RitualComponent.BLANK)); + veilRitual.add(new RitualComponent(4, i, 5, RitualComponent.EARTH)); veilRitual.add(new RitualComponent(5, i, 4, RitualComponent.EARTH)); veilRitual.add(new RitualComponent(4, i, -5, RitualComponent.EARTH)); @@ -139,12 +128,12 @@ public class RitualEffectVeilOfEvil extends RitualEffect veilRitual.add(new RitualComponent(-4, i, -5, RitualComponent.EARTH)); veilRitual.add(new RitualComponent(-5, i, -4, RitualComponent.EARTH)); } - + veilRitual.add(new RitualComponent(5, 1, 5, RitualComponent.BLANK)); veilRitual.add(new RitualComponent(-5, 1, 5, RitualComponent.BLANK)); veilRitual.add(new RitualComponent(5, 1, -5, RitualComponent.BLANK)); veilRitual.add(new RitualComponent(-5, 1, -5, RitualComponent.BLANK)); return veilRitual; - } + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java index 9b1718cb..95e68c3e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java @@ -1,121 +1,118 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +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; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -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; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectWater extends RitualEffect { - public static final int aquasalusDrain = 5; - public static final int offensaDrain = 20; - public static final int sanctusDrain = 5; - public static final int reductusDrain = 2; - public static final int crystallosDrain = 10; - + public static final int aquasalusDrain = 5; + public static final int offensaDrain = 20; + public static final int sanctusDrain = 5; + public static final int reductusDrain = 2; + public static final int crystallosDrain = 10; + 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(); - + boolean hasCrystallos = this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, false); boolean hasAquasalus = this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false); boolean hasOffensa = this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false); - - if(hasAquasalus) + + if (hasAquasalus) { - int hydrationRange = 4; - int vertRange = 3; - - for(int i=-hydrationRange; i<=hydrationRange; i++) - { - for(int j=-vertRange; j<=vertRange; j++) - { - for(int k=-hydrationRange; k<=hydrationRange; k++) - { - if(SpellHelper.hydrateSoil(world, x+i, y+j, z+k)) - { - this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); - } - } - } - } + int hydrationRange = 4; + int vertRange = 3; + + for (int i = -hydrationRange; i <= hydrationRange; i++) + { + for (int j = -vertRange; j <= vertRange; j++) + { + for (int k = -hydrationRange; k <= hydrationRange; k++) + { + if (SpellHelper.hydrateSoil(world, x + i, y + j, z + k)) + { + this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); + } + } + } + } } - - if(hasOffensa) + + if (hasOffensa) { - boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); - boolean drainReductus = world.getWorldTime() % 100 == 0; - - int range = 10; - List list = SpellHelper.getEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); - for(Entity entity : list) - { - if(entity instanceof EntityLivingBase) - { - EntityLivingBase livingEntity = (EntityLivingBase) entity; - - if(livingEntity == SpellHelper.getPlayerForUsername(owner)) - { - continue; - } - - if(hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) - { - if(livingEntity instanceof EntityPlayer) - { - if(drainReductus) - { - this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); - } - - continue; - } - } - - if(!livingEntity.isPotionActive(AlchemicalWizardry.customPotionDrowning)) - { - livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id,100,0)); - this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true); - } - } - } + boolean hasReductus = this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); + boolean drainReductus = world.getWorldTime() % 100 == 0; + + int range = 10; + List list = SpellHelper.getEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); + for (Entity entity : list) + { + if (entity instanceof EntityLivingBase) + { + EntityLivingBase livingEntity = (EntityLivingBase) entity; + + if (livingEntity == SpellHelper.getPlayerForUsername(owner)) + { + continue; + } + + if (hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false)) + { + if (livingEntity instanceof EntityPlayer) + { + if (drainReductus) + { + this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true); + } + + continue; + } + } + + if (!livingEntity.isPotionActive(AlchemicalWizardry.customPotionDrowning)) + { + livingEntity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 0)); + this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, true); + } + } + } } - + Block block = world.getBlock(x, y + 1, z); - + if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) { if (currentEssence < this.getCostPerRefresh()) { - SoulNetworkHandler.causeNauseaToPlayer(owner); + SoulNetworkHandler.causeNauseaToPlayer(owner); } else { for (int i = 0; i < 10; i++) @@ -126,61 +123,61 @@ public class RitualEffectWater extends RitualEffect world.setBlock(x, y + 1, z, Blocks.water, 0, 3); SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } - }else + } else { - boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); - if(!hasSanctus) - { - return; - } - TileEntity tile = world.getTileEntity(x, y + 1, z); - if(tile instanceof IFluidHandler) - { - int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), false); - if(amount >= 1000) - { - ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), true); - - this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); - - SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); - } - } + boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); + if (!hasSanctus) + { + return; + } + TileEntity tile = world.getTileEntity(x, y + 1, z); + if (tile instanceof IFluidHandler) + { + int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), false); + if (amount >= 1000) + { + ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), true); + + this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); + + SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); + } + } } - - if(hasCrystallos) + + if (hasCrystallos) { - int range = 2; - for(int i=-range; i<=range; i++) - { - for(int j=-range; j<=range; j++) - { - for(int k=-range; k<=range; k++) - { - hasCrystallos = hasCrystallos && this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, false); - - if(hasCrystallos) - { - boolean success = false; - if(!world.isAirBlock(x+i, y+j, z+k) && SpellHelper.freezeWaterBlock(world, x+i, y+j, z+k)) - { - success = true; - }else - { - if(world.rand.nextInt(100) == 0 && world.isSideSolid(x+i, y+j-1, z+k, ForgeDirection.UP)) - { - success = true; - } - } - - if(success) - { - this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, true); - } - } - } - } - } + int range = 2; + for (int i = -range; i <= range; i++) + { + for (int j = -range; j <= range; j++) + { + for (int k = -range; k <= range; k++) + { + hasCrystallos = hasCrystallos && this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, false); + + if (hasCrystallos) + { + boolean success = false; + if (!world.isAirBlock(x + i, y + j, z + k) && SpellHelper.freezeWaterBlock(world, x + i, y + j, z + k)) + { + success = true; + } else + { + if (world.rand.nextInt(100) == 0 && world.isSideSolid(x + i, y + j - 1, z + k, ForgeDirection.UP)) + { + success = true; + } + } + + if (success) + { + this.canDrainReagent(ritualStone, ReagentRegistry.crystallosReagent, crystallosDrain, true); + } + } + } + } + } } } @@ -190,13 +187,13 @@ public class RitualEffectWater extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList waterRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList waterRitual = new ArrayList(); waterRitual.add(new RitualComponent(-1, 0, 1, 1)); waterRitual.add(new RitualComponent(-1, 0, -1, 1)); waterRitual.add(new RitualComponent(1, 0, -1, 1)); waterRitual.add(new RitualComponent(1, 0, 1, 1)); return waterRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java index 7ec6e98b..ef2d3d59 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java @@ -1,25 +1,19 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; 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.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectWellOfSuffering extends RitualEffect { @@ -30,7 +24,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect public void performEffect(IMasterRitualStone ritualStone) { String owner = ritualStone.getOwner(); - + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); World world = ritualStone.getWorld(); int x = ritualStone.getXCoord(); @@ -77,14 +71,14 @@ public class RitualEffectWellOfSuffering extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - for(EntityLivingBase livingEntity : list) + for (EntityLivingBase livingEntity : list) { if (livingEntity instanceof EntityPlayer || AlchemicalWizardry.wellBlacklist.contains(livingEntity.getClass())) { continue; } - if(livingEntity.attackEntityFrom(DamageSource.outOfWorld, 1)) + if (livingEntity.attackEntityFrom(DamageSource.outOfWorld, 1)) { entityCount++; tileAltar.sacrificialDaggerCall(this.amount, true); @@ -102,9 +96,9 @@ public class RitualEffectWellOfSuffering extends RitualEffect } @Override - public List getRitualComponentList() - { - ArrayList wellOfSufferingRitual = new ArrayList(); + public List getRitualComponentList() + { + ArrayList wellOfSufferingRitual = new ArrayList(); wellOfSufferingRitual.add(new RitualComponent(1, 0, 1, RitualComponent.FIRE)); wellOfSufferingRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.FIRE)); wellOfSufferingRitual.add(new RitualComponent(1, 0, -1, RitualComponent.FIRE)); @@ -142,5 +136,5 @@ public class RitualEffectWellOfSuffering extends RitualEffect wellOfSufferingRitual.add(new RitualComponent(-4, 1, 0, RitualComponent.AIR)); wellOfSufferingRitual.add(new RitualComponent(0, 1, -4, RitualComponent.AIR)); return wellOfSufferingRitual; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java index 767b22f3..186d1722 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java @@ -1,178 +1,187 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.IProjectile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class EntitySpellProjectile extends Entity implements IProjectile +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class EntitySpellProjectile extends Entity implements IProjectile { - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private int inTile = 0; - private int inData = 0; - private boolean inGround = false; - /** The owner of this arrow. */ - public EntityPlayer shootingEntity; - private int ticksInAir = 0; - private int ricochetCounter = 0; - private boolean scheduledForDeath = false; - private boolean isSilkTouch = false; - - //Custom variables - private int maxRicochet = 0; - private float damage = 1; - public List impactList = new ArrayList(); - private boolean penetration = false; - public List updateEffectList = new ArrayList(); - public List spellEffectList = new LinkedList(); - private int blocksBroken = 0; + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private int inTile = 0; + private int inData = 0; + private boolean inGround = false; + /** + * The owner of this arrow. + */ + public EntityPlayer shootingEntity; + private int ticksInAir = 0; + private int ricochetCounter = 0; + private boolean scheduledForDeath = false; + private boolean isSilkTouch = false; - public EntitySpellProjectile(World par1World) - { - super(par1World); - this.setSize(0.5F, 0.5F); - } + //Custom variables + private int maxRicochet = 0; + private float damage = 1; + public List impactList = new ArrayList(); + private boolean penetration = false; + public List updateEffectList = new ArrayList(); + public List spellEffectList = new LinkedList(); + private int blocksBroken = 0; - public EntitySpellProjectile(World par1World, double par2, double par4, double par6) - { - super(par1World); - this.setSize(0.5F, 0.5F); - this.setPosition(par2, par4, par6); - yOffset = 0.0F; - } + public EntitySpellProjectile(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.5F); + } - public EntitySpellProjectile(World par1World, EntityPlayer par2EntityPlayer) - { - super(par1World); - shootingEntity = par2EntityPlayer; - float par3 = 0.8F; - this.setSize(0.1F, 0.1F); - this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); - posX -= MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - posY -= 0.2D; - posZ -= MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - this.setPosition(posX, posY, posZ); - yOffset = 0.0F; - motionX = -MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI); - motionZ = MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI); - motionY = -MathHelper.sin(rotationPitch / 180.0F * (float)Math.PI); - this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F); - - } + public EntitySpellProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World); + this.setSize(0.5F, 0.5F); + this.setPosition(par2, par4, par6); + yOffset = 0.0F; + } - @Override - protected void entityInit() { - dataWatcher.addObject(16, Byte.valueOf((byte)0)); - } + public EntitySpellProjectile(World par1World, EntityPlayer par2EntityPlayer) + { + super(par1World); + shootingEntity = par2EntityPlayer; + float par3 = 0.8F; + this.setSize(0.1F, 0.1F); + this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); + posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + posY -= 0.2D; + posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(posX, posY, posZ); + yOffset = 0.0F; + motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI); + this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F); - /** - * Similar to setArrowHeading, it's point the throwable entity to a x, y, z - * direction. - */ - @Override - public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) { - float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); - var1 /= var9; - var3 /= var9; - var5 /= var9; - var1 += rand.nextGaussian() * 0.007499999832361937D * var8; - var3 += rand.nextGaussian() * 0.007499999832361937D * var8; - var5 += rand.nextGaussian() * 0.007499999832361937D * var8; - var1 *= var7; - var3 *= var7; - var5 *= var7; - motionX = var1; - motionY = var3; - motionZ = var5; - float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); - prevRotationYaw = rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / Math.PI); - prevRotationPitch = rotationPitch = (float)(Math.atan2(var3, var10) * 180.0D / Math.PI); - } + } - @Override - @SideOnly(Side.CLIENT) - /** - * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, - * posY, posZ, yaw, pitch - */ - public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { - this.setPosition(par1, par3, par5); - this.setRotation(par7, par8); - } + @Override + protected void entityInit() + { + dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } - @Override - @SideOnly(Side.CLIENT) - /** - * Sets the velocity to the args. Args: x, y, z - */ - public void setVelocity(double par1, double par3, double par5) { - motionX = par1; - motionY = par3; - motionZ = par5; - if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) { - float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); - prevRotationYaw = rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); - prevRotationPitch = rotationPitch = (float)(Math.atan2(par3, var7) * 180.0D / Math.PI); - prevRotationPitch = rotationPitch; - prevRotationYaw = rotationYaw; - this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); - } - } + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z + * direction. + */ + @Override + public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) + { + float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); + var1 /= var9; + var3 /= var9; + var5 /= var9; + var1 += rand.nextGaussian() * 0.007499999832361937D * var8; + var3 += rand.nextGaussian() * 0.007499999832361937D * var8; + var5 += rand.nextGaussian() * 0.007499999832361937D * var8; + var1 *= var7; + var3 *= var7; + var5 *= var7; + motionX = var1; + motionY = var3; + motionZ = var5; + float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); + prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI); + } - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() - { - super.onUpdate(); - this.performUpdateEffects(); - if (ticksInAir > 600) { - this.setDead(); - } - if (shootingEntity == null) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); - Iterator i = players.iterator(); - double closestDistance = Double.MAX_VALUE; - EntityPlayer closestPlayer = null; - while (i.hasNext()) { - EntityPlayer e = (EntityPlayer)i.next(); - double distance = e.getDistanceToEntity(this); - if (distance < closestDistance) { - closestPlayer = e; - } - } - if (closestPlayer != null) { - shootingEntity = closestPlayer; - } - } - if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) { - float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); - prevRotationYaw = rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI); - prevRotationPitch = rotationPitch = (float)(Math.atan2(motionY, var1) * 180.0D / Math.PI); - } - Block var16 = worldObj.getBlock(xTile, yTile, zTile); + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) + { + this.setPosition(par1, par3, par5); + this.setRotation(par7, par8); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double par1, double par3, double par5) + { + motionX = par1; + motionY = par3; + motionZ = par5; + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + prevRotationYaw = rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch; + prevRotationYaw = rotationYaw; + this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + } + } + + /** + * Called to update the entity's position/logic. + */ + @Override + public void onUpdate() + { + super.onUpdate(); + this.performUpdateEffects(); + if (ticksInAir > 600) + { + this.setDead(); + } + if (shootingEntity == null) + { + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); + Iterator i = players.iterator(); + double closestDistance = Double.MAX_VALUE; + EntityPlayer closestPlayer = null; + while (i.hasNext()) + { + EntityPlayer e = (EntityPlayer) i.next(); + double distance = e.getDistanceToEntity(this); + if (distance < closestDistance) + { + closestPlayer = e; + } + } + if (closestPlayer != null) + { + shootingEntity = closestPlayer; + } + } + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI); + } + Block var16 = worldObj.getBlock(xTile, yTile, zTile); if (var16 != null) { @@ -270,40 +279,43 @@ public class EntitySpellProjectile extends Entity implements IProjectile this.setPosition(posX, posY, posZ); //this.doBlockCollisions(); } - } + } - private void doFlightParticles() { - if (ticksInAir % 3 == 0) { - double gauss = gaussian(1.0F); - worldObj.spawnParticle("mobSpell", posX, posY, posZ, gauss, gauss, 0.0F); - } - } + private void doFlightParticles() + { + if (ticksInAir % 3 == 0) + { + double gauss = gaussian(1.0F); + worldObj.spawnParticle("mobSpell", posX, posY, posZ, gauss, gauss, 0.0F); + } + } - private void doFiringParticles() { - worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); - } + private void doFiringParticles() + { + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)xTile); - par1NBTTagCompound.setShort("yTile", (short)yTile); - par1NBTTagCompound.setShort("zTile", (short)zTile); - par1NBTTagCompound.setByte("inTile", (byte)inTile); - par1NBTTagCompound.setByte("inData", (byte)inData); - par1NBTTagCompound.setByte("inGround", (byte)(inGround ? 1 : 0)); - - NBTTagList effectList = new NBTTagList(); + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setShort("xTile", (short) xTile); + par1NBTTagCompound.setShort("yTile", (short) yTile); + par1NBTTagCompound.setShort("zTile", (short) zTile); + par1NBTTagCompound.setByte("inTile", (byte) inTile); + par1NBTTagCompound.setByte("inData", (byte) inData); + par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0)); + + NBTTagList effectList = new NBTTagList(); + + for (SpellEffect eff : spellEffectList) + { + effectList.appendTag(eff.getTag()); + } - for(SpellEffect eff : spellEffectList) - { - effectList.appendTag(eff.getTag()); - } - // for (String str : this.effectList) // { // if (str != null) @@ -315,42 +327,42 @@ public class EntitySpellProjectile extends Entity implements IProjectile // } // } - par1NBTTagCompound.setTag("Effects", effectList); + par1NBTTagCompound.setTag("Effects", effectList); par1NBTTagCompound.setInteger("blocksBroken", blocksBroken); par1NBTTagCompound.setBoolean("isSilkTouch", isSilkTouch); - } + } - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - xTile = par1NBTTagCompound.getShort("xTile"); - yTile = par1NBTTagCompound.getShort("yTile"); - zTile = par1NBTTagCompound.getShort("zTile"); - inTile = par1NBTTagCompound.getByte("inTile") & 255; - inData = par1NBTTagCompound.getByte("inData") & 255; - inGround = par1NBTTagCompound.getByte("inGround") == 1; - blocksBroken = par1NBTTagCompound.getInteger("blocksBroken"); - isSilkTouch = par1NBTTagCompound.getBoolean("isSilkTouch"); - - NBTTagList tagList = par1NBTTagCompound.getTagList("Effects",Constants.NBT.TAG_COMPOUND); - - List spellEffectList = new LinkedList(); - for (int i = 0; i < tagList.tagCount(); i++) + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + xTile = par1NBTTagCompound.getShort("xTile"); + yTile = par1NBTTagCompound.getShort("yTile"); + zTile = par1NBTTagCompound.getShort("zTile"); + inTile = par1NBTTagCompound.getByte("inTile") & 255; + inData = par1NBTTagCompound.getByte("inData") & 255; + inGround = par1NBTTagCompound.getByte("inGround") == 1; + blocksBroken = par1NBTTagCompound.getInteger("blocksBroken"); + isSilkTouch = par1NBTTagCompound.getBoolean("isSilkTouch"); + + NBTTagList tagList = par1NBTTagCompound.getTagList("Effects", Constants.NBT.TAG_COMPOUND); + + List spellEffectList = new LinkedList(); + for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); SpellEffect eff = SpellEffect.getEffectFromTag(tag); - if(eff!=null) + if (eff != null) { - spellEffectList.add(eff); + spellEffectList.add(eff); } } - this.spellEffectList = spellEffectList; - - + this.spellEffectList = spellEffectList; + + // this.effectList = new LinkedList(); // for (int i = 0; i < tagList.tagCount(); i++) // { @@ -358,267 +370,284 @@ public class EntitySpellProjectile extends Entity implements IProjectile // // this.effectList.add(tag.getString("Class")); // } - + //SpellParadigmProjectile parad = SpellParadigmProjectile.getParadigmForStringArray(effectList); SpellParadigmProjectile parad = SpellParadigmProjectile.getParadigmForEffectArray(spellEffectList); parad.applyAllSpellEffects(); parad.prepareProjectile(this); - } + } - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they - * walk on. used for spiders and wolves to prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they + * walk on. used for spiders and wolves to prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() + { + return false; + } - @Override - @SideOnly(Side.CLIENT) - public float getShadowSize() { - return 0.0F; - } + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } - /** - * Sets the amount of knockback the arrow applies when it hits a mob. - */ - public void setKnockbackStrength(int par1) { - } + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int par1) + { + } - /** - * If returns false, the item will not inflict any damage against entities. - */ - @Override - public boolean canAttackWithItem() { - return false; - } + /** + * If returns false, the item will not inflict any damage against entities. + */ + @Override + public boolean canAttackWithItem() + { + return false; + } - /** - * Whether the arrow has a stream of critical hit particles flying behind - * it. - */ - public void setIsCritical(boolean par1) { - byte var2 = dataWatcher.getWatchableObjectByte(16); - if (par1) { - dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); - } else { - dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); - } - } + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public void setIsCritical(boolean par1) + { + byte var2 = dataWatcher.getWatchableObjectByte(16); + if (par1) + { + dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 | 1))); + } else + { + dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 & -2))); + } + } - /** - * Whether the arrow has a stream of critical hit particles flying behind - * it. - */ - public boolean getIsCritical() { - byte var1 = dataWatcher.getWatchableObjectByte(16); - return (var1 & 1) != 0; - } + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public boolean getIsCritical() + { + byte var1 = dataWatcher.getWatchableObjectByte(16); + return (var1 & 1) != 0; + } - private void onImpact(MovingObjectPosition mop) - { - if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) - { - if (mop.entityHit == shootingEntity) return; - this.onImpact(mop.entityHit); - this.performEntityImpactEffects(mop.entityHit); - } - else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) - { - if(!this.penetration) - { - this.groundImpact(mop.sideHit); - this.performTileImpactEffects(mop); - } - } - } + private void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) return; + this.onImpact(mop.entityHit); + this.performEntityImpactEffects(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + if (!this.penetration) + { + this.groundImpact(mop.sideHit); + this.performTileImpactEffects(mop); + } + } + } - private void onImpact(Entity mop) //TODO - { - if (mop == shootingEntity && ticksInAir > 3) - { - shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); - this.setDead(); - } - else - { - doDamage(this.damage, mop); - } - spawnHitParticles("exorcism", 8); - this.setDead(); - } + private void onImpact(Entity mop) //TODO + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); + this.setDead(); + } else + { + doDamage(this.damage, mop); + } + spawnHitParticles("exorcism", 8); + this.setDead(); + } - private void spawnHitParticles(String string, int i) { - for (int particles = 0; particles < i; particles++) { - worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), posGauss(1.0F), posGauss(1.0F), 0.0F); - } - } + private void spawnHitParticles(String string, int i) + { + for (int particles = 0; particles < i; particles++) + { + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), posGauss(1.0F), posGauss(1.0F), 0.0F); + } + } - private void doDamage(float f, Entity mop) - { - mop.attackEntityFrom(this.getDamageSource(), f); - } + private void doDamage(float f, Entity mop) + { + mop.attackEntityFrom(this.getDamageSource(), f); + } - private DamageSource getDamageSource() - { - return DamageSource.causePlayerDamage(shootingEntity); - } + private DamageSource getDamageSource() + { + return DamageSource.causePlayerDamage(shootingEntity); + } - private void groundImpact(int sideHit) { - this.ricochet(sideHit); - } + private void groundImpact(int sideHit) + { + this.ricochet(sideHit); + } - private double smallGauss(double d) { - return (worldObj.rand.nextFloat() - 0.5D) * d; - } + private double smallGauss(double d) + { + return (worldObj.rand.nextFloat() - 0.5D) * d; + } - private double posGauss(double d) { - return rand.nextFloat() * 0.5D * d; - } + private double posGauss(double d) + { + return rand.nextFloat() * 0.5D * d; + } - private double gaussian(double d) { - return d + d * ((rand.nextFloat() - 0.5D) / 4); - } + private double gaussian(double d) + { + return d + d * ((rand.nextFloat() - 0.5D) / 4); + } - private void ricochet(int sideHit) { - switch (sideHit) { - case 0: - case 1: - // topHit, bottomHit, reflect Y - motionY = motionY * -1; - break; - case 2: - case 3: - // westHit, eastHit, reflect Z - motionZ = motionZ * -1; - break; - case 4: - case 5: - // southHit, northHit, reflect X - motionX = motionX * -1; - break; - } - ricochetCounter++; - if (ricochetCounter > this.getRicochetMax()) { - scheduledForDeath = true; - for (int particles = 0; particles < 4; particles++) { - switch (sideHit) { - case 0: - worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); - break; - case 1: - worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); - break; - case 2: - worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); - break; - case 3: - worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); - break; - case 4: - worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); - break; - case 5: - worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); - break; - } - } - } - } + private void ricochet(int sideHit) + { + switch (sideHit) + { + case 0: + case 1: + // topHit, bottomHit, reflect Y + motionY = motionY * -1; + break; + case 2: + case 3: + // westHit, eastHit, reflect Z + motionZ = motionZ * -1; + break; + case 4: + case 5: + // southHit, northHit, reflect X + motionX = motionX * -1; + break; + } + ricochetCounter++; + if (ricochetCounter > this.getRicochetMax()) + { + scheduledForDeath = true; + for (int particles = 0; particles < 4; particles++) + { + switch (sideHit) + { + case 0: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); + break; + case 1: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + case 2: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); + break; + case 3: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + case 4: + worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + case 5: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + } + } + } + } - //Custom stuff - public int getRicochetMax() - { - return this.maxRicochet; - } - - public void setRicochetMax(int ricochet) - { - this.maxRicochet = ricochet; - } - - public void setImpactList(List list) - { - this.impactList = list; - } - - public void setUpdateEffectList(List list) - { - this.updateEffectList = list; - } - - private void performEntityImpactEffects(Entity mop) - { - if(impactList!=null) - { - for(IProjectileImpactEffect impactEffect : impactList) - { - impactEffect.onEntityImpact(mop, this); - } - } - } - - private void performTileImpactEffects(MovingObjectPosition mop) - { - if(impactList!=null) - { - for(IProjectileImpactEffect impactEffect : impactList) - { - impactEffect.onTileImpact(worldObj, mop); - } - } - } - - private void performUpdateEffects() - { - if(updateEffectList!=null) - { - for(IProjectileUpdateEffect updateEffect : updateEffectList) - { - updateEffect.onUpdateEffect(this); - } - } - } - - public void setPenetration(boolean penetration) - { - this.penetration = penetration; - } - - public float getDamage() - { - return this.damage; - } - - public void setDamage(float damage) - { - this.damage = damage; - } - - public void setSpellEffectList(List list) - { - this.spellEffectList = list; - } - - public int getBlocksBroken() - { - return this.blocksBroken; - } - - public void setBlocksBroken(int blocksBroken) - { - this.blocksBroken = blocksBroken; - } - - public boolean getIsSilkTouch() - { - return this.isSilkTouch; - } - - public void setIsSilkTouch(boolean bool) - { - this.isSilkTouch = bool; - } + //Custom stuff + public int getRicochetMax() + { + return this.maxRicochet; + } + + public void setRicochetMax(int ricochet) + { + this.maxRicochet = ricochet; + } + + public void setImpactList(List list) + { + this.impactList = list; + } + + public void setUpdateEffectList(List list) + { + this.updateEffectList = list; + } + + private void performEntityImpactEffects(Entity mop) + { + if (impactList != null) + { + for (IProjectileImpactEffect impactEffect : impactList) + { + impactEffect.onEntityImpact(mop, this); + } + } + } + + private void performTileImpactEffects(MovingObjectPosition mop) + { + if (impactList != null) + { + for (IProjectileImpactEffect impactEffect : impactList) + { + impactEffect.onTileImpact(worldObj, mop); + } + } + } + + private void performUpdateEffects() + { + if (updateEffectList != null) + { + for (IProjectileUpdateEffect updateEffect : updateEffectList) + { + updateEffect.onUpdateEffect(this); + } + } + } + + public void setPenetration(boolean penetration) + { + this.penetration = penetration; + } + + public float getDamage() + { + return this.damage; + } + + public void setDamage(float damage) + { + this.damage = damage; + } + + public void setSpellEffectList(List list) + { + this.spellEffectList = list; + } + + public int getBlocksBroken() + { + return this.blocksBroken; + } + + public void setBlocksBroken(int blocksBroken) + { + this.blocksBroken = blocksBroken; + } + + public boolean getIsSilkTouch() + { + return this.isSilkTouch; + } + + public void setIsSilkTouch(boolean bool) + { + this.isSilkTouch = bool; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java index 39297530..36754656 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java @@ -1,21 +1,21 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -public class SpellModifier +public class SpellModifier { - public static final int DEFAULT = 0; - public static final int OFFENSIVE = 1; - public static final int DEFENSIVE = 2; - public static final int ENVIRONMENTAL = 3; - - private int modifier; - - protected SpellModifier(int modifier) - { - this.modifier = modifier; - } - - public int getModifier() - { - return this.modifier; - } + public static final int DEFAULT = 0; + public static final int OFFENSIVE = 1; + public static final int DEFENSIVE = 2; + public static final int ENVIRONMENTAL = 3; + + private int modifier; + + protected SpellModifier(int modifier) + { + this.modifier = modifier; + } + + public int getModifier() + { + return this.modifier; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java index fd379ae1..771ca1ce 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -public class SpellModifierDefault extends SpellModifier +public class SpellModifierDefault extends SpellModifier { - public SpellModifierDefault() - { - super(SpellModifier.DEFAULT); - } + public SpellModifierDefault() + { + super(SpellModifier.DEFAULT); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java index f9f69dbe..29d89007 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -public class SpellModifierDefensive extends SpellModifier +public class SpellModifierDefensive extends SpellModifier { - public SpellModifierDefensive() - { - super(SpellModifier.DEFENSIVE); - } + public SpellModifierDefensive() + { + super(SpellModifier.DEFENSIVE); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java index ff9ef7f4..f805dfca 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -public class SpellModifierEnvironmental extends SpellModifier +public class SpellModifierEnvironmental extends SpellModifier { - public SpellModifierEnvironmental() - { - super(SpellModifier.ENVIRONMENTAL); - } + public SpellModifierEnvironmental() + { + super(SpellModifier.ENVIRONMENTAL); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java index 783ab1e3..5d956e3f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -public class SpellModifierOffensive extends SpellModifier +public class SpellModifierOffensive extends SpellModifier { - public SpellModifierOffensive() - { - super(SpellModifier.OFFENSIVE); - } + public SpellModifierOffensive() + { + super(SpellModifier.OFFENSIVE); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java index 75bad220..52b1fe2f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java @@ -1,163 +1,161 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; -public abstract class SpellParadigm +import java.util.LinkedList; +import java.util.List; + +public abstract class SpellParadigm { - protected List bufferedEffectList = new LinkedList(); - public List effectList = new LinkedList(); - - public void addBufferedEffect(SpellEffect effect) - { - if(effect!=null) - { - this.bufferedEffectList.add(effect); - - effectList.add(effect.getClass().getName()); - } - } - - public void modifyBufferedEffect(SpellModifier modifier) - { - SpellEffect effect = this.getBufferedEffect(); - if(effect!=null) - { - effect.modifyEffect(modifier); - - effectList.add(modifier.getClass().getName()); - } - } - - public void applyEnhancement(SpellEnhancement enh) - { - if(enh!=null) - { - if(bufferedEffectList.isEmpty()) - { - this.enhanceParadigm(enh); - } - else - { - SpellEffect effect = this.getBufferedEffect(); - if(effect!=null) - { - effect.enhanceEffect(enh); - } - } - - effectList.add(enh.getClass().getName()); - } - - } - - public abstract void enhanceParadigm(SpellEnhancement enh); - public abstract void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack); - - public void applySpellEffect(SpellEffect effect) - { - effect.modifyParadigm(this); - } - - public void applyAllSpellEffects() - { - for(SpellEffect effect : bufferedEffectList) - { - this.applySpellEffect(effect); - } - } - - public SpellEffect getBufferedEffect() - { - if(bufferedEffectList.isEmpty()) - { - return null; - } - else - { - return bufferedEffectList.get(bufferedEffectList.size()-1); - } - } - - public int getTotalCost() - { - int cost = 0; - if(this.bufferedEffectList!=null && !this.bufferedEffectList.isEmpty()) - { - if(this instanceof SpellParadigmProjectile) - { - for(SpellEffect effect : bufferedEffectList) - { - cost+=effect.getCostForProjectile(); - } - }else if(this instanceof SpellParadigmSelf) - { - for(SpellEffect effect : bufferedEffectList) - { - cost+=effect.getCostForSelf(); - } - }else if(this instanceof SpellParadigmMelee) - { - for(SpellEffect effect : bufferedEffectList) - { - cost+=effect.getCostForMelee(); - } - }else if(this instanceof SpellParadigmTool) - { - for(SpellEffect effect : bufferedEffectList) - { - cost+=effect.getCostForTool(); - } - } - - return (int)(cost*Math.sqrt(this.bufferedEffectList.size())); - } + protected List bufferedEffectList = new LinkedList(); + public List effectList = new LinkedList(); - return getDefaultCost(); - } - - public abstract int getDefaultCost(); - - public int getBufferedEffectPower() - { - SpellEffect eff = this.getBufferedEffect(); - - if(eff!=null) - { - return eff.getPowerEnhancements(); - } - - return 0; - } - - public int getBufferedEffectCost() - { - SpellEffect eff = this.getBufferedEffect(); - - if(eff!=null) - { - return eff.getCostEnhancements(); - } - - return 0; - } - - public int getBufferedEffectPotency() - { - SpellEffect eff = this.getBufferedEffect(); - - if(eff!=null) - { - return eff.getPotencyEnhancements(); - } - - return 0; - } + public void addBufferedEffect(SpellEffect effect) + { + if (effect != null) + { + this.bufferedEffectList.add(effect); + + effectList.add(effect.getClass().getName()); + } + } + + public void modifyBufferedEffect(SpellModifier modifier) + { + SpellEffect effect = this.getBufferedEffect(); + if (effect != null) + { + effect.modifyEffect(modifier); + + effectList.add(modifier.getClass().getName()); + } + } + + public void applyEnhancement(SpellEnhancement enh) + { + if (enh != null) + { + if (bufferedEffectList.isEmpty()) + { + this.enhanceParadigm(enh); + } else + { + SpellEffect effect = this.getBufferedEffect(); + if (effect != null) + { + effect.enhanceEffect(enh); + } + } + + effectList.add(enh.getClass().getName()); + } + + } + + public abstract void enhanceParadigm(SpellEnhancement enh); + + public abstract void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack); + + public void applySpellEffect(SpellEffect effect) + { + effect.modifyParadigm(this); + } + + public void applyAllSpellEffects() + { + for (SpellEffect effect : bufferedEffectList) + { + this.applySpellEffect(effect); + } + } + + public SpellEffect getBufferedEffect() + { + if (bufferedEffectList.isEmpty()) + { + return null; + } else + { + return bufferedEffectList.get(bufferedEffectList.size() - 1); + } + } + + public int getTotalCost() + { + int cost = 0; + if (this.bufferedEffectList != null && !this.bufferedEffectList.isEmpty()) + { + if (this instanceof SpellParadigmProjectile) + { + for (SpellEffect effect : bufferedEffectList) + { + cost += effect.getCostForProjectile(); + } + } else if (this instanceof SpellParadigmSelf) + { + for (SpellEffect effect : bufferedEffectList) + { + cost += effect.getCostForSelf(); + } + } else if (this instanceof SpellParadigmMelee) + { + for (SpellEffect effect : bufferedEffectList) + { + cost += effect.getCostForMelee(); + } + } else if (this instanceof SpellParadigmTool) + { + for (SpellEffect effect : bufferedEffectList) + { + cost += effect.getCostForTool(); + } + } + + return (int) (cost * Math.sqrt(this.bufferedEffectList.size())); + } + + return getDefaultCost(); + } + + public abstract int getDefaultCost(); + + public int getBufferedEffectPower() + { + SpellEffect eff = this.getBufferedEffect(); + + if (eff != null) + { + return eff.getPowerEnhancements(); + } + + return 0; + } + + public int getBufferedEffectCost() + { + SpellEffect eff = this.getBufferedEffect(); + + if (eff != null) + { + return eff.getCostEnhancements(); + } + + return 0; + } + + public int getBufferedEffectPotency() + { + SpellEffect eff = this.getBufferedEffect(); + + if (eff != null) + { + return eff.getPotencyEnhancements(); + } + + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java index b1cac7de..4cc3dd8b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java @@ -1,70 +1,70 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IMeleeSpellEntityEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IMeleeSpellWorldEffect; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; -public class SpellParadigmMelee extends SpellParadigm +import java.util.ArrayList; +import java.util.List; + +public class SpellParadigmMelee extends SpellParadigm { - private List entityEffectList; - private List worldEffectList; - - public SpellParadigmMelee() - { - this.entityEffectList = new ArrayList(); - this.worldEffectList = new ArrayList(); - } - - @Override - public void enhanceParadigm(SpellEnhancement enh) - { - - } + private List entityEffectList; + private List worldEffectList; - @Override - public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) - { - for(IMeleeSpellEntityEffect effect : entityEffectList) - { - effect.onEntityImpact(world, entityPlayer); - } - - for(IMeleeSpellWorldEffect effect : worldEffectList) - { - effect.onWorldEffect(world, entityPlayer); - } - - int cost = this.getTotalCost(); - - EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); - } + public SpellParadigmMelee() + { + this.entityEffectList = new ArrayList(); + this.worldEffectList = new ArrayList(); + } - public void addEntityEffect(IMeleeSpellEntityEffect eff) - { - if(eff!=null) - { - this.entityEffectList.add(eff); - } - } - - public void addWorldEffect(IMeleeSpellWorldEffect eff) - { - if(eff!=null) - { - this.worldEffectList.add(eff); - } - } - - @Override - public int getDefaultCost() - { - return 0; - } + @Override + public void enhanceParadigm(SpellEnhancement enh) + { + + } + + @Override + public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) + { + for (IMeleeSpellEntityEffect effect : entityEffectList) + { + effect.onEntityImpact(world, entityPlayer); + } + + for (IMeleeSpellWorldEffect effect : worldEffectList) + { + effect.onWorldEffect(world, entityPlayer); + } + + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); + } + + public void addEntityEffect(IMeleeSpellEntityEffect eff) + { + if (eff != null) + { + this.entityEffectList.add(eff); + } + } + + public void addWorldEffect(IMeleeSpellWorldEffect eff) + { + if (eff != null) + { + this.worldEffectList.add(eff); + } + } + + @Override + public int getDefaultCost() + { + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java index 8bb44f6a..f30ad7e0 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java @@ -1,102 +1,101 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; public class SpellParadigmProjectile extends SpellParadigm { - public DamageSource damageSource; - public float damage; - public int cost; - public List impactList; - public List updateEffectList; - public boolean penetration; - public int ricochetMax; - public boolean isSilkTouch; - - public SpellParadigmProjectile() - { - this.damageSource = DamageSource.generic; - this.damage = 1; - this.cost = 0; - this.impactList = new ArrayList(); - this.updateEffectList = new ArrayList(); - this.penetration = false; - this.ricochetMax = 0; - this.isSilkTouch = false; - } - - @Override - public void enhanceParadigm(SpellEnhancement enh) - { - - } + public DamageSource damageSource; + public float damage; + public int cost; + public List impactList; + public List updateEffectList; + public boolean penetration; + public int ricochetMax; + public boolean isSilkTouch; - @Override - public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) - { - EntitySpellProjectile proj = new EntitySpellProjectile(world, entityPlayer); - this.prepareProjectile(proj); - world.spawnEntityInWorld(proj); - int cost = this.getTotalCost(); - - EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); - } - - public static SpellParadigmProjectile getParadigmForEffectArray(List effectList) - { - SpellParadigmProjectile parad = new SpellParadigmProjectile(); - - for(SpellEffect eff : effectList) - { - parad.addBufferedEffect(eff); - } - - return parad; - } - - public void prepareProjectile(EntitySpellProjectile proj) - { - proj.setDamage(damage); - proj.setImpactList(impactList); - proj.setUpdateEffectList(updateEffectList); - proj.setPenetration(penetration); - proj.setRicochetMax(ricochetMax); - proj.setIsSilkTouch(isSilkTouch); - proj.setSpellEffectList(bufferedEffectList); - } - - public void addImpactEffect(IProjectileImpactEffect eff) - { - if(eff!=null) - { - this.impactList.add(eff); - } - } - - public void addUpdateEffect(IProjectileUpdateEffect eff) - { - if(eff!=null) - { - this.updateEffectList.add(eff); - } - } + public SpellParadigmProjectile() + { + this.damageSource = DamageSource.generic; + this.damage = 1; + this.cost = 0; + this.impactList = new ArrayList(); + this.updateEffectList = new ArrayList(); + this.penetration = false; + this.ricochetMax = 0; + this.isSilkTouch = false; + } + + @Override + public void enhanceParadigm(SpellEnhancement enh) + { + + } + + @Override + public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) + { + EntitySpellProjectile proj = new EntitySpellProjectile(world, entityPlayer); + this.prepareProjectile(proj); + world.spawnEntityInWorld(proj); + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); + } + + public static SpellParadigmProjectile getParadigmForEffectArray(List effectList) + { + SpellParadigmProjectile parad = new SpellParadigmProjectile(); + + for (SpellEffect eff : effectList) + { + parad.addBufferedEffect(eff); + } + + return parad; + } + + public void prepareProjectile(EntitySpellProjectile proj) + { + proj.setDamage(damage); + proj.setImpactList(impactList); + proj.setUpdateEffectList(updateEffectList); + proj.setPenetration(penetration); + proj.setRicochetMax(ricochetMax); + proj.setIsSilkTouch(isSilkTouch); + proj.setSpellEffectList(bufferedEffectList); + } + + public void addImpactEffect(IProjectileImpactEffect eff) + { + if (eff != null) + { + this.impactList.add(eff); + } + } + + public void addUpdateEffect(IProjectileUpdateEffect eff) + { + if (eff != null) + { + this.updateEffectList.add(eff); + } + } + + @Override + public int getDefaultCost() + { + return 50; + } - @Override - public int getDefaultCost() - { - return 50; - } - } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java index 94a7186a..43be820e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java @@ -1,58 +1,57 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -import java.util.ArrayList; -import java.util.List; - import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ISelfSpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.List; + public class SpellParadigmSelf extends SpellParadigm { - public List selfSpellEffectList; - - public SpellParadigmSelf() - { - selfSpellEffectList = new ArrayList(); - } - - @Override - public void enhanceParadigm(SpellEnhancement enh) - { - - } + public List selfSpellEffectList; - @Override - public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) - { - this.applyAllSpellEffects(); - - for(ISelfSpellEffect eff : selfSpellEffectList) - { - eff.onSelfUse(world, entityPlayer); - } - - int cost = this.getTotalCost(); - - EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); - } + public SpellParadigmSelf() + { + selfSpellEffectList = new ArrayList(); + } + + @Override + public void enhanceParadigm(SpellEnhancement enh) + { + + } + + @Override + public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) + { + this.applyAllSpellEffects(); + + for (ISelfSpellEffect eff : selfSpellEffectList) + { + eff.onSelfUse(world, entityPlayer); + } + + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); + } + + public void addSelfSpellEffect(ISelfSpellEffect eff) + { + if (eff != null) + { + this.selfSpellEffectList.add(eff); + } + } + + @Override + public int getDefaultCost() + { + return 100; + } - public void addSelfSpellEffect(ISelfSpellEffect eff) - { - if(eff!=null) - { - this.selfSpellEffectList.add(eff); - } - } - - @Override - public int getDefaultCost() - { - return 100; - } - } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java index 16b1498f..a8532ad4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java @@ -1,11 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map.Entry; -import java.util.Set; - +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.*; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -14,488 +15,470 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IDigAreaEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IItemManipulator; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ILeftClickEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IOnBanishTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IOnBreakBlock; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IOnSummonTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IRightClickEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ISpecialDamageEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IToolUpdateEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.RightClickTunnel; -import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; -public class SpellParadigmTool extends SpellParadigm +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map.Entry; +import java.util.Set; + +public class SpellParadigmTool extends SpellParadigm { - private List leftClickEffectList; - private List rightClickEffectList; - private List toolUpdateEffectList; - private List toolSummonEffectList; - private List toolBanishEffectList; - private List breakBlockEffectList; - private List itemManipulatorEffectList; - private List digAreaEffectList; - private List specialDamageEffectList; - - private float maxDamage; - private HashMap harvestLevel; - private HashMap digSpeed; - private HashMap maxDamageHash; - private HashMap critChanceHash; - private HashMap durationHash; //ticks - - private HashMap toolInfoString; - - private int fortuneLevel; - private boolean silkTouch; - - private int duration; - - public SpellParadigmTool() - { - this.leftClickEffectList = new LinkedList(); - this.rightClickEffectList = new LinkedList(); - this.toolUpdateEffectList = new LinkedList(); - this.toolSummonEffectList = new LinkedList(); - this.toolBanishEffectList = new LinkedList(); - this.breakBlockEffectList = new LinkedList(); - this.itemManipulatorEffectList = new LinkedList(); - this.digAreaEffectList = new LinkedList(); - this.specialDamageEffectList = new LinkedList(); - this.durationHash = new HashMap(); - - this.toolInfoString = new HashMap(); - this.critChanceHash = new HashMap(); - - this.maxDamage = 5; - - this.harvestLevel = new HashMap(); - this.harvestLevel.put("pickaxe", -1); - this.harvestLevel.put("shovel", -1); - this.harvestLevel.put("axe", -1); - - this.digSpeed = new HashMap(); - this.digSpeed.put("pickaxe", 1.0f); - this.digSpeed.put("shovel", 1.0f); - this.digSpeed.put("axe", 1.0f); - - this.maxDamageHash = new HashMap(); - this.maxDamageHash.put("default", 5.0f); - - this.fortuneLevel = 0; - this.silkTouch = false; - - this.duration = 0; - - this.durationHash.put("default", 2400); - - //this.addRightClickEffect(new RightClickTunnel(0,0,0)); - - //this.addItemManipulatorEffect(new ToolDefaultFire(0,0,0)); - //this.addDigAreaEffect(new DigAreaEffect(0,0,0)); - } - - @Override - public void enhanceParadigm(SpellEnhancement enh) - { - - } + private List leftClickEffectList; + private List rightClickEffectList; + private List toolUpdateEffectList; + private List toolSummonEffectList; + private List toolBanishEffectList; + private List breakBlockEffectList; + private List itemManipulatorEffectList; + private List digAreaEffectList; + private List specialDamageEffectList; - @Override - public void castSpell(World world, EntityPlayer entityPlayer, ItemStack crystal) - { - if(entityPlayer.worldObj.isRemote) - { - return; - } - - int cost = this.getTotalCost(); - - EnergyItems.syphonBatteries(crystal, entityPlayer, cost); - - ItemStack toolStack = this.prepareTool(crystal, world); - - entityPlayer.setCurrentItemOrArmor(0, toolStack); - - this.onSummonTool(toolStack, world, entityPlayer); - } - - /** - * - * @param crystalStack - * @return stack containing the new multitool - */ - public ItemStack prepareTool(ItemStack crystalStack, World world) - { - ItemStack toolStack = new ItemStack(ModItems.customTool,1); - - ItemSpellMultiTool itemTool = (ItemSpellMultiTool) ModItems.customTool; - - itemTool.setItemAttack(toolStack, this.composeMaxDamageFromHash()); - - Set> harvestLevelSet = this.harvestLevel.entrySet(); - - for(Entry testMap : harvestLevelSet) - { - String tool = testMap.getKey(); - int level = testMap.getValue(); - - itemTool.setHarvestLevel(toolStack, tool, level); - } - - Set> digSpeedSet = this.digSpeed.entrySet(); - - for(Entry testMap : digSpeedSet) - { - String tool = testMap.getKey(); - float speed = testMap.getValue(); - - itemTool.setDigSpeed(toolStack, tool, speed); - } - - itemTool.setFortuneLevel(toolStack, getFortuneLevel()); - itemTool.setSilkTouch(toolStack, this.getSilkTouch()); - - if(this.getSilkTouch()) - { - this.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt(1)); - } - - if(this.getFortuneLevel() > 0) - { - this.addToolString("Fortune", "Fortune" + " " + SpellHelper.getNumeralForInt(this.getFortuneLevel())); - } - - itemTool.setCritChance(toolStack, this.getCritChance()/100f); - - List toolStringList = new LinkedList(); - - for(String str : this.toolInfoString.values()) - { - toolStringList.add(str); - } - - itemTool.setToolListString(toolStack, toolStringList); - - for(Integer integ : this.durationHash.values()) - { - this.duration += integ; - } - - itemTool.setDuration(toolStack, world, this.duration); - itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList); - - EnergyItems.checkAndSetItemOwner(toolStack, EnergyItems.getOwnerName(crystalStack)); - - itemTool.setContainedCrystal(toolStack, crystalStack); - - return toolStack; - } + private float maxDamage; + private HashMap harvestLevel; + private HashMap digSpeed; + private HashMap maxDamageHash; + private HashMap critChanceHash; + private HashMap durationHash; - @Override - public int getDefaultCost() - { - return 100; - } - - public static SpellParadigmTool getParadigmForEffectArray(List effectList) - { - SpellParadigmTool parad = new SpellParadigmTool(); - - for(SpellEffect eff : effectList) - { - parad.addBufferedEffect(eff); - } - - parad.applyAllSpellEffects(); - - return parad; - } - - public void addLeftClickEffect(ILeftClickEffect eff) - { - if(eff != null) - { - this.leftClickEffectList.add(eff); - } - } - - public void addRightClickEffect(IRightClickEffect eff) - { - if(eff != null) - { - this.rightClickEffectList.add(eff); - } - } - - public void addUpdateEffect(IToolUpdateEffect eff) - { - if(eff != null) - { - this.toolUpdateEffectList.add(eff); - } - } - - public void addToolSummonEffect(IOnSummonTool eff) - { - if(eff != null) - { - this.toolSummonEffectList.add(eff); - } - } - - public void addToolBanishEffect(IOnBanishTool eff) - { - if(eff != null) - { - this.toolBanishEffectList.add(eff); - } - } - - public void addBlockBreakEffect(IOnBreakBlock eff) - { - if(eff != null) - { - this.breakBlockEffectList.add(eff); - } - } - - public void addItemManipulatorEffect(IItemManipulator eff) - { - if(eff != null) - { - this.itemManipulatorEffectList.add(eff); - } - } - - public void addDigAreaEffect(IDigAreaEffect eff) - { - if(eff != null) - { - this.digAreaEffectList.add(eff); - } - } - - public void addSpecialDamageEffect(ISpecialDamageEffect eff) - { - if(eff != null) - { - this.specialDamageEffectList.add(eff); - } - } - - public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) - { - int total = 0; - for(ILeftClickEffect effect : this.leftClickEffectList) - { - total += effect.onLeftClickEntity(stack, attacked, weilder); - } - - return total; - } - - public int onRightClickBlock(ItemStack toolStack, EntityLivingBase weilder, World world, MovingObjectPosition mop) - { - int total = 0; - for(IRightClickEffect effect : this.rightClickEffectList) - { - total += effect.onRightClickBlock(toolStack, weilder, world, mop); - } - - return total; - } - - public int onRightClickAir(ItemStack toolStack, World world, EntityPlayer player) - { - int total = 0; - for(IRightClickEffect effect : this.rightClickEffectList) - { - total += effect.onRightClickAir(toolStack, player); - } - - return total; - } - - public int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand) - { - int total = 0; - for(IToolUpdateEffect effect : this.toolUpdateEffectList) - { - total += effect.onUpdate(toolStack, world, par3Entity, invSlot, inHand); - } - - return total; - } - - public int onSummonTool(ItemStack toolStack, World world, Entity entity) - { - int total = 0; - for(IOnSummonTool effect : this.toolSummonEffectList) - { - total += effect.onSummonTool(toolStack, world, entity); - } - - return total; - } - - public int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand) - { - int total = 0; - for(IOnBanishTool effect : this.toolBanishEffectList) - { - total += effect.onBanishTool(toolStack, world, entity, invSlot, inHand); - } - - return total; - } - - public int onBreakBlock(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken) - { - int total = 0; - for(IOnBreakBlock effect : this.breakBlockEffectList) - { - total += effect.onBlockBroken(container, world, player, block, meta, x, y, z, sideBroken); - } - - return total; - } - - public List handleItemList(ItemStack toolStack, List items) - { - List heldList = items; - - for(IItemManipulator eff : this.itemManipulatorEffectList) - { - List newHeldList = eff.handleItemsOnBlockBroken(toolStack, heldList); - heldList = newHeldList; - } - - return heldList; - } - - public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) - { - int cost = 0; - - for(IDigAreaEffect effect : this.digAreaEffectList) - { - cost += effect.digSurroundingArea(container, world, player, blockPos, usedToolClass, blockHardness, harvestLvl, itemTool); - } - - return cost; - } - - public int getFortuneLevel() - { - return this.fortuneLevel; - } - - public void setFortuneLevel(int fortuneLevel) - { - this.fortuneLevel = fortuneLevel; - } - - public boolean getSilkTouch() - { - return this.silkTouch; - } - - public void setSilkTouch(boolean silkTouch) - { - this.silkTouch = silkTouch; - } - - public int getDuration() - { - return this.duration; - } - - public void setDuration(int duration) - { - this.duration = duration; - } - - public void setDigSpeed(String toolClass, float digSpeed) - { - this.digSpeed.put(toolClass, digSpeed); - } - - public void setHarvestLevel(String toolClass, int hlvl) - { - this.harvestLevel.put(toolClass, hlvl); - } - - public float composeMaxDamageFromHash() - { - float damage = 0.0f; - - for(float f : this.maxDamageHash.values()) - { - damage += f; - } - - return damage; - } - - public void addDamageToHash(String key, float dmg) - { - this.maxDamageHash.put(key, dmg); - } - - public void addToolString(String key, String str) - { - if(str != null && key != null) - { - this.toolInfoString.put(key, str); - } - } - - public void addCritChance(String key, float chance) - { - //Chance is in percentage chance i.e. chance = 1.0 means 1.0% - this.critChanceHash.put(key, chance); - } - - public void addDuration(String key, int dur) - { - this.durationHash.put(key, dur); - } - - public float getCritChance() - { - float chance = 0.0f; - - for(float fl : this.critChanceHash.values()) - { - chance += fl; - } - - return chance; - } - - public float getAddedDamageForEntity(Entity entity) - { - HashMap hash = new HashMap(); - - for(ISpecialDamageEffect effect : this.specialDamageEffectList) - { - hash.put(effect.getKey(), effect.getDamageForEntity(entity)); - } - - float addedDmg = 0.0f; - - for(float fl : hash.values()) - { - addedDmg += fl; - } - - return addedDmg; - } + private HashMap toolInfoString; + + private int fortuneLevel; + private boolean silkTouch; + + private int duration; + + public SpellParadigmTool() + { + this.leftClickEffectList = new LinkedList(); + this.rightClickEffectList = new LinkedList(); + this.toolUpdateEffectList = new LinkedList(); + this.toolSummonEffectList = new LinkedList(); + this.toolBanishEffectList = new LinkedList(); + this.breakBlockEffectList = new LinkedList(); + this.itemManipulatorEffectList = new LinkedList(); + this.digAreaEffectList = new LinkedList(); + this.specialDamageEffectList = new LinkedList(); + this.durationHash = new HashMap(); + + this.toolInfoString = new HashMap(); + this.critChanceHash = new HashMap(); + + this.maxDamage = 5; + + this.harvestLevel = new HashMap(); + this.harvestLevel.put("pickaxe", -1); + this.harvestLevel.put("shovel", -1); + this.harvestLevel.put("axe", -1); + + this.digSpeed = new HashMap(); + this.digSpeed.put("pickaxe", 1.0f); + this.digSpeed.put("shovel", 1.0f); + this.digSpeed.put("axe", 1.0f); + + this.maxDamageHash = new HashMap(); + this.maxDamageHash.put("default", 5.0f); + + this.fortuneLevel = 0; + this.silkTouch = false; + this.duration = 0; + this.durationHash.put("default", 2400); + } + + @Override + public void enhanceParadigm(SpellEnhancement enh) + { + + } + + @Override + public void castSpell(World world, EntityPlayer entityPlayer, ItemStack crystal) + { + if (entityPlayer.worldObj.isRemote) + { + return; + } + + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(crystal, entityPlayer, cost); + + ItemStack toolStack = this.prepareTool(crystal, world); + + entityPlayer.setCurrentItemOrArmor(0, toolStack); + + this.onSummonTool(toolStack, world, entityPlayer); + } + + /** + * @param crystalStack + * @return stack containing the new multitool + */ + public ItemStack prepareTool(ItemStack crystalStack, World world) + { + ItemStack toolStack = new ItemStack(ModItems.customTool, 1); + + ItemSpellMultiTool itemTool = (ItemSpellMultiTool) ModItems.customTool; + + itemTool.setItemAttack(toolStack, this.composeMaxDamageFromHash()); + + Set> harvestLevelSet = this.harvestLevel.entrySet(); + + for (Entry testMap : harvestLevelSet) + { + String tool = testMap.getKey(); + int level = testMap.getValue(); + + itemTool.setHarvestLevel(toolStack, tool, level); + } + + Set> digSpeedSet = this.digSpeed.entrySet(); + + for (Entry testMap : digSpeedSet) + { + String tool = testMap.getKey(); + float speed = testMap.getValue(); + + itemTool.setDigSpeed(toolStack, tool, speed); + } + + itemTool.setFortuneLevel(toolStack, getFortuneLevel()); + itemTool.setSilkTouch(toolStack, this.getSilkTouch()); + + if (this.getSilkTouch()) + { + this.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt(1)); + } + + if (this.getFortuneLevel() > 0) + { + this.addToolString("Fortune", "Fortune" + " " + SpellHelper.getNumeralForInt(this.getFortuneLevel())); + } + + itemTool.setCritChance(toolStack, this.getCritChance() / 100f); + + List toolStringList = new LinkedList(); + + for (String str : this.toolInfoString.values()) + { + toolStringList.add(str); + } + + itemTool.setToolListString(toolStack, toolStringList); + + for (Integer integ : this.durationHash.values()) + { + this.duration += integ; + } + + itemTool.setDuration(toolStack, world, this.duration); + itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList); + + EnergyItems.checkAndSetItemOwner(toolStack, EnergyItems.getOwnerName(crystalStack)); + + itemTool.setContainedCrystal(toolStack, crystalStack); + + return toolStack; + } + + @Override + public int getDefaultCost() + { + return 100; + } + + public static SpellParadigmTool getParadigmForEffectArray(List effectList) + { + SpellParadigmTool parad = new SpellParadigmTool(); + + for (SpellEffect eff : effectList) + { + parad.addBufferedEffect(eff); + } + + parad.applyAllSpellEffects(); + + return parad; + } + + public void addLeftClickEffect(ILeftClickEffect eff) + { + if (eff != null) + { + this.leftClickEffectList.add(eff); + } + } + + public void addRightClickEffect(IRightClickEffect eff) + { + if (eff != null) + { + this.rightClickEffectList.add(eff); + } + } + + public void addUpdateEffect(IToolUpdateEffect eff) + { + if (eff != null) + { + this.toolUpdateEffectList.add(eff); + } + } + + public void addToolSummonEffect(IOnSummonTool eff) + { + if (eff != null) + { + this.toolSummonEffectList.add(eff); + } + } + + public void addToolBanishEffect(IOnBanishTool eff) + { + if (eff != null) + { + this.toolBanishEffectList.add(eff); + } + } + + public void addBlockBreakEffect(IOnBreakBlock eff) + { + if (eff != null) + { + this.breakBlockEffectList.add(eff); + } + } + + public void addItemManipulatorEffect(IItemManipulator eff) + { + if (eff != null) + { + this.itemManipulatorEffectList.add(eff); + } + } + + public void addDigAreaEffect(IDigAreaEffect eff) + { + if (eff != null) + { + this.digAreaEffectList.add(eff); + } + } + + public void addSpecialDamageEffect(ISpecialDamageEffect eff) + { + if (eff != null) + { + this.specialDamageEffectList.add(eff); + } + } + + public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) + { + int total = 0; + for (ILeftClickEffect effect : this.leftClickEffectList) + { + total += effect.onLeftClickEntity(stack, attacked, weilder); + } + + return total; + } + + public int onRightClickBlock(ItemStack toolStack, EntityLivingBase weilder, World world, MovingObjectPosition mop) + { + int total = 0; + for (IRightClickEffect effect : this.rightClickEffectList) + { + total += effect.onRightClickBlock(toolStack, weilder, world, mop); + } + + return total; + } + + public int onRightClickAir(ItemStack toolStack, World world, EntityPlayer player) + { + int total = 0; + for (IRightClickEffect effect : this.rightClickEffectList) + { + total += effect.onRightClickAir(toolStack, player); + } + + return total; + } + + public int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand) + { + int total = 0; + for (IToolUpdateEffect effect : this.toolUpdateEffectList) + { + total += effect.onUpdate(toolStack, world, par3Entity, invSlot, inHand); + } + + return total; + } + + public int onSummonTool(ItemStack toolStack, World world, Entity entity) + { + int total = 0; + for (IOnSummonTool effect : this.toolSummonEffectList) + { + total += effect.onSummonTool(toolStack, world, entity); + } + + return total; + } + + public int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand) + { + int total = 0; + for (IOnBanishTool effect : this.toolBanishEffectList) + { + total += effect.onBanishTool(toolStack, world, entity, invSlot, inHand); + } + + return total; + } + + public int onBreakBlock(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken) + { + int total = 0; + for (IOnBreakBlock effect : this.breakBlockEffectList) + { + total += effect.onBlockBroken(container, world, player, block, meta, x, y, z, sideBroken); + } + + return total; + } + + public List handleItemList(ItemStack toolStack, List items) + { + List heldList = items; + + for (IItemManipulator eff : this.itemManipulatorEffectList) + { + List newHeldList = eff.handleItemsOnBlockBroken(toolStack, heldList); + heldList = newHeldList; + } + + return heldList; + } + + public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) + { + int cost = 0; + + for (IDigAreaEffect effect : this.digAreaEffectList) + { + cost += effect.digSurroundingArea(container, world, player, blockPos, usedToolClass, blockHardness, harvestLvl, itemTool); + } + + return cost; + } + + public int getFortuneLevel() + { + return this.fortuneLevel; + } + + public void setFortuneLevel(int fortuneLevel) + { + this.fortuneLevel = fortuneLevel; + } + + public boolean getSilkTouch() + { + return this.silkTouch; + } + + public void setSilkTouch(boolean silkTouch) + { + this.silkTouch = silkTouch; + } + + public int getDuration() + { + return this.duration; + } + + public void setDuration(int duration) + { + this.duration = duration; + } + + public void setDigSpeed(String toolClass, float digSpeed) + { + this.digSpeed.put(toolClass, digSpeed); + } + + public void setHarvestLevel(String toolClass, int hlvl) + { + this.harvestLevel.put(toolClass, hlvl); + } + + public float composeMaxDamageFromHash() + { + float damage = 0.0f; + + for (float f : this.maxDamageHash.values()) + { + damage += f; + } + + return damage; + } + + public void addDamageToHash(String key, float dmg) + { + this.maxDamageHash.put(key, dmg); + } + + public void addToolString(String key, String str) + { + if (str != null && key != null) + { + this.toolInfoString.put(key, str); + } + } + + public void addCritChance(String key, float chance) + { + //Chance is in percentage chance i.e. chance = 1.0 means 1.0% + this.critChanceHash.put(key, chance); + } + + public void addDuration(String key, int dur) + { + this.durationHash.put(key, dur); + } + + public float getCritChance() + { + float chance = 0.0f; + + for (float fl : this.critChanceHash.values()) + { + chance += fl; + } + + return chance; + } + + public float getAddedDamageForEntity(Entity entity) + { + HashMap hash = new HashMap(); + + for (ISpecialDamageEffect effect : this.specialDamageEffectList) + { + hash.put(effect.getKey(), effect.getDamageForEntity(entity)); + } + + float addedDmg = 0.0f; + + for (float fl : hash.values()) + { + addedDmg += fl; + } + + return addedDmg; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java index d241917e..cf17a98f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java @@ -1,217 +1,290 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect; -import net.minecraft.nbt.NBTTagCompound; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellModifier; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; +import WayofTime.alchemicalWizardry.common.spell.complex.*; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; +import net.minecraft.nbt.NBTTagCompound; -public abstract class SpellEffect +public abstract class SpellEffect { - protected int modifierState; - protected int powerEnhancement; - protected int costEnhancement; - protected int potencyEnhancement; - - public SpellEffect() - { - this.modifierState = SpellModifier.DEFAULT; - this.powerEnhancement = 0; - this.costEnhancement = 0; - this.potencyEnhancement = 0; - } - - public void enhanceEffect(SpellEnhancement enh) - { - if(enh!=null) - { - switch(enh.getState()) - { - case SpellEnhancement.POWER: this.powerEnhancement++; break; - case SpellEnhancement.EFFICIENCY: this.costEnhancement++; break; - case SpellEnhancement.POTENCY: this.potencyEnhancement++; break; - } - } - } - - public void modifyEffect(SpellModifier mod) - { - if(mod!=null) - modifierState = mod.getModifier(); - } - - public void modifyParadigm(SpellParadigm parad) - { - if(parad instanceof SpellParadigmProjectile) - { - this.modifyProjectileParadigm((SpellParadigmProjectile)parad); - } - if(parad instanceof SpellParadigmSelf) - { - this.modifySelfParadigm((SpellParadigmSelf)parad); - } - if(parad instanceof SpellParadigmMelee) - { - this.modifyMeleeParadigm((SpellParadigmMelee)parad); - } - if(parad instanceof SpellParadigmTool) - { - this.modifyToolParadigm((SpellParadigmTool)parad); - } - } - - public void modifyProjectileParadigm(SpellParadigmProjectile parad) - { - switch(modifierState) - { - case SpellModifier.DEFAULT: this.defaultModificationProjectile(parad); break; - case SpellModifier.OFFENSIVE: this.offensiveModificationProjectile(parad); break; - case SpellModifier.DEFENSIVE: this.defensiveModificationProjectile(parad); break; - case SpellModifier.ENVIRONMENTAL: this.environmentalModificationProjectile(parad); break; - } - } - - public abstract void defaultModificationProjectile(SpellParadigmProjectile parad); - public abstract void offensiveModificationProjectile(SpellParadigmProjectile parad); - public abstract void defensiveModificationProjectile(SpellParadigmProjectile parad); - public abstract void environmentalModificationProjectile(SpellParadigmProjectile parad); - - public void modifySelfParadigm(SpellParadigmSelf parad) - { - switch(modifierState) - { - case SpellModifier.DEFAULT: this.defaultModificationSelf(parad); break; - case SpellModifier.OFFENSIVE: this.offensiveModificationSelf(parad); break; - case SpellModifier.DEFENSIVE: this.defensiveModificationSelf(parad); break; - case SpellModifier.ENVIRONMENTAL: this.environmentalModificationSelf(parad); break; - } - } - - public abstract void defaultModificationSelf(SpellParadigmSelf parad); - public abstract void offensiveModificationSelf(SpellParadigmSelf parad); - public abstract void defensiveModificationSelf(SpellParadigmSelf parad); - public abstract void environmentalModificationSelf(SpellParadigmSelf parad); - - public void modifyMeleeParadigm(SpellParadigmMelee parad) - { - switch(modifierState) - { - case SpellModifier.DEFAULT: this.defaultModificationMelee(parad); break; - case SpellModifier.OFFENSIVE: this.offensiveModificationMelee(parad); break; - case SpellModifier.DEFENSIVE: this.defensiveModificationMelee(parad); break; - case SpellModifier.ENVIRONMENTAL: this.environmentalModificationMelee(parad); break; - } - } - - public abstract void defaultModificationMelee(SpellParadigmMelee parad); - public abstract void offensiveModificationMelee(SpellParadigmMelee parad); - public abstract void defensiveModificationMelee(SpellParadigmMelee parad); - public abstract void environmentalModificationMelee(SpellParadigmMelee parad); - - public void modifyToolParadigm(SpellParadigmTool parad) - { - switch(modifierState) - { - case SpellModifier.DEFAULT: this.defaultModificationTool(parad); break; - case SpellModifier.OFFENSIVE: this.offensiveModificationTool(parad); break; - case SpellModifier.DEFENSIVE: this.defensiveModificationTool(parad); break; - case SpellModifier.ENVIRONMENTAL: this.environmentalModificationTool(parad); break; - } - } - - public abstract void defaultModificationTool(SpellParadigmTool parad); - public abstract void offensiveModificationTool(SpellParadigmTool parad); - public abstract void defensiveModificationTool(SpellParadigmTool parad); - public abstract void environmentalModificationTool(SpellParadigmTool parad); - - public int getCostForProjectile() - { - switch(this.modifierState) - { - case SpellModifier.DEFAULT: return this.getCostForDefaultProjectile(); - case SpellModifier.OFFENSIVE: return this.getCostForOffenseProjectile(); - case SpellModifier.DEFENSIVE: return this.getCostForDefenseProjectile(); - case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentProjectile(); - } - return 0; - } - - protected abstract int getCostForDefaultProjectile(); - protected abstract int getCostForOffenseProjectile(); - protected abstract int getCostForDefenseProjectile(); - protected abstract int getCostForEnvironmentProjectile(); - - public int getCostForSelf() - { - switch(this.modifierState) - { - case SpellModifier.DEFAULT: return this.getCostForDefaultSelf(); - case SpellModifier.OFFENSIVE: return this.getCostForOffenseSelf(); - case SpellModifier.DEFENSIVE: return this.getCostForDefenseSelf(); - case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentSelf(); - } - return 0; - } - - protected abstract int getCostForDefaultSelf(); - protected abstract int getCostForOffenseSelf(); - protected abstract int getCostForDefenseSelf(); - protected abstract int getCostForEnvironmentSelf(); - - public int getCostForMelee() - { - switch(this.modifierState) - { - case SpellModifier.DEFAULT: return this.getCostForDefaultMelee(); - case SpellModifier.OFFENSIVE: return this.getCostForOffenseMelee(); - case SpellModifier.DEFENSIVE: return this.getCostForDefenseMelee(); - case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentMelee(); - } - return 0; - } - - protected abstract int getCostForDefaultMelee(); - protected abstract int getCostForOffenseMelee(); - protected abstract int getCostForDefenseMelee(); - protected abstract int getCostForEnvironmentMelee(); - - public int getCostForTool() - { - switch(this.modifierState) - { - case SpellModifier.DEFAULT: return this.getCostForDefaultTool(); - case SpellModifier.OFFENSIVE: return this.getCostForOffenseTool(); - case SpellModifier.DEFENSIVE: return this.getCostForDefenseTool(); - case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentTool(); - } - return 0; - } - - protected abstract int getCostForDefaultTool(); - protected abstract int getCostForOffenseTool(); - protected abstract int getCostForDefenseTool(); - protected abstract int getCostForEnvironmentTool(); - - public int getPowerEnhancements() - { - return this.powerEnhancement; - } - - public int getCostEnhancements() - { - return this.costEnhancement; - } - - public int getPotencyEnhancements() - { - return this.potencyEnhancement; - } - - public NBTTagCompound getTag() - { + protected int modifierState; + protected int powerEnhancement; + protected int costEnhancement; + protected int potencyEnhancement; + + public SpellEffect() + { + this.modifierState = SpellModifier.DEFAULT; + this.powerEnhancement = 0; + this.costEnhancement = 0; + this.potencyEnhancement = 0; + } + + public void enhanceEffect(SpellEnhancement enh) + { + if (enh != null) + { + switch (enh.getState()) + { + case SpellEnhancement.POWER: + this.powerEnhancement++; + break; + case SpellEnhancement.EFFICIENCY: + this.costEnhancement++; + break; + case SpellEnhancement.POTENCY: + this.potencyEnhancement++; + break; + } + } + } + + public void modifyEffect(SpellModifier mod) + { + if (mod != null) + modifierState = mod.getModifier(); + } + + public void modifyParadigm(SpellParadigm parad) + { + if (parad instanceof SpellParadigmProjectile) + { + this.modifyProjectileParadigm((SpellParadigmProjectile) parad); + } + if (parad instanceof SpellParadigmSelf) + { + this.modifySelfParadigm((SpellParadigmSelf) parad); + } + if (parad instanceof SpellParadigmMelee) + { + this.modifyMeleeParadigm((SpellParadigmMelee) parad); + } + if (parad instanceof SpellParadigmTool) + { + this.modifyToolParadigm((SpellParadigmTool) parad); + } + } + + public void modifyProjectileParadigm(SpellParadigmProjectile parad) + { + switch (modifierState) + { + case SpellModifier.DEFAULT: + this.defaultModificationProjectile(parad); + break; + case SpellModifier.OFFENSIVE: + this.offensiveModificationProjectile(parad); + break; + case SpellModifier.DEFENSIVE: + this.defensiveModificationProjectile(parad); + break; + case SpellModifier.ENVIRONMENTAL: + this.environmentalModificationProjectile(parad); + break; + } + } + + public abstract void defaultModificationProjectile(SpellParadigmProjectile parad); + + public abstract void offensiveModificationProjectile(SpellParadigmProjectile parad); + + public abstract void defensiveModificationProjectile(SpellParadigmProjectile parad); + + public abstract void environmentalModificationProjectile(SpellParadigmProjectile parad); + + public void modifySelfParadigm(SpellParadigmSelf parad) + { + switch (modifierState) + { + case SpellModifier.DEFAULT: + this.defaultModificationSelf(parad); + break; + case SpellModifier.OFFENSIVE: + this.offensiveModificationSelf(parad); + break; + case SpellModifier.DEFENSIVE: + this.defensiveModificationSelf(parad); + break; + case SpellModifier.ENVIRONMENTAL: + this.environmentalModificationSelf(parad); + break; + } + } + + public abstract void defaultModificationSelf(SpellParadigmSelf parad); + + public abstract void offensiveModificationSelf(SpellParadigmSelf parad); + + public abstract void defensiveModificationSelf(SpellParadigmSelf parad); + + public abstract void environmentalModificationSelf(SpellParadigmSelf parad); + + public void modifyMeleeParadigm(SpellParadigmMelee parad) + { + switch (modifierState) + { + case SpellModifier.DEFAULT: + this.defaultModificationMelee(parad); + break; + case SpellModifier.OFFENSIVE: + this.offensiveModificationMelee(parad); + break; + case SpellModifier.DEFENSIVE: + this.defensiveModificationMelee(parad); + break; + case SpellModifier.ENVIRONMENTAL: + this.environmentalModificationMelee(parad); + break; + } + } + + public abstract void defaultModificationMelee(SpellParadigmMelee parad); + + public abstract void offensiveModificationMelee(SpellParadigmMelee parad); + + public abstract void defensiveModificationMelee(SpellParadigmMelee parad); + + public abstract void environmentalModificationMelee(SpellParadigmMelee parad); + + public void modifyToolParadigm(SpellParadigmTool parad) + { + switch (modifierState) + { + case SpellModifier.DEFAULT: + this.defaultModificationTool(parad); + break; + case SpellModifier.OFFENSIVE: + this.offensiveModificationTool(parad); + break; + case SpellModifier.DEFENSIVE: + this.defensiveModificationTool(parad); + break; + case SpellModifier.ENVIRONMENTAL: + this.environmentalModificationTool(parad); + break; + } + } + + public abstract void defaultModificationTool(SpellParadigmTool parad); + + public abstract void offensiveModificationTool(SpellParadigmTool parad); + + public abstract void defensiveModificationTool(SpellParadigmTool parad); + + public abstract void environmentalModificationTool(SpellParadigmTool parad); + + public int getCostForProjectile() + { + switch (this.modifierState) + { + case SpellModifier.DEFAULT: + return this.getCostForDefaultProjectile(); + case SpellModifier.OFFENSIVE: + return this.getCostForOffenseProjectile(); + case SpellModifier.DEFENSIVE: + return this.getCostForDefenseProjectile(); + case SpellModifier.ENVIRONMENTAL: + return this.getCostForEnvironmentProjectile(); + } + return 0; + } + + protected abstract int getCostForDefaultProjectile(); + + protected abstract int getCostForOffenseProjectile(); + + protected abstract int getCostForDefenseProjectile(); + + protected abstract int getCostForEnvironmentProjectile(); + + public int getCostForSelf() + { + switch (this.modifierState) + { + case SpellModifier.DEFAULT: + return this.getCostForDefaultSelf(); + case SpellModifier.OFFENSIVE: + return this.getCostForOffenseSelf(); + case SpellModifier.DEFENSIVE: + return this.getCostForDefenseSelf(); + case SpellModifier.ENVIRONMENTAL: + return this.getCostForEnvironmentSelf(); + } + return 0; + } + + protected abstract int getCostForDefaultSelf(); + + protected abstract int getCostForOffenseSelf(); + + protected abstract int getCostForDefenseSelf(); + + protected abstract int getCostForEnvironmentSelf(); + + public int getCostForMelee() + { + switch (this.modifierState) + { + case SpellModifier.DEFAULT: + return this.getCostForDefaultMelee(); + case SpellModifier.OFFENSIVE: + return this.getCostForOffenseMelee(); + case SpellModifier.DEFENSIVE: + return this.getCostForDefenseMelee(); + case SpellModifier.ENVIRONMENTAL: + return this.getCostForEnvironmentMelee(); + } + return 0; + } + + protected abstract int getCostForDefaultMelee(); + + protected abstract int getCostForOffenseMelee(); + + protected abstract int getCostForDefenseMelee(); + + protected abstract int getCostForEnvironmentMelee(); + + public int getCostForTool() + { + switch (this.modifierState) + { + case SpellModifier.DEFAULT: + return this.getCostForDefaultTool(); + case SpellModifier.OFFENSIVE: + return this.getCostForOffenseTool(); + case SpellModifier.DEFENSIVE: + return this.getCostForDefenseTool(); + case SpellModifier.ENVIRONMENTAL: + return this.getCostForEnvironmentTool(); + } + return 0; + } + + protected abstract int getCostForDefaultTool(); + + protected abstract int getCostForOffenseTool(); + + protected abstract int getCostForDefenseTool(); + + protected abstract int getCostForEnvironmentTool(); + + public int getPowerEnhancements() + { + return this.powerEnhancement; + } + + public int getCostEnhancements() + { + return this.costEnhancement; + } + + public int getPotencyEnhancements() + { + return this.potencyEnhancement; + } + + public NBTTagCompound getTag() + { NBTTagCompound tag = new NBTTagCompound(); tag.setString("Class", this.getClass().getName()); @@ -219,41 +292,43 @@ public abstract class SpellEffect tag.setInteger("power", powerEnhancement); tag.setInteger("cost", costEnhancement); tag.setInteger("potency", potencyEnhancement); - + return tag; - } - - public static SpellEffect getEffectFromTag(NBTTagCompound tag) - { - try { - Class clazz = Class.forName(tag.getString("Class")); - if(clazz !=null) - { - try { - Object obj = clazz.newInstance(); - if(obj instanceof SpellEffect) - { - SpellEffect eff = (SpellEffect) obj; - - eff.modifierState = tag.getInteger("modifier"); - eff.powerEnhancement = tag.getInteger("power"); - eff.costEnhancement = tag.getInteger("cost"); - eff.potencyEnhancement = tag.getInteger("potency"); - - return eff; - } - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } + } + + public static SpellEffect getEffectFromTag(NBTTagCompound tag) + { + try + { + Class clazz = Class.forName(tag.getString("Class")); + if (clazz != null) + { + try + { + Object obj = clazz.newInstance(); + if (obj instanceof SpellEffect) + { + SpellEffect eff = (SpellEffect) obj; + + eff.modifierState = tag.getInteger("modifier"); + eff.powerEnhancement = tag.getInteger("power"); + eff.costEnhancement = tag.getInteger("cost"); + eff.potencyEnhancement = tag.getInteger("potency"); + + return eff; + } + } catch (InstantiationException e) + { + e.printStackTrace(); + } catch (IllegalAccessException e) + { + e.printStackTrace(); + } + } + } catch (ClassNotFoundException e) + { + e.printStackTrace(); + } + return null; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java index 094d3fb4..1fde92cd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java @@ -4,277 +4,264 @@ import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeDefaultEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeDefensiveEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeEnvironmentalEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeOffensiveEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileDefaultEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileDefensiveEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileEnvironmentalEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileOffensiveEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfDefaultEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfDefensiveEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfEnvironmentalEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfOffensiveEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ToolEnvironmentalEarth; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ToolOffensiveEarth; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.*; -public class SpellEffectEarth extends SpellEffect +public class SpellEffectEarth extends SpellEffect { - @Override - public void defaultModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileDefensiveEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationProjectile(SpellParadigmProjectile parad) - { - parad.addUpdateEffect(new ProjectileEnvironmentalEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + parad.addUpdateEffect(new ProjectileEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defaultModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfOffensiveEarth(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefensiveEarth(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfEnvironmentalEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defaultModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeOffensiveEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeDefensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeDefensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - protected int getCostForDefaultProjectile() - { - return (int)(10*Math.pow((0.5*(this.powerEnhancement)+1)*2 + 1,3)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultProjectile() + { + return (int) (10 * Math.pow((0.5 * (this.powerEnhancement) + 1) * 2 + 1, 3) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseProjectile() - { - - return (int)(10*(1.5*this.potencyEnhancement+1)*(Math.pow(1*this.powerEnhancement+1,2))*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseProjectile() + { - @Override - protected int getCostForDefenseProjectile() - { - return (int)(3*Math.pow((this.powerEnhancement*2+1),2)*(this.potencyEnhancement*2+1)*Math.pow(0.85, costEnhancement)); - } + return (int) (10 * (1.5 * this.potencyEnhancement + 1) * (Math.pow(1 * this.powerEnhancement + 1, 2)) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentProjectile() - { - return (int)(10*2*(0.1d*(this.potencyEnhancement+1))*Math.pow(3.47,this.potencyEnhancement)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseProjectile() + { + return (int) (3 * Math.pow((this.powerEnhancement * 2 + 1), 2) * (this.potencyEnhancement * 2 + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultSelf() - { - return (int)(20*Math.pow(1.5*powerEnhancement+1,2)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentProjectile() + { + return (int) (10 * 2 * (0.1d * (this.potencyEnhancement + 1)) * Math.pow(3.47, this.potencyEnhancement) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseSelf() - { - return (int)(10*Math.pow(2*this.powerEnhancement+1,2)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultSelf() + { + return (int) (20 * Math.pow(1.5 * powerEnhancement + 1, 2) * (2 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseSelf() - { - return (int)(750*(1.1*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseSelf() + { + return (int) (10 * Math.pow(2 * this.powerEnhancement + 1, 2) * (this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentSelf() - { - return (int)(250*(1.2*this.potencyEnhancement+1)*(3*this.powerEnhancement+2.5)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseSelf() + { + return (int) (750 * (1.1 * this.powerEnhancement + 1) * (0.5 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultMelee() - { - return (int)(50*Math.pow(1.5*this.potencyEnhancement + 1,3)*(0.5*this.powerEnhancement + 1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentSelf() + { + return (int) (250 * (1.2 * this.potencyEnhancement + 1) * (3 * this.powerEnhancement + 2.5) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseMelee() - { - return (int)(20*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultMelee() + { + return (int) (50 * Math.pow(1.5 * this.potencyEnhancement + 1, 3) * (0.5 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseMelee() - { - return (int)(5*(1.2*this.powerEnhancement+1)*(1.0f/3.0f*Math.pow(this.potencyEnhancement,2)+2+1.0f/2.0f*this.potencyEnhancement)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseMelee() + { + return (int) (20 * Math.pow(1.5 * this.powerEnhancement + 1, 3) * (0.25 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentMelee() - { - return (int)(500*Math.pow(2*this.potencyEnhancement+1, 3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseMelee() + { + return (int) (5 * (1.2 * this.powerEnhancement + 1) * (1.0f / 3.0f * Math.pow(this.potencyEnhancement, 2) + 2 + 1.0f / 2.0f * this.potencyEnhancement) * Math.pow(0.85, costEnhancement)); + } - @Override - public void defaultModificationTool(SpellParadigmTool parad) - { - String toolClass = "pickaxe"; + @Override + protected int getCostForEnvironmentMelee() + { + return (int) (500 * Math.pow(2 * this.potencyEnhancement + 1, 3) * (0.25 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } + + @Override + public void defaultModificationTool(SpellParadigmTool parad) + { + String toolClass = "pickaxe"; - float digSpeed = 7.0f; + float digSpeed = 7.0f; - switch(this.powerEnhancement) - { - case 1: - digSpeed = 9.0f; - break; - case 2: - digSpeed = 12.0f; - break; - case 3: - digSpeed = 16.0f; - break; - case 4: - digSpeed = 21.0f; - break; - case 5: - digSpeed = 27.0f; - break; - } + switch (this.powerEnhancement) + { + case 1: + digSpeed = 9.0f; + break; + case 2: + digSpeed = 12.0f; + break; + case 3: + digSpeed = 16.0f; + break; + case 4: + digSpeed = 21.0f; + break; + case 5: + digSpeed = 27.0f; + break; + } - parad.setDigSpeed(toolClass, digSpeed); + parad.setDigSpeed(toolClass, digSpeed); - int hlvl = this.potencyEnhancement + 2; - parad.setHarvestLevel(toolClass, hlvl); - } + int hlvl = this.potencyEnhancement + 2; + parad.setHarvestLevel(toolClass, hlvl); + } - @Override - public void offensiveModificationTool(SpellParadigmTool parad) - { - parad.addItemManipulatorEffect(new ToolOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void offensiveModificationTool(SpellParadigmTool parad) + { + parad.addItemManipulatorEffect(new ToolOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationTool(SpellParadigmTool parad) - { - String toolClass = "shovel"; + @Override + public void defensiveModificationTool(SpellParadigmTool parad) + { + String toolClass = "shovel"; - float digSpeed = 7.0f; + float digSpeed = 7.0f; - switch(this.powerEnhancement) - { - case 1: - digSpeed = 9.0f; - break; - case 2: - digSpeed = 12.0f; - break; - case 3: - digSpeed = 16.0f; - break; - case 4: - digSpeed = 21.0f; - break; - case 5: - digSpeed = 27.0f; - break; - } + switch (this.powerEnhancement) + { + case 1: + digSpeed = 9.0f; + break; + case 2: + digSpeed = 12.0f; + break; + case 3: + digSpeed = 16.0f; + break; + case 4: + digSpeed = 21.0f; + break; + case 5: + digSpeed = 27.0f; + break; + } - parad.setDigSpeed(toolClass, digSpeed); + parad.setDigSpeed(toolClass, digSpeed); - int hlvl = this.potencyEnhancement + 2; - parad.setHarvestLevel(toolClass, hlvl); - } + int hlvl = this.potencyEnhancement + 2; + parad.setHarvestLevel(toolClass, hlvl); + } - @Override - public void environmentalModificationTool(SpellParadigmTool parad) - { - parad.addDigAreaEffect(new ToolEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void environmentalModificationTool(SpellParadigmTool parad) + { + parad.addDigAreaEffect(new ToolEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - protected int getCostForDefaultTool() - { - return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultTool() + { + return (int) (1000 * (1 + this.potencyEnhancement * 0.1f) * (1 + this.powerEnhancement * 0.2f) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseTool() - { - return 1000; - } + @Override + protected int getCostForOffenseTool() + { + return 1000; + } - @Override - protected int getCostForDefenseTool() - { - return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseTool() + { + return (int) (1000 * (1 + this.potencyEnhancement * 0.1f) * (1 + this.powerEnhancement * 0.2f) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentTool() - { - return (int)(10 * (1+this.potencyEnhancement*0.8) * Math.pow(1.5*this.powerEnhancement + 3, 2) * Math.pow(0.85, this.costEnhancement)); - } + @Override + protected int getCostForEnvironmentTool() + { + return (int) (10 * (1 + this.potencyEnhancement * 0.8) * Math.pow(1.5 * this.powerEnhancement + 3, 2) * Math.pow(0.85, this.costEnhancement)); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java index a4027390..cb5e8a73 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java @@ -4,222 +4,208 @@ import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeDefaultFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeDefensiveFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeEnvironmentalFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeOffensiveFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefensiveFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileEnvironmentalFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileOffensiveFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefaultFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefensiveFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfEnvironmentalFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfOffensiveFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolDefaultFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolEnvironmentalFire; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolOffensiveFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.*; public class SpellEffectFire extends SpellEffect { - @Override - public void defaultModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - parad.damage+=this.potencyEnhancement; - } + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + parad.damage += this.potencyEnhancement; + } - @Override - public void offensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileOffensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileOffensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileDefensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationProjectile(SpellParadigmProjectile parad) - { - parad.addUpdateEffect(new ProjectileEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + parad.addUpdateEffect(new ProjectileEnvironmentalFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defaultModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefaultFire(powerEnhancement, potencyEnhancement, costEnhancement)); - } + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefaultFire(powerEnhancement, potencyEnhancement, costEnhancement)); + } - @Override - public void offensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfOffensiveFire(powerEnhancement,potencyEnhancement,costEnhancement)); - } + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfOffensiveFire(powerEnhancement, potencyEnhancement, costEnhancement)); + } - @Override - public void defensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefensiveFire(powerEnhancement,potencyEnhancement,costEnhancement)); - } + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefensiveFire(powerEnhancement, potencyEnhancement, costEnhancement)); + } - @Override - public void environmentalModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfEnvironmentalFire(powerEnhancement, potencyEnhancement, costEnhancement)); - } + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfEnvironmentalFire(powerEnhancement, potencyEnhancement, costEnhancement)); + } - @Override - public void defaultModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeDefaultFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeDefaultFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeOffensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeOffensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeDefensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeDefensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeEnvironmentalFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - protected int getCostForDefaultProjectile() - { - return (int)((5*Math.pow(1.5*this.powerEnhancement+1, 2)*(1.5*this.potencyEnhancement+1)+this.potencyEnhancement*15)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultProjectile() + { + return (int) ((5 * Math.pow(1.5 * this.powerEnhancement + 1, 2) * (1.5 * this.potencyEnhancement + 1) + this.potencyEnhancement * 15) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseProjectile() - { - return (int)(10*Math.pow((this.powerEnhancement)*1.3+1,2)*((1.5*this.potencyEnhancement+1))*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseProjectile() + { + return (int) (10 * Math.pow((this.powerEnhancement) * 1.3 + 1, 2) * ((1.5 * this.potencyEnhancement + 1)) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseProjectile() - { - return (int)(25*Math.pow(1*this.powerEnhancement+1,2)*(1*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseProjectile() + { + return (int) (25 * Math.pow(1 * this.powerEnhancement + 1, 2) * (1 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentProjectile() - { - return (int)(75*(0.5*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentProjectile() + { + return (int) (75 * (0.5 * this.powerEnhancement + 1) * (0.5 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultSelf() - { - return 10*(int)(10*Math.pow(1.5, this.powerEnhancement+1.5*this.potencyEnhancement)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultSelf() + { + return 10 * (int) (10 * Math.pow(1.5, this.powerEnhancement + 1.5 * this.potencyEnhancement) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseSelf() - { - return (int)(300*(3*powerEnhancement+1)*(2*potencyEnhancement + 1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseSelf() + { + return (int) (300 * (3 * powerEnhancement + 1) * (2 * potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseSelf() - { - return (int)(25*(3*this.potencyEnhancement+1)*(2*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseSelf() + { + return (int) (25 * (3 * this.potencyEnhancement + 1) * (2 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentSelf() - { - return (int)((15*Math.pow(1.7, powerEnhancement)+10*Math.pow(potencyEnhancement,1.8))*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentSelf() + { + return (int) ((15 * Math.pow(1.7, powerEnhancement) + 10 * Math.pow(potencyEnhancement, 1.8)) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultMelee() - { - return (int)(25*(1.2*this.potencyEnhancement+1)*(2.5*this.powerEnhancement+2)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultMelee() + { + return (int) (25 * (1.2 * this.potencyEnhancement + 1) * (2.5 * this.powerEnhancement + 2) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseMelee() - { - return (int)(500*(1+this.potencyEnhancement)*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseMelee() + { + return (int) (500 * (1 + this.potencyEnhancement) * (this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseMelee() - { - return (int)(30*(1.5*potencyEnhancement+1)*(3*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseMelee() + { + return (int) (30 * (1.5 * potencyEnhancement + 1) * (3 * powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentMelee() - { - return (int)(25*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentMelee() + { + return (int) (25 * Math.pow(1.5 * this.powerEnhancement + 1, 3) * (0.25 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - public void defaultModificationTool(SpellParadigmTool parad) - { - parad.addItemManipulatorEffect(new ToolDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defaultModificationTool(SpellParadigmTool parad) + { + parad.addItemManipulatorEffect(new ToolDefaultFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationTool(SpellParadigmTool parad) - { - parad.addLeftClickEffect(new ToolOffensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - - parad.addToolString("offFire", "Fire Aspect" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); - } + @Override + public void offensiveModificationTool(SpellParadigmTool parad) + { + parad.addLeftClickEffect(new ToolOffensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - @Override - public void defensiveModificationTool(SpellParadigmTool parad) - { - parad.addCritChance("defFire", this.potencyEnhancement); - - parad.addDuration("defFire", 1200 * this.powerEnhancement); - - parad.addToolString("defFire", "Unbreaking" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); - } + parad.addToolString("offFire", "Fire Aspect" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); + } - @Override - public void environmentalModificationTool(SpellParadigmTool parad) - { - parad.addBlockBreakEffect(new ToolEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - - parad.addToolString("envFire", "Magma Plume" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); - } + @Override + public void defensiveModificationTool(SpellParadigmTool parad) + { + parad.addCritChance("defFire", this.potencyEnhancement); - @Override - protected int getCostForDefaultTool() - { - return 1000; - } + parad.addDuration("defFire", 1200 * this.powerEnhancement); - @Override - protected int getCostForOffenseTool() - { - return (int)(1000 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.2f) * Math.pow(0.85, costEnhancement)); - } + parad.addToolString("defFire", "Unbreaking" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); + } - @Override - protected int getCostForDefenseTool() - { - return (int)(500 * (1 + this.powerEnhancement*0.5f) * (1 + this.potencyEnhancement) * Math.pow(0.85, costEnhancement)); - } + @Override + public void environmentalModificationTool(SpellParadigmTool parad) + { + parad.addBlockBreakEffect(new ToolEnvironmentalFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - @Override - protected int getCostForEnvironmentTool() - { - return 0; - } + parad.addToolString("envFire", "Magma Plume" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); + } + + @Override + protected int getCostForDefaultTool() + { + return 1000; + } + + @Override + protected int getCostForOffenseTool() + { + return (int) (1000 * (1 + this.powerEnhancement * 0.3f) * (1 + this.potencyEnhancement * 0.2f) * Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForDefenseTool() + { + return (int) (500 * (1 + this.powerEnhancement * 0.5f) * (1 + this.potencyEnhancement) * Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForEnvironmentTool() + { + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectIce.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectIce.java index ee85fb46..2ab1b5cd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectIce.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectIce.java @@ -4,238 +4,225 @@ import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeDefaultIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeDefensiveIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeEnvironmentalIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeOffensiveIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileDefaultIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileDefensiveIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileEnvironmentalIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileOffensiveIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfDefaultIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfDefensiveIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfEnvironmentalIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfOffensiveIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ToolDefaultIce; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ToolDefensiveIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.*; -public class SpellEffectIce extends SpellEffect +public class SpellEffectIce extends SpellEffect { - @Override - public void defaultModificationProjectile(SpellParadigmProjectile parad) - { - parad.damage+=this.potencyEnhancement; - parad.addImpactEffect(new ProjectileDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + parad.damage += this.potencyEnhancement; + parad.addImpactEffect(new ProjectileDefaultIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.damage+=2; - parad.addImpactEffect(new ProjectileOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.damage += 2; + parad.addImpactEffect(new ProjectileOffensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + } - @Override - public void environmentalModificationProjectile(SpellParadigmProjectile parad) - { - parad.addUpdateEffect(new ProjectileEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + parad.addUpdateEffect(new ProjectileEnvironmentalIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defaultModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefaultIce(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement)); - } + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefaultIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfOffensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfEnvironmentalIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defaultModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeDefaultIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeOffensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeDefensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeEnvironmentalIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - protected int getCostForDefaultProjectile() - { - return (int)((30)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultProjectile() + { + return (int) ((30) * (this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseProjectile() - { - return (int)((60)*(this.powerEnhancement+1)*(3*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseProjectile() + { + return (int) ((60) * (this.powerEnhancement + 1) * (3 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseProjectile() - { - return (int)(75*(2*this.powerEnhancement+1)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseProjectile() + { + return (int) (75 * (2 * this.powerEnhancement + 1) * (this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentProjectile() - { - return (int)(200*(2*this.powerEnhancement+1)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentProjectile() + { + return (int) (200 * (2 * this.powerEnhancement + 1) * (2 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultSelf() - { - return (int)(20*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultSelf() + { + return (int) (20 * (this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseSelf() - { - return (int)(100*(2*this.powerEnhancement+1)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseSelf() + { + return (int) (100 * (2 * this.powerEnhancement + 1) * (2 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseSelf() - { - return (int)(200*(3*powerEnhancement+1)*(2*potencyEnhancement + 1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseSelf() + { + return (int) (200 * (3 * powerEnhancement + 1) * (2 * potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentSelf() - { - return (int)(10*(1.5*potencyEnhancement+1)*(3*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentSelf() + { + return (int) (10 * (1.5 * potencyEnhancement + 1) * (3 * powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultMelee() - { - return (int)(250*(potencyEnhancement+1)*(1.5*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultMelee() + { + return (int) (250 * (potencyEnhancement + 1) * (1.5 * powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseMelee() - { - return (int)(40*(1.5*potencyEnhancement+1)*Math.pow(1.5, powerEnhancement)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseMelee() + { + return (int) (40 * (1.5 * potencyEnhancement + 1) * Math.pow(1.5, powerEnhancement) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseMelee() - { - return (int)(50*(0.5*potencyEnhancement+1)*(0.7*powerEnhancement+1)*(0.5*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseMelee() + { + return (int) (50 * (0.5 * potencyEnhancement + 1) * (0.7 * powerEnhancement + 1) * (0.5 * powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentMelee() - { - return (int)(20*(0.5*potencyEnhancement+1)*(0*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentMelee() + { + return (int) (20 * (0.5 * potencyEnhancement + 1) * (0 * powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - public void defaultModificationTool(SpellParadigmTool parad) - { - parad.addLeftClickEffect(new ToolDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + @Override + public void defaultModificationTool(SpellParadigmTool parad) + { + parad.addLeftClickEffect(new ToolDefaultIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - parad.addToolString("FrostTouch", "FrostTouch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1))); + parad.addToolString("FrostTouch", "FrostTouch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement + 1))); - parad.addCritChance("FrostCrit", this.potencyEnhancement * 0.5f); - } + parad.addCritChance("FrostCrit", this.potencyEnhancement * 0.5f); + } - @Override - public void offensiveModificationTool(SpellParadigmTool parad) - { - parad.addDamageToHash("Sharpness", (this.powerEnhancement+1)*1.5f); + @Override + public void offensiveModificationTool(SpellParadigmTool parad) + { + parad.addDamageToHash("Sharpness", (this.powerEnhancement + 1) * 1.5f); - parad.addToolString("Sharpness", "Sharpness" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1))); + parad.addToolString("Sharpness", "Sharpness" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement + 1))); - parad.addCritChance("SharpCrit", this.potencyEnhancement); - } + parad.addCritChance("SharpCrit", this.potencyEnhancement); + } - @Override - public void defensiveModificationTool(SpellParadigmTool parad) - { - parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationTool(SpellParadigmTool parad) + { + parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationTool(SpellParadigmTool parad) - { - parad.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1))); + @Override + public void environmentalModificationTool(SpellParadigmTool parad) + { + parad.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement + 1))); - parad.setSilkTouch(true); - } + parad.setSilkTouch(true); + } - @Override - protected int getCostForDefaultTool() - { - return (int)(500 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.1f) * Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultTool() + { + return (int) (500 * (1 + this.powerEnhancement * 0.3f) * (1 + this.potencyEnhancement * 0.1f) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseTool() - { - return (int)(1000 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.2f) * Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseTool() + { + return (int) (1000 * (1 + this.powerEnhancement * 0.3f) * (1 + this.potencyEnhancement * 0.2f) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseTool() - { - return (int)(500 * (1 + this.powerEnhancement*0.2) * (1 + this.potencyEnhancement*0.5) * Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseTool() + { + return (int) (500 * (1 + this.powerEnhancement * 0.2) * (1 + this.potencyEnhancement * 0.5) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentTool() - { - return (int)(1000 * Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentTool() + { + return (int) (1000 * Math.pow(0.85, costEnhancement)); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java index 7bf6ec80..2d661892 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java @@ -4,239 +4,226 @@ import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeDefaultWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeDefensiveWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeEnvironmentalWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeOffensiveWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileDefaultWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileEnvironmentalWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileOffensiveWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfDefaultWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfDefensiveWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfEnvironmentalWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfOffensiveWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ToolDefensiveWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ToolEnvironmentalWind; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ToolOffensiveWind; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.*; -public class SpellEffectWind extends SpellEffect +public class SpellEffectWind extends SpellEffect { - @Override - public void defaultModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileDefaultWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefaultWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.addImpactEffect(new ProjectileOffensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationProjectile(SpellParadigmProjectile parad) - { - parad.isSilkTouch = true; - } + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.isSilkTouch = true; + } - @Override - public void environmentalModificationProjectile(SpellParadigmProjectile parad) - { - parad.addUpdateEffect(new ProjectileEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + parad.addUpdateEffect(new ProjectileEnvironmentalWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defaultModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefaultWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefaultWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfOffensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfDefensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationSelf(SpellParadigmSelf parad) - { - parad.addSelfSpellEffect(new SelfEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfEnvironmentalWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defaultModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeDefaultWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeDefaultWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void offensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeOffensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void defensiveModificationMelee(SpellParadigmMelee parad) - { - parad.addEntityEffect(new MeleeDefensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeDefensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - public void environmentalModificationMelee(SpellParadigmMelee parad) - { - parad.addWorldEffect(new MeleeEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); - } + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeEnvironmentalWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - protected int getCostForDefaultProjectile() - { - return (int)(100*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultProjectile() + { + return (int) (100 * (this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseProjectile() - { - return (int)(100*(0.5*this.potencyEnhancement+1)*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseProjectile() + { + return (int) (100 * (0.5 * this.potencyEnhancement + 1) * (this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseProjectile() - { - return (int)(100*(this.potencyEnhancement+1)); - } + @Override + protected int getCostForDefenseProjectile() + { + return (int) (100 * (this.potencyEnhancement + 1)); + } - @Override - protected int getCostForEnvironmentProjectile() - { - return (int)(50*(this.powerEnhancement+1)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentProjectile() + { + return (int) (50 * (this.powerEnhancement + 1) * (this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultSelf() - { - return (int)(100*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultSelf() + { + return (int) (100 * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseSelf() - { - return (int)(100*(0.5*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseSelf() + { + return (int) (100 * (0.5 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseSelf() - { - return (int)(500*(0.7d*this.powerEnhancement+1)*(0.8*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseSelf() + { + return (int) (500 * (0.7d * this.powerEnhancement + 1) * (0.8 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentSelf() - { - return (int)(500*(0.7d*this.powerEnhancement+1)*(0.2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentSelf() + { + return (int) (500 * (0.7d * this.powerEnhancement + 1) * (0.2 * this.potencyEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefaultMelee() - { - return (int)(350*(1.0*this.potencyEnhancement+1)*(1.2*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefaultMelee() + { + return (int) (350 * (1.0 * this.potencyEnhancement + 1) * (1.2 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForOffenseMelee() - { - return (int)(250*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForOffenseMelee() + { + return (int) (250 * (1.0 * this.potencyEnhancement + 1) * (0.7 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForDefenseMelee() - { - return (int)(150*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForDefenseMelee() + { + return (int) (150 * (1.0 * this.potencyEnhancement + 1) * (0.7 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - protected int getCostForEnvironmentMelee() - { - return (int)(100*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); - } + @Override + protected int getCostForEnvironmentMelee() + { + return (int) (100 * (1.0 * this.potencyEnhancement + 1) * (0.7 * this.powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + } - @Override - public void defaultModificationTool(SpellParadigmTool parad) - { - String toolClass = "axe"; - - float digSpeed = 7.0f; - - switch(this.powerEnhancement) - { - case 1: - digSpeed = 9.0f; - break; - case 2: - digSpeed = 12.0f; - break; - case 3: - digSpeed = 16.0f; - break; - case 4: - digSpeed = 21.0f; - break; - case 5: - digSpeed = 27.0f; - break; - } - - parad.setDigSpeed(toolClass, digSpeed); - - int hlvl = this.potencyEnhancement + 2; - parad.setHarvestLevel(toolClass, hlvl); - } + @Override + public void defaultModificationTool(SpellParadigmTool parad) + { + String toolClass = "axe"; - @Override - public void offensiveModificationTool(SpellParadigmTool parad) - { - parad.addLeftClickEffect(new ToolOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + float digSpeed = 7.0f; - @Override - public void defensiveModificationTool(SpellParadigmTool parad) - { - parad.addLeftClickEffect(new ToolDefensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - parad.addToolString("DefWind", "Knockback" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); - } + switch (this.powerEnhancement) + { + case 1: + digSpeed = 9.0f; + break; + case 2: + digSpeed = 12.0f; + break; + case 3: + digSpeed = 16.0f; + break; + case 4: + digSpeed = 21.0f; + break; + case 5: + digSpeed = 27.0f; + break; + } - @Override - public void environmentalModificationTool(SpellParadigmTool parad) - { - parad.addBlockBreakEffect(new ToolEnvironmentalWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); - } + parad.setDigSpeed(toolClass, digSpeed); - @Override - protected int getCostForDefaultTool() - { - return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement)); - } + int hlvl = this.potencyEnhancement + 2; + parad.setHarvestLevel(toolClass, hlvl); + } - @Override - protected int getCostForOffenseTool() - { - return 0; //Cost is on the attack method - } + @Override + public void offensiveModificationTool(SpellParadigmTool parad) + { + parad.addLeftClickEffect(new ToolOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } - @Override - protected int getCostForDefenseTool() - { - return (int)(150 * (1+this.powerEnhancement*0.4f) * (1+this.potencyEnhancement*0.3f) * Math.pow(0.85, costEnhancement)); - } + @Override + public void defensiveModificationTool(SpellParadigmTool parad) + { + parad.addLeftClickEffect(new ToolDefensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + parad.addToolString("DefWind", "Knockback" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); + } - @Override - protected int getCostForEnvironmentTool() - { - return (int)(150 * (1+this.powerEnhancement) * Math.pow(0.85, costEnhancement)); - } + @Override + public void environmentalModificationTool(SpellParadigmTool parad) + { + parad.addBlockBreakEffect(new ToolEnvironmentalWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement)); + } + + @Override + protected int getCostForDefaultTool() + { + return (int) (1000 * (1 + this.potencyEnhancement * 0.1f) * (1 + this.powerEnhancement * 0.2f) * Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForOffenseTool() + { + return 0; //Cost is on the attack method + } + + @Override + protected int getCostForDefenseTool() + { + return (int) (150 * (1 + this.powerEnhancement * 0.4f) * (1 + this.potencyEnhancement * 0.3f) * Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForEnvironmentTool() + { + return (int) (150 * (1 + this.powerEnhancement) * Math.pow(0.85, costEnhancement)); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java index 8aa7fd8e..e3935182 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java @@ -1,9 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; +import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.entity.Entity; @@ -25,364 +26,361 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; -import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -public class SpellHelper +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class SpellHelper { - public static Random rand = new Random(); - public static final double root2 = Math.sqrt(2); - - public static boolean canEntityBeSeen(Entity entity, Entity entity2) - { - return entity.worldObj.rayTraceBlocks(Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ), Vec3.createVectorHelper(entity2.posX, entity2.posY, entity2.posZ), false) == null; - } - - public static void smeltBlockInWorld(World world, int posX, int posY, int posZ) - { - FurnaceRecipes recipes = FurnaceRecipes.smelting(); - - Block block = world.getBlock(posX, posY, posZ); - if(block==null) - { - return; - } - - int meta = world.getBlockMetadata(posX, posY, posZ); - - ItemStack smeltedStack = recipes.getSmeltingResult(new ItemStack(block,1,meta)); - if(smeltedStack!=null && smeltedStack.getItem() instanceof ItemBlock) - { - world.setBlock(posX, posY, posZ, ((ItemBlock)(smeltedStack.getItem())).field_150939_a, smeltedStack.getItemDamage(), 3); - } - } - - public static boolean canPlayerSeeAlchemy(EntityPlayer player) - { - if(player != null) - { - ItemStack stack = player.getCurrentArmor(3); - if(stack != null) - { - Item item = stack.getItem(); - if(item instanceof IAlchemyGoggles && ((IAlchemyGoggles)item).showIngameHUD(player.worldObj, stack, player)) - { - return true; - } - } - - ItemStack heldStack = player.getHeldItem(); - if(heldStack != null && heldStack.getItem() instanceof IReagentManipulator) - { - return true; - } - } - - return false; - } - - public static List getEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) - { - return world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); - } - - public static List getLivingEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) - { - return world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); - } - - public static List getItemsInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) - { - return world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); - } - - public static List getPlayersInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) - { - return world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); - } - - public static double gaussian(double d) - { - return d * ((rand.nextFloat() - 0.5D)); - } - - public static Vec3 getEntityBlockVector(Entity entity) - { - int posX = (int) Math.round(entity.posX - 0.5f); + public static Random rand = new Random(); + public static final double root2 = Math.sqrt(2); + + public static boolean canEntityBeSeen(Entity entity, Entity entity2) + { + return entity.worldObj.rayTraceBlocks(Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ), Vec3.createVectorHelper(entity2.posX, entity2.posY, entity2.posZ), false) == null; + } + + public static void smeltBlockInWorld(World world, int posX, int posY, int posZ) + { + FurnaceRecipes recipes = FurnaceRecipes.smelting(); + + Block block = world.getBlock(posX, posY, posZ); + if (block == null) + { + return; + } + + int meta = world.getBlockMetadata(posX, posY, posZ); + + ItemStack smeltedStack = recipes.getSmeltingResult(new ItemStack(block, 1, meta)); + if (smeltedStack != null && smeltedStack.getItem() instanceof ItemBlock) + { + world.setBlock(posX, posY, posZ, ((ItemBlock) (smeltedStack.getItem())).field_150939_a, smeltedStack.getItemDamage(), 3); + } + } + + public static boolean canPlayerSeeAlchemy(EntityPlayer player) + { + if (player != null) + { + ItemStack stack = player.getCurrentArmor(3); + if (stack != null) + { + Item item = stack.getItem(); + if (item instanceof IAlchemyGoggles && ((IAlchemyGoggles) item).showIngameHUD(player.worldObj, stack, player)) + { + return true; + } + } + + ItemStack heldStack = player.getHeldItem(); + if (heldStack != null && heldStack.getItem() instanceof IReagentManipulator) + { + return true; + } + } + + return false; + } + + public static List getEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) + { + return world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + } + + public static List getLivingEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) + { + return world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + } + + public static List getItemsInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) + { + return world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + } + + public static List getPlayersInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) + { + return world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + } + + public static double gaussian(double d) + { + return d * ((rand.nextFloat() - 0.5D)); + } + + public static Vec3 getEntityBlockVector(Entity entity) + { + int posX = (int) Math.round(entity.posX - 0.5f); int posY = (int) entity.posY; int posZ = (int) Math.round(entity.posZ - 0.5f); - - return entity.getLookVec().createVectorHelper(posX, posY, posZ); - } - - public static ForgeDirection getDirectionForLookVector(Vec3 lookVec) - { - double distance = lookVec.lengthVector(); - - if(lookVec.yCoord>distance*0.9) - { - return ForgeDirection.UP; - } - if(lookVec.yCoordradius*1/root2) - { - return ForgeDirection.SOUTH; - } - if(lookVec.zCoord<-radius*1/root2) - { - return ForgeDirection.NORTH; - } - if(lookVec.xCoord>radius*1/root2) - { - return ForgeDirection.EAST; - } - if(lookVec.xCoord<-radius*1/root2) - { - return ForgeDirection.WEST; - } - - return ForgeDirection.EAST; - } - - public static boolean freezeWaterBlock(World world, int posX, int posY, int posZ) - { - Block block = world.getBlock(posX, posY, posZ); - - if(block == Blocks.water || block == Blocks.flowing_water) - { - world.setBlock(posX, posY, posZ, Blocks.ice); - return true; - } - - return false; - } - - public static String getUsername(EntityPlayer player) - { - return SoulNetworkHandler.getUsername(player); - } - - public static EntityPlayer getPlayerForUsername(String str) - { - return SoulNetworkHandler.getPlayerForUsername(str); - } - - public static void sendParticleToPlayer(EntityPlayer player, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) - { - if(player instanceof EntityPlayerMP) - { - NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getParticlePacket(str, xCoord, yCoord, zCoord, xVel, yVel, zVel),(EntityPlayerMP) player); - } - } - - public static void sendIndexedParticleToPlayer(EntityPlayer player, int index, double xCoord, double yCoord, double zCoord) - { - switch(index) - { - case 1: - SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D); - break; - case 2: - SpellHelper.sendParticleToPlayer(player, "reddust", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D); - break; - case 3: - SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D); - break; - case 4: - float f = (float) 1.0F; - float f1 = f * 0.6F + 0.4F; - float f2 = f * f * 0.7F - 0.5F; - float f3 = f * f * 0.6F - 0.7F; - for (int l = 0; l < 8; ++l) + return entity.getLookVec().createVectorHelper(posX, posY, posZ); + } + + public static ForgeDirection getDirectionForLookVector(Vec3 lookVec) + { + double distance = lookVec.lengthVector(); + + if (lookVec.yCoord > distance * 0.9) + { + return ForgeDirection.UP; + } + if (lookVec.yCoord < distance * -0.9) + { + return ForgeDirection.DOWN; + } + + return getCompassDirectionForLookVector(lookVec); + } + + public static ForgeDirection getCompassDirectionForLookVector(Vec3 lookVec) + { + double radius = Math.sqrt(Math.pow(lookVec.xCoord, 2) + Math.pow(lookVec.zCoord, 2)); + + if (lookVec.zCoord > radius * 1 / root2) + { + return ForgeDirection.SOUTH; + } + if (lookVec.zCoord < -radius * 1 / root2) + { + return ForgeDirection.NORTH; + } + if (lookVec.xCoord > radius * 1 / root2) + { + return ForgeDirection.EAST; + } + if (lookVec.xCoord < -radius * 1 / root2) + { + return ForgeDirection.WEST; + } + + return ForgeDirection.EAST; + } + + public static boolean freezeWaterBlock(World world, int posX, int posY, int posZ) + { + Block block = world.getBlock(posX, posY, posZ); + + if (block == Blocks.water || block == Blocks.flowing_water) + { + world.setBlock(posX, posY, posZ, Blocks.ice); + return true; + } + + return false; + } + + public static String getUsername(EntityPlayer player) + { + return SoulNetworkHandler.getUsername(player); + } + + public static EntityPlayer getPlayerForUsername(String str) + { + return SoulNetworkHandler.getPlayerForUsername(str); + } + + public static void sendParticleToPlayer(EntityPlayer player, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) + { + if (player instanceof EntityPlayerMP) + { + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getParticlePacket(str, xCoord, yCoord, zCoord, xVel, yVel, zVel), (EntityPlayerMP) player); + } + } + + public static void sendIndexedParticleToPlayer(EntityPlayer player, int index, double xCoord, double yCoord, double zCoord) + { + switch (index) + { + case 1: + SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D); + break; + case 2: + SpellHelper.sendParticleToPlayer(player, "reddust", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D); + break; + case 3: + SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D); + break; + case 4: + float f = (float) 1.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + for (int l = 0; l < 8; ++l) + { + SpellHelper.sendParticleToPlayer(player, "reddust", xCoord + Math.random() - Math.random(), yCoord + Math.random() - Math.random(), zCoord + Math.random() - Math.random(), f1, f2, f3); + } + break; + } + } + + public static void sendParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) + { + List entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius); + + if (entities == null) + { + return; + } + + for (EntityPlayer player : entities) + { + SpellHelper.sendParticleToPlayer(player, str, xCoord, yCoord, zCoord, xVel, yVel, zVel); + } + } + + public static void sendIndexedParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, int index, double xCoord, double yCoord, double zCoord) + { + List entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius); + + if (entities == null) + { + return; + } + + for (EntityPlayer player : entities) + { + SpellHelper.sendIndexedParticleToPlayer(player, index, xCoord, yCoord, zCoord); + } + } + + public static void setPlayerSpeedFromServer(EntityPlayer player, double motionX, double motionY, double motionZ) + { + if (player instanceof EntityPlayerMP) + { + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getVelSettingPacket(motionX, motionY, motionZ), (EntityPlayerMP) player); + } + } + + public static boolean isFakePlayer(World world, EntityPlayer player) + { + if (world.isRemote) + { + return false; + } + + if (player instanceof FakePlayer || SpellHelper.getUsername(player).contains("[CoFH]")) + { + return true; + } + + String str = player.getClass().getSimpleName(); + if (str.contains("GC")) + { + return false; + } + + if (player.getClass().equals(EntityPlayerMP.class)) + { + return false; + } + + return false; + } + + public static void smashBlock(World world, int posX, int posY, int posZ) + { + Block block = world.getBlock(posX, posY, posZ); + + if (block == Blocks.stone) + { + world.setBlock(posX, posY, posZ, Blocks.cobblestone); + return; + } else if (block == Blocks.cobblestone) + { + world.setBlock(posX, posY, posZ, Blocks.gravel); + return; + } else if (block == Blocks.gravel) + { + world.setBlock(posX, posY, posZ, Blocks.sand); + return; + } + } + + public static boolean isBlockFluid(Block block) + { + return block instanceof BlockLiquid; + } + + public static void evaporateWaterBlock(World world, int posX, int posY, int posZ) + { + Block block = world.getBlock(posX, posY, posZ); + + if (block == Blocks.water || block == Blocks.flowing_water) + { + world.setBlockToAir(posX, posY, posZ); + } + } + + public static ItemStack getDustForOre(ItemStack item) + { + String oreName = OreDictionary.getOreName(OreDictionary.getOreID(item)); + + if (oreName.contains("ore")) + { + String lowercaseOre = oreName.toLowerCase(); + boolean isAllowed = false; + + for (String str : AlchemicalWizardry.allowedCrushedOresArray) { - SpellHelper.sendParticleToPlayer(player,"reddust", xCoord + Math.random() - Math.random(), yCoord + Math.random() - Math.random(), zCoord + Math.random() - Math.random(), f1, f2, f3); + String testStr = str.toLowerCase(); + + if (lowercaseOre.contains(testStr)) + { + isAllowed = true; + break; + } } - break; - } - } - - public static void sendParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) - { - List entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius); - - if(entities==null) - { - return; - } - - for(EntityPlayer player : entities) - { - SpellHelper.sendParticleToPlayer(player, str, xCoord, yCoord, zCoord, xVel, yVel, zVel); - } - } - - public static void sendIndexedParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, int index, double xCoord, double yCoord, double zCoord) - { - List entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius); - - if(entities==null) - { - return; - } - - for(EntityPlayer player : entities) - { - SpellHelper.sendIndexedParticleToPlayer(player, index, xCoord, yCoord, zCoord); - } - } - - public static void setPlayerSpeedFromServer(EntityPlayer player, double motionX, double motionY, double motionZ) - { - if(player instanceof EntityPlayerMP) - { - NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getVelSettingPacket(motionX, motionY, motionZ), (EntityPlayerMP) player); - } - } - - public static boolean isFakePlayer(World world, EntityPlayer player) - { - if(world.isRemote) - { - return false; - } - - if(player instanceof FakePlayer || SpellHelper.getUsername(player).contains("[CoFH]")) - { - return true; - } - - String str = player.getClass().getSimpleName(); - if(str.contains("GC")) - { - return false; - } - - if(player.getClass().equals(EntityPlayerMP.class)) - { - return false; - } - - return false; - } - - public static void smashBlock(World world, int posX, int posY, int posZ) - { - Block block = world.getBlock(posX, posY, posZ); - - if(block==Blocks.stone) - { - world.setBlock(posX, posY, posZ, Blocks.cobblestone); - return; - } - else if(block==Blocks.cobblestone) - { - world.setBlock(posX, posY, posZ, Blocks.gravel); - return; - } - else if(block==Blocks.gravel) - { - world.setBlock(posX, posY, posZ, Blocks.sand); - return; - } - } - - public static boolean isBlockFluid(Block block) - { - return block instanceof BlockLiquid; - } - - public static void evaporateWaterBlock(World world, int posX, int posY, int posZ) - { - Block block = world.getBlock(posX, posY, posZ); - - if(block == Blocks.water || block == Blocks.flowing_water) - { - world.setBlockToAir(posX, posY, posZ); - } - } - - public static ItemStack getDustForOre(ItemStack item) - { - String oreName = OreDictionary.getOreName(OreDictionary.getOreID(item)); - - if(oreName.contains("ore")) - { - String lowercaseOre = oreName.toLowerCase(); - boolean isAllowed = false; - for(String str : AlchemicalWizardry.allowedCrushedOresArray) - { - String testStr = str.toLowerCase(); + if (!isAllowed) + { + return null; + } - if(lowercaseOre.contains(testStr)) - { - isAllowed = true; - break; - } - } - - if(!isAllowed) - { - return null; - } - - String dustName = oreName.replace("ore", "dust"); - - ArrayList items = OreDictionary.getOres(dustName); - - if(items!=null && items.size()>=1) - { - return(items.get(0).copy()); - } - } - - return null; - } - - public static List getItemsFromBlock(World world, Block block, int x, int y, int z, int meta, boolean silkTouch, int fortune) - { - boolean canSilk = block.canSilkHarvest(world, null, x, y, z, meta); + String dustName = oreName.replace("ore", "dust"); - if(canSilk && silkTouch) - { - ArrayList items = new ArrayList(); - ItemStack item = new ItemStack(block, 1, meta); - - items.add(item); - - return items; - }else - { - return block.getDrops(world, x, y, z, meta, fortune); - } - } - - public static void spawnItemListInWorld(List items, World world, float x, float y, float z) - { - for(ItemStack stack : items) - { - EntityItem itemEntity = new EntityItem(world, x, y, z, stack); - itemEntity.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(itemEntity); - } - } - - public static MovingObjectPosition raytraceFromEntity (World world, Entity player, boolean par3, double range) + ArrayList items = OreDictionary.getOres(dustName); + + if (items != null && items.size() >= 1) + { + return (items.get(0).copy()); + } + } + + return null; + } + + public static List getItemsFromBlock(World world, Block block, int x, int y, int z, int meta, boolean silkTouch, int fortune) + { + boolean canSilk = block.canSilkHarvest(world, null, x, y, z, meta); + + if (canSilk && silkTouch) + { + ArrayList items = new ArrayList(); + ItemStack item = new ItemStack(block, 1, meta); + + items.add(item); + + return items; + } else + { + return block.getDrops(world, x, y, z, meta, fortune); + } + } + + public static void spawnItemListInWorld(List items, World world, float x, float y, float z) + { + for (ItemStack stack : items) + { + EntityItem itemEntity = new EntityItem(world, x, y, z, stack); + itemEntity.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(itemEntity); + } + } + + public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range) { float f = 1.0F; float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f; @@ -408,116 +406,127 @@ public class SpellHelper return world.func_147447_a(vec3, vec31, par3, !par3, par3); } - public static String getNumeralForInt(int num) - { - switch(num) - { - case 1: return "I"; - case 2: return "II"; - case 3: return "III"; - case 4: return "IV"; - case 5: return "V"; - case 6: return "VI"; - case 7: return "VII"; - case 8: return "VIII"; - case 9: return "IX"; - case 10: return "X"; - default: return ""; - } - } - - /** - * Used to determine if stack1 can be placed into stack2. If stack2 is null and stack1 isn't null, returns true. Ignores stack size - * @param stack1 Stack that is placed into a slot - * @param stack2 Slot content that stack1 is placed into - * @return True if they can be combined - */ - public static boolean canCombine(ItemStack stack1, ItemStack stack2) - { - if(stack1 == null) - { - return false; - } - - if(stack2 == null) - { - return true; - } - - if(stack1.isItemStackDamageable() ^ stack2.isItemStackDamageable()) - { - return false; - } - - boolean tagsEqual = ItemStack.areItemStackTagsEqual(stack1, stack2); - - return stack1.getItem() == stack2.getItem() && tagsEqual && stack1.getItemDamage() == stack2.getItemDamage() && Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize) > 0; - } - - /** - * - * @param stack1 Stack that is placed into a slot - * @param stack2 Slot content that stack1 is placed into - * @return Stacks after stacking - */ - public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2) - { - ItemStack[] returned = new ItemStack[2]; - - if(canCombine(stack1, stack2)) - { - int transferedAmount = stack2 == null ? stack1.stackSize : Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize); - if(transferedAmount > 0) - { - ItemStack copyStack = stack1.splitStack(transferedAmount); - if(stack2 == null) - { - stack2 = copyStack; - }else - { - stack2.stackSize+=transferedAmount; - } - } - } - - returned[0] = stack1; - returned[1] = stack2; - - return returned; - } - - public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory) - { - if(stack == null) - { - return stack; - } - - for(int i=0; i 0; + } + + /** + * @param stack1 Stack that is placed into a slot + * @param stack2 Slot content that stack1 is placed into + * @return Stacks after stacking + */ + public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2) + { + ItemStack[] returned = new ItemStack[2]; + + if (canCombine(stack1, stack2)) + { + int transferedAmount = stack2 == null ? stack1.stackSize : Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize); + if (transferedAmount > 0) + { + ItemStack copyStack = stack1.splitStack(transferedAmount); + if (stack2 == null) + { + stack2 = copyStack; + } else + { + stack2.stackSize += transferedAmount; + } + } + } + + returned[0] = stack1; + returned[1] = stack2; + + return returned; + } + + public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory) + { + if (stack == null) + { + return stack; + } + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack[] combinedStacks = combineStacks(stack, inventory.getStackInSlot(i)); + stack = combinedStacks[0]; + inventory.setInventorySlotContents(i, combinedStacks[1]); + + if (stack.stackSize <= 0) + { + return stack; + } + } + + return stack; + } + + public static boolean hydrateSoil(World world, int x, int y, int z) + { + Block block = world.getBlock(x, y, z); + if (block == Blocks.dirt || block == Blocks.grass || (block == Blocks.farmland && world.getBlockMetadata(x, y, z) == 0)) + { + world.setBlock(x, y, z, Blocks.farmland, 15, 2); + + return true; + } + + return false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ExtrapolatedMeleeEntityEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ExtrapolatedMeleeEntityEffect.java index 7e48b5a8..198320c6 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ExtrapolatedMeleeEntityEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ExtrapolatedMeleeEntityEffect.java @@ -1,74 +1,73 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects; -import java.util.List; - import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import java.util.List; + public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntityEffect { - protected float range; - protected float radius; - protected int powerUpgrades; - protected int potencyUpgrades; - protected int costUpgrades; - protected int maxHit; - - public ExtrapolatedMeleeEntityEffect(int power, int potency, int cost) - { - this.powerUpgrades = power; - this.potencyUpgrades = potency; - this.costUpgrades = cost; - this.range = 0; - this.radius = 0; - this.maxHit = 1; - } - - @Override - public void onEntityImpact(World world, EntityPlayer entityPlayer) - { - Vec3 lookVec = entityPlayer.getLook(range); - double x = entityPlayer.posX + lookVec.xCoord; - double y = entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord; - double z = entityPlayer.posZ + lookVec.zCoord; - - List entities = world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(x-0.5f, y-0.5f, z-0.5f, x + 0.5f, y + 0.5f, z + 0.5f).expand(radius, radius, radius)); + protected float range; + protected float radius; + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + protected int maxHit; + + public ExtrapolatedMeleeEntityEffect(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + this.range = 0; + this.radius = 0; + this.maxHit = 1; + } + + @Override + public void onEntityImpact(World world, EntityPlayer entityPlayer) + { + Vec3 lookVec = entityPlayer.getLook(range); + double x = entityPlayer.posX + lookVec.xCoord; + double y = entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord; + double z = entityPlayer.posZ + lookVec.zCoord; + + List entities = world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(x - 0.5f, y - 0.5f, z - 0.5f, x + 0.5f, y + 0.5f, z + 0.5f).expand(radius, radius, radius)); int hit = 0; - - if(entities!=null) + + if (entities != null) { - for(Entity entity : entities) + for (Entity entity : entities) { - if(hit=maxBlocks) - { - return; - } - - for(int i=-horizRange; i<=horizRange; i++) - { - for(int j=-vertRange; j<=vertRange; j++) - { - for(int k=-horizRange; k<=horizRange; k++) - { - if(!worldObj.isAirBlock(posX+i, posY+j, posZ+k)&&blocksBroken= maxBlocks) + { + return; + } + + for (int i = -horizRange; i <= horizRange; i++) + { + for (int j = -vertRange; j <= vertRange; j++) + { + for (int k = -horizRange; k <= horizRange; k++) + { + if (!worldObj.isAirBlock(posX + i, posY + j, posZ + k) && blocksBroken < maxBlocks) + { + Block block = worldObj.getBlock(posX + i, posY + j, posZ + k); + int meta = worldObj.getBlockMetadata(posX + i, posY + j, posZ + k); + if (block == null || block.getBlockHardness(worldObj, posX + i, posY + j, posZ + k) == -1 || SpellHelper.isBlockFluid(block)) + { + continue; + } + + if (((EntitySpellProjectile) projectile).getIsSilkTouch() && block.canSilkHarvest(worldObj, ((EntitySpellProjectile) projectile).shootingEntity, posX + i, posY + j, posZ + k, meta)) + { + ItemStack stack = new ItemStack(block, 1, meta); + EntityItem itemEntity = new EntityItem(worldObj, posX + i + 0.5, posY + j + 0.5, posZ + k + 0.5, stack); + worldObj.spawnEntityInWorld(itemEntity); + worldObj.setBlockToAir(posX + i, posY + j, posZ + k); + } else + { + worldObj.func_147480_a(posX + i, posY + j, posZ + k, true); + } + blocksBroken++; + } + } + } + } + + ((EntitySpellProjectile) projectile).setBlocksBroken(blocksBroken); + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java index cf0eb203..cbbcd60f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java @@ -1,92 +1,60 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect; -public class ProjectileOffensiveEarth extends ProjectileImpactEffect +public class ProjectileOffensiveEarth extends ProjectileImpactEffect { - public ProjectileOffensiveEarth(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ProjectileOffensiveEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onEntityImpact(Entity mop, Entity proj) - { - int horizRange = (int)(this.powerUpgrades); - int vertDepth = (int)(3*this.potencyUpgrades+1); - - Vec3 blockVector = SpellHelper.getEntityBlockVector(mop); - - int posX = (int)(blockVector.xCoord); - int posY = (int)(blockVector.yCoord); - int posZ = (int)(blockVector.zCoord); - - World world = mop.worldObj; - - for(int i=-horizRange; i<=horizRange; i++) - { - for(int j=-vertDepth; j<0; j++) - { - for(int k=-horizRange; k<=horizRange; k++) - { - if(!world.isAirBlock(posX+i, posY+j, posZ+k)) - { - Block block = world.getBlock(posX+i, posY+j, posZ+k); - if(block == null || block.getBlockHardness(world, posX+i, posY+j, posZ+k)==-1) - { - continue; - } - //block.breakBlock(world, posX+i, posY+j, posZ+k, block.blockID, world.getBlockMetadata(posX+i, posY+j, posZ+k)); - //world.destroyBlock(posX+i, posY+j, posZ+k, true); - if(block == Blocks.stone || block == Blocks.cobblestone || block == Blocks.sand || block == Blocks.gravel || block == Blocks.grass || block == Blocks.dirt) - { - world.setBlockToAir(posX+i, posY+j, posZ+k); - } - } - } - } - } - } + @Override + public void onEntityImpact(Entity mop, Entity proj) + { + int horizRange = (int) (this.powerUpgrades); + int vertDepth = (int) (3 * this.potencyUpgrades + 1); - @Override - public void onTileImpact(World world, MovingObjectPosition mop) - { -// int horizRange = (int)(this.powerUpgrades); -// int vertRange = (int)(this.potencyUpgrades); -// -// int posX = mop.blockX; -// int posY = mop.blockY; -// int posZ = mop.blockZ; -// -// for(int i=-horizRange; i<=horizRange; i++) -// { -// for(int j=-vertRange; j<=vertRange; j++) -// { -// for(int k=-horizRange; k<=horizRange; k++) -// { -// if(!world.isAirBlock(posX+i, posY+j, posZ+k)) -// { -// Block block = world.getBlock(posX+i, posY+j, posZ+k); -// if(block == null || block.getBlockHardness(world, posX+i, posY+j, posZ+k)==-1) -// { -// continue; -// } -// //block.breakBlock(world, posX+i, posY+j, posZ+k, block.blockID, world.getBlockMetadata(posX+i, posY+j, posZ+k)); -// //world.destroyBlock(posX+i, posY+j, posZ+k, true); -// if(world.rand.nextFloat()<0.6f) -// { -// SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k); -// } -// } -// } -// } -// } - } + Vec3 blockVector = SpellHelper.getEntityBlockVector(mop); + + int posX = (int) (blockVector.xCoord); + int posY = (int) (blockVector.yCoord); + int posZ = (int) (blockVector.zCoord); + + World world = mop.worldObj; + + for (int i = -horizRange; i <= horizRange; i++) + { + for (int j = -vertDepth; j < 0; j++) + { + for (int k = -horizRange; k <= horizRange; k++) + { + if (!world.isAirBlock(posX + i, posY + j, posZ + k)) + { + Block block = world.getBlock(posX + i, posY + j, posZ + k); + if (block == null || block.getBlockHardness(world, posX + i, posY + j, posZ + k) == -1) + { + continue; + } + if (block == Blocks.stone || block == Blocks.cobblestone || block == Blocks.sand || block == Blocks.gravel || block == Blocks.grass || block == Blocks.dirt) + { + world.setBlockToAir(posX + i, posY + j, posZ + k); + } + } + } + } + } + } + + @Override + public void onTileImpact(World world, MovingObjectPosition mop) + { + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java index 11fc1be4..bb952879 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java @@ -1,52 +1,51 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class SelfDefaultEarth extends SelfSpellEffect { - public SelfDefaultEarth(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfDefaultEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - int horizRadius = this.powerUpgrades; - int vertRange = 5 + 10*this.potencyUpgrades; - - Vec3 blockVec = SpellHelper.getEntityBlockVector(player); - - int posX = (int)(blockVec.xCoord); - int posY = (int)(blockVec.yCoord) - 1; - int posZ = (int)(blockVec.zCoord); - - for(int i=-horizRadius; i<=horizRadius; i++) - { - for(int k=-horizRadius; k<=horizRadius; k++) - { - if(!world.isAirBlock(posX+i, posY, posZ+k)) - { - continue; - } - - for(int j=-1; j>=-vertRange; j--) - { - if(!world.isAirBlock(posX+i, posY+j, posZ+k)&&!SpellHelper.isBlockFluid(world.getBlock(posX+i, posY+j, posZ+k))) - { - BlockTeleposer.swapBlocks(world, world, posX+i, posY, posZ+k, posX+i, posY+j, posZ+k); - - break; - } - } - } - } - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + int horizRadius = this.powerUpgrades; + int vertRange = 5 + 10 * this.potencyUpgrades; + + Vec3 blockVec = SpellHelper.getEntityBlockVector(player); + + int posX = (int) (blockVec.xCoord); + int posY = (int) (blockVec.yCoord) - 1; + int posZ = (int) (blockVec.zCoord); + + for (int i = -horizRadius; i <= horizRadius; i++) + { + for (int k = -horizRadius; k <= horizRadius; k++) + { + if (!world.isAirBlock(posX + i, posY, posZ + k)) + { + continue; + } + + for (int j = -1; j >= -vertRange; j--) + { + if (!world.isAirBlock(posX + i, posY + j, posZ + k) && !SpellHelper.isBlockFluid(world.getBlock(posX + i, posY + j, posZ + k))) + { + BlockTeleposer.swapBlocks(world, world, posX + i, posY, posZ + k, posX + i, posY + j, posZ + k); + + break; + } + } + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java index d0053320..24e0979c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java @@ -1,27 +1,27 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; public class SelfDefensiveEarth extends SelfSpellEffect { - public SelfDefensiveEarth(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfDefensiveEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - int pot = 2*this.potencyUpgrades + 1; - int duration = 20*60*(this.powerUpgrades+1); - - player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id,duration, pot)); - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, duration, pot)); - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + int pot = 2 * this.potencyUpgrades + 1; + int duration = 20 * 60 * (this.powerUpgrades + 1); + + player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration, pot)); + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, duration, pot)); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfEnvironmentalEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfEnvironmentalEarth.java index d73381ee..faaaa632 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfEnvironmentalEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfEnvironmentalEarth.java @@ -1,37 +1,37 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; + +import java.util.List; public class SelfEnvironmentalEarth extends SelfSpellEffect { - public SelfEnvironmentalEarth(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfEnvironmentalEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - float radius = this.powerUpgrades*2 + 1.5f; - int dur = this.powerUpgrades*5*20 + 60; - - List entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ, radius, radius); - - for(Entity entity : entities) - { - if(entity instanceof EntityLiving) - { - ((EntityLiving) entity).addPotionEffect(new PotionEffect(Potion.weakness.id,dur,this.potencyUpgrades)); - } - } - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + float radius = this.powerUpgrades * 2 + 1.5f; + int dur = this.powerUpgrades * 5 * 20 + 60; + + List entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ, radius, radius); + + for (Entity entity : entities) + { + if (entity instanceof EntityLiving) + { + ((EntityLiving) entity).addPotionEffect(new PotionEffect(Potion.weakness.id, dur, this.potencyUpgrades)); + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java index 6637e9d8..ebd74ea8 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java @@ -1,43 +1,43 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; public class SelfOffensiveEarth extends SelfSpellEffect { - public SelfOffensiveEarth(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfOffensiveEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - int horizRadius = this.powerUpgrades; - int vertRadius = this.potencyUpgrades + 1; - - Vec3 blockVec = SpellHelper.getEntityBlockVector(player); - - int posX = (int)(blockVec.xCoord); - int posY = (int)(blockVec.yCoord); - int posZ = (int)(blockVec.zCoord); - - for(int i=-horizRadius; i<=horizRadius; i++) - { - for(int j=-vertRadius; j<0; j++) - { - for(int k=-horizRadius; k<=horizRadius; k++) - { - if(world.rand.nextFloat()<0.7f) - { - SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k); - } - } - } - } - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + int horizRadius = this.powerUpgrades; + int vertRadius = this.potencyUpgrades + 1; + + Vec3 blockVec = SpellHelper.getEntityBlockVector(player); + + int posX = (int) (blockVec.xCoord); + int posY = (int) (blockVec.yCoord); + int posZ = (int) (blockVec.zCoord); + + for (int i = -horizRadius; i <= horizRadius; i++) + { + for (int j = -vertRadius; j < 0; j++) + { + for (int k = -horizRadius; k <= horizRadius; k++) + { + if (world.rand.nextFloat() < 0.7f) + { + SpellHelper.smashBlock(world, posX + i, posY + j, posZ + k); + } + } + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java index a6f03bc1..6f3f19ad 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java @@ -1,86 +1,86 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; +import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.DigAreaEffect; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.DigAreaEffect; public class ToolEnvironmentalEarth extends DigAreaEffect { - public ToolEnvironmentalEarth(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolEnvironmentalEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) - { - if(!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) - { - return 0; - } - - int x = blockPos.blockX; - int y = blockPos.blockY; - int z = blockPos.blockZ; - ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); - - int radius = 2; - int depth = 5; - - depth--; - - int posX = radius; - int negX = radius; - int posY = radius; - int negY = radius; - int posZ = radius; - int negZ = radius; - - switch(sidehit) - { - case UP: - posY = 0; - negY = depth; - break; - case DOWN: - negY = 0; - posY = depth; - break; - case SOUTH: - posZ = 0; - negZ = depth; - break; - case NORTH: - negZ = 0; - posZ = depth; - break; - case WEST: - negX = 0; - posX = depth; - break; - case EAST: - posX = 0; - negX = depth; - break; - - default: - } - - for(int xPos = x-negX; xPos <= x+posX; xPos++) - { - for(int yPos = y-negY; yPos <= y+posY; yPos++) - { - for(int zPos = z-negZ; zPos <= z+posZ; zPos++) - { - this.breakBlock(container, world, player, blockHardness, xPos, yPos, zPos, itemTool); - } - } - } - - return 0; - } + @Override + public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) + { + if (!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) + { + return 0; + } + + int x = blockPos.blockX; + int y = blockPos.blockY; + int z = blockPos.blockZ; + ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); + + int radius = 2; + int depth = 5; + + depth--; + + int posX = radius; + int negX = radius; + int posY = radius; + int negY = radius; + int posZ = radius; + int negZ = radius; + + switch (sidehit) + { + case UP: + posY = 0; + negY = depth; + break; + case DOWN: + negY = 0; + posY = depth; + break; + case SOUTH: + posZ = 0; + negZ = depth; + break; + case NORTH: + negZ = 0; + posZ = depth; + break; + case WEST: + negX = 0; + posX = depth; + break; + case EAST: + posX = 0; + negX = depth; + break; + + default: + } + + for (int xPos = x - negX; xPos <= x + posX; xPos++) + { + for (int yPos = y - negY; yPos <= y + posY; yPos++) + { + for (int zPos = z - negZ; zPos <= z + posZ; zPos++) + { + this.breakBlock(container, world, player, blockHardness, xPos, yPos, zPos, itemTool); + } + } + } + + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java index 240bef61..fabe6659 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java @@ -1,58 +1,57 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ItemManipulator; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + import java.util.LinkedList; import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ItemManipulator; - - public class ToolOffensiveEarth extends ItemManipulator { - public static Block[] mundaneList = new Block[]{Blocks.stone,Blocks.cobblestone,Blocks.sand,Blocks.gravel,Blocks.netherrack,Blocks.dirt}; + public static Block[] mundaneList = new Block[]{Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.gravel, Blocks.netherrack, Blocks.dirt}; - public ToolOffensiveEarth(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolOffensiveEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public List handleItemsOnBlockBroken(ItemStack toolStack, List itemList) - { - List newList = new LinkedList(); + @Override + public List handleItemsOnBlockBroken(ItemStack toolStack, List itemList) + { + List newList = new LinkedList(); - for(ItemStack stack : itemList) - { - if(stack != null && stack.getItem() instanceof ItemBlock && !this.isMundaneBlock(((ItemBlock)stack.getItem()).field_150939_a)) - { - newList.add(stack); - } - } + for (ItemStack stack : itemList) + { + if (stack != null && stack.getItem() instanceof ItemBlock && !this.isMundaneBlock(((ItemBlock) stack.getItem()).field_150939_a)) + { + newList.add(stack); + } + } - return newList; - } + return newList; + } - public boolean isMundaneBlock(Block block) - { - for(Block test : mundaneList) - { - if(test.equals(block)) - { - return true; - } - } + public boolean isMundaneBlock(Block block) + { + for (Block test : mundaneList) + { + if (test.equals(block)) + { + return true; + } + } - return false; - } + return false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefaultFire.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefaultFire.java index af369dea..43f9ecdd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefaultFire.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefaultFire.java @@ -1,30 +1,30 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; -public class MeleeDefaultFire extends ExtrapolatedMeleeEntityEffect +public class MeleeDefaultFire extends ExtrapolatedMeleeEntityEffect { - public MeleeDefaultFire(int power, int potency, int cost) - { - super(power, potency, cost); - this.setRange(3+0.3f*potency); - this.setRadius(2+0.3f*potency); - this.setMaxNumberHit(potency+1); - } + public MeleeDefaultFire(int power, int potency, int cost) + { + super(power, potency, cost); + this.setRange(3 + 0.3f * potency); + this.setRadius(2 + 0.3f * potency); + this.setMaxNumberHit(potency + 1); + } - @Override - protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer) - { - if(entity instanceof EntityLiving) - { - entity.setFire(3*this.powerUpgrades+3); - return true; - } - - return false; - } + @Override + protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer) + { + if (entity instanceof EntityLiving) + { + entity.setFire(3 * this.powerUpgrades + 3); + return true; + } + + return false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java index 3fb3d275..b2191020 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java @@ -1,49 +1,49 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect; public class MeleeDefensiveFire extends MeleeSpellWorldEffect { - public MeleeDefensiveFire(int power, int potency, int cost) - { - super(power, potency, cost); - } + public MeleeDefensiveFire(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onWorldEffect(World world, EntityPlayer entityPlayer) - { - ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec()); - - int width = this.potencyUpgrades + 1; - int length = 5*this.powerUpgrades + 3; - - int xOffset = look.offsetX; - int zOffset = look.offsetZ; - - Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer); - - int xStart = (int)(lookVec.xCoord)+1*xOffset; - int zStart = (int)(lookVec.zCoord)+1*zOffset; - int yStart = (int)(lookVec.yCoord)-1; - - for(int i=-width; i<=width; i++) - { - for(int j=0; j handleItemsOnBlockBroken(ItemStack toolStack, List itemList) - { - LinkedList newList = new LinkedList(); - for(ItemStack item : itemList) - { - ItemStack newItem = FurnaceRecipes.smelting().getSmeltingResult(item); - if(newItem != null) - { - newList.add(newItem); - } - else - { - newList.add(item); - } - } - - return newList; - } + @Override + public List handleItemsOnBlockBroken(ItemStack toolStack, List itemList) + { + LinkedList newList = new LinkedList(); + for (ItemStack item : itemList) + { + ItemStack newItem = FurnaceRecipes.smelting().getSmeltingResult(item); + if (newItem != null) + { + newList.add(newItem); + } else + { + newList.add(item); + } + } + + return newList; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java index cfa1aa8b..518ccc2d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java @@ -1,47 +1,47 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect; + +import java.util.Random; public class ToolEnvironmentalFire extends OnBreakBlockEffect { - public ToolEnvironmentalFire(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolEnvironmentalFire(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken) - { - int amount = 0; - int cost = (int)(250 * (1 - 0.1f*powerUpgrades) * Math.pow(0.85, costUpgrades)); - int radius = this.powerUpgrades; - float chance = 0.35f + 0.15f*this.potencyUpgrades; - - for(int i=-radius; i<=radius; i++) - { - for(int j=-radius; j<=radius; j++) - { - for(int k=-radius; k<=radius; k++) - { - Block blockAffected = world.getBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ); - - if((new Random().nextFloat() <= chance) && (blockAffected == Blocks.gravel || blockAffected == Blocks.stone || blockAffected == Blocks.cobblestone)) - { - world.setBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ, Blocks.lava); - amount += cost; - } - } - } - } - - return amount; - } + @Override + public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken) + { + int amount = 0; + int cost = (int) (250 * (1 - 0.1f * powerUpgrades) * Math.pow(0.85, costUpgrades)); + int radius = this.powerUpgrades; + float chance = 0.35f + 0.15f * this.potencyUpgrades; + + for (int i = -radius; i <= radius; i++) + { + for (int j = -radius; j <= radius; j++) + { + for (int k = -radius; k <= radius; k++) + { + Block blockAffected = world.getBlock(x + i - sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ); + + if ((new Random().nextFloat() <= chance) && (blockAffected == Blocks.gravel || blockAffected == Blocks.stone || blockAffected == Blocks.cobblestone)) + { + world.setBlock(x + i - sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ, Blocks.lava); + amount += cost; + } + } + } + } + + return amount; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolOffensiveFire.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolOffensiveFire.java index 40a59bf0..c7a94579 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolOffensiveFire.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolOffensiveFire.java @@ -1,21 +1,21 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; public class ToolOffensiveFire extends LeftClickEffect { - public ToolOffensiveFire(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolOffensiveFire(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) - { - attacked.setFire(3 + 4*this.powerUpgrades); - - return (int)(10*(1+this.powerUpgrades)*Math.pow(0.85, this.costUpgrades)); - } + @Override + public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) + { + attacked.setFire(3 + 4 * this.powerUpgrades); + + return (int) (10 * (1 + this.powerUpgrades) * Math.pow(0.85, this.costUpgrades)); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java index 7992509e..29119824 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java @@ -1,28 +1,29 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; -public class MeleeDefaultIce extends ExtrapolatedMeleeEntityEffect { +public class MeleeDefaultIce extends ExtrapolatedMeleeEntityEffect +{ - public MeleeDefaultIce(int power, int potency, int cost) - { - super(power, potency, cost); - this.setRange(3+0.3f*potency); - this.setRadius(2+0.3f*potency); - this.setMaxNumberHit(potency+1); - } + public MeleeDefaultIce(int power, int potency, int cost) + { + super(power, potency, cost); + this.setRange(3 + 0.3f * potency); + this.setRadius(2 + 0.3f * potency); + this.setMaxNumberHit(potency + 1); + } - @Override - protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer) - { - if(entity.hurtResistantTime>0) - { - entity.hurtResistantTime = Math.max(0, -(potencyUpgrades+1)+entity.hurtResistantTime); - } - - return true; - } + @Override + protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer) + { + if (entity.hurtResistantTime > 0) + { + entity.hurtResistantTime = Math.max(0, -(potencyUpgrades + 1) + entity.hurtResistantTime); + } + + return true; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java index 03471ca7..a3cfdf53 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java @@ -1,48 +1,48 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect; -public class MeleeDefensiveIce extends MeleeSpellWorldEffect +public class MeleeDefensiveIce extends MeleeSpellWorldEffect { - public MeleeDefensiveIce(int power, int potency, int cost) - { - super(power, potency, cost); - } + public MeleeDefensiveIce(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onWorldEffect(World world, EntityPlayer entityPlayer) - { - ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec()); - - int width = this.powerUpgrades; - int height = this.powerUpgrades + 2; - - int xOffset = look.offsetX; - int zOffset = look.offsetZ; - - int range = this.potencyUpgrades + 1; - - Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer); - - int xStart = (int)(lookVec.xCoord) + range * xOffset; - int zStart = (int)(lookVec.zCoord) + range * zOffset; - int yStart = (int)(lookVec.yCoord); - - for(int i=-width; i<=width; i++) - { - for(int j=0; j entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ,horizRadius, vertRadius); - - if(entities==null) - { - return; - } - - int i=0; - int number = this.powerUpgrades+1; - - for(Entity entity : entities) - { - if(i>=number) - { - continue; - } - - if(entity instanceof EntityLivingBase && !entity.equals(player)) - { - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60*(1+this.powerUpgrades),this.potencyUpgrades)); - - i++; - } - } - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + double horizRadius = this.powerUpgrades + 1; + double vertRadius = 0.5 * this.powerUpgrades + 1; + + List entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ, horizRadius, vertRadius); + + if (entities == null) + { + return; + } + + int i = 0; + int number = this.powerUpgrades + 1; + + for (Entity entity : entities) + { + if (i >= number) + { + continue; + } + + if (entity instanceof EntityLivingBase && !entity.equals(player)) + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60 * (1 + this.powerUpgrades), this.potencyUpgrades)); + + i++; + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java index 295ed906..e9eeb811 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java @@ -1,30 +1,30 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; public class ToolDefaultIce extends LeftClickEffect { - public ToolDefaultIce(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolDefaultIce(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) - { - int duration = 200; + @Override + public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) + { + int duration = 200; - attacked.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,duration,this.powerUpgrades)); + attacked.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration, this.powerUpgrades)); - return 0; - } + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java index 4a4fac77..37070d7c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.SummonToolEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; @@ -11,52 +11,52 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.SummonToolEffect; + +import java.util.List; public class ToolDefensiveIce extends SummonToolEffect { - public ToolDefensiveIce(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolDefensiveIce(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onSummonTool(ItemStack toolStack, World world, Entity entity) - { - int horizRadius = this.powerUpgrades*2+2; - int vertRadius = this.powerUpgrades * 3 + 2; - List entityList = SpellHelper.getEntitiesInRange(world, entity.posX, entity.posY, entity.posZ, horizRadius, vertRadius); + @Override + public int onSummonTool(ItemStack toolStack, World world, Entity entity) + { + int horizRadius = this.powerUpgrades * 2 + 2; + int vertRadius = this.powerUpgrades * 3 + 2; + List entityList = SpellHelper.getEntitiesInRange(world, entity.posX, entity.posY, entity.posZ, horizRadius, vertRadius); - for(Entity ent : entityList) - { - if(ent instanceof EntityLivingBase && !ent.equals(entity)) - { - ((EntityLivingBase)ent).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,200,this.potencyUpgrades*2)); - } - } - - Vec3 blockVec = SpellHelper.getEntityBlockVector(entity); - - int x = (int)(blockVec.xCoord); - int y = (int)(blockVec.yCoord); - int z = (int)(blockVec.zCoord); - - for(int posX = x-horizRadius; posX <= x+horizRadius; posX++) - { - for(int posY = y-vertRadius; posY <= y+vertRadius; posY++) - { - for(int posZ = z-horizRadius; posZ <= z+horizRadius; posZ++) - { - SpellHelper.freezeWaterBlock(world, posX, posY, posZ); - if(world.isSideSolid(posX, posY, posZ, ForgeDirection.UP) && world.isAirBlock(posX, posY+1, posZ)) - { - world.setBlock(posX, posY+1, posZ, Blocks.snow_layer); - } - } - } - } - - return 0; - } + for (Entity ent : entityList) + { + if (ent instanceof EntityLivingBase && !ent.equals(entity)) + { + ((EntityLivingBase) ent).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, this.potencyUpgrades * 2)); + } + } + + Vec3 blockVec = SpellHelper.getEntityBlockVector(entity); + + int x = (int) (blockVec.xCoord); + int y = (int) (blockVec.yCoord); + int z = (int) (blockVec.zCoord); + + for (int posX = x - horizRadius; posX <= x + horizRadius; posX++) + { + for (int posY = y - vertRadius; posY <= y + vertRadius; posY++) + { + for (int posZ = z - horizRadius; posZ <= z + horizRadius; posZ++) + { + SpellHelper.freezeWaterBlock(world, posX, posY, posZ); + if (world.isSideSolid(posX, posY, posZ, ForgeDirection.UP) && world.isAirBlock(posX, posY + 1, posZ)) + { + world.setBlock(posX, posY + 1, posZ, Blocks.snow_layer); + } + } + } + } + + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java index c1e9511f..b2e86b0b 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java @@ -1,69 +1,69 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.List; public class DigAreaEffect implements IDigAreaEffect { - protected int powerUpgrades; - protected int potencyUpgrades; - protected int costUpgrades; - - public DigAreaEffect(int power, int potency, int cost) - { - this.powerUpgrades = power; - this.potencyUpgrades = potency; - this.costUpgrades = cost; - } - - @Override - public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) - { - if(!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) - { - return 0; - } - - int x = blockPos.blockX; - int y = blockPos.blockY; - int z = blockPos.blockZ; - ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); - - for(int xPos = x-1; xPos <= x+1; xPos++) - { - for(int yPos = y-1; yPos <= y+1; yPos++) - { - for(int zPos = z-1; zPos <= z+1; zPos++) - { - this.breakBlock(container, world, player, blockHardness, xPos, yPos, zPos, itemTool); - } - } - } - - return 0; - } - - public void breakBlock(ItemStack container, World world, EntityPlayer player, float blockHardness, int x, int y, int z, ItemSpellMultiTool itemTool) - { - int hlvl = -1; - Block localBlock = world.getBlock(x, y, z); + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + + public DigAreaEffect(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + } + + @Override + public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) + { + if (!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) + { + return 0; + } + + int x = blockPos.blockX; + int y = blockPos.blockY; + int z = blockPos.blockZ; + ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); + + for (int xPos = x - 1; xPos <= x + 1; xPos++) + { + for (int yPos = y - 1; yPos <= y + 1; yPos++) + { + for (int zPos = z - 1; zPos <= z + 1; zPos++) + { + this.breakBlock(container, world, player, blockHardness, xPos, yPos, zPos, itemTool); + } + } + } + + return 0; + } + + public void breakBlock(ItemStack container, World world, EntityPlayer player, float blockHardness, int x, int y, int z, ItemSpellMultiTool itemTool) + { + int hlvl = -1; + Block localBlock = world.getBlock(x, y, z); int localMeta = world.getBlockMetadata(x, y, z); String toolClass = localBlock.getHarvestTool(localMeta); if (toolClass != null && itemTool.getHarvestLevel(container, toolClass) != -1) hlvl = localBlock.getHarvestLevel(localMeta); int toolLevel = itemTool.getHarvestLevel(container, toolClass); - + float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, x, y, z); - + if (hlvl <= toolLevel && localHardness - this.getHardnessDifference() <= blockHardness) { boolean cancelHarvest = false; @@ -76,9 +76,9 @@ public class DigAreaEffect implements IDigAreaEffect String localToolClass = itemTool.getToolClassForMaterial(localBlock.getMaterial()); - if(localToolClass != null && itemTool.getHarvestLevel(container, toolClass) >= localBlock.getHarvestLevel(localMeta)) + if (localToolClass != null && itemTool.getHarvestLevel(container, toolClass) >= localBlock.getHarvestLevel(localMeta)) { - isEffective = true; + isEffective = true; } @@ -96,32 +96,26 @@ public class DigAreaEffect implements IDigAreaEffect { localBlock.onBlockDestroyedByPlayer(world, x, y, z, localMeta); } - //localBlock.harvestBlock(world, player, x, y, z, localMeta); localBlock.onBlockHarvested(world, x, y, z, localMeta, player); if (localHardness > 0f) - itemTool.onBlockDestroyed(container, world, localBlock, x, y, z, player); - + itemTool.onBlockDestroyed(container, world, localBlock, x, y, z, player); + List items = SpellHelper.getItemsFromBlock(world, localBlock, x, y, z, localMeta, itemTool.getSilkTouch(container), itemTool.getFortuneLevel(container)); - + SpellParadigmTool parad = itemTool.loadParadigmFromStack(container); items = parad.handleItemList(container, items); - - if(!world.isRemote) + + if (!world.isRemote) { - SpellHelper.spawnItemListInWorld(items, world, x + 0.5f, y + 0.5f, z + 0.5f); + SpellHelper.spawnItemListInWorld(items, world, x + 0.5f, y + 0.5f, z + 0.5f); } - + world.func_147479_m(x, y, z); - } - else + } else { -// world.setBlockToAir(x, y, z); -// world.func_147479_m(x, y, z); } - - } - else + } else { world.setBlockToAir(x, y, z); world.func_147479_m(x, y, z); @@ -129,10 +123,10 @@ public class DigAreaEffect implements IDigAreaEffect } } } - } - - public float getHardnessDifference() - { - return 1.5f; - } + } + + public float getHardnessDifference() + { + return 1.5f; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java index 323ab050..b0b3cc83 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java @@ -1,171 +1,171 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import java.util.LinkedList; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; + +import java.util.LinkedList; +import java.util.List; +import java.util.Random; public class DigAreaTunnel extends DigAreaEffect { - Random rand = new Random(); - - public DigAreaTunnel(int power, int potency, int cost) - { - super(power, potency, cost); - } - - @Override - public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) - { - if(!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) - { - return 0; - } - - List vectorLine = new LinkedList(); - - double initialX = blockPos.blockX; - double initialY = blockPos.blockY; - double initialZ = blockPos.blockZ; - ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); - ForgeDirection opposite = sidehit.getOpposite(); - - System.out.println(opposite.toString()); - - double initialLength = this.getRandomVectorLength(); - - Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX*initialLength, opposite.offsetY*initialLength, opposite.offsetZ*initialLength); - - Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); - vectorLine.add(initialVector); - - double currentLength = lastVec.lengthVector(); - double totalLength = this.totalLength(); - - while(currentLength < totalLength-0.01) - { - Vec3 tempVec = lastVec.addVector(0, 0, 0); - - tempVec = tempVec.normalize(); - - double varr = this.varyRate(); - - tempVec = tempVec.addVector(varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat())); - - tempVec = tempVec.normalize(); - - double length = Math.min(this.getRandomVectorLength(), totalLength-currentLength); - - tempVec.xCoord = tempVec.xCoord*length; - tempVec.yCoord = tempVec.yCoord*length; - tempVec.zCoord = tempVec.zCoord*length; - - vectorLine.add(tempVec); - - lastVec = tempVec; - - currentLength += tempVec.lengthVector(); - } - - for(Vec3 testVec : vectorLine) - { - this.travelVector(testVec, world, initialX, initialY, initialZ); - - initialX += testVec.xCoord; - initialY += testVec.yCoord; - initialZ += testVec.zCoord; - } - - this.travelVector(lastVec, world, initialX, initialY, initialZ); - - return 0; - } - - public double totalLength() - { - return 100; - } - - public double getStepSize() - { - return 1; - } - - public double varyRate() - { - return 0.5; - } - - public double getRandomVectorLength() - { - return 10; - } - - public double getRandomStepLength() - { - return 0.5; - } - - public int getRandomRadius() - { - return 3; - } - - public void destroySphereOfMundane(World world, double x, double y, double z, int radius) - { - for(int i=-radius; i<=radius; i++) - { - for(int j=-radius; j<=radius; j++) - { - for(int k=-radius; k<=radius; k++) - { - if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) - { - continue; - } - - int newX = (int)(i + x + 0.5); - int newY = (int)(j + y + 0.5); - int newZ = (int)(k + z + 0.5); - - this.destroyMunadeAt(world, newX, newY, newZ); - } - } - } - } - - public void destroyMunadeAt(World world, int x, int y, int z) - { - world.setBlockToAir(x, y, z); - } - - public void travelVector(Vec3 vector, World world, double x, double y, double z) - { - double vecLength = vector.lengthVector(); - System.out.println(vecLength); - Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); - normVec = normVec.normalize(); - - Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0); - double distanceTravelled = 0; - - while(distanceTravelled < vecLength) - { - System.out.println(distanceTravelled); - double stepLength = this.getRandomStepLength(); - - prevVec = prevVec.addVector(stepLength*normVec.xCoord, stepLength*normVec.yCoord, normVec.zCoord); - - this.destroySphereOfMundane(world, prevVec.xCoord + x, prevVec.yCoord + y, prevVec.zCoord + z, this.getRandomRadius()); - - distanceTravelled = prevVec.lengthVector(); - } - } + Random rand = new Random(); + + public DigAreaTunnel(int power, int potency, int cost) + { + super(power, potency, cost); + } + + @Override + public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool) + { + if (!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) + { + return 0; + } + + List vectorLine = new LinkedList(); + + double initialX = blockPos.blockX; + double initialY = blockPos.blockY; + double initialZ = blockPos.blockZ; + ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); + ForgeDirection opposite = sidehit.getOpposite(); + + System.out.println(opposite.toString()); + + double initialLength = this.getRandomVectorLength(); + + Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength); + + Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); + vectorLine.add(initialVector); + + double currentLength = lastVec.lengthVector(); + double totalLength = this.totalLength(); + + while (currentLength < totalLength - 0.01) + { + Vec3 tempVec = lastVec.addVector(0, 0, 0); + + tempVec = tempVec.normalize(); + + double varr = this.varyRate(); + + tempVec = tempVec.addVector(varr * (rand.nextFloat() - rand.nextFloat()), varr * (rand.nextFloat() - rand.nextFloat()), varr * (rand.nextFloat() - rand.nextFloat())); + + tempVec = tempVec.normalize(); + + double length = Math.min(this.getRandomVectorLength(), totalLength - currentLength); + + tempVec.xCoord = tempVec.xCoord * length; + tempVec.yCoord = tempVec.yCoord * length; + tempVec.zCoord = tempVec.zCoord * length; + + vectorLine.add(tempVec); + + lastVec = tempVec; + + currentLength += tempVec.lengthVector(); + } + + for (Vec3 testVec : vectorLine) + { + this.travelVector(testVec, world, initialX, initialY, initialZ); + + initialX += testVec.xCoord; + initialY += testVec.yCoord; + initialZ += testVec.zCoord; + } + + this.travelVector(lastVec, world, initialX, initialY, initialZ); + + return 0; + } + + public double totalLength() + { + return 100; + } + + public double getStepSize() + { + return 1; + } + + public double varyRate() + { + return 0.5; + } + + public double getRandomVectorLength() + { + return 10; + } + + public double getRandomStepLength() + { + return 0.5; + } + + public int getRandomRadius() + { + return 3; + } + + public void destroySphereOfMundane(World world, double x, double y, double z, int radius) + { + for (int i = -radius; i <= radius; i++) + { + for (int j = -radius; j <= radius; j++) + { + for (int k = -radius; k <= radius; k++) + { + if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) + { + continue; + } + + int newX = (int) (i + x + 0.5); + int newY = (int) (j + y + 0.5); + int newZ = (int) (k + z + 0.5); + + this.destroyMunadeAt(world, newX, newY, newZ); + } + } + } + } + + public void destroyMunadeAt(World world, int x, int y, int z) + { + world.setBlockToAir(x, y, z); + } + + public void travelVector(Vec3 vector, World world, double x, double y, double z) + { + double vecLength = vector.lengthVector(); + System.out.println(vecLength); + Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); + normVec = normVec.normalize(); + + Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0); + double distanceTravelled = 0; + + while (distanceTravelled < vecLength) + { + System.out.println(distanceTravelled); + double stepLength = this.getRandomStepLength(); + + prevVec = prevVec.addVector(stepLength * normVec.xCoord, stepLength * normVec.yCoord, normVec.zCoord); + + this.destroySphereOfMundane(world, prevVec.xCoord + x, prevVec.yCoord + y, prevVec.zCoord + z, this.getRandomRadius()); + + distanceTravelled = prevVec.lengthVector(); + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IDigAreaEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IDigAreaEffect.java index 8e993b49..8e20e062 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IDigAreaEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IDigAreaEffect.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; +import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool; -public interface IDigAreaEffect +public interface IDigAreaEffect { - public abstract int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool); + public abstract int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IItemManipulator.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IItemManipulator.java index 4df354e2..bdfa0ee2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IItemManipulator.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IItemManipulator.java @@ -1,10 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import java.util.List; - import net.minecraft.item.ItemStack; -public interface IItemManipulator +import java.util.List; + +public interface IItemManipulator { - public List handleItemsOnBlockBroken(ItemStack toolStack, List itemList); + public List handleItemsOnBlockBroken(ItemStack toolStack, List itemList); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ILeftClickEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ILeftClickEffect.java index 64ee0ce9..7b368202 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ILeftClickEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ILeftClickEffect.java @@ -1,11 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -public interface ILeftClickEffect +public interface ILeftClickEffect { - public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder); + public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBanishTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBanishTool.java index d734154a..b8bfe314 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBanishTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBanishTool.java @@ -4,7 +4,7 @@ import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public interface IOnBanishTool +public interface IOnBanishTool { - public abstract int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand); + public abstract int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBreakBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBreakBlock.java index 0bb58be6..452a7164 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBreakBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnBreakBlock.java @@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public interface IOnBreakBlock +public interface IOnBreakBlock { - public abstract int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken); + public abstract int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnSummonTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnSummonTool.java index 612e23c8..5752ab45 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnSummonTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IOnSummonTool.java @@ -4,7 +4,7 @@ import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public interface IOnSummonTool +public interface IOnSummonTool { - public abstract int onSummonTool(ItemStack toolStack, World world, Entity entity); + public abstract int onSummonTool(ItemStack toolStack, World world, Entity entity); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IRightClickEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IRightClickEffect.java index 9bd8db88..12152d1a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IRightClickEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IRightClickEffect.java @@ -5,11 +5,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -public interface IRightClickEffect +public interface IRightClickEffect { - //public abstract int onRightClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder); - - public abstract int onRightClickBlock(ItemStack stack, EntityLivingBase weilder, World world, MovingObjectPosition mop); - - public abstract int onRightClickAir(ItemStack stack, EntityLivingBase weilder); + //public abstract int onRightClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder); + + public abstract int onRightClickBlock(ItemStack stack, EntityLivingBase weilder, World world, MovingObjectPosition mop); + + public abstract int onRightClickAir(ItemStack stack, EntityLivingBase weilder); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ISpecialDamageEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ISpecialDamageEffect.java index 3882fd6c..9b40c724 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ISpecialDamageEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ISpecialDamageEffect.java @@ -2,9 +2,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.t import net.minecraft.entity.Entity; -public interface ISpecialDamageEffect +public interface ISpecialDamageEffect { - public float getDamageForEntity(Entity entity); - - public String getKey(); + public float getDamageForEntity(Entity entity); + + public String getKey(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IToolUpdateEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IToolUpdateEffect.java index ffb0d6cf..70f397af 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IToolUpdateEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/IToolUpdateEffect.java @@ -4,7 +4,7 @@ import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public interface IToolUpdateEffect +public interface IToolUpdateEffect { - public abstract int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand); + public abstract int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ItemManipulator.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ItemManipulator.java index 079b7e98..7fe00aa3 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ItemManipulator.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/ItemManipulator.java @@ -1,22 +1,22 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import java.util.List; - import net.minecraft.item.ItemStack; +import java.util.List; + public abstract class ItemManipulator implements IItemManipulator { - protected int powerUpgrades; - protected int potencyUpgrades; - protected int costUpgrades; - - public ItemManipulator(int power, int potency, int cost) - { - this.powerUpgrades = power; - this.potencyUpgrades = potency; - this.costUpgrades = cost; - } - - @Override - public abstract List handleItemsOnBlockBroken(ItemStack toolStack,List itemList); + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + + public ItemManipulator(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + } + + @Override + public abstract List handleItemsOnBlockBroken(ItemStack toolStack, List itemList); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/LeftClickEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/LeftClickEffect.java index 63e0629a..cb1a9b9c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/LeftClickEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/LeftClickEffect.java @@ -5,17 +5,17 @@ import net.minecraft.item.ItemStack; public abstract class LeftClickEffect implements ILeftClickEffect { - protected int powerUpgrades; - protected int potencyUpgrades; - protected int costUpgrades; - - public LeftClickEffect(int power, int potency, int cost) - { - this.powerUpgrades = power; - this.potencyUpgrades = potency; - this.costUpgrades = cost; - } - - @Override - public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder); + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + + public LeftClickEffect(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + } + + @Override + public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/OnBreakBlockEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/OnBreakBlockEffect.java index d8521990..331a1064 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/OnBreakBlockEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/OnBreakBlockEffect.java @@ -1,21 +1,15 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - public abstract class OnBreakBlockEffect implements IOnBreakBlock { - protected int powerUpgrades; - protected int potencyUpgrades; - protected int costUpgrades; - - public OnBreakBlockEffect(int power, int potency, int cost) - { - this.powerUpgrades = power; - this.potencyUpgrades = potency; - this.costUpgrades = cost; - } + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + + public OnBreakBlockEffect(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickEffect.java index e047b01a..f0153db7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickEffect.java @@ -2,14 +2,14 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.t public abstract class RightClickEffect implements IRightClickEffect { - protected int powerUpgrades; - protected int potencyUpgrades; - protected int costUpgrades; - - public RightClickEffect(int power, int potency, int cost) - { - this.powerUpgrades = power; - this.potencyUpgrades = potency; - this.costUpgrades = cost; - } + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + + public RightClickEffect(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java index 6f300afb..0ea6d6ef 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java @@ -1,9 +1,5 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import java.util.LinkedList; -import java.util.List; -import java.util.Random; - import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; @@ -11,167 +7,171 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; + public class RightClickTunnel extends RightClickEffect { - Random rand = new Random(); - public RightClickTunnel(int power, int potency, int cost) - { - super(power, potency, cost); - } + Random rand = new Random(); - @Override - public int onRightClickBlock(ItemStack stack, EntityLivingBase weilder, World world, MovingObjectPosition mop) - { - if(weilder.worldObj.isRemote) - { - return 0; - } - if(!mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) - { - return 0; - } - - List vectorLine = new LinkedList(); - - double initialX = mop.blockX; - double initialY = mop.blockY; - double initialZ = mop.blockZ; - ForgeDirection sidehit = ForgeDirection.getOrientation(mop.sideHit); - ForgeDirection opposite = sidehit.getOpposite(); - - double initialLength = this.getRandomVectorLength(); - - Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX*initialLength, opposite.offsetY*initialLength, opposite.offsetZ*initialLength); - - Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); - vectorLine.add(initialVector); - - double currentLength = lastVec.lengthVector(); - double totalLength = this.totalLength(); - - while(currentLength < totalLength-0.01) - { - Vec3 tempVec = lastVec.addVector(0, 0, 0); - - tempVec = tempVec.normalize(); - - double varr = this.varyRate(); - - tempVec = tempVec.addVector(varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat())); - - tempVec = tempVec.normalize(); - - double length = Math.min(this.getRandomVectorLength(), totalLength-currentLength); - - tempVec.xCoord = tempVec.xCoord*length; - tempVec.yCoord = tempVec.yCoord*length; - tempVec.zCoord = tempVec.zCoord*length; - - vectorLine.add(tempVec); - - lastVec = tempVec; - - currentLength += tempVec.lengthVector(); - } - - for(Vec3 testVec : vectorLine) - { - this.travelVector(testVec, world, initialX, initialY, initialZ); - - initialX += testVec.xCoord; - initialY += testVec.yCoord; - initialZ += testVec.zCoord; - } - - this.travelVector(lastVec, world, initialX, initialY, initialZ); - - return 0; - } + public RightClickTunnel(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onRightClickAir(ItemStack stack, EntityLivingBase weilder) - { - //Empty Method - return 0; - } - - public double totalLength() - { - return 100; - } - - public double getStepSize() - { - return 1; - } - - public double varyRate() - { - return 0.5; - } - - public double getRandomVectorLength() - { - return 10; - } - - public double getRandomStepLength() - { - return 0.5; - } - - public int getRandomRadius() - { - return 3; - } - - public void destroySphereOfMundane(World world, double x, double y, double z, int radius) - { - for(int i=-radius; i<=radius; i++) - { - for(int j=-radius; j<=radius; j++) - { - for(int k=-radius; k<=radius; k++) - { - if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) - { - continue; - } - - int newX = (int)(i + x + 0.5); - int newY = (int)(j + y + 0.5); - int newZ = (int)(k + z + 0.5); - - this.destroyMunadeAt(world, newX, newY, newZ); - } - } - } - } - - public void destroyMunadeAt(World world, int x, int y, int z) - { - world.setBlockToAir(x, y, z); - } - - public void travelVector(Vec3 vector, World world, double x, double y, double z) - { - double vecLength = vector.lengthVector(); + @Override + public int onRightClickBlock(ItemStack stack, EntityLivingBase weilder, World world, MovingObjectPosition mop) + { + if (weilder.worldObj.isRemote) + { + return 0; + } + if (!mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) + { + return 0; + } - Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); - normVec = normVec.normalize(); - - Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0); - double distanceTravelled = 0; - - while(distanceTravelled < vecLength) - { - double stepLength = this.getRandomStepLength(); - - prevVec = prevVec.addVector(stepLength*normVec.xCoord, stepLength*normVec.yCoord, normVec.zCoord); - - this.destroySphereOfMundane(world, prevVec.xCoord + x, prevVec.yCoord + y, prevVec.zCoord + z, this.getRandomRadius()); - - distanceTravelled = prevVec.lengthVector(); - } - } + List vectorLine = new LinkedList(); + + double initialX = mop.blockX; + double initialY = mop.blockY; + double initialZ = mop.blockZ; + ForgeDirection sidehit = ForgeDirection.getOrientation(mop.sideHit); + ForgeDirection opposite = sidehit.getOpposite(); + + double initialLength = this.getRandomVectorLength(); + + Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength); + + Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); + vectorLine.add(initialVector); + + double currentLength = lastVec.lengthVector(); + double totalLength = this.totalLength(); + + while (currentLength < totalLength - 0.01) + { + Vec3 tempVec = lastVec.addVector(0, 0, 0); + + tempVec = tempVec.normalize(); + + double varr = this.varyRate(); + + tempVec = tempVec.addVector(varr * (rand.nextFloat() - rand.nextFloat()), varr * (rand.nextFloat() - rand.nextFloat()), varr * (rand.nextFloat() - rand.nextFloat())); + + tempVec = tempVec.normalize(); + + double length = Math.min(this.getRandomVectorLength(), totalLength - currentLength); + + tempVec.xCoord = tempVec.xCoord * length; + tempVec.yCoord = tempVec.yCoord * length; + tempVec.zCoord = tempVec.zCoord * length; + + vectorLine.add(tempVec); + + lastVec = tempVec; + + currentLength += tempVec.lengthVector(); + } + + for (Vec3 testVec : vectorLine) + { + this.travelVector(testVec, world, initialX, initialY, initialZ); + + initialX += testVec.xCoord; + initialY += testVec.yCoord; + initialZ += testVec.zCoord; + } + + this.travelVector(lastVec, world, initialX, initialY, initialZ); + + return 0; + } + + @Override + public int onRightClickAir(ItemStack stack, EntityLivingBase weilder) + { + return 0; + } + + public double totalLength() + { + return 100; + } + + public double getStepSize() + { + return 1; + } + + public double varyRate() + { + return 0.5; + } + + public double getRandomVectorLength() + { + return 10; + } + + public double getRandomStepLength() + { + return 0.5; + } + + public int getRandomRadius() + { + return 3; + } + + public void destroySphereOfMundane(World world, double x, double y, double z, int radius) + { + for (int i = -radius; i <= radius; i++) + { + for (int j = -radius; j <= radius; j++) + { + for (int k = -radius; k <= radius; k++) + { + if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) + { + continue; + } + + int newX = (int) (i + x + 0.5); + int newY = (int) (j + y + 0.5); + int newZ = (int) (k + z + 0.5); + + this.destroyMunadeAt(world, newX, newY, newZ); + } + } + } + } + + public void destroyMunadeAt(World world, int x, int y, int z) + { + world.setBlockToAir(x, y, z); + } + + public void travelVector(Vec3 vector, World world, double x, double y, double z) + { + double vecLength = vector.lengthVector(); + + Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); + normVec = normVec.normalize(); + + Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0); + double distanceTravelled = 0; + + while (distanceTravelled < vecLength) + { + double stepLength = this.getRandomStepLength(); + + prevVec = prevVec.addVector(stepLength * normVec.xCoord, stepLength * normVec.yCoord, normVec.zCoord); + + this.destroySphereOfMundane(world, prevVec.xCoord + x, prevVec.yCoord + y, prevVec.zCoord + z, this.getRandomRadius()); + + distanceTravelled = prevVec.lengthVector(); + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/SummonToolEffect.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/SummonToolEffect.java index e8bb04a4..86c396ab 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/SummonToolEffect.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/SummonToolEffect.java @@ -2,14 +2,14 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.t public abstract class SummonToolEffect implements IOnSummonTool { - protected int powerUpgrades; - protected int potencyUpgrades; - protected int costUpgrades; - - public SummonToolEffect(int power, int potency, int cost) - { - this.powerUpgrades = power; - this.potencyUpgrades = potency; - this.costUpgrades = cost; - } + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + + public SummonToolEffect(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefaultWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefaultWind.java index 31b324ef..2bf17e56 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefaultWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefaultWind.java @@ -1,40 +1,40 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; public class MeleeDefaultWind extends ExtrapolatedMeleeEntityEffect { - public MeleeDefaultWind(int power, int potency, int cost) - { - super(power, potency, cost); - this.setRange(4+2.0f*potency); - this.setRadius(4+2.0f*potency); - this.setMaxNumberHit(potency+1); - } + public MeleeDefaultWind(int power, int potency, int cost) + { + super(power, potency, cost); + this.setRange(4 + 2.0f * potency); + this.setRadius(4 + 2.0f * potency); + this.setMaxNumberHit(potency + 1); + } - @Override - protected boolean entityEffect(World world, Entity entity, EntityPlayer player) - { - double wantedVel = -(0.5d+0.7d*this.powerUpgrades); - - if(entity instanceof EntityLiving) - { - double dist = Math.sqrt(entity.getDistanceToEntity(player)); - double xVel = wantedVel*(entity.posX - player.posX)/dist; - double yVel = wantedVel*(entity.posY - player.posY)/dist; - double zVel = wantedVel*(entity.posZ - player.posZ)/dist; - - entity.motionX = xVel; - entity.motionY = yVel; - entity.motionZ = zVel; - - return true; - } - - return false; - } + @Override + protected boolean entityEffect(World world, Entity entity, EntityPlayer player) + { + double wantedVel = -(0.5d + 0.7d * this.powerUpgrades); + + if (entity instanceof EntityLiving) + { + double dist = Math.sqrt(entity.getDistanceToEntity(player)); + double xVel = wantedVel * (entity.posX - player.posX) / dist; + double yVel = wantedVel * (entity.posY - player.posY) / dist; + double zVel = wantedVel * (entity.posZ - player.posZ) / dist; + + entity.motionX = xVel; + entity.motionY = yVel; + entity.motionZ = zVel; + + return true; + } + + return false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefensiveWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefensiveWind.java index 5f146e25..cf2d7d93 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefensiveWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeDefensiveWind.java @@ -1,33 +1,33 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; public class MeleeDefensiveWind extends ExtrapolatedMeleeEntityEffect { - public MeleeDefensiveWind(int power, int potency, int cost) - { - super(power, potency, cost); - this.setRange(3+0.3f*potency); - this.setRadius(2+0.3f*potency); - this.setMaxNumberHit(potency+1); - } + public MeleeDefensiveWind(int power, int potency, int cost) + { + super(power, potency, cost); + this.setRange(3 + 0.3f * potency); + this.setRadius(2 + 0.3f * potency); + this.setMaxNumberHit(potency + 1); + } - @Override - protected boolean entityEffect(World world, Entity entity, EntityPlayer player) - { - double wantedVel = 0.5d+0.5d*this.powerUpgrades; - - if(entity instanceof EntityLiving) - { - entity.motionY = wantedVel; + @Override + protected boolean entityEffect(World world, Entity entity, EntityPlayer player) + { + double wantedVel = 0.5d + 0.5d * this.powerUpgrades; - return true; - } - - return false; - } + if (entity instanceof EntityLiving) + { + entity.motionY = wantedVel; + + return true; + } + + return false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java index 2eed2c73..1a3c3479 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java @@ -1,36 +1,36 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect; + +import java.util.List; public class MeleeEnvironmentalWind extends MeleeSpellCenteredWorldEffect { - public MeleeEnvironmentalWind(int power, int potency, int cost) - { - super(power, potency, cost); - this.setRange(5*power + 5); - } + public MeleeEnvironmentalWind(int power, int potency, int cost) + { + super(power, potency, cost); + this.setRange(5 * power + 5); + } - @Override - public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) - { - int radius = 5*this.potencyUpgrades + 3; - - List entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius); - - for(Entity entity : entities) - { - if(entity instanceof EntityItem) - { - ((EntityItem)entity).delayBeforeCanPickup = 0; - entity.onCollideWithPlayer((EntityPlayer)player); - } - } - } + @Override + public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) + { + int radius = 5 * this.potencyUpgrades + 3; + + List entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius); + + for (Entity entity : entities) + { + if (entity instanceof EntityItem) + { + ((EntityItem) entity).delayBeforeCanPickup = 0; + entity.onCollideWithPlayer((EntityPlayer) player); + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeOffensiveWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeOffensiveWind.java index dd283246..810a766f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeOffensiveWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeOffensiveWind.java @@ -1,40 +1,40 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect; public class MeleeOffensiveWind extends ExtrapolatedMeleeEntityEffect { - public MeleeOffensiveWind(int power, int potency, int cost) - { - super(power, potency, cost); - this.setRange(3+0.3f*potency); - this.setRadius(2+0.3f*potency); - this.setMaxNumberHit(potency+1); - } + public MeleeOffensiveWind(int power, int potency, int cost) + { + super(power, potency, cost); + this.setRange(3 + 0.3f * potency); + this.setRadius(2 + 0.3f * potency); + this.setMaxNumberHit(potency + 1); + } - @Override - protected boolean entityEffect(World world, Entity entity, EntityPlayer player) - { - double wantedVel = 1.0d+1.0d*this.powerUpgrades; - - if(entity instanceof EntityLiving) - { - double dist = Math.sqrt(entity.getDistanceToEntity(player)); - double xVel = wantedVel*(entity.posX - player.posX)/dist; - double yVel = wantedVel*(entity.posY - player.posY+0.5f)/dist; - double zVel = wantedVel*(entity.posZ - player.posZ)/dist; - - entity.motionX = xVel; - entity.motionY = yVel; - entity.motionZ = zVel; - - return true; - } - - return false; - } + @Override + protected boolean entityEffect(World world, Entity entity, EntityPlayer player) + { + double wantedVel = 1.0d + 1.0d * this.powerUpgrades; + + if (entity instanceof EntityLiving) + { + double dist = Math.sqrt(entity.getDistanceToEntity(player)); + double xVel = wantedVel * (entity.posX - player.posX) / dist; + double yVel = wantedVel * (entity.posY - player.posY + 0.5f) / dist; + double zVel = wantedVel * (entity.posZ - player.posZ) / dist; + + entity.motionX = xVel; + entity.motionY = yVel; + entity.motionZ = zVel; + + return true; + } + + return false; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java index a50dcbd3..61dbfda2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java @@ -1,33 +1,30 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.potion.PotionEffect; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect; public class ProjectileDefaultWind extends ProjectileImpactEffect { - public ProjectileDefaultWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ProjectileDefaultWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onEntityImpact(Entity mop, Entity proj) - { - float wantedYVel = (float)((0.5)*(0.5*this.potencyUpgrades + 1)); - - mop.motionX = proj.motionX; - mop.motionY = mop.motionY += wantedYVel; - mop.motionZ = proj.motionZ; - } + @Override + public void onEntityImpact(Entity mop, Entity proj) + { + float wantedYVel = (float) ((0.5) * (0.5 * this.potencyUpgrades + 1)); - @Override - public void onTileImpact(World world, MovingObjectPosition mop) - { - return; - } + mop.motionX = proj.motionX; + mop.motionY = mop.motionY += wantedYVel; + mop.motionZ = proj.motionZ; + } + + @Override + public void onTileImpact(World world, MovingObjectPosition mop) + { + return; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java index e1871678..268e8d38 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java @@ -1,53 +1,53 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect; -public class ProjectileEnvironmentalWind extends ProjectileUpdateEffect -{ - public ProjectileEnvironmentalWind(int power, int potency, int cost) - { - super(power, potency, cost); - } +import java.util.List; - @Override - public void onUpdateEffect(Entity projectile) - { - Vec3 posVec = SpellHelper.getEntityBlockVector(projectile); - - int horizRange = this.powerUpgrades+1; - int vertRange = 1*this.potencyUpgrades+1; - - World worldObj = projectile.worldObj; - - if(projectile instanceof EntitySpellProjectile) - { - Entity shooter = ((EntitySpellProjectile) projectile).shootingEntity; - if(shooter instanceof EntityPlayer) - { - List entitylist = SpellHelper.getEntitiesInRange(worldObj, projectile.posX, projectile.posY, projectile.posZ, horizRange, vertRange); - if(entitylist !=null) - { - for(Entity entity : entitylist) - { - if(entity instanceof EntityItem) - { - ((EntityItem)entity).delayBeforeCanPickup = 0; - entity.onCollideWithPlayer((EntityPlayer)shooter); - } - } - } - } - } - - - } +public class ProjectileEnvironmentalWind extends ProjectileUpdateEffect +{ + public ProjectileEnvironmentalWind(int power, int potency, int cost) + { + super(power, potency, cost); + } + + @Override + public void onUpdateEffect(Entity projectile) + { + Vec3 posVec = SpellHelper.getEntityBlockVector(projectile); + + int horizRange = this.powerUpgrades + 1; + int vertRange = 1 * this.potencyUpgrades + 1; + + World worldObj = projectile.worldObj; + + if (projectile instanceof EntitySpellProjectile) + { + Entity shooter = ((EntitySpellProjectile) projectile).shootingEntity; + if (shooter instanceof EntityPlayer) + { + List entitylist = SpellHelper.getEntitiesInRange(worldObj, projectile.posX, projectile.posY, projectile.posZ, horizRange, vertRange); + if (entitylist != null) + { + for (Entity entity : entitylist) + { + if (entity instanceof EntityItem) + { + ((EntityItem) entity).delayBeforeCanPickup = 0; + entity.onCollideWithPlayer((EntityPlayer) shooter); + } + } + } + } + } + + + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java index 661fa367..eecfaf64 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java @@ -1,33 +1,33 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.potion.PotionEffect; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect; public class ProjectileOffensiveWind extends ProjectileImpactEffect { - public ProjectileOffensiveWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ProjectileOffensiveWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onEntityImpact(Entity mop, Entity proj) - { - if(mop instanceof EntityLiving) - { - ((EntityLiving) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id,(int)(100*(2*this.powerUpgrades+1)*(1/(this.potencyUpgrades+1))),this.potencyUpgrades)); - } - } + @Override + public void onEntityImpact(Entity mop, Entity proj) + { + if (mop instanceof EntityLiving) + { + ((EntityLiving) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, (int) (100 * (2 * this.powerUpgrades + 1) * (1 / (this.potencyUpgrades + 1))), this.potencyUpgrades)); + } + } - @Override - public void onTileImpact(World world, MovingObjectPosition mop) - { - return; - } + @Override + public void onTileImpact(World world, MovingObjectPosition mop) + { + return; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefaultWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefaultWind.java index 3e13568a..34176f08 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefaultWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefaultWind.java @@ -1,27 +1,20 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; public class SelfDefaultWind extends SelfSpellEffect { - public SelfDefaultWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfDefaultWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - player.extinguish(); - player.fallDistance = 0; - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + player.extinguish(); + player.fallDistance = 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefensiveWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefensiveWind.java index 125ef17d..fdf5e6d7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefensiveWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfDefensiveWind.java @@ -1,39 +1,39 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; + +import java.util.List; public class SelfDefensiveWind extends SelfSpellEffect { - public SelfDefensiveWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfDefensiveWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - double radius = 1.5d*this.powerUpgrades+1.5d; - double posX = player.posX; - double posY = player.posY; - double posZ = player.posZ; - - List entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius); - - for(Entity entity: entities) - { - if((!entity.equals(player))&&entity instanceof EntityLiving) - { - ((EntityLiving)entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id,200,this.potencyUpgrades)); - } - } - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + double radius = 1.5d * this.powerUpgrades + 1.5d; + double posX = player.posX; + double posY = player.posY; + double posZ = player.posZ; + + List entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius); + + for (Entity entity : entities) + { + if ((!entity.equals(player)) && entity instanceof EntityLiving) + { + ((EntityLiving) entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, 200, this.potencyUpgrades)); + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfEnvironmentalWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfEnvironmentalWind.java index 3ea0f86b..487fe396 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfEnvironmentalWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfEnvironmentalWind.java @@ -1,45 +1,45 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; + +import java.util.List; public class SelfEnvironmentalWind extends SelfSpellEffect { - public SelfEnvironmentalWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfEnvironmentalWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - double radius = 1.5d*this.potencyUpgrades+1; - double posX = player.posX; - double posY = player.posY-0.7d; - double posZ = player.posZ; - double wantedVel = 0.7d+0.7d*this.powerUpgrades; - - List entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius); - - for(Entity entity: entities) - { - if((!entity.equals(player))&&entity instanceof EntityLiving) - { - double dist = Math.sqrt(entity.getDistanceToEntity(player)); - double xVel = wantedVel*(entity.posX - posX)/dist; - double yVel = wantedVel*(entity.posY - posY)/dist; - double zVel = wantedVel*(entity.posZ - posZ)/dist; - - entity.motionX = xVel; - entity.motionY = yVel; - entity.motionZ = zVel; - } - } - } + @Override + public void onSelfUse(World world, EntityPlayer player) + { + double radius = 1.5d * this.potencyUpgrades + 1; + double posX = player.posX; + double posY = player.posY - 0.7d; + double posZ = player.posZ; + double wantedVel = 0.7d + 0.7d * this.powerUpgrades; + + List entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius); + + for (Entity entity : entities) + { + if ((!entity.equals(player)) && entity instanceof EntityLiving) + { + double dist = Math.sqrt(entity.getDistanceToEntity(player)); + double xVel = wantedVel * (entity.posX - posX) / dist; + double yVel = wantedVel * (entity.posY - posY) / dist; + double zVel = wantedVel * (entity.posZ - posZ) / dist; + + entity.motionX = xVel; + entity.motionY = yVel; + entity.motionZ = zVel; + } + } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java index 74dd6e13..280b4d33 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java @@ -1,32 +1,26 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class SelfOffensiveWind extends SelfSpellEffect { - public SelfOffensiveWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public SelfOffensiveWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public void onSelfUse(World world, EntityPlayer player) - { - Vec3 vec = player.getLookVec(); - double wantedVelocity = 1.5 + this.powerUpgrades*0.4; + @Override + public void onSelfUse(World world, EntityPlayer player) + { + Vec3 vec = player.getLookVec(); + double wantedVelocity = 1.5 + this.powerUpgrades * 0.4; SpellHelper.setPlayerSpeedFromServer(player, vec.xCoord * wantedVelocity, vec.yCoord * wantedVelocity, vec.zCoord * wantedVelocity); - + player.fallDistance = 0; - } + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java index 02dd42dc..3ec33947 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java @@ -1,32 +1,32 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.Vec3; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; public class ToolDefensiveWind extends LeftClickEffect { - public ToolDefensiveWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolDefensiveWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) - { - Vec3 vec = weilder.getLookVec(); - vec.yCoord = 0; - vec.normalize(); - - float velocity = 0.5f*(1+this.powerUpgrades*0.8f); - float ratio = 0.1f + 0.3f*this.potencyUpgrades; - - attacked.motionX += vec.xCoord*velocity; - attacked.motionY += velocity*ratio; - attacked.motionZ += vec.zCoord*velocity; - - return 0; - } + @Override + public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) + { + Vec3 vec = weilder.getLookVec(); + vec.yCoord = 0; + vec.normalize(); + + float velocity = 0.5f * (1 + this.powerUpgrades * 0.8f); + float ratio = 0.1f + 0.3f * this.potencyUpgrades; + + attacked.motionX += vec.xCoord * velocity; + attacked.motionY += velocity * ratio; + attacked.motionZ += vec.zCoord * velocity; + + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java index 082c27e2..fac9f23f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java @@ -1,41 +1,41 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect; + +import java.util.List; public class ToolEnvironmentalWind extends OnBreakBlockEffect { - public ToolEnvironmentalWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolEnvironmentalWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken) - { - double vertRange = 0.5 + (this.powerUpgrades*this.powerUpgrades + this.powerUpgrades)/2; - double horizRange = vertRange; - - List itemList = SpellHelper.getItemsInRange(world, x + 0.5f, y + 0.5f, z + 0.5f, horizRange, vertRange); - - for(EntityItem entity : itemList) - { - if(!world.isRemote) - { - entity.delayBeforeCanPickup = 0; - entity.onCollideWithPlayer(player); - } - } - - return 0; - } + @Override + public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken) + { + double vertRange = 0.5 + (this.powerUpgrades * this.powerUpgrades + this.powerUpgrades) / 2; + double horizRange = vertRange; + + List itemList = SpellHelper.getItemsInRange(world, x + 0.5f, y + 0.5f, z + 0.5f, horizRange, vertRange); + + for (EntityItem entity : itemList) + { + if (!world.isRemote) + { + entity.delayBeforeCanPickup = 0; + entity.onCollideWithPlayer(player); + } + } + + return 0; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java index 5d08d2df..07be3f79 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java @@ -1,24 +1,23 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import net.minecraft.entity.EntityLiving; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect; public class ToolOffensiveWind extends LeftClickEffect { - public ToolOffensiveWind(int power, int potency, int cost) - { - super(power, potency, cost); - } + public ToolOffensiveWind(int power, int potency, int cost) + { + super(power, potency, cost); + } - @Override - public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) - { - attacked.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id,(int)(100*(2*this.powerUpgrades+1)*(1/(this.potencyUpgrades+1))),this.potencyUpgrades)); - - return (int)(100*(0.5*this.potencyUpgrades+1)*(this.powerUpgrades+1)*Math.pow(0.85, costUpgrades)); - } + @Override + public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) + { + attacked.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, (int) (100 * (2 * this.powerUpgrades + 1) * (1 / (this.potencyUpgrades + 1))), this.potencyUpgrades)); + + return (int) (100 * (0.5 * this.potencyUpgrades + 1) * (this.powerUpgrades + 1) * Math.pow(0.85, costUpgrades)); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancement.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancement.java index b17c5659..8cb26bf7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancement.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancement.java @@ -1,20 +1,20 @@ package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; -public class SpellEnhancement +public class SpellEnhancement { - public static final int POWER = 0; - public static final int EFFICIENCY = 1; - public static final int POTENCY = 2; - - private int state = this.POWER; - - protected SpellEnhancement(int state) - { - this.state = state; - } - - public int getState() - { - return this.state; - } + public static final int POWER = 0; + public static final int EFFICIENCY = 1; + public static final int POTENCY = 2; + + private int state = this.POWER; + + protected SpellEnhancement(int state) + { + this.state = state; + } + + public int getState() + { + return this.state; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementCost.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementCost.java index 2e0df1fb..51fd717f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementCost.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementCost.java @@ -1,10 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; -public class SpellEnhancementCost extends SpellEnhancement +public class SpellEnhancementCost extends SpellEnhancement { - public SpellEnhancementCost() - { - super(SpellEnhancement.EFFICIENCY); - } + public SpellEnhancementCost() + { + super(SpellEnhancement.EFFICIENCY); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPotency.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPotency.java index 6231c8a7..f2e51faf 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPotency.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPotency.java @@ -1,10 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; -public class SpellEnhancementPotency extends SpellEnhancement +public class SpellEnhancementPotency extends SpellEnhancement { - public SpellEnhancementPotency() - { - super(SpellEnhancement.POTENCY); - } + public SpellEnhancementPotency() + { + super(SpellEnhancement.POTENCY); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPower.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPower.java index 527dfe46..735da367 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPower.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPower.java @@ -1,10 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; -public class SpellEnhancementPower extends SpellEnhancement +public class SpellEnhancementPower extends SpellEnhancement { - public SpellEnhancementPower() - { - super(SpellEnhancement.POWER); - } + public SpellEnhancementPower() + { + super(SpellEnhancement.POWER); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellRegistry.java index 645bd99c..c4f5ac28 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellRegistry.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import java.util.ArrayList; +import java.util.List; + public class HomSpellRegistry { public static List spellList = new ArrayList(); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java index e4a31e55..cab42791 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java @@ -1,16 +1,15 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.Random; public class SpellEarthBender extends HomSpell { @@ -20,7 +19,6 @@ public class SpellEarthBender extends HomSpell { super(); this.setEnergies(100, 150, 350, 200); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -135,7 +133,6 @@ public class SpellEarthBender extends HomSpell for (int i = 0; i < 20; i++) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F)); SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); } @@ -190,7 +187,6 @@ public class SpellEarthBender extends HomSpell for (int i = 0; i < 16; i++) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, 0.0F, 0.410F, 1.0F)); SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java index 44ede225..6a409224 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java @@ -16,7 +16,6 @@ public class SpellExplosions extends HomSpell { super(); this.setEnergies(400, 500, 1900, 1500); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -38,7 +37,6 @@ public class SpellExplosions extends HomSpell if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new ExplosionProjectile(par2World, par3EntityPlayer, 6, true)); } @@ -83,8 +81,6 @@ public class SpellExplosions extends HomSpell } int distance = 4; -// double yaw = par3EntityPlayer.rotationYaw/180*Math.PI; -// double pitch = par3EntityPlayer.rotationPitch/180*Math.PI; par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, (float) (distance), false); return par1ItemStack; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java index 2d02fdaa..aedc5e1e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java @@ -1,9 +1,7 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -11,8 +9,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; public class SpellFireBurst extends HomSpell { @@ -22,7 +22,6 @@ public class SpellFireBurst extends HomSpell { super(); this.setEnergies(100, 300, 400, 100); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -44,8 +43,7 @@ public class SpellFireBurst extends HomSpell if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); - FireProjectile proj = new FireProjectile(par2World, par3EntityPlayer, 7); + FireProjectile proj = new FireProjectile(par2World, par3EntityPlayer, 7); par2World.spawnEntityInWorld(proj); } @@ -101,7 +99,6 @@ public class SpellFireBurst extends HomSpell par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); int d0 = 2; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); - //axisalignedbb.maxY = (double)this.worldObj.getHeight(); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -120,18 +117,6 @@ public class SpellFireBurst extends HomSpell entityLiving.setFire(100); entityLiving.attackEntityFrom(DamageSource.inFire, 2); } - -// if (!par2World.isRemote) -// { -// -// for(int i=0;i<10;i++) -// { -// for(int j=0;j<5;j++) -// { -// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10,5,par3EntityPlayer.posX,par3EntityPlayer.posY+par3EntityPlayer.getEyeHeight(),par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw+i*36F,par3EntityPlayer.rotationPitch+j*72F)); -// } -// } -// } return par1ItemStack; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java index bfa441eb..8239b019 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java @@ -1,14 +1,14 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; + +import java.util.Random; public class SpellFrozenWater extends HomSpell { @@ -18,7 +18,6 @@ public class SpellFrozenWater extends HomSpell { super(); this.setEnergies(100, 200, 150, 100); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -40,7 +39,6 @@ public class SpellFrozenWater extends HomSpell if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new IceProjectile(par2World, par3EntityPlayer, 6)); } @@ -187,8 +185,6 @@ public class SpellFrozenWater extends HomSpell for (int k = -radius; k <= radius; k++) { Block block = par2World.getBlock((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k); - - //Block block = Block.blocksList[blockID]; if (block == Blocks.water || block == Blocks.flowing_water) { par2World.setBlock((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.ice); @@ -196,13 +192,6 @@ public class SpellFrozenWater extends HomSpell } } } - -// int blockID = par2World.getBlockId((int)par3EntityPlayer.posX+i, (int)par3EntityPlayer.posY+j, (int)par3EntityPlayer.posZ+k); -// //Block block = Block.blocksList[blockID]; -// if(blockID==Block.waterMoving.blockID||blockID==Block.waterStill.blockID) -// { -// par2World.setBlock((int)par3EntityPlayer.posX+i, (int)par3EntityPlayer.posY+j, (int)par3EntityPlayer.posZ+k, Blocks.ice); -// } return par1ItemStack; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java index f712073f..4548111c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java @@ -1,19 +1,18 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; public class SpellHolyBlast extends HomSpell { @@ -23,7 +22,6 @@ public class SpellHolyBlast extends HomSpell { super(); this.setEnergies(100, 300, 500, 400); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -45,7 +43,6 @@ public class SpellHolyBlast extends HomSpell if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new HolyProjectile(par2World, par3EntityPlayer, 8)); } @@ -75,7 +72,6 @@ public class SpellHolyBlast extends HomSpell double zCoord = par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance; float d0 = 0.5f; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX - 0.5 + Math.sin(yaw) * Math.cos(pitch) * (-distance), par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance, par3EntityPlayer.posZ - 0.5 + Math.cos(yaw) * Math.cos(pitch) * distance, par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance) + 0.5, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance + 1, par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance + 0.5).expand(d0, d0, d0); - //axisalignedbb.maxY = (double)this.worldObj.getHeight(); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -97,17 +93,13 @@ public class SpellHolyBlast extends HomSpell { i = 3; } - - //entityLiving.setFire(50); entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5 * i); - //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); } par2World.createExplosion(par3EntityPlayer, xCoord, yCoord, zCoord, (float) (1), false); for (int i = 0; i < 5; i++) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F)); SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F); } @@ -157,7 +149,6 @@ public class SpellHolyBlast extends HomSpell int d0 = 3; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); - //axisalignedbb.maxY = (double)this.worldObj.getHeight(); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -179,10 +170,7 @@ public class SpellHolyBlast extends HomSpell { i = 3; } - - //entityLiving.setFire(50); entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5 * i); - //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); } par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float) (2), false); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java index 576b9884..ea63e871 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java @@ -1,15 +1,14 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.Random; public class SpellLightningBolt extends HomSpell { @@ -19,7 +18,6 @@ public class SpellLightningBolt extends HomSpell { super(); this.setEnergies(75, 200, 700, 700); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -41,7 +39,6 @@ public class SpellLightningBolt extends HomSpell if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new LightningBoltProjectile(par2World, par3EntityPlayer, 8, false)); } @@ -68,7 +65,6 @@ public class SpellLightningBolt extends HomSpell double yCoord = par3EntityPlayer.posY; double zCoord = par3EntityPlayer.posZ; par2World.getWorldInfo().setRaining(true); - //par2World.setRainStrength(1.0F); par2World.setRainStrength(1.0f); par2World.setThunderStrength(1.0f); par2World.getWorldInfo().setThunderTime(0); @@ -76,7 +72,6 @@ public class SpellLightningBolt extends HomSpell for (int i = 0; i < 5; i++) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F)); SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F); } @@ -132,7 +127,6 @@ public class SpellLightningBolt extends HomSpell if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new LightningBoltProjectile(par2World, par3EntityPlayer, 8, true)); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java index b1276d95..66166423 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java @@ -1,9 +1,8 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -16,10 +15,10 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; public class SpellTeleport extends HomSpell { @@ -29,7 +28,6 @@ public class SpellTeleport extends HomSpell { super(); this.setEnergies(500, 300, 500, 1000); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -94,7 +92,6 @@ public class SpellTeleport extends HomSpell for (int i = 0; i < 20; i++) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("portal", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, itemRand.nextFloat(), itemRand.nextFloat(), itemRand.nextFloat())); SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "portal", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, itemRand.nextFloat(), itemRand.nextFloat(), itemRand.nextFloat()); } @@ -120,7 +117,6 @@ public class SpellTeleport extends HomSpell { int d0 = 3; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); - //axisalignedbb.maxY = (double)this.worldObj.getHeight(); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -135,9 +131,7 @@ public class SpellTeleport extends HomSpell continue; } } - SpellTeleport.teleportRandomly(entityLiving, 128); - //entityLiving.attackEntityFrom(DamageSource.inFire, 5); } } @@ -178,7 +172,6 @@ public class SpellTeleport extends HomSpell } return true; - //return SpellTeleport.teleportTo(entityLiving, d0, d1, d2,x,y,z); } private static boolean teleportTo(EntityLivingBase entityLiving, double par1, double par3, double par5, double lastX, double lastY, double lastZ) @@ -248,9 +241,6 @@ public class SpellTeleport extends HomSpell double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2); } - -// this.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F); -// this.playSound("mob.endermen.portal", 1.0F, 1.0F); return true; } } @@ -262,8 +252,6 @@ public class SpellTeleport extends HomSpell if (entityLiving != null && entityLiving instanceof EntityPlayerMP) { EntityPlayerMP entityplayermp = (EntityPlayerMP) entityLiving; - - //if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == entityLiving.worldObj) if (entityplayermp.worldObj == entityLiving.worldObj) { EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, x, y, z, 5.0F); @@ -274,10 +262,7 @@ public class SpellTeleport extends HomSpell { entityLiving.mountEntity((Entity) null); } - entityLiving.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); -// this.getThrower().fallDistance = 0.0F; -// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java index 58450299..ee9bd426 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -12,11 +12,10 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; public class SpellWateryGrave extends HomSpell { @@ -26,7 +25,6 @@ public class SpellWateryGrave extends HomSpell { super(); this.setEnergies(250, 350, 500, 750); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -95,7 +93,6 @@ public class SpellWateryGrave extends HomSpell int d0 = 3; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); - //axisalignedbb.maxY = (double)this.worldObj.getHeight(); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -128,7 +125,6 @@ public class SpellWateryGrave extends HomSpell for (int i = 0; i < 20; i++) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F)); SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java index 0e9e831d..c3d23d48 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java @@ -1,21 +1,18 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import ibxm.Player; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; public class SpellWindGust extends HomSpell { @@ -25,7 +22,6 @@ public class SpellWindGust extends HomSpell { super(); this.setEnergies(300, 400, 300, 500); - //this.setCreativeTab(CreativeTabs.tabMisc); } @Override @@ -47,7 +43,6 @@ public class SpellWindGust extends HomSpell if (!par2World.isRemote) { - //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); par2World.spawnEntityInWorld(new WindGustProjectile(par2World, par3EntityPlayer, 8)); } @@ -77,7 +72,6 @@ public class SpellWindGust extends HomSpell double zCoord = par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance; float d0 = 0.5f; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX - 0.5 + Math.sin(yaw) * Math.cos(pitch) * (-distance), par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance, par3EntityPlayer.posZ - 0.5 + Math.cos(yaw) * Math.cos(pitch) * distance, par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance) + 0.5, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance + 1, par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance + 0.5).expand(d0, d0, d0); - //axisalignedbb.maxY = (double)this.worldObj.getHeight(); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -92,24 +86,15 @@ public class SpellWindGust extends HomSpell continue; } } - - //entityLiving.setFire(50); - //entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5*i); - //entityLiving.setVelocity(Math.sin(-yaw)*2, 2, Math.cos(yaw)*2); entityLiving.motionX = Math.sin(-yaw) * 2; entityLiving.motionY = 2; entityLiving.motionZ = Math.cos(yaw) * 2; - //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); } - - //par2World.createExplosion(par3EntityPlayer, xCoord, yCoord, zCoord, (float)(1), false); - for (int i = 0; i < 5; i++) { SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); } - return par1ItemStack; } @@ -139,11 +124,9 @@ public class SpellWindGust extends HomSpell par3EntityPlayer.motionX = vec.xCoord * wantedVelocity; par3EntityPlayer.motionY = vec.yCoord * wantedVelocity; par3EntityPlayer.motionZ = vec.zCoord * wantedVelocity; - //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(xVel, yVel, zVel), (Player) par3EntityPlayer); SpellHelper.setPlayerSpeedFromServer(par3EntityPlayer, xVel, yVel, zVel); par2World.playSoundEffect((double) ((float) par3EntityPlayer.posX + 0.5F), (double) ((float) par3EntityPlayer.posY + 0.5F), (double) ((float) par3EntityPlayer.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F); par3EntityPlayer.fallDistance = 0; - //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); double xCoord = par3EntityPlayer.posX; double yCoord = par3EntityPlayer.posY; double zCoord = par3EntityPlayer.posZ; @@ -173,7 +156,6 @@ public class SpellWindGust extends HomSpell int d0 = 3; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); - //axisalignedbb.maxY = (double)this.worldObj.getHeight(); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); double xCoord = par3EntityPlayer.posX; @@ -198,17 +180,10 @@ public class SpellWindGust extends HomSpell double posZDif = entityLiving.posZ - par3EntityPlayer.posZ; double distance2 = Math.pow(posXDif, 2) + Math.pow(posYDif, 2) + Math.pow(posZDif, 2); double distance = Math.sqrt(distance2); - //entityLiving.setVelocity(posXDif*wantedVel/distance, posYDif*wantedVel/distance, posZDif*wantedVel/distance); entityLiving.motionX = posXDif * wantedVel / distance; entityLiving.motionY = posYDif * wantedVel / distance; entityLiving.motionZ = posZDif * wantedVel / distance; - //entityLiving.setFire(50); - //entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5*i); - //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); } - - //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); - for (int i = 0; i < 20; i++) { SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningFallenAngel.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningFallenAngel.java index bade513d..ddee6676 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningFallenAngel.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningFallenAngel.java @@ -10,7 +10,6 @@ public class SummoningFallenAngel extends SummoningHelper public SummoningFallenAngel(int id) { super(id); - // TODO Auto-generated constructor stub } public EntityLivingBase getEntity(World worldObj) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningHelperAW.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningHelperAW.java index 8d615cf1..14e2c442 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningHelperAW.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/SummoningHelperAW.java @@ -1,28 +1,16 @@ package WayofTime.alchemicalWizardry.common.summoning; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.passive.EntityPig; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningHelper; import WayofTime.alchemicalWizardry.common.EntityAirElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.world.World; public class SummoningHelperAW extends SummoningHelper { - public SummoningHelperAW(int id) + public SummoningHelperAW(int id) { super(id); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java index 56a615e6..45cfd506 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java @@ -1,15 +1,15 @@ package WayofTime.alchemicalWizardry.common.summoning.meteor; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; public class MeteorParadigm { @@ -17,7 +17,7 @@ public class MeteorParadigm public ItemStack focusStack; public int radius; public static int maxChance = 1000; - + public static Random rand = new Random(); public MeteorParadigm(ItemStack focusStack, int radius) @@ -44,37 +44,37 @@ public class MeteorParadigm boolean hasCrystallos = false; boolean hasIncendium = false; boolean hasTennebrae = false; - - if(flags != null && flags.length >= 5) - { - hasTerrae = flags[0]; - hasOrbisTerrae = flags[1]; - hasCrystallos = flags[2]; - hasIncendium = flags[3]; - hasTennebrae = flags[4]; - } - - int newRadius = radius; - int chance = maxChance; - if(hasOrbisTerrae) - { - newRadius += 2; - chance += 200; - }else if(hasTerrae) - { - newRadius += 1; - chance += 100; - } - + if (flags != null && flags.length >= 5) + { + hasTerrae = flags[0]; + hasOrbisTerrae = flags[1]; + hasCrystallos = flags[2]; + hasIncendium = flags[3]; + hasTennebrae = flags[4]; + } + + int newRadius = radius; + int chance = maxChance; + + if (hasOrbisTerrae) + { + newRadius += 2; + chance += 200; + } else if (hasTerrae) + { + newRadius += 1; + chance += 100; + } + world.createExplosion(null, x, y, z, newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks); float iceChance = hasCrystallos ? 1 : 0; - float soulChance = hasIncendium ? 1 : 0; - float obsidChance = hasTennebrae ? 1 : 0; - - float totalChance = iceChance + soulChance + obsidChance; - + float soulChance = hasIncendium ? 1 : 0; + float obsidChance = hasTennebrae ? 1 : 0; + + float totalChance = iceChance + soulChance + obsidChance; + for (int i = -newRadius; i <= newRadius; i++) { for (int j = -newRadius; j <= newRadius; j++) @@ -114,44 +114,44 @@ public class MeteorParadigm if (!hasPlacedBlock) { - float randChance = rand.nextFloat() * totalChance; - - if(randChance < iceChance) - { - world.setBlock(x + i, y + j, z + k, Blocks.ice, 0, 3); - }else - { - randChance-=iceChance; - - if(randChance < soulChance) - { - switch(rand.nextInt(3)) - { - case 0: - world.setBlock(x + i, y + j, z + k, Blocks.soul_sand, 0, 3); - break; - case 1: - world.setBlock(x + i, y + j, z + k, Blocks.glowstone, 0, 3); - break; - case 2: - world.setBlock(x + i, y + j, z + k, Blocks.netherrack, 0, 3); - break; - } - }else - { - randChance-=soulChance; - - if(randChance < obsidChance) - { - world.setBlock(x + i, y + j, z + k, Blocks.obsidian, 0, 3); - }else - { - randChance-=obsidChance; - + float randChance = rand.nextFloat() * totalChance; + + if (randChance < iceChance) + { + world.setBlock(x + i, y + j, z + k, Blocks.ice, 0, 3); + } else + { + randChance -= iceChance; + + if (randChance < soulChance) + { + switch (rand.nextInt(3)) + { + case 0: + world.setBlock(x + i, y + j, z + k, Blocks.soul_sand, 0, 3); + break; + case 1: + world.setBlock(x + i, y + j, z + k, Blocks.glowstone, 0, 3); + break; + case 2: + world.setBlock(x + i, y + j, z + k, Blocks.netherrack, 0, 3); + break; + } + } else + { + randChance -= soulChance; + + if (randChance < obsidChance) + { + world.setBlock(x + i, y + j, z + k, Blocks.obsidian, 0, 3); + } else + { + randChance -= obsidChance; + world.setBlock(x + i, y + j, z + k, Blocks.stone, 0, 3); - } - } - } + } + } + } } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java index eb26421a..7deedd38 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java @@ -45,7 +45,7 @@ public class MeteorRegistry { ItemStack focusStack = paradigmList.get(i).focusStack; - if (focusStack != null && focusStack.getItem()== stack.getItem() && (focusStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || focusStack.getItemDamage() == stack.getItemDamage())) + if (focusStack != null && focusStack.getItem() == stack.getItem() && (focusStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || focusStack.getItemDamage() == stack.getItemDamage())) { return i; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicCalcinator.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicCalcinator.java index cdca4619..0cd9c5ac 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicCalcinator.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicCalcinator.java @@ -1,5 +1,12 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -10,258 +17,251 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class TEAlchemicCalcinator extends TEReagentConduit implements IInventory { - protected ItemStack[] inv; - protected ReagentContainer bufferTank = new ReagentContainer(Reagent.REAGENT_SIZE * 2); - - protected int bufferTransferRate = 20; - - private int lpPerTick = 10; - private int ticksPerReagent = 200; - - public int progress; - - public TEAlchemicCalcinator() - { - super(1, Reagent.REAGENT_SIZE * 4); - this.inv = new ItemStack[2]; - this.tickRate = 20; - this.maxConnextions = 1; - this.progress = 0; - } - - @Override - public void readFromNBT(NBTTagCompound tag) - { - super.readFromNBT(tag); - bufferTransferRate = tag.getInteger("bufferTransferRate"); - progress = tag.getInteger("progress"); - - NBTTagCompound bufferTankTag = tag.getCompoundTag("bufferTank"); - - this.bufferTank = ReagentContainer.readFromNBT(bufferTankTag); - - NBTTagList tagList = tag.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + protected ItemStack[] inv; + protected ReagentContainer bufferTank = new ReagentContainer(Reagent.REAGENT_SIZE * 2); + + protected int bufferTransferRate = 20; + + private int lpPerTick = 10; + private int ticksPerReagent = 200; + + public int progress; + + public TEAlchemicCalcinator() + { + super(1, Reagent.REAGENT_SIZE * 4); + this.inv = new ItemStack[2]; + this.tickRate = 20; + this.maxConnextions = 1; + this.progress = 0; + } + + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + bufferTransferRate = tag.getInteger("bufferTransferRate"); + progress = tag.getInteger("progress"); + + NBTTagCompound bufferTankTag = tag.getCompoundTag("bufferTank"); + + this.bufferTank = ReagentContainer.readFromNBT(bufferTankTag); + + NBTTagList tagList = tag.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound savedTag = (NBTTagCompound) tagList.getCompoundTagAt(i); - - if(savedTag.getBoolean("Empty")) + + if (savedTag.getBoolean("Empty")) { - inv[i] = null; - }else + inv[i] = null; + } else { inv[i] = ItemStack.loadItemStackFromNBT(savedTag); } } - } - - @Override - public void writeToNBT(NBTTagCompound tag) - { - super.writeToNBT(tag); - tag.setInteger("bufferTransferRate", bufferTransferRate); - tag.setInteger("progress", progress); - - NBTTagCompound bufferTankTag = new NBTTagCompound(); - - this.bufferTank.writeToNBT(bufferTankTag); - - tag.setTag("bufferTank", bufferTankTag); - - NBTTagList itemList = new NBTTagList(); + } - for (int i = 0; i < inv.length; i++) - { - ItemStack stack = inv[i]; - NBTTagCompound savedTag = new NBTTagCompound(); - - if (inv[i] != null) - { - inv[i].writeToNBT(savedTag); - }else - { - savedTag.setBoolean("Empty", true); - } - - itemList.appendTag(savedTag); - } + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + tag.setInteger("bufferTransferRate", bufferTransferRate); + tag.setInteger("progress", progress); - tag.setTag("Inventory", itemList); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - if(!worldObj.isRemote) - { - moveBufferToMain(); - tickProgress(); - } - } - - public void moveBufferToMain() - { - ReagentStack amountStack = this.bufferTank.drain(bufferTransferRate, false); - int drainAmount = this.fill(ForgeDirection.UNKNOWN, amountStack, false); - - if(drainAmount > 0) - { - ReagentStack drainedStack = this.bufferTank.drain(drainAmount, true); - this.fill(ForgeDirection.UNKNOWN, drainedStack, true); - } - } - - public void tickProgress() - { - ItemStack reagentItemStack = this.getStackInSlot(1); - if(reagentItemStack == null) - { - progress = 0; - return; - } - - ReagentStack possibleReagent = ReagentRegistry.getReagentStackForItem(reagentItemStack); - if(possibleReagent == null || !this.canReagentFitBuffer(possibleReagent)) - { - return; - } - - ItemStack orbStack = this.getStackInSlot(0); - if(orbStack == null || !(orbStack.getItem() instanceof IBloodOrb)) - { - return; - } - - if(!SoulNetworkHandler.canSyphonFromOnlyNetwork(orbStack, lpPerTick)) - { - SoulNetworkHandler.causeNauseaToPlayer(orbStack); - return; - } - - SoulNetworkHandler.syphonFromNetwork(orbStack, lpPerTick); - progress++; - - if (worldObj.getWorldTime() % 4 == 0) - { - SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); - } - - if(progress >= this.ticksPerReagent) - { - progress = 0; - this.bufferTank.fill(possibleReagent, true); - this.decrStackSize(1, 1); - } - } - - public boolean canReagentFitBuffer(ReagentStack stack) - { - int amount = this.bufferTank.fill(stack, false); + NBTTagCompound bufferTankTag = new NBTTagCompound(); - return amount >= stack.amount; - } - - @Override - public void readClientNBT(NBTTagCompound tag) - { - super.readClientNBT(tag); - - NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND); - - int size = tagList.tagCount(); - this.tanks = new ReagentContainer[size]; - - for(int i=0; i 0) + { + ReagentStack drainedStack = this.bufferTank.drain(drainAmount, true); + this.fill(ForgeDirection.UNKNOWN, drainedStack, true); + } + } + + public void tickProgress() + { + ItemStack reagentItemStack = this.getStackInSlot(1); + if (reagentItemStack == null) + { + progress = 0; + return; + } + + ReagentStack possibleReagent = ReagentRegistry.getReagentStackForItem(reagentItemStack); + if (possibleReagent == null || !this.canReagentFitBuffer(possibleReagent)) + { + return; + } + + ItemStack orbStack = this.getStackInSlot(0); + if (orbStack == null || !(orbStack.getItem() instanceof IBloodOrb)) + { + return; + } + + if (!SoulNetworkHandler.canSyphonFromOnlyNetwork(orbStack, lpPerTick)) + { + SoulNetworkHandler.causeNauseaToPlayer(orbStack); + return; + } + + SoulNetworkHandler.syphonFromNetwork(orbStack, lpPerTick); + progress++; + + if (worldObj.getWorldTime() % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (progress >= this.ticksPerReagent) + { + progress = 0; + this.bufferTank.fill(possibleReagent, true); + this.decrStackSize(1, 1); + } + } + + public boolean canReagentFitBuffer(ReagentStack stack) + { + int amount = this.bufferTank.fill(stack, false); + + return amount >= stack.amount; + } + + @Override + public void readClientNBT(NBTTagCompound tag) + { + super.readClientNBT(tag); + + NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND); + + int size = tagList.tagCount(); + this.tanks = new ReagentContainer[size]; + + for (int i = 0; i < size; i++) + { + NBTTagCompound savedTag = tagList.getCompoundTagAt(i); + this.tanks[i] = ReagentContainer.readFromNBT(savedTag); + } + + NBTTagList invTagList = tag.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < invTagList.tagCount(); i++) + { + NBTTagCompound savedTag = (NBTTagCompound) invTagList.getCompoundTagAt(i); + + if (savedTag.getBoolean("Empty")) + { + inv[i] = null; + } else + { + inv[i] = ItemStack.loadItemStackFromNBT(savedTag); + } + } + } + + @Override + public void writeClientNBT(NBTTagCompound tag) + { + super.writeClientNBT(tag); + + NBTTagList tagList = new NBTTagList(); + + for (int i = 0; i < this.tanks.length; i++) + { + NBTTagCompound savedTag = new NBTTagCompound(); + if (this.tanks[i] != null) + { + this.tanks[i].writeToNBT(savedTag); + } + tagList.appendTag(savedTag); + } + + tag.setTag("reagentTanks", tagList); + + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < inv.length; i++) + { + ItemStack stack = inv[i]; + NBTTagCompound savedTag = new NBTTagCompound(); + + if (inv[i] != null) + { + inv[i].writeToNBT(savedTag); + } else + { + savedTag.setBoolean("Empty", true); + } + + itemList.appendTag(savedTag); + } + + tag.setTag("Inventory", itemList); + } + + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeClientNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + super.onDataPacket(net, packet); + readClientNBT(packet.func_148857_g()); + } + + @Override public int getSizeInventory() { return inv.length; @@ -277,12 +277,12 @@ public class TEAlchemicCalcinator extends TEReagentConduit implements IInventory public void setInventorySlotContents(int slot, ItemStack stack) { inv[slot] = stack; - + if (stack != null && stack.stackSize > getInventoryStackLimit()) { stack.stackSize = getInventoryStackLimit(); } - + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @@ -345,32 +345,32 @@ public class TEAlchemicCalcinator extends TEReagentConduit implements IInventory { } - @Override - public String getInventoryName() - { - return "AlchemicCalcinator"; - } + @Override + public String getInventoryName() + { + return "AlchemicCalcinator"; + } - @Override - public boolean hasCustomInventoryName() - { - return false; - } + @Override + public boolean hasCustomInventoryName() + { + return false; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) - { - return true; - } - - @Override + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemStack) + { + return true; + } + + @Override public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) - { - if(doFill && !worldObj.isRemote) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - return super.fill(from, resource, doFill); - } + { + if (doFill && !worldObj.isRemote) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return super.fill(from, resource, doFill); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index 5ef267a6..a5599459 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -1,7 +1,15 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeComponent; +import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -18,33 +26,17 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidEvent; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import net.minecraftforge.fluids.IFluidTank; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; -import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeComponent; -import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraftforge.fluids.*; + +import java.util.List; public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFluidHandler, IBloodAltar { - public static final int sizeInv = 1; + public static final int sizeInv = 1; private ItemStack[] inv; private int resultID; private int resultDamage; private int upgradeLevel; - //public final LiquidTank tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME * 10); protected FluidStack fluid; public int capacity; private boolean isActive; @@ -66,7 +58,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui protected FluidStack fluidInput; private int progress; private int hasChanged = 0; - + private int lockdownDuration; public TEAltar() @@ -94,14 +86,14 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui public int getRSPowerOutput() { - return 5; + return 5; } - + @Override public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); - NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < tagList.tagCount(); i++) { @@ -327,13 +319,11 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui @Override public void openInventory() { - // TODO Auto-generated method stub } @Override public void closeInventory() { - // TODO Auto-generated method stub } //IFluidTank methods @@ -457,8 +447,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui if (fluidInput == null) { fluidInput = new FluidStack(resource, Math.min(bufferCapacity, resource.amount)); - - //The tile is never null, so we dont need this if (tile != null) { FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); @@ -483,7 +471,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui fluidInput.amount = bufferCapacity; } - //Never null, so not needed :P if (tile != null) { FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); @@ -518,7 +505,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui fluidOutput = null; } - //This is never null, so its un needed :D if (this != null) { FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluidOutput, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this)); @@ -542,30 +528,28 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui @Override public void updateEntity() { - //this.capacity=(int) (10000*this.capacityMultiplier); - if(this.lockdownDuration > 0) - { - this.lockdownDuration --; - } - + if (this.lockdownDuration > 0) + { + this.lockdownDuration--; + } + if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) { - //TODO - { - Block block = worldObj.getBlock(xCoord+1, yCoord, zCoord); - block.onNeighborBlockChange(worldObj, xCoord+1, yCoord, zCoord, block); - block = worldObj.getBlock(xCoord-1, yCoord, zCoord); - block.onNeighborBlockChange(worldObj, xCoord-1, yCoord, zCoord, block); - block = worldObj.getBlock(xCoord, yCoord+1, zCoord); - block.onNeighborBlockChange(worldObj, xCoord, yCoord+1, zCoord, block); - block = worldObj.getBlock(xCoord, yCoord-1, zCoord); - block.onNeighborBlockChange(worldObj, xCoord, yCoord-1, zCoord, block); - block = worldObj.getBlock(xCoord, yCoord, zCoord+1); - block.onNeighborBlockChange(worldObj, xCoord, yCoord, zCoord+1, block); - block = worldObj.getBlock(xCoord, yCoord, zCoord-1); - block.onNeighborBlockChange(worldObj, xCoord, yCoord, zCoord-1, block); - } - + { + Block block = worldObj.getBlock(xCoord + 1, yCoord, zCoord); + block.onNeighborBlockChange(worldObj, xCoord + 1, yCoord, zCoord, block); + block = worldObj.getBlock(xCoord - 1, yCoord, zCoord); + block.onNeighborBlockChange(worldObj, xCoord - 1, yCoord, zCoord, block); + block = worldObj.getBlock(xCoord, yCoord + 1, zCoord); + block.onNeighborBlockChange(worldObj, xCoord, yCoord + 1, zCoord, block); + block = worldObj.getBlock(xCoord, yCoord - 1, zCoord); + block.onNeighborBlockChange(worldObj, xCoord, yCoord - 1, zCoord, block); + block = worldObj.getBlock(xCoord, yCoord, zCoord + 1); + block.onNeighborBlockChange(worldObj, xCoord, yCoord, zCoord + 1, block); + block = worldObj.getBlock(xCoord, yCoord, zCoord - 1); + block.onNeighborBlockChange(worldObj, xCoord, yCoord, zCoord - 1, block); + } + int syphonMax = (int) (20 * this.dislocationMultiplier); int fluidInputted = 0; int fluidOutputted = 0; @@ -577,34 +561,34 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui fluidOutputted = Math.min(this.fluid.amount, fluidOutputted); this.fluidOutput.amount += fluidOutputted; this.fluid.amount -= fluidOutputted; - - if(AlchemicalWizardry.lockdownAltar) + + if (AlchemicalWizardry.lockdownAltar) { - List list = SpellHelper.getPlayersInRange(worldObj, xCoord+0.5, yCoord+0.5, zCoord+0.5, 15, 15); + List list = SpellHelper.getPlayersInRange(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 15, 15); boolean hasHighRegen = false; - for(EntityPlayer player : list) + for (EntityPlayer player : list) { - PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration); - if(regenEffect != null && regenEffect.getAmplifier() >= 2) - { - this.lockdownDuration += 20; - } - } - } - - if(AlchemicalWizardry.causeHungerWithRegen) - { - List list = SpellHelper.getPlayersInRange(worldObj, xCoord+0.5, yCoord+0.5, zCoord+0.5, 15, 15); - for(EntityPlayer player : list) - { - PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration); - if(regenEffect != null && regenEffect.getAmplifier() > 0) - { - player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier()*2 - 2)); - } - } + PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration); + if (regenEffect != null && regenEffect.getAmplifier() >= 2) + { + this.lockdownDuration += 20; + } + } } - } + + if (AlchemicalWizardry.causeHungerWithRegen) + { + List list = SpellHelper.getPlayersInRange(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 15, 15); + for (EntityPlayer player : list) + { + PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration); + if (regenEffect != null && regenEffect.getAmplifier() > 0) + { + player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier() * 2 - 2)); + } + } + } + } if (worldObj.getWorldTime() % 100 == 0) { @@ -627,32 +611,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui { return; } -// -// int range = 5; -// -// for(int i=-range; i<=range; i++) -// { -// for(int j=-range; j<=range; j++) -// { -// for(int k=-range; k<=range; k++) -// { -// Block block = worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k); -// int meta = worldObj.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); -// -// List list = block.getDrops(worldObj, xCoord + i, yCoord + j, zCoord + k, meta, 1); -// for(ItemStack stack : list) -// { -// String str = stack.getUnlocalizedName(); -// if(str.contains("fallenKanade")) -// { -// System.out.println("" + str); -// } -// } -// } -// } -// } - //o,o this is always true if (worldTime % 1 == 0) { if (!canBeFilled) @@ -669,8 +628,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui fluid.amount = fluid.amount - liquidDrained; progress += liquidDrained; - - //getStackInSlot(0).setItemDamage(getStackInSlot(0).getItemDamage() + liquidDrained); if (worldTime % 4 == 0) { @@ -681,28 +638,18 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui { ItemStack result = null; result = AltarRecipeRegistry.getItemForItemAndTier(this.getStackInSlot(0), this.upgradeLevel); - if(result!=null) + if (result != null) { - result.stackSize*=stackSize; + result.stackSize *= stackSize; } -// if (!isResultBlock) -// { -// result = new ItemStack(resultID, stackSize, resultDamage); -// } else -// { -// result = new ItemStack(Block.blocksList[resultID], stackSize, 0); -// } - setInventorySlotContents(0, result); progress = 0; for (int i = 0; i < 8; i++) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 4, xCoord+0.5f, yCoord+1.0f, zCoord+0.5f); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 4, xCoord + 0.5f, yCoord + 1.0f, zCoord + 0.5f); } - - //setInventorySlotContents(1, null); this.isActive = false; } } else if (progress > 0) @@ -737,8 +684,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui { return; } - - //EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(itemTag.getString("ownerName")); World world = MinecraftServer.getServer().worldServers[0]; LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); @@ -749,13 +694,9 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui } int currentEssence = data.currentEssence; -// if(owner==null){return;} -// NBTTagCompound playerTag = owner.getEntityData(); -// if(playerTag==null){return;} - //int currentEssence=playerTag.getInteger("currentEssence"); if (fluid != null && fluid.amount >= 1) - { + { int liquidDrained = Math.min((int) (upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount); if (liquidDrained > (item.getMaxEssence() * this.orbCapacityMultiplier - currentEssence)) @@ -769,36 +710,19 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui } fluid.amount = fluid.amount - liquidDrained; -// int maxAmount = (int) Math.min(item.getMaxEssence() - consumptionRate * (1 + consumptionMultiplier), consumptionRate * (1 + consumptionMultiplier)); -// fluid.amount -= maxAmount; data.currentEssence = liquidDrained + data.currentEssence; data.markDirty(); -// playerTag.setInteger("currentEssence", currentEssence+maxAmount); if (worldTime % 4 == 0) { - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 3)); SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 3, xCoord, yCoord, zCoord); } } } - if (worldObj != null) { worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } - - //AlchemicalWizardry.proxy.getClientWorld().markBlockForUpdate(xCoord, yCoord, zCoord); - //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 10, 1, getDescriptionPacket()); - /* - progress++; - - if(progress>=liquidRequired) - { - setActive(); - setInventorySlotContents(0, new ItemStack(AlchemicalWizardry.weakBloodOrb)); - } - */ } } @@ -814,14 +738,14 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui public void sacrificialDaggerCall(int amount, boolean isSacrifice) { - if(!isSacrifice && this.lockdownDuration > 0) - { - int amt = (int) Math.min(bufferCapacity - fluidInput.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount); - fluidInput.amount += amt; - }else - { + if (!isSacrifice && this.lockdownDuration > 0) + { + int amt = (int) Math.min(bufferCapacity - fluidInput.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount); + fluidInput.amount += amt; + } else + { fluid.amount += Math.min(capacity - fluid.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount); - } + } } @Override @@ -852,9 +776,9 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui } } - FluidStack flMain = new FluidStack(fluidData[0],fluidData[1]); - FluidStack flIn = new FluidStack(fluidData[2],fluidData[3]); - FluidStack flOut = new FluidStack(fluidData[4],fluidData[5]); + FluidStack flMain = new FluidStack(fluidData[0], fluidData[1]); + FluidStack flIn = new FluidStack(fluidData[2], fluidData[3]); + FluidStack flOut = new FluidStack(fluidData[4], fluidData[5]); this.setMainFluid(flMain); this.setInputFluid(flIn); @@ -910,15 +834,15 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui progress = 0; } - if(AltarRecipeRegistry.isRequiredItemValid(getStackInSlot(0), upgradeLevel)) + if (AltarRecipeRegistry.isRequiredItemValid(getStackInSlot(0), upgradeLevel)) { - AltarRecipe recipe = AltarRecipeRegistry.getAltarRecipeForItemAndTier(getStackInSlot(0), upgradeLevel); - this.isActive = true; - this.liquidRequired = recipe.getLiquidRequired(); - this.canBeFilled = recipe.getCanBeFilled(); - this.consumptionRate = recipe.getConsumptionRate(); - this.drainRate = recipe.drainRate; - return; + AltarRecipe recipe = AltarRecipeRegistry.getAltarRecipeForItemAndTier(getStackInSlot(0), upgradeLevel); + this.isActive = true; + this.liquidRequired = recipe.getLiquidRequired(); + this.canBeFilled = recipe.getCanBeFilled(); + this.consumptionRate = recipe.getConsumptionRate(); + this.drainRate = recipe.drainRate; + return; } isActive = false; @@ -966,7 +890,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui this.efficiencyMultiplier = (float) Math.pow(0.85, upgrades.getSpeedUpgrades()); this.sacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSacrificeUpgrades()); this.selfSacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSelfSacrificeUpgrades()); - this.capacityMultiplier = (float) ((1*Math.pow(1.10,upgrades.getBetterCapacitiveUpgrades()) + 0.20 * upgrades.getAltarCapacitiveUpgrades())); + this.capacityMultiplier = (float) ((1 * Math.pow(1.10, upgrades.getBetterCapacitiveUpgrades()) + 0.20 * upgrades.getAltarCapacitiveUpgrades())); //TODO finalize values this.dislocationMultiplier = (float) (Math.pow(1.2, upgrades.getDisplacementUpgrades())); this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades()); @@ -989,46 +913,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui } worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); -// for (int x = -1; x <= 1; x++) -// { -// for (int z = -1; z <= 1; z++) -// { -// if (!(x == 0 && z == 0)) -// { -// Block block = Block.blocksList[worldObj.getBlockId(xCoord + x, yCoord - 1, zCoord + z)]; -// -// if (!(block instanceof BloodRune)) -// { -// checkUpgrade = false; -// this.isUpgraded = false; -// return; -// } -// -// if ((z == 0 && (x == -1 || x == 1)) || (x == 0 && (z == -1 || z == 1))) -// { -// switch (((BloodRune)block).getRuneEffect()) -// { -// case 1: -// speedUpgrades++; -// -// case 2: -// efficiencyUpgrades++; -// -// case 3: -// sacrificeUpgrades++; -// -// case 4: -// selfSacrificeUpgrades++; -// } -// } -// } -// } -// } -// this.isUpgraded = checkUpgrade; -// this.consumptionMultiplier = (float)(0.20 * speedUpgrades); -// this.efficiencyMultiplier = (float)Math.pow(0.80, efficiencyUpgrades); -// this.sacrificeEfficiencyMultiplier = (float)(0.10 * sacrificeUpgrades); -// this.selfSacrificeEfficiencyMultiplier = (float)(0.10 * sacrificeUpgrades); } @Override @@ -1048,28 +932,9 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui resource = resource.copy(); int totalUsed = 0; - //TileTank tankToFill = getBottomTank(); int used = this.fill(resource, doFill); resource.amount -= used; totalUsed += used; - //FluidStack liquid = tankToFill.tank.getFluid(); -// if (liquid != null && liquid.amount > 0 && !liquid.isFluidEqual(resource)) -// { -// return 0; -// } -// while (tankToFill != null && resource.amount > 0) -// { -// int used = tankToFill.tank.fill(resource, doFill); -// resource.amount -= used; -// if (used > 0) -// { -// tankToFill.hasUpdate = true; -// } -// -// -// totalUsed += used; -// tankToFill = getTankAbove(tankToFill); -// } this.startCycle(); return totalUsed; } @@ -1099,7 +964,6 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui @Override public boolean canFill(ForgeDirection from, Fluid fluid) { - // TODO Auto-generated method stub //I changed this, since fluidstack != fluid... :p dunno if it was a accident? so you might wanna check this return this.fluidInput != null && this.fluid.getFluid().equals(fluidInput.getFluid()); } @@ -1107,14 +971,12 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - // TODO Auto-generated method stub return true; } @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - // TODO Auto-generated method stub FluidTank compositeTank = new FluidTank(capacity); compositeTank.setFluid(fluid); return new FluidTankInfo[]{compositeTank.getInfo()}; @@ -1122,37 +984,37 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui public int[] buildFluidList() { - int[] sortList = new int[6]; + int[] sortList = new int[6]; - if(this.fluid == null) - { - sortList[0] = AlchemicalWizardry.lifeEssenceFluid.getID(); - sortList[1] = 0; - }else - { - sortList[0] = this.fluid.fluidID; - sortList[1] = this.fluid.amount; - } + if (this.fluid == null) + { + sortList[0] = AlchemicalWizardry.lifeEssenceFluid.getID(); + sortList[1] = 0; + } else + { + sortList[0] = this.fluid.fluidID; + sortList[1] = this.fluid.amount; + } - if(this.fluidInput == null) - { - sortList[2] = AlchemicalWizardry.lifeEssenceFluid.getID(); - sortList[3] = 0; - }else - { - sortList[2] = this.fluidInput.fluidID; - sortList[3] = this.fluidInput.amount; - } + if (this.fluidInput == null) + { + sortList[2] = AlchemicalWizardry.lifeEssenceFluid.getID(); + sortList[3] = 0; + } else + { + sortList[2] = this.fluidInput.fluidID; + sortList[3] = this.fluidInput.amount; + } - if(this.fluidOutput == null) - { - sortList[4] = AlchemicalWizardry.lifeEssenceFluid.getID(); - sortList[5] = 0; - }else - { - sortList[4] = this.fluidOutput.fluidID; - sortList[5] = this.fluidOutput.amount; - } + if (this.fluidOutput == null) + { + sortList[4] = AlchemicalWizardry.lifeEssenceFluid.getID(); + sortList[5] = 0; + } else + { + sortList[4] = this.fluidOutput.fluidID; + sortList[5] = this.fluidOutput.amount; + } return sortList; } @@ -1166,14 +1028,14 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui public void sendMoreChatInfoToPlayer(EntityPlayer player) { - if(getStackInSlot(0) != null) - { - int stackSize = getStackInSlot(0).stackSize; + if (getStackInSlot(0) != null) + { + int stackSize = getStackInSlot(0).stackSize; player.addChatMessage(new ChatComponentText("Altar's Progress: " + progress + "LP/" + liquidRequired * stackSize + "LP")); - player.addChatMessage(new ChatComponentText("Consumption rate: " + (int)(consumptionRate * (1+consumptionMultiplier)) + "LP/t")); - } - player.addChatMessage(new ChatComponentText("Altar's Current Essence: " + this.fluid.amount + "LP")); - player.addChatMessage(new ChatComponentText(" Input tank: " + this.fluidInput.amount + "LP")); - player.addChatMessage(new ChatComponentText(" Output tank: " + this.fluidOutput.amount + "LP")); + player.addChatMessage(new ChatComponentText("Consumption rate: " + (int) (consumptionRate * (1 + consumptionMultiplier)) + "LP/t")); + } + player.addChatMessage(new ChatComponentText("Altar's Current Essence: " + this.fluid.amount + "LP")); + player.addChatMessage(new ChatComponentText(" Input tank: " + this.fluidInput.amount + "LP")); + player.addChatMessage(new ChatComponentText(" Output tank: " + this.fluidOutput.amount + "LP")); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBellJar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBellJar.java index 8db83a89..1126762a 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBellJar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBellJar.java @@ -1,158 +1,121 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -public class TEBellJar extends TEReagentConduit -{ - public TEBellJar() - { - super(1, 16000); - this.maxConnextions = 1; - this.affectedByRedstone = false; - } - - public int getRSPowerOutput() - { - ReagentContainer thisTank = this.tanks[0]; - if(thisTank != null) - { - ReagentStack stack = thisTank.getReagent(); - if(stack != null) - { - return (15*stack.amount/thisTank.getCapacity()); - } - } - return 0; - } - - public static ReagentContainerInfo[] getContainerInfoFromItem(ItemStack stack) - { - if(stack != null && stack.getItem() instanceof ItemBlock && ModBlocks.blockCrystalBelljar == ((ItemBlock)stack.getItem()).field_150939_a) - { - NBTTagCompound tag = stack.getTagCompound(); - if(tag != null) - { - NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND); - - int size = tagList.tagCount(); - ReagentContainer[] tanks = new ReagentContainer[size]; - - ReagentContainerInfo[] infos = new ReagentContainerInfo[size]; - - for(int i=0; i buildingList = new ArrayList(); - public Random rand = new Random(); - private GridSpace[][] area; - - private int negXRadius; //These variables indicate how much the grid has expanded from the 1x1 - private int posXRadius; //matrix in each direction - private int negZRadius; - private int posZRadius; - - private boolean isInitialized; - - public int houseCooldown; - public int roadCooldown; - public int tier; //Tier of the demon portal - Should select buildings 2 below to this - public int totalPoints; - - public int yLevelDestination; - public boolean hasLocationChanged; - - public TEDemonPortal() - { - super(); - - negXRadius = posXRadius = negZRadius = posZRadius = 1; - - area = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 1]; - for(int xIndex = -negXRadius; xIndex <= posXRadius; xIndex++) - { - for(int zIndex = -negZRadius; zIndex <= posZRadius; zIndex++) - { - if(Math.abs(xIndex) == 1 || Math.abs(zIndex) == 1) - { - this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD,4)); - }else - { - this.setGridSpace(xIndex, zIndex, new GridSpace()); - } - } - } - - isInitialized = false; - - this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); - - this.houseCooldown = 0; - this.roadCooldown = 0; - this.tier = 0; - - this.yLevelDestination = 0; - this.hasLocationChanged = false; - } - - public void initialize() - { - if(isInitialized) - { - return; - } - - for(int xIndex = -negXRadius; xIndex <= posXRadius; xIndex++) - { - for(int zIndex = -negZRadius; zIndex <= posZRadius; zIndex++) - { - if(Math.abs(xIndex) == 1 || Math.abs(zIndex) == 1) - { - this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD,yCoord)); - }else if(xIndex == 0 && zIndex == 0) - { - this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); - }else - { - this.setGridSpace(xIndex, zIndex, new GridSpace()); - } - } - } - - this.houseCooldown = TEDemonPortal.buildingGridDelay; - this.roadCooldown = TEDemonPortal.roadGridDelay; - - isInitialized = true; - } - - @Override - public void updateEntity() - { - if(!isInitialized) - { - return; - } - - if(this.hasLocationChanged) - { - if(this.changePortalLocation()) - { - return; - }else - { - this.hasLocationChanged = false; - } - } - - if(this.roadCooldown <= 0) - { - int roadsMade = this.createRandomRoad(); - if(roadsMade > 0) - { - this.roadCooldown = TEDemonPortal.roadGridDelay * roadsMade; - this.totalPoints += this.roadCooldown; - } - } - else if(this.houseCooldown <= 0) - { - int gridsUsed = this.createRandomBuilding(0, 0); - if(gridsUsed > 0) - { - this.houseCooldown = TEDemonPortal.buildingGridDelay * gridsUsed; - this.totalPoints += this.houseCooldown; - } - } - - if(this.tier < this.tierCostList.length && this.totalPoints > this.tierCostList[this.tier]) - { - this.tier++; + public static int buildingGridDelay = 25; + public static int roadGridDelay = 10; - if(this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, tier+1) >= 1) - { - } - } - - this.houseCooldown = Math.max(0, this.houseCooldown - 1); //Current dummy implementation of the increasing costs - this.roadCooldown = Math.max(0, this.roadCooldown - 1); - } - - @Override + public static int[] tierCostList = new int[]{1000, 50000}; + + public static List buildingList = new ArrayList(); + public Random rand = new Random(); + private GridSpace[][] area; + + private int negXRadius; //These variables indicate how much the grid has expanded from the 1x1 + private int posXRadius; //matrix in each direction + private int negZRadius; + private int posZRadius; + + private boolean isInitialized; + + public int houseCooldown; + public int roadCooldown; + public int tier; //Tier of the demon portal - Should select buildings 2 below to this + public int totalPoints; + + public int yLevelDestination; + public boolean hasLocationChanged; + + public TEDemonPortal() + { + super(); + + negXRadius = posXRadius = negZRadius = posZRadius = 1; + + area = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 1]; + for (int xIndex = -negXRadius; xIndex <= posXRadius; xIndex++) + { + for (int zIndex = -negZRadius; zIndex <= posZRadius; zIndex++) + { + if (Math.abs(xIndex) == 1 || Math.abs(zIndex) == 1) + { + this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD, 4)); + } else + { + this.setGridSpace(xIndex, zIndex, new GridSpace()); + } + } + } + + isInitialized = false; + + this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); + + this.houseCooldown = 0; + this.roadCooldown = 0; + this.tier = 0; + + this.yLevelDestination = 0; + this.hasLocationChanged = false; + } + + public void initialize() + { + if (isInitialized) + { + return; + } + + for (int xIndex = -negXRadius; xIndex <= posXRadius; xIndex++) + { + for (int zIndex = -negZRadius; zIndex <= posZRadius; zIndex++) + { + if (Math.abs(xIndex) == 1 || Math.abs(zIndex) == 1) + { + this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD, yCoord)); + } else if (xIndex == 0 && zIndex == 0) + { + this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); + } else + { + this.setGridSpace(xIndex, zIndex, new GridSpace()); + } + } + } + + this.houseCooldown = TEDemonPortal.buildingGridDelay; + this.roadCooldown = TEDemonPortal.roadGridDelay; + + isInitialized = true; + } + + @Override + public void updateEntity() + { + if (!isInitialized) + { + return; + } + + if (this.hasLocationChanged) + { + if (this.changePortalLocation()) + { + return; + } else + { + this.hasLocationChanged = false; + } + } + + if (this.roadCooldown <= 0) + { + int roadsMade = this.createRandomRoad(); + if (roadsMade > 0) + { + this.roadCooldown = TEDemonPortal.roadGridDelay * roadsMade; + this.totalPoints += this.roadCooldown; + } + } else if (this.houseCooldown <= 0) + { + int gridsUsed = this.createRandomBuilding(0, 0); + if (gridsUsed > 0) + { + this.houseCooldown = TEDemonPortal.buildingGridDelay * gridsUsed; + this.totalPoints += this.houseCooldown; + } + } + + if (this.tier < this.tierCostList.length && this.totalPoints > this.tierCostList[this.tier]) + { + this.tier++; + + if (this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, tier + 1) >= 1) + { + } + } + + this.houseCooldown = Math.max(0, this.houseCooldown - 1); //Current dummy implementation of the increasing costs + this.roadCooldown = Math.max(0, this.roadCooldown - 1); + } + + @Override public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); @@ -184,33 +169,33 @@ public class TEDemonPortal extends TileEntity this.posZRadius = par1NBTTagCompound.getInteger("posZRadius"); this.houseCooldown = par1NBTTagCompound.getInteger("houseCooldown"); this.roadCooldown = par1NBTTagCompound.getInteger("roadCooldown"); - + area = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 1]; - - NBTTagList tagList = par1NBTTagCompound.getTagList("Grid",Constants.NBT.TAG_COMPOUND); + + NBTTagList tagList = par1NBTTagCompound.getTagList("Grid", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < tagList.tagCount(); i++) { - int length = (negZRadius+posZRadius+1); - - int x = i/length; - int z = i%length; - + int length = (negZRadius + posZRadius + 1); + + int x = i / length; + int z = i % length; + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); GridSpace space = GridSpace.getGridFromTag(tag); - + area[x][z] = space; } - + this.isInitialized = par1NBTTagCompound.getBoolean("init"); - + this.tier = par1NBTTagCompound.getInteger("tier"); this.totalPoints = par1NBTTagCompound.getInteger("totalPoints"); this.yLevelDestination = par1NBTTagCompound.getInteger("yLevelDestination"); this.hasLocationChanged = par1NBTTagCompound.getBoolean("hasLocationChanged"); } - - @Override + + @Override public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); @@ -223,1037 +208,1011 @@ public class TEDemonPortal extends TileEntity NBTTagList gridList = new NBTTagList(); - for(int i=0; i<=negXRadius+posXRadius; i++) + for (int i = 0; i <= negXRadius + posXRadius; i++) { - for(int j=0; j<=negZRadius+posZRadius; j++) - { - int index = i + (negZRadius+posZRadius+1)*j; - - GridSpace space = area[i][j]; - NBTTagCompound nextTag; - - if(space == null) - { - nextTag = new GridSpace().getTag(); - }else - { - nextTag = space.getTag(); - } - - gridList.appendTag(nextTag); - } + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + int index = i + (negZRadius + posZRadius + 1) * j; + + GridSpace space = area[i][j]; + NBTTagCompound nextTag; + + if (space == null) + { + nextTag = new GridSpace().getTag(); + } else + { + nextTag = space.getTag(); + } + + gridList.appendTag(nextTag); + } } par1NBTTagCompound.setTag("Grid", gridList); - + par1NBTTagCompound.setBoolean("init", this.isInitialized); par1NBTTagCompound.setInteger("tier", this.tier); par1NBTTagCompound.setInteger("totalPoints", this.totalPoints); par1NBTTagCompound.setInteger("yLevelDestination", this.yLevelDestination); par1NBTTagCompound.setBoolean("hasLocationChanged", this.hasLocationChanged); } - - public int createRandomRoad() //Return the number of road spaces - { - int next = rand.nextInt(4); - ForgeDirection dir; - - switch(next) - { - case 0: - dir = ForgeDirection.NORTH; - break; - case 1: - dir = ForgeDirection.SOUTH; - break; - case 2: - dir = ForgeDirection.EAST; - break; - case 3: - dir = ForgeDirection.WEST; - break; - default: - dir = ForgeDirection.NORTH; - } - - int length = 5; - - Int3 road = findRoadSpaceFromDirection(dir, (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius))+1); - - int x = road.xCoord; - int yLevel = road.yCoord; - int z = road.zCoord; - - System.out.println("X: " + x + " Z: " + z + " Direction: " + dir.toString()); - - List directions = this.findValidExtentionDirection(x, z); - - if(directions.size() <= 0) - { - return 0; - } - - int maxDistance = 5; - - int distance = 0; - ForgeDirection dominantDirection = null; - - for(ForgeDirection direction: directions) - { - int amt = this.getLength(direction, maxDistance, x, z); - if(amt > distance) - { - distance = amt; - dominantDirection = direction; - }else if(amt == distance && rand.nextBoolean()) - { - dominantDirection = direction; - } - } - - if(dominantDirection == null) - { - return 0; - } - System.out.println("I got here!"); - System.out.println("Distance: " + distance + " Direction: " + dominantDirection.toString() + " yLevel: " + yLevel); - - this.createGriddedRoad(x, yLevel, z, dominantDirection, distance+1, true); - - return distance; - } - - public List findValidExtentionDirection(int x, int z) - { - List directions = new LinkedList(); - - if(this.getGridSpace(x, z) == null || !this.getGridSpace(x, z).isRoadSegment()) - { - return directions; - } - - GridSpace nextGrid = this.getGridSpace(x+1, z); - if(nextGrid.isEmpty()) - { - directions.add(ForgeDirection.EAST); - } - - nextGrid = this.getGridSpace(x-1, z); - if(nextGrid.isEmpty()) - { - directions.add(ForgeDirection.WEST); - } - - nextGrid = this.getGridSpace(x, z+1); - if(nextGrid.isEmpty()) - { - directions.add(ForgeDirection.SOUTH); - } - - nextGrid = this.getGridSpace(x, z-1); - if(nextGrid.isEmpty()) - { - directions.add(ForgeDirection.NORTH); - } - - return directions; - } - - public int getLength(ForgeDirection dir, int maxLength, int x, int z) //Number of spaces forward - { - for(int i=1; i<=maxLength; i++) - { - GridSpace space = this.getGridSpace(x + i*dir.offsetX, z + i*dir.offsetZ); - if(space.isEmpty()) - { - for(int k=1; k<=this.getRoadSpacer(); k++) - { - GridSpace space1 = this.getGridSpace(x + i*dir.offsetX + dir.offsetZ*k, z + i*dir.offsetZ + dir.offsetX*k); - GridSpace space2 = this.getGridSpace(x + i*dir.offsetX - dir.offsetZ*k, z + i*dir.offsetZ - dir.offsetX*k); - if(space1.isRoadSegment() || space2.isRoadSegment()) - { - return i-1; - } - } - - continue; - } - if(space.isRoadSegment()) - { - return i; - }else - { - return i-1; - } - } - return maxLength; - } - - public Int3 findRoadSpaceFromDirection(ForgeDirection dir, int amount) - { - int index = 0; - if(dir == ForgeDirection.NORTH) - { - System.out.print("NORTH!"); - for(int i=0; i<= negZRadius + posZRadius; i++) - { - for(int j=0; j<= negXRadius + posXRadius; j++) - { - GridSpace space = area[j][i]; - if(space.isRoadSegment()) - { - index++; - if(index >= amount) - { - return new Int3(j-negXRadius,space.getYLevel(),i-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.SOUTH) - { - for(int i=negZRadius + posZRadius; i >= 0 ; i--) - { - for(int j=0; j<= negXRadius + posXRadius; j++) - { - GridSpace space = area[j][i]; - if(space.isRoadSegment()) - { - index++; - if(index >= amount) - { - return new Int3(j-negXRadius,space.getYLevel(),i-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.EAST) - { - for(int i=negXRadius + posXRadius; i >= 0; i--) - { - for(int j=0; j <= negZRadius + posZRadius ; j++) - { - GridSpace space = area[i][j]; - if(space.isRoadSegment()) - { - index++; - if(index >= amount) - { - return new Int3(i-negXRadius,space.getYLevel(),j-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.WEST) - { - for(int i=0; i <= negXRadius + posXRadius; i++) - { - for(int j=0; j <= negZRadius + posZRadius ; j++) - { - GridSpace space = area[i][j]; - if(space.isRoadSegment()) - { - index++; - if(index >= amount) - { - return new Int3(i-negXRadius,space.getYLevel(),j-negZRadius); - } - } - } - } - } - - return new Int3(0,0,0); - } - - public Int3 findEmptySpaceNearRoad(ForgeDirection dir, int amount, int closeness) - { - int index = 0; - if(dir == ForgeDirection.NORTH) - { - System.out.print("NORTH!"); - for(int i=0; i<= negZRadius + posZRadius; i++) - { - for(int j=0; j<= negXRadius + posXRadius; j++) - { - GridSpace space = area[j][i]; - if(space.isEmpty()) - { - int yLevel = this.findNearestRoadYLevel(j-negXRadius, i-negZRadius, closeness); - if(yLevel == -1) - { - continue; - } - index++; - if(index >= amount) - { - return new Int3(j-negXRadius,yLevel,i-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.SOUTH) - { - for(int i=negZRadius + posZRadius; i >= 0 ; i--) - { - for(int j=0; j<= negXRadius + posXRadius; j++) - { - GridSpace space = area[j][i]; - int yLevel = this.findNearestRoadYLevel(j-negXRadius, i-negZRadius, closeness); - if(yLevel == -1) - { - continue; - } - if(space.isEmpty()) - { - index++; - if(index >= amount) - { - return new Int3(j-negXRadius,yLevel,i-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.EAST) - { - for(int i=negXRadius + posXRadius; i >= 0; i--) - { - for(int j=0; j <= negZRadius + posZRadius ; j++) - { - GridSpace space = area[i][j]; - int yLevel = this.findNearestRoadYLevel(i-negXRadius, j-negZRadius, closeness); - if(yLevel == -1) - { - continue; - } - if(space.isEmpty()) - { - index++; - if(index >= amount) - { - return new Int3(i-negXRadius,yLevel,j-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.WEST) - { - for(int i=0; i <= negXRadius + posXRadius; i++) - { - for(int j=0; j <= negZRadius + posZRadius ; j++) - { - GridSpace space = area[i][j]; - int yLevel = this.findNearestRoadYLevel(i-negXRadius, j-negZRadius, closeness); - if(yLevel == -1) - { - continue; - } - if(space.isEmpty()) - { - index++; - if(index >= amount) - { - return new Int3(i-negXRadius,yLevel,j-negZRadius); - } - } - } - } - } - - return new Int3(0,0,0); - } - - public Int3 findEmptySpaceFromDirection(ForgeDirection dir, int amount) - { - int index = 0; - if(dir == ForgeDirection.NORTH) - { - System.out.print("NORTH!"); - for(int i=0; i<= negZRadius + posZRadius; i++) - { - for(int j=0; j<= negXRadius + posXRadius; j++) - { - GridSpace space = area[j][i]; - if(space.isEmpty()) - { - index++; - if(index >= amount) - { - return new Int3(j-negXRadius,space.getYLevel(),i-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.SOUTH) - { - for(int i=negZRadius + posZRadius; i >= 0 ; i--) - { - for(int j=0; j<= negXRadius + posXRadius; j++) - { - GridSpace space = area[j][i]; - if(space.isEmpty()) - { - index++; - if(index >= amount) - { - return new Int3(j-negXRadius,space.getYLevel(),i-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.EAST) - { - for(int i=negXRadius + posXRadius; i >= 0; i--) - { - for(int j=0; j <= negZRadius + posZRadius ; j++) - { - GridSpace space = area[i][j]; - if(space.isEmpty()) - { - index++; - if(index >= amount) - { - return new Int3(i-negXRadius,space.getYLevel(),j-negZRadius); - } - } - } - } - }else if(dir == ForgeDirection.WEST) - { - for(int i=0; i <= negXRadius + posXRadius; i++) - { - for(int j=0; j <= negZRadius + posZRadius ; j++) - { - GridSpace space = area[i][j]; - if(space.isEmpty()) - { - index++; - if(index >= amount) - { - return new Int3(i-negXRadius,space.getYLevel(),j-negZRadius); - } - } - } - } - } - - return new Int3(0,0,0); - } - - public void createGriddedRoad(int gridXi, int yi, int gridZi, ForgeDirection dir, int gridLength, boolean convertStarter) //Total grid length - { - if(gridLength == 0 || gridLength == 1) - { - return; - } - - if(convertStarter) - { - - } - - int initGridX = gridXi; - int initGridZ = gridZi; - int initY = yi; - - if(convertStarter) - { - this.setGridSpace(initGridX, initGridZ, new GridSpace(GridSpace.CROSSROAD,initY)); - - DemonCrosspath crosspath = new DemonCrosspath(xCoord + initGridX*5, initY, zCoord + initGridZ*5); - crosspath.createCrosspath(worldObj); - } - - for(int index=0; index posXRadius|| x < -negXRadius || z > posZRadius || z < -negZRadius) - { - return new GridSpace(); - }else - { - return (area[x + negXRadius][z + negZRadius]); - } - } - - public void setGridSpace(int x, int z, GridSpace space) - { - if(x > posXRadius) - { - this.expandAreaInPosX(); - this.setGridSpace(x, z, space); - return; - }else if(x < -negXRadius) - { - this.expandAreaInNegX(); - this.setGridSpace(x, z, space); - return; - }else if(z > posZRadius) - { - this.expandAreaInPosZ(); - this.setGridSpace(x, z, space); - return; - }else if(z < -negZRadius) - { - this.expandAreaInNegZ(); - this.setGridSpace(x, z, space); - return; - }else - { - area[x + negXRadius][z + negZRadius] = space; - } - } - - public void rightClickBlock(EntityPlayer player, int side) - { - if(worldObj.isRemote) - { - return; - } - - this.initialize(); - - if(ForgeDirection.getOrientation(side) == ForgeDirection.UP) - { - this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0); - }else if(ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) - { - this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0); - }else - { - this.createRandomRoad(); - } - } - - public int createRandomBuilding(int type, int tier) - { - switch(type) - { - case DemonBuilding.BUILDING_HOUSE: - return this.createRandomHouse(tier); - case DemonBuilding.BUILDING_PORTAL: - return this.createPortalBuilding(tier); - } - - return 0; - } - - public int createPortalBuilding(int buildingTier) - { - int x = 0; - int z = 0; - - GridSpace home = this.getGridSpace(x, z); - int yLevel = home.getYLevel(); - - GridSpaceHolder grid = this.createGSH(); - - List directions = new ArrayList(); - - for(int i=2; i<6; i++) - { - ForgeDirection testDir = ForgeDirection.getOrientation(i); - //if(this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty()) - { - directions.add(testDir); - } - } - - if(directions.isEmpty()) - { - return 0; - } - - HashMap> schemMap = new HashMap(); - - for(ForgeDirection nextDir : directions) - { - for(DemonBuilding build : TEDemonPortal.buildingList) - { - if(build.buildingType != DemonBuilding.BUILDING_PORTAL) - { - continue; - } - if(schemMap.containsKey(nextDir)) - { - schemMap.get(nextDir).add(build); - }else - { - schemMap.put(nextDir, new ArrayList()); - schemMap.get(nextDir).add(build); - } - } - } - - if(schemMap.keySet().isEmpty()) - { - return 0; - } - - ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; - DemonBuilding build = schemMap.get(chosenDirection).get(new Random().nextInt(schemMap.get(chosenDirection).size())); - - build.destroyAllInField(worldObj, xCoord + (x)*5, yLevel, zCoord + (z)*5, chosenDirection.getOpposite()); - - Int3 portalSpace = build.getDoorSpace(chosenDirection); - int yOffset = portalSpace.yCoord; - - //TODO - -// for(int i=0; i<256; i++) -// { -// Block block = worldObj.getBlock(xCoord + (x)*5, i, zCoord + (z)*5); -// if(block == ModBlocks.blockDemonPortal) -// { -// BlockTeleposer.swapBlocks(worldObj, worldObj, xCoord, i, zCoord, xCoord, yLevel + yOffset, zCoord); -// break; -// } -// } - - build.buildAll(worldObj, xCoord + (x)*5, yLevel, zCoord + (z)*5, chosenDirection.getOpposite()); - build.setAllGridSpaces(x, z, yLevel, chosenDirection.getOpposite(), GridSpace.MAIN_PORTAL, grid); - this.loadGSH(grid); - - return build.getNumberOfGridSpaces(); - } - - public int createRandomHouse(int buildingTier) - { - int next = rand.nextInt(4); - ForgeDirection dir; - - switch(next) - { - case 0: - dir = ForgeDirection.NORTH; - break; - case 1: - dir = ForgeDirection.SOUTH; - break; - case 2: - dir = ForgeDirection.EAST; - break; - case 3: - dir = ForgeDirection.WEST; - break; - default: - dir = ForgeDirection.NORTH; - } - - boolean newProtocol = true; - - if(newProtocol) - { - Int3 space = this.findRoadSpaceFromDirection(dir, 1*(rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius))+1); - - int x = space.xCoord; - int z = space.zCoord; - int yLevel = space.yCoord; - - System.out.println("Road space - x: " + x + " z: " + z); - - GridSpaceHolder grid = this.createGSH(); - - if(!this.getGridSpace(x, z).isRoadSegment()) - { - return 0; - } - - List directions = new ArrayList(); - - for(int i=2; i<6; i++) - { - ForgeDirection testDir = ForgeDirection.getOrientation(i); - if(this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty()) - { - directions.add(testDir); - } - } - - if(directions.isEmpty()) - { - return 0; - } - - HashMap> schemMap = new HashMap(); - - for(ForgeDirection nextDir : directions) - { - for(DemonBuilding build : TEDemonPortal.buildingList) - { - if(build.buildingTier != buildingTier || build.buildingType != DemonBuilding.BUILDING_HOUSE) - { - continue; - } - Int3 offsetSpace = build.getGridOffsetFromRoad(nextDir, yLevel); - int xOff = offsetSpace.xCoord; - int zOff = offsetSpace.zCoord; - - if(build.isValid(grid, x + xOff, z + zOff, nextDir.getOpposite())) - { - if(schemMap.containsKey(nextDir)) - { - schemMap.get(nextDir).add(build); - }else - { - schemMap.put(nextDir, new ArrayList()); - schemMap.get(nextDir).add(build); - } - }else - { - System.out.println("This ISN'T valid!"); - } - } - } - - if(schemMap.keySet().isEmpty()) - { - return 0; - } - - ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; - DemonBuilding build = schemMap.get(chosenDirection).get(new Random().nextInt(schemMap.get(chosenDirection).size())); - - Int3 offsetSpace = build.getGridOffsetFromRoad(chosenDirection, yLevel); - int xOff = offsetSpace.xCoord; - int zOff = offsetSpace.zCoord; - - build.destroyAllInField(worldObj, xCoord + (x + xOff)*5, yLevel, zCoord + (z + zOff)*5, chosenDirection.getOpposite()); - build.buildAll(worldObj, xCoord + (x + xOff)*5, yLevel, zCoord + (z + zOff)*5, chosenDirection.getOpposite()); - build.setAllGridSpaces(x + xOff, z + zOff, yLevel, chosenDirection.getOpposite(), GridSpace.HOUSE, grid); - this.loadGSH(grid); - - return build.getNumberOfGridSpaces(); - }else - { - Int3 space = findEmptySpaceNearRoad(dir, 3*(rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius))+1, 2); - - int x = space.xCoord; - int z = space.zCoord; - int yLevel = space.yCoord; - - GridSpace newSpace = this.getGridSpace(x, z); - if(!newSpace.isEmpty()) - { - return 0; - } - - if(yLevel == -1) - { - return 0; - } - - GridSpaceHolder grid = this.createGSH(); - - ForgeDirection chosenDirection = ForgeDirection.NORTH; - - HashMap> bigList = new HashMap(); - - for(DemonBuilding build : TEDemonPortal.buildingList) - { - for(int i=2; i<6; i++) - { - chosenDirection = ForgeDirection.getOrientation(i); - System.out.println("" + chosenDirection.toString()); - if(build.isValid(grid, x, z, chosenDirection)) - { - System.out.println("Valid!"); - if(bigList.containsKey(chosenDirection)) - { - bigList.get(chosenDirection).add(build); - }else - { - bigList.put(chosenDirection, new ArrayList()); - bigList.get(chosenDirection).add(build); - } - } - } - } - - chosenDirection = ForgeDirection.getOrientation(new Random().nextInt(4) + 2); //Change to favour a direction with a road nearby - - List buildingList = bigList.get(chosenDirection); - DemonBuilding build; - - if(buildingList != null && buildingList.size() > 0) - { - build = buildingList.get(new Random().nextInt(buildingList.size())); - }else - { - return 0; - } - //TODO: Finish the selection algorythm - //TODO: Should favour those directions that have a road right next to them. - - build.buildAll(worldObj, xCoord + x*5, yLevel, zCoord + z*5, chosenDirection); - build.setAllGridSpaces(x, z, yLevel, chosenDirection, GridSpace.HOUSE, grid); - this.loadGSH(grid); - - return build.getNumberOfGridSpaces(); + public int createRandomRoad() //Return the number of road spaces + { + int next = rand.nextInt(4); + ForgeDirection dir; + + switch (next) + { + case 0: + dir = ForgeDirection.NORTH; + break; + case 1: + dir = ForgeDirection.SOUTH; + break; + case 2: + dir = ForgeDirection.EAST; + break; + case 3: + dir = ForgeDirection.WEST; + break; + default: + dir = ForgeDirection.NORTH; + } + + int length = 5; + + Int3 road = findRoadSpaceFromDirection(dir, (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1); + + int x = road.xCoord; + int yLevel = road.yCoord; + int z = road.zCoord; + + System.out.println("X: " + x + " Z: " + z + " Direction: " + dir.toString()); + + List directions = this.findValidExtentionDirection(x, z); + + if (directions.size() <= 0) + { + return 0; + } + + int maxDistance = 5; + + int distance = 0; + ForgeDirection dominantDirection = null; + + for (ForgeDirection direction : directions) + { + int amt = this.getLength(direction, maxDistance, x, z); + if (amt > distance) + { + distance = amt; + dominantDirection = direction; + } else if (amt == distance && rand.nextBoolean()) + { + dominantDirection = direction; + } + } + + if (dominantDirection == null) + { + return 0; + } + System.out.println("I got here!"); + System.out.println("Distance: " + distance + " Direction: " + dominantDirection.toString() + " yLevel: " + yLevel); + + this.createGriddedRoad(x, yLevel, z, dominantDirection, distance + 1, true); + + return distance; + } + + public List findValidExtentionDirection(int x, int z) + { + List directions = new LinkedList(); + + if (this.getGridSpace(x, z) == null || !this.getGridSpace(x, z).isRoadSegment()) + { + return directions; + } + + GridSpace nextGrid = this.getGridSpace(x + 1, z); + if (nextGrid.isEmpty()) + { + directions.add(ForgeDirection.EAST); + } + + nextGrid = this.getGridSpace(x - 1, z); + if (nextGrid.isEmpty()) + { + directions.add(ForgeDirection.WEST); + } + + nextGrid = this.getGridSpace(x, z + 1); + if (nextGrid.isEmpty()) + { + directions.add(ForgeDirection.SOUTH); + } + + nextGrid = this.getGridSpace(x, z - 1); + if (nextGrid.isEmpty()) + { + directions.add(ForgeDirection.NORTH); + } + + return directions; + } + + public int getLength(ForgeDirection dir, int maxLength, int x, int z) //Number of spaces forward + { + for (int i = 1; i <= maxLength; i++) + { + GridSpace space = this.getGridSpace(x + i * dir.offsetX, z + i * dir.offsetZ); + if (space.isEmpty()) + { + for (int k = 1; k <= this.getRoadSpacer(); k++) + { + GridSpace space1 = this.getGridSpace(x + i * dir.offsetX + dir.offsetZ * k, z + i * dir.offsetZ + dir.offsetX * k); + GridSpace space2 = this.getGridSpace(x + i * dir.offsetX - dir.offsetZ * k, z + i * dir.offsetZ - dir.offsetX * k); + + if (space1.isRoadSegment() || space2.isRoadSegment()) + { + return i - 1; + } + } + + continue; + } + if (space.isRoadSegment()) + { + return i; + } else + { + return i - 1; + } + } + return maxLength; + } + + public Int3 findRoadSpaceFromDirection(ForgeDirection dir, int amount) + { + int index = 0; + if (dir == ForgeDirection.NORTH) + { + System.out.print("NORTH!"); + for (int i = 0; i <= negZRadius + posZRadius; i++) + { + for (int j = 0; j <= negXRadius + posXRadius; j++) + { + GridSpace space = area[j][i]; + if (space.isRoadSegment()) + { + index++; + if (index >= amount) + { + return new Int3(j - negXRadius, space.getYLevel(), i - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.SOUTH) + { + for (int i = negZRadius + posZRadius; i >= 0; i--) + { + for (int j = 0; j <= negXRadius + posXRadius; j++) + { + GridSpace space = area[j][i]; + if (space.isRoadSegment()) + { + index++; + if (index >= amount) + { + return new Int3(j - negXRadius, space.getYLevel(), i - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.EAST) + { + for (int i = negXRadius + posXRadius; i >= 0; i--) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + GridSpace space = area[i][j]; + if (space.isRoadSegment()) + { + index++; + if (index >= amount) + { + return new Int3(i - negXRadius, space.getYLevel(), j - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.WEST) + { + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + GridSpace space = area[i][j]; + if (space.isRoadSegment()) + { + index++; + if (index >= amount) + { + return new Int3(i - negXRadius, space.getYLevel(), j - negZRadius); + } + } + } + } + } + + return new Int3(0, 0, 0); + } + + public Int3 findEmptySpaceNearRoad(ForgeDirection dir, int amount, int closeness) + { + int index = 0; + if (dir == ForgeDirection.NORTH) + { + System.out.print("NORTH!"); + for (int i = 0; i <= negZRadius + posZRadius; i++) + { + for (int j = 0; j <= negXRadius + posXRadius; j++) + { + GridSpace space = area[j][i]; + if (space.isEmpty()) + { + int yLevel = this.findNearestRoadYLevel(j - negXRadius, i - negZRadius, closeness); + if (yLevel == -1) + { + continue; + } + index++; + if (index >= amount) + { + return new Int3(j - negXRadius, yLevel, i - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.SOUTH) + { + for (int i = negZRadius + posZRadius; i >= 0; i--) + { + for (int j = 0; j <= negXRadius + posXRadius; j++) + { + GridSpace space = area[j][i]; + int yLevel = this.findNearestRoadYLevel(j - negXRadius, i - negZRadius, closeness); + if (yLevel == -1) + { + continue; + } + if (space.isEmpty()) + { + index++; + if (index >= amount) + { + return new Int3(j - negXRadius, yLevel, i - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.EAST) + { + for (int i = negXRadius + posXRadius; i >= 0; i--) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + GridSpace space = area[i][j]; + int yLevel = this.findNearestRoadYLevel(i - negXRadius, j - negZRadius, closeness); + if (yLevel == -1) + { + continue; + } + if (space.isEmpty()) + { + index++; + if (index >= amount) + { + return new Int3(i - negXRadius, yLevel, j - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.WEST) + { + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + GridSpace space = area[i][j]; + int yLevel = this.findNearestRoadYLevel(i - negXRadius, j - negZRadius, closeness); + if (yLevel == -1) + { + continue; + } + if (space.isEmpty()) + { + index++; + if (index >= amount) + { + return new Int3(i - negXRadius, yLevel, j - negZRadius); + } + } + } + } + } + + return new Int3(0, 0, 0); + } + + public Int3 findEmptySpaceFromDirection(ForgeDirection dir, int amount) + { + int index = 0; + if (dir == ForgeDirection.NORTH) + { + System.out.print("NORTH!"); + for (int i = 0; i <= negZRadius + posZRadius; i++) + { + for (int j = 0; j <= negXRadius + posXRadius; j++) + { + GridSpace space = area[j][i]; + if (space.isEmpty()) + { + index++; + if (index >= amount) + { + return new Int3(j - negXRadius, space.getYLevel(), i - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.SOUTH) + { + for (int i = negZRadius + posZRadius; i >= 0; i--) + { + for (int j = 0; j <= negXRadius + posXRadius; j++) + { + GridSpace space = area[j][i]; + if (space.isEmpty()) + { + index++; + if (index >= amount) + { + return new Int3(j - negXRadius, space.getYLevel(), i - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.EAST) + { + for (int i = negXRadius + posXRadius; i >= 0; i--) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + GridSpace space = area[i][j]; + if (space.isEmpty()) + { + index++; + if (index >= amount) + { + return new Int3(i - negXRadius, space.getYLevel(), j - negZRadius); + } + } + } + } + } else if (dir == ForgeDirection.WEST) + { + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + GridSpace space = area[i][j]; + if (space.isEmpty()) + { + index++; + if (index >= amount) + { + return new Int3(i - negXRadius, space.getYLevel(), j - negZRadius); + } + } + } + } + } + + return new Int3(0, 0, 0); + } + + public void createGriddedRoad(int gridXi, int yi, int gridZi, ForgeDirection dir, int gridLength, boolean convertStarter) //Total grid length + { + if (gridLength == 0 || gridLength == 1) + { + return; + } + + if (convertStarter) + { + + } + + int initGridX = gridXi; + int initGridZ = gridZi; + int initY = yi; + + if (convertStarter) + { + this.setGridSpace(initGridX, initGridZ, new GridSpace(GridSpace.CROSSROAD, initY)); + + DemonCrosspath crosspath = new DemonCrosspath(xCoord + initGridX * 5, initY, zCoord + initGridZ * 5); + crosspath.createCrosspath(worldObj); + } + + for (int index = 0; index < gridLength - 1; index++) + { + DemonVillagePath path = new DemonVillagePath(xCoord + initGridX * 5, initY, zCoord + initGridZ * 5, dir, 6); + + Int3 next = path.constructFullPath(worldObj, this.getRoadStepClearance(), this.getRoadBlock(), this.getRoadMeta()); + + if (next != null) + { + initY = next.yCoord; + System.out.println("" + initY); + } + + initGridX += dir.offsetX; + initGridZ += dir.offsetZ; + + if (!this.getGridSpace(initGridX, initGridZ).isRoadSegment()) + { + this.setGridSpace(initGridX, initGridZ, new GridSpace(GridSpace.ROAD, initY)); + } + } + } + + public void expandAreaInNegX() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1]; + for (int i = 0; i <= negZRadius + posZRadius; i++) + { + newGrid[0][i] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i + 1][j] = area[i][j]; + } + } + + area = newGrid; + negXRadius += 1; + } + + public void expandAreaInPosX() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1]; + + for (int i = 0; i <= negZRadius + posZRadius; i++) + { + newGrid[negXRadius + posXRadius + 1][i] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i][j] = area[i][j]; + } + } + + area = newGrid; + posXRadius += 1; + } + + public void expandAreaInNegZ() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2]; + + System.out.println("x " + newGrid.length + "z " + newGrid[0].length); + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + newGrid[i][0] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i][j + 1] = area[i][j]; + } + } + + area = newGrid; + negZRadius += 1; + } + + public void expandAreaInPosZ() + { + GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2]; + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + newGrid[i][negZRadius + posZRadius + 1] = new GridSpace(); + } + + for (int i = 0; i <= negXRadius + posXRadius; i++) + { + for (int j = 0; j <= negZRadius + posZRadius; j++) + { + newGrid[i][j] = area[i][j]; + } + } + + area = newGrid; + posZRadius += 1; + } + + public GridSpace getGridSpace(int x, int z) + { + if (x > posXRadius || x < -negXRadius || z > posZRadius || z < -negZRadius) + { + return new GridSpace(); + } else + { + return (area[x + negXRadius][z + negZRadius]); + } + } + + public void setGridSpace(int x, int z, GridSpace space) + { + if (x > posXRadius) + { + this.expandAreaInPosX(); + this.setGridSpace(x, z, space); + return; + } else if (x < -negXRadius) + { + this.expandAreaInNegX(); + this.setGridSpace(x, z, space); + return; + } else if (z > posZRadius) + { + this.expandAreaInPosZ(); + this.setGridSpace(x, z, space); + return; + } else if (z < -negZRadius) + { + this.expandAreaInNegZ(); + this.setGridSpace(x, z, space); + return; + } else + { + area[x + negXRadius][z + negZRadius] = space; + } + } + + public void rightClickBlock(EntityPlayer player, int side) + { + if (worldObj.isRemote) + { + return; + } + + this.initialize(); + + if (ForgeDirection.getOrientation(side) == ForgeDirection.UP) + { + this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0); + } else if (ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) + { + this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0); + } else + { + this.createRandomRoad(); + } + } + + public int createRandomBuilding(int type, int tier) + { + switch (type) + { + case DemonBuilding.BUILDING_HOUSE: + return this.createRandomHouse(tier); + case DemonBuilding.BUILDING_PORTAL: + return this.createPortalBuilding(tier); + } + + return 0; + } + + public int createPortalBuilding(int buildingTier) + { + int x = 0; + int z = 0; + + GridSpace home = this.getGridSpace(x, z); + int yLevel = home.getYLevel(); + + GridSpaceHolder grid = this.createGSH(); + + List directions = new ArrayList(); + + for (int i = 2; i < 6; i++) + { + ForgeDirection testDir = ForgeDirection.getOrientation(i); + directions.add(testDir); + } + + if (directions.isEmpty()) + { + return 0; + } + + HashMap> schemMap = new HashMap(); + + for (ForgeDirection nextDir : directions) + { + for (DemonBuilding build : TEDemonPortal.buildingList) + { + if (build.buildingType != DemonBuilding.BUILDING_PORTAL) + { + continue; + } + if (schemMap.containsKey(nextDir)) + { + schemMap.get(nextDir).add(build); + } else + { + schemMap.put(nextDir, new ArrayList()); + schemMap.get(nextDir).add(build); + } + } + } + + if (schemMap.keySet().isEmpty()) + { + return 0; + } + + ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; + DemonBuilding build = schemMap.get(chosenDirection).get(new Random().nextInt(schemMap.get(chosenDirection).size())); + + build.destroyAllInField(worldObj, xCoord + (x) * 5, yLevel, zCoord + (z) * 5, chosenDirection.getOpposite()); + + Int3 portalSpace = build.getDoorSpace(chosenDirection); + int yOffset = portalSpace.yCoord; + build.buildAll(worldObj, xCoord + (x) * 5, yLevel, zCoord + (z) * 5, chosenDirection.getOpposite()); + build.setAllGridSpaces(x, z, yLevel, chosenDirection.getOpposite(), GridSpace.MAIN_PORTAL, grid); + this.loadGSH(grid); + + return build.getNumberOfGridSpaces(); + } + + public int createRandomHouse(int buildingTier) + { + int next = rand.nextInt(4); + ForgeDirection dir; + + switch (next) + { + case 0: + dir = ForgeDirection.NORTH; + break; + case 1: + dir = ForgeDirection.SOUTH; + break; + case 2: + dir = ForgeDirection.EAST; + break; + case 3: + dir = ForgeDirection.WEST; + break; + default: + dir = ForgeDirection.NORTH; + } + + boolean newProtocol = true; + + if (newProtocol) + { + Int3 space = this.findRoadSpaceFromDirection(dir, 1 * (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1); + + int x = space.xCoord; + int z = space.zCoord; + int yLevel = space.yCoord; + + System.out.println("Road space - x: " + x + " z: " + z); + + GridSpaceHolder grid = this.createGSH(); + + if (!this.getGridSpace(x, z).isRoadSegment()) + { + return 0; + } + + List directions = new ArrayList(); + + for (int i = 2; i < 6; i++) + { + ForgeDirection testDir = ForgeDirection.getOrientation(i); + if (this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty()) + { + directions.add(testDir); + } + } + + if (directions.isEmpty()) + { + return 0; + } + + HashMap> schemMap = new HashMap(); + + for (ForgeDirection nextDir : directions) + { + for (DemonBuilding build : TEDemonPortal.buildingList) + { + if (build.buildingTier != buildingTier || build.buildingType != DemonBuilding.BUILDING_HOUSE) + { + continue; + } + Int3 offsetSpace = build.getGridOffsetFromRoad(nextDir, yLevel); + int xOff = offsetSpace.xCoord; + int zOff = offsetSpace.zCoord; + + if (build.isValid(grid, x + xOff, z + zOff, nextDir.getOpposite())) + { + if (schemMap.containsKey(nextDir)) + { + schemMap.get(nextDir).add(build); + } else + { + schemMap.put(nextDir, new ArrayList()); + schemMap.get(nextDir).add(build); + } + } else + { + System.out.println("This ISN'T valid!"); + } + } + } + + if (schemMap.keySet().isEmpty()) + { + return 0; + } + + ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; + DemonBuilding build = schemMap.get(chosenDirection).get(new Random().nextInt(schemMap.get(chosenDirection).size())); + + Int3 offsetSpace = build.getGridOffsetFromRoad(chosenDirection, yLevel); + int xOff = offsetSpace.xCoord; + int zOff = offsetSpace.zCoord; + + build.destroyAllInField(worldObj, xCoord + (x + xOff) * 5, yLevel, zCoord + (z + zOff) * 5, chosenDirection.getOpposite()); + build.buildAll(worldObj, xCoord + (x + xOff) * 5, yLevel, zCoord + (z + zOff) * 5, chosenDirection.getOpposite()); + build.setAllGridSpaces(x + xOff, z + zOff, yLevel, chosenDirection.getOpposite(), GridSpace.HOUSE, grid); + this.loadGSH(grid); + + return build.getNumberOfGridSpaces(); + } else + { + Int3 space = findEmptySpaceNearRoad(dir, 3 * (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1, 2); + + int x = space.xCoord; + int z = space.zCoord; + int yLevel = space.yCoord; + + GridSpace newSpace = this.getGridSpace(x, z); + if (!newSpace.isEmpty()) + { + return 0; + } + + if (yLevel == -1) + { + return 0; + } + + GridSpaceHolder grid = this.createGSH(); + + ForgeDirection chosenDirection = ForgeDirection.NORTH; + + HashMap> bigList = new HashMap(); + + for (DemonBuilding build : TEDemonPortal.buildingList) + { + for (int i = 2; i < 6; i++) + { + chosenDirection = ForgeDirection.getOrientation(i); + System.out.println("" + chosenDirection.toString()); + if (build.isValid(grid, x, z, chosenDirection)) + { + System.out.println("Valid!"); + if (bigList.containsKey(chosenDirection)) + { + bigList.get(chosenDirection).add(build); + } else + { + bigList.put(chosenDirection, new ArrayList()); + bigList.get(chosenDirection).add(build); + } + } + } + } + + chosenDirection = ForgeDirection.getOrientation(new Random().nextInt(4) + 2); //Change to favour a direction with a road nearby + + List buildingList = bigList.get(chosenDirection); + DemonBuilding build; + + if (buildingList != null && buildingList.size() > 0) + { + build = buildingList.get(new Random().nextInt(buildingList.size())); + } else + { + return 0; + } + //TODO: Finish the selection algorythm + //TODO: Should favour those directions that have a road right next to them. + + build.buildAll(worldObj, xCoord + x * 5, yLevel, zCoord + z * 5, chosenDirection); + build.setAllGridSpaces(x, z, yLevel, chosenDirection, GridSpace.HOUSE, grid); + this.loadGSH(grid); + + return build.getNumberOfGridSpaces(); // System.out.println("X: " + x + " Z: " + z + " Direction: " + chosenDirection.toString()); - } - } - - public int findNearestRoadYLevel(int xCoord, int zCoord, int maxDistance) - { - for(int l=1; l<=maxDistance; l++) - { - for(int i=-l; i<=l; i++) - { - for(int j=-l; j<=l; j++) - { - if(Math.abs(i)!=l && Math.abs(j)!=l) - { - continue; - } - - if(this.getGridSpace(xCoord + i, zCoord + j).isRoadSegment()) - { - return this.getGridSpace(xCoord + i, zCoord + j).getYLevel(); - } - } - } - } - - return -1; - } + } + } - public void createRoad(int xi, int yi, int zi, ForgeDirection dir, int length, boolean doesNotDrop) - { - int curX = xi; - int curY = yi; - int curZ = zi; - int roadRadius = this.getRoadRadius(); - - if(dir.offsetY != 0) - { - return; - } - - DemonVillagePath path = new DemonVillagePath(xi, yi, zi, dir, length); - - path.constructFullPath(worldObj, this.getRoadStepClearance(), this.getRoadBlock(), this.getRoadMeta()); - } - - public int placeMaterialOnNextAvailable() - { - return 0; - } - - public int getRoadRadius() - { - return 1; - } - - public Block getRoadBlock() - { - return Blocks.nether_brick; - } - - public int getRoadMeta() - { - return 0; - } - - public int getRoadStepClearance() - { - return 10; - } - - public int getRoadSpacer() - { - return 1; - } - - public GridSpaceHolder createGSH() - { - GridSpaceHolder grid = new GridSpaceHolder(); - grid.area = this.area; - grid.negXRadius = this.negXRadius; - grid.negZRadius = this.negZRadius; - grid.posXRadius = this.posXRadius; - grid.posZRadius = this.posZRadius; - - return grid; - } - - public void loadGSH(GridSpaceHolder grid) - { - this.area = grid.area; - this.negXRadius = grid.negXRadius; - this.negZRadius = grid.negZRadius; - this.posXRadius = grid.posXRadius; - this.posZRadius = grid.posZRadius; - } - - public static void loadBuildingList() - { - String folder = "config/BloodMagic/schematics"; - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - File file = new File(folder); - File[] files = file.listFiles(); - BufferedReader br; + public int findNearestRoadYLevel(int xCoord, int zCoord, int maxDistance) + { + for (int l = 1; l <= maxDistance; l++) + { + for (int i = -l; i <= l; i++) + { + for (int j = -l; j <= l; j++) + { + if (Math.abs(i) != l && Math.abs(j) != l) + { + continue; + } - try{ - for(File f : files) - { - br = new BufferedReader(new FileReader(f)); - BuildingSchematic schema = gson.fromJson(br, BuildingSchematic.class); - TEDemonPortal.buildingList.add(new DemonBuilding(schema)); - } - }catch(FileNotFoundException e) - { - e.printStackTrace(); - } -// -// try { -// br = new BufferedReader(new FileReader(folder + "test3.json")); -// BuildingSchematic schema = gson.fromJson(br, BuildingSchematic.class); -// TEDemonPortal.buildingList.add(new DemonBuilding(schema)); -// } catch (FileNotFoundException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } - - - } - - public int getTotalPoints() - { - return this.totalPoints; - } - - public void addToPoints(int addition) - { - this.totalPoints += addition; - } - - public void setPortalDestination(int yLevel) - { - if(yLevel != this.yCoord) - { - this.hasLocationChanged = true; - this.yLevelDestination = yLevel; - } - } - - public boolean changePortalLocation() - { - if(yLevelDestination == yCoord) - { - return false; - } - - BlockTeleposer.swapBlocks(worldObj, worldObj, xCoord, yCoord, zCoord, xCoord, yLevelDestination, zCoord); - - return true; - } + if (this.getGridSpace(xCoord + i, zCoord + j).isRoadSegment()) + { + return this.getGridSpace(xCoord + i, zCoord + j).getYLevel(); + } + } + } + } + + return -1; + } + + public void createRoad(int xi, int yi, int zi, ForgeDirection dir, int length, boolean doesNotDrop) + { + int curX = xi; + int curY = yi; + int curZ = zi; + int roadRadius = this.getRoadRadius(); + + if (dir.offsetY != 0) + { + return; + } + + DemonVillagePath path = new DemonVillagePath(xi, yi, zi, dir, length); + + path.constructFullPath(worldObj, this.getRoadStepClearance(), this.getRoadBlock(), this.getRoadMeta()); + } + + public int placeMaterialOnNextAvailable() + { + return 0; + } + + public int getRoadRadius() + { + return 1; + } + + public Block getRoadBlock() + { + return Blocks.nether_brick; + } + + public int getRoadMeta() + { + return 0; + } + + public int getRoadStepClearance() + { + return 10; + } + + public int getRoadSpacer() + { + return 1; + } + + public GridSpaceHolder createGSH() + { + GridSpaceHolder grid = new GridSpaceHolder(); + grid.area = this.area; + grid.negXRadius = this.negXRadius; + grid.negZRadius = this.negZRadius; + grid.posXRadius = this.posXRadius; + grid.posZRadius = this.posZRadius; + + return grid; + } + + public void loadGSH(GridSpaceHolder grid) + { + this.area = grid.area; + this.negXRadius = grid.negXRadius; + this.negZRadius = grid.negZRadius; + this.posXRadius = grid.posXRadius; + this.posZRadius = grid.posZRadius; + } + + public static void loadBuildingList() + { + String folder = "config/BloodMagic/schematics"; + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + File file = new File(folder); + File[] files = file.listFiles(); + BufferedReader br; + + try + { + for (File f : files) + { + br = new BufferedReader(new FileReader(f)); + BuildingSchematic schema = gson.fromJson(br, BuildingSchematic.class); + TEDemonPortal.buildingList.add(new DemonBuilding(schema)); + } + } catch (FileNotFoundException e) + { + e.printStackTrace(); + } + } + + public int getTotalPoints() + { + return this.totalPoints; + } + + public void addToPoints(int addition) + { + this.totalPoints += addition; + } + + public void setPortalDestination(int yLevel) + { + if (yLevel != this.yCoord) + { + this.hasLocationChanged = true; + this.yLevelDestination = yLevel; + } + } + + public boolean changePortalLocation() + { + if (yLevelDestination == yCoord) + { + return false; + } + + BlockTeleposer.swapBlocks(worldObj, worldObj, xCoord, yCoord, zCoord, xCoord, yLevelDestination, zCoord); + + return true; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java index 180b0d35..21f10093 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java @@ -1,5 +1,7 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import WayofTime.alchemicalWizardry.common.spell.simple.HomSpell; +import WayofTime.alchemicalWizardry.common.spell.simple.HomSpellRegistry; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -7,8 +9,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.simple.HomSpell; -import WayofTime.alchemicalWizardry.common.spell.simple.HomSpellRegistry; public class TEHomHeart extends TileEntity { @@ -41,8 +41,6 @@ public class TEHomHeart extends TileEntity spell.onEnvironmentalRightClick(par1ItemStack, par2World, par3EntityPlayer); break; } - - //spell.onOffensiveRangedRightClick(par1ItemStack, par2World, par3EntityPlayer); } return 0; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEImperfectRitualStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEImperfectRitualStone.java index 110996ea..a6b0404c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEImperfectRitualStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEImperfectRitualStone.java @@ -6,6 +6,5 @@ public class TEImperfectRitualStone extends TileEntity { public TEImperfectRitualStone() { - // TODO Auto-generated constructor stub } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java index 94b4458a..a56ee1b1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java @@ -1,9 +1,10 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - +import WayofTime.alchemicalWizardry.api.alchemy.energy.*; +import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.Rituals; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -17,16 +18,10 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -import WayofTime.alchemicalWizardry.api.rituals.Rituals; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; public class TEMasterStone extends TileEntity implements IMasterRitualStone { @@ -39,17 +34,17 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone private int direction; public boolean isRunning; public int runningTime; - + private NBTTagCompound customRitualTag; - + protected ReagentContainer[] tanks; protected Map attunedTankMap; public TEMasterStone() { - tanks = new ReagentContainer[]{new ReagentContainer(1000),new ReagentContainer(1000),new ReagentContainer(1000)}; - this.attunedTankMap = new HashMap(); - + tanks = new ReagentContainer[]{new ReagentContainer(1000), new ReagentContainer(1000), new ReagentContainer(1000)}; + this.attunedTankMap = new HashMap(); + isActive = false; owner = ""; cooldown = 0; @@ -59,49 +54,49 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone currentRitualString = ""; isRunning = false; runningTime = 0; - + this.customRitualTag = new NBTTagCompound(); } public void readClientNBT(NBTTagCompound tag) { - currentRitualString = tag.getString("currentRitualString"); + currentRitualString = tag.getString("currentRitualString"); isRunning = tag.getBoolean("isRunning"); runningTime = tag.getInteger("runningTime"); - + NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND); int size = tagList.tagCount(); this.tanks = new ReagentContainer[size]; - - for(int i=0; i entry : this.attunedTankMap.entrySet()) + + for (Entry entry : this.attunedTankMap.entrySet()) { - NBTTagCompound savedTag = new NBTTagCompound(); - savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); - savedTag.setInteger("amount", entry.getValue()); - attunedTagList.appendTag(savedTag); + NBTTagCompound savedTag = new NBTTagCompound(); + savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); + savedTag.setInteger("amount", entry.getValue()); + attunedTagList.appendTag(savedTag); } - + tag.setTag("attunedTankMap", attunedTagList); - + tag.setTag("customRitualTag", customRitualTag); } public void activateRitual(World world, int crystalLevel, EntityPlayer player) { - if (world.isRemote) + if (world.isRemote) { return; } - + String testRitual = Rituals.checkValidRitual(world, xCoord, yCoord, zCoord); if (testRitual.equals("")) { - player.addChatMessage(new ChatComponentText("Nothing appears to have happened...")); + player.addChatMessage(new ChatComponentText("Nothing appears to have happened...")); return; } @@ -199,7 +194,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if (!testLevel) { - player.addChatMessage(new ChatComponentText("Your crystal vibrates pathetically.")); + player.addChatMessage(new ChatComponentText("Your crystal vibrates pathetically.")); return; } @@ -217,30 +212,30 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if (currentEssence < Rituals.getCostForActivation(testRitual)) { - player.addChatMessage(new ChatComponentText("You feel a pull, but you are too weak to push any further.")); + player.addChatMessage(new ChatComponentText("You feel a pull, but you are too weak to push any further.")); return; } if (!world.isRemote) { - if(!Rituals.startRitual(this, testRitual, player)) - { - player.addChatMessage(new ChatComponentText("The ritual appears to actively resist you!")); - - return; - }else - { - data.currentEssence = currentEssence - Rituals.getCostForActivation(testRitual); + if (!Rituals.startRitual(this, testRitual, player)) + { + player.addChatMessage(new ChatComponentText("The ritual appears to actively resist you!")); + + return; + } else + { + data.currentEssence = currentEssence - Rituals.getCostForActivation(testRitual); data.markDirty(); - - player.addChatMessage(new ChatComponentText("A rush of energy flows through the ritual!")); + + player.addChatMessage(new ChatComponentText("A rush of energy flows through the ritual!")); for (int i = 0; i < 12; i++) { SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } - } + } } cooldown = Rituals.getInitialCooldown(testRitual); @@ -259,20 +254,20 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone public void useOnRitualBroken() { - Rituals.onRitualBroken(this, this.currentRitualString); + Rituals.onRitualBroken(this, this.currentRitualString); } - + @Override public void updateEntity() { - if(isRunning && runningTime < 100) - { - runningTime++; - }else if(!isRunning && runningTime > 0) - { - runningTime--; - } - + if (isRunning && runningTime < 100) + { + runningTime++; + } else if (!isRunning && runningTime > 0) + { + runningTime--; + } + if (!isActive) { return; @@ -292,7 +287,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if (!testRunes) { - Rituals.onRitualBroken(this, currentRitualString); + Rituals.onRitualBroken(this, currentRitualString); isActive = false; currentRitualString = ""; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); @@ -302,19 +297,19 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if (worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0) { - if(isRunning) - { - isRunning = false; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } + if (isRunning) + { + isRunning = false; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } return; - }else + } else { - if(!isRunning) - { - isRunning = true; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } + if (!isRunning) + { + isRunning = true; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } } performRitual(worldObj, xCoord, yCoord, zCoord, currentRitualString); @@ -362,174 +357,168 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone return this.direction; } - @Override - public World getWorld() - { - return this.getWorldObj(); - } + @Override + public World getWorld() + { + return this.getWorldObj(); + } - @Override - public int getXCoord() - { - return xCoord; - } + @Override + public int getXCoord() + { + return xCoord; + } - @Override - public int getYCoord() - { - return yCoord; - } + @Override + public int getYCoord() + { + return yCoord; + } - @Override - public int getZCoord() - { - return zCoord; - } - - public String getCurrentRitual() - { - return this.currentRitualString; - } - - public void setCurrentRitual(String str) - { - this.currentRitualString = str; - } - -// @Override -// public Packet getDescriptionPacket() -// { -// return NewPacketHandler.getPacket(this); -// } - - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeClientNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - super.onDataPacket(net, packet); - readClientNBT(packet.func_148857_g()); - } - - public AxisAlignedBB getRenderBoundingBox() - { - double renderExtention = 1.0d; - AxisAlignedBB bb = AxisAlignedBB. getBoundingBox(xCoord-renderExtention, yCoord-renderExtention, zCoord-renderExtention, xCoord+1+renderExtention, yCoord+1+renderExtention, zCoord+1+renderExtention); - return bb; - } - - /* ISegmentedReagentHandler */ + @Override + public int getZCoord() + { + return zCoord; + } + + public String getCurrentRitual() + { + return this.currentRitualString; + } + + public void setCurrentRitual(String str) + { + this.currentRitualString = str; + } + + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeClientNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + super.onDataPacket(net, packet); + readClientNBT(packet.func_148857_g()); + } + + public AxisAlignedBB getRenderBoundingBox() + { + double renderExtention = 1.0d; + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(xCoord - renderExtention, yCoord - renderExtention, zCoord - renderExtention, xCoord + 1 + renderExtention, yCoord + 1 + renderExtention, zCoord + 1 + renderExtention); + return bb; + } + + /* ISegmentedReagentHandler */ @Override public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) { - if(doFill) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - int totalFill = 0; - - boolean useTankLimit = !this.attunedTankMap.isEmpty(); - - if(resource != null) - { - int totalTanksFillable = useTankLimit ? this.getTanksTunedToReagent(resource.reagent) : this.tanks.length; - int tanksFilled = 0; + if (doFill) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } - int maxFill = resource.amount; - - for(int i=this.tanks.length-1; i>=0; i--) - { - ReagentStack remainingStack = resource.copy(); - remainingStack.amount = maxFill - totalFill; - - boolean doesReagentMatch = tanks[i].getReagent() == null ? false : tanks[i].getReagent().isReagentEqual(remainingStack); - - if(doesReagentMatch) - { - totalFill += tanks[i].fill(remainingStack, doFill); - tanksFilled++; - }else - { - continue; - } - - if(totalFill >= maxFill || tanksFilled >= totalTanksFillable) - { - return totalFill; - } - } - - if(tanksFilled >= totalTanksFillable) - { - return totalFill; - } - - for(int i=this.tanks.length-1; i>=0; i--) - { - ReagentStack remainingStack = resource.copy(); - remainingStack.amount = maxFill - totalFill; - - boolean isTankEmpty = tanks[i].getReagent() == null; - - if(isTankEmpty) - { - totalFill += tanks[i].fill(remainingStack, doFill); - tanksFilled++; - }else - { - continue; - } - - if(totalFill >= maxFill || tanksFilled >= totalTanksFillable) - { - return totalFill; - } - } - } + int totalFill = 0; + + boolean useTankLimit = !this.attunedTankMap.isEmpty(); + + if (resource != null) + { + int totalTanksFillable = useTankLimit ? this.getTanksTunedToReagent(resource.reagent) : this.tanks.length; + int tanksFilled = 0; + + int maxFill = resource.amount; + + for (int i = this.tanks.length - 1; i >= 0; i--) + { + ReagentStack remainingStack = resource.copy(); + remainingStack.amount = maxFill - totalFill; + + boolean doesReagentMatch = tanks[i].getReagent() == null ? false : tanks[i].getReagent().isReagentEqual(remainingStack); + + if (doesReagentMatch) + { + totalFill += tanks[i].fill(remainingStack, doFill); + tanksFilled++; + } else + { + continue; + } + + if (totalFill >= maxFill || tanksFilled >= totalTanksFillable) + { + return totalFill; + } + } + + if (tanksFilled >= totalTanksFillable) + { + return totalFill; + } + + for (int i = this.tanks.length - 1; i >= 0; i--) + { + ReagentStack remainingStack = resource.copy(); + remainingStack.amount = maxFill - totalFill; + + boolean isTankEmpty = tanks[i].getReagent() == null; + + if (isTankEmpty) + { + totalFill += tanks[i].fill(remainingStack, doFill); + tanksFilled++; + } else + { + continue; + } + + if (totalFill >= maxFill || tanksFilled >= totalTanksFillable) + { + return totalFill; + } + } + } return totalFill; } @Override public ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain) { - if(resource == null) - { - return null; - } - - if(doDrain) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - int maxDrain = resource.amount; - Reagent reagent = resource.reagent; - int drained = 0; - - for(int i=0; i= maxDrain) - { - break; - } - - if (resource.isReagentEqual(tanks[i].getReagent())) + if (resource == null) + { + return null; + } + + if (doDrain) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + int maxDrain = resource.amount; + Reagent reagent = resource.reagent; + int drained = 0; + + for (int i = 0; i < tanks.length; i++) + { + if (drained >= maxDrain) { - ReagentStack drainStack = tanks[i].drain(maxDrain-drained, doDrain); - if(drainStack != null) - { - drained += drainStack.amount; - } + break; } - } - + + if (resource.isReagentEqual(tanks[i].getReagent())) + { + ReagentStack drainStack = tanks[i].drain(maxDrain - drained, doDrain); + if (drainStack != null) + { + drained += drainStack.amount; + } + } + } + return new ReagentStack(reagent, drained); } @@ -537,21 +526,21 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone @Override public ReagentStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - for(int i=0; i getAttunedTankMap() - { - return this.attunedTankMap; - } - - public boolean areTanksEmpty() - { - for(int i=0; i getAttunedTankMap() + { + return this.attunedTankMap; + } - @Override - public void setCustomRitualTag(NBTTagCompound tag) - { - this.customRitualTag = tag; - } + public boolean areTanksEmpty() + { + for (int i = 0; i < this.tanks.length; i++) + { + if (tanks[i] != null && tanks[i].getReagent() != null) + { + return false; + } + } + + return true; + } + + @Override + public NBTTagCompound getCustomRitualTag() + { + return this.customRitualTag; + } + + @Override + public void setCustomRitualTag(NBTTagCompound tag) + { + this.customRitualTag = tag; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java index 991f6e64..4029c2fa 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java @@ -1,12 +1,11 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.block.IOrientable; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; public class TEOrientable extends TileEntity implements IOrientable { @@ -85,25 +84,25 @@ public class TEOrientable extends TileEntity implements IOrientable return 0; } } - + @Override public Packet getDescriptionPacket() { - return NewPacketHandler.getPacket(this); + return NewPacketHandler.getPacket(this); } - + public boolean isSideRendered(ForgeDirection side) { - if(side.equals(this.getInputDirection()) || side.equals(this.getOutputDirection())) - { - return true; - } - return false; + if (side.equals(this.getInputDirection()) || side.equals(this.getOutputDirection())) + { + return true; + } + return false; } - + public String getResourceLocationForMeta(int meta) { - return ""; + return ""; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java index d83006cc..dd0e05e6 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java @@ -1,5 +1,7 @@ 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; @@ -8,11 +10,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; 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 TileEntity implements IInventory { @@ -165,13 +164,11 @@ public class TEPedestal extends TileEntity implements IInventory @Override public void openInventory() { - // TODO Auto-generated method stub } @Override public void closeInventory() { - // TODO Auto-generated method stub } //Logic for the actual block is under here @@ -256,7 +253,6 @@ public class TEPedestal extends TileEntity implements IInventory public void onItemDeletion() { - //worldObj.createExplosion(null, xCoord+0.5, yCoord+0.5, zCoord+0.5, 1, false); worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, xCoord, yCoord, zCoord)); for (int i = 0; i < 16; i++) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java index f9cfdbf4..6e452642 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java @@ -1,8 +1,11 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -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; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -12,16 +15,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; import net.minecraftforge.oredict.OreDictionary; -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; public class TEPlinth extends TileEntity implements IInventory { @@ -33,7 +32,7 @@ public class TEPlinth extends TileEntity implements IInventory private ItemStack[] ring1Inv; private ItemStack[] ring2Inv; private ItemStack[] ring3Inv; - + public static final int sizeInv = 1; private int progressInterval; @@ -56,7 +55,7 @@ public class TEPlinth extends TileEntity implements IInventory public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); - NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < tagList.tagCount(); i++) { @@ -69,7 +68,7 @@ public class TEPlinth extends TileEntity implements IInventory } } - NBTTagList ring1TagList = par1NBTTagCompound.getTagList("ring1Inv",Constants.NBT.TAG_COMPOUND); + NBTTagList ring1TagList = par1NBTTagCompound.getTagList("ring1Inv", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < ring1TagList.tagCount(); i++) { @@ -82,7 +81,7 @@ public class TEPlinth extends TileEntity implements IInventory } } - NBTTagList ring2TagList = par1NBTTagCompound.getTagList("ring2Inv",Constants.NBT.TAG_COMPOUND); + NBTTagList ring2TagList = par1NBTTagCompound.getTagList("ring2Inv", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < ring2TagList.tagCount(); i++) { @@ -95,7 +94,7 @@ public class TEPlinth extends TileEntity implements IInventory } } - NBTTagList ring3TagList = par1NBTTagCompound.getTagList("ring3Inv",Constants.NBT.TAG_COMPOUND); + NBTTagList ring3TagList = par1NBTTagCompound.getTagList("ring3Inv", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < ring3TagList.tagCount(); i++) { @@ -273,13 +272,11 @@ public class TEPlinth extends TileEntity implements IInventory @Override public void openInventory() { - // TODO Auto-generated method stub } @Override public void closeInventory() { - // TODO Auto-generated method stub } //Logic for the actual block is under here @@ -370,11 +367,9 @@ public class TEPlinth extends TileEntity implements IInventory { int bloodOrbLevel = ((EnergyBattery) getStackInSlot(0).getItem()).getOrbLevel(); EntityLivingBase entity = SummoningRegistry.getEntity(worldObj, bloodOrbLevel, ring1Inv, ring2Inv, ring3Inv); - //EntityLivingBase entity = new EntityFallenAngel(worldObj); if (entity != null) { - //entity.worldObj = worldObj; entity.setPosition(xCoord + 0.5, yCoord + 1, zCoord + 0.5); worldObj.spawnEntityInWorld(entity); @@ -481,12 +476,12 @@ public class TEPlinth extends TileEntity implements IInventory if (test) { - if (itemStack.getItem()== possibleItem.getItem() && (itemStack.getItemDamage() == possibleItem.getItemDamage() || itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) + if (itemStack.getItem() == possibleItem.getItem() && (itemStack.getItemDamage() == possibleItem.getItemDamage() || itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) { ((TEPedestal) tileEntity).decrStackSize(0, 1); - if(((TEPedestal) tileEntity).getStackInSlot(0) !=null && ((TEPedestal) tileEntity).getStackInSlot(0).stackSize==0) + if (((TEPedestal) tileEntity).getStackInSlot(0) != null && ((TEPedestal) tileEntity).getStackInSlot(0).stackSize == 0) { - ((TEPedestal) tileEntity).setInventorySlotContents(0, null); + ((TEPedestal) tileEntity).setInventorySlotContents(0, null); } ((TEPedestal) tileEntity).onItemDeletion(); worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); @@ -537,7 +532,6 @@ public class TEPlinth extends TileEntity implements IInventory { ((TEPedestal) tileEntity).decrStackSize(0, 1); ((TEPedestal) tileEntity).onItemDeletion(); - //worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); worldObj.markBlockForUpdate(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); return true; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java index 2743ac9c..c45bda00 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java @@ -1,11 +1,12 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - +import WayofTime.alchemicalWizardry.api.ColourAndCoords; +import WayofTime.alchemicalWizardry.api.alchemy.energy.*; +import WayofTime.alchemicalWizardry.common.Int3; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -17,528 +18,522 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; -import WayofTime.alchemicalWizardry.api.ColourAndCoords; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; -import WayofTime.alchemicalWizardry.api.alchemy.energy.TileSegmentedReagentHandler; -import WayofTime.alchemicalWizardry.common.Int3; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; public class TEReagentConduit extends TileSegmentedReagentHandler { - public List destinationList; //These are offsets - public Map> reagentTargetList; - public Map reagentTankDesignationList; - public int tickRate = 20; //Rate that the reagents are sent - - int hasChanged = 0; - public boolean affectedByRedstone = true; - - public int maxConnextions = 5; - - public int renderCount = 0; - - public TEReagentConduit() - { - this(2, 2000); - } - - public TEReagentConduit(int numberOfTanks, int size) - { - super(numberOfTanks, size); - - destinationList = new LinkedList(); - reagentTargetList = new HashMap(); - reagentTankDesignationList = new HashMap(); - } - - public Int3 getColour() - { - int[] redMap = new int[this.tanks.length]; - int[] greenMap = new int[this.tanks.length]; - int[] blueMap = new int[this.tanks.length]; - - for(int i=0; i destinationList; //These are offsets + public Map> reagentTargetList; + public Map reagentTankDesignationList; + public int tickRate = 20; //Rate that the reagents are sent - @Override - public void writeToNBT(NBTTagCompound tag) - { - super.writeToNBT(tag); - - tag.setInteger("hasChanged", hasChanged); - - NBTTagList tagList = new NBTTagList(); - - for(int i=0; i> entry : reagentTargetList.entrySet()) - { - NBTTagCompound savedTag = new NBTTagCompound(); - savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); - - NBTTagList coordinateTagList = new NBTTagList(); - - for(Int3 coord : entry.getValue()) - { - NBTTagCompound coordinateTag = new NBTTagCompound(); - - coord.writeToNBT(coordinateTag); - - coordinateTagList.appendTag(coordinateTag); - } - - savedTag.setTag("coordinateList", coordinateTagList); - - reagentTagList.appendTag(savedTag); - } - - tag.setTag("reagentTargetList", reagentTagList); + int hasChanged = 0; + public boolean affectedByRedstone = true; + + public int maxConnextions = 5; + + public int renderCount = 0; + + public TEReagentConduit() + { + this(2, 2000); + } + + public TEReagentConduit(int numberOfTanks, int size) + { + super(numberOfTanks, size); + + destinationList = new LinkedList(); + reagentTargetList = new HashMap(); + reagentTankDesignationList = new HashMap(); + } + + public Int3 getColour() + { + int[] redMap = new int[this.tanks.length]; + int[] greenMap = new int[this.tanks.length]; + int[] blueMap = new int[this.tanks.length]; + + for (int i = 0; i < this.tanks.length; i++) + { + ReagentContainer container = this.tanks[i]; + if (container != null && container.getReagent() != null) + { + Reagent reagent = container.getReagent().reagent; + + redMap[i] = reagent.getColourRed(); + greenMap[i] = reagent.getColourGreen(); + blueMap[i] = reagent.getColourBlue(); + } + } + + int red = 0; + int green = 0; + int blue = 0; + + for (int i = 0; i < this.tanks.length; i++) + { + red += redMap[i]; + green += greenMap[i]; + blue += blueMap[i]; + } + + red /= this.tanks.length; + green /= this.tanks.length; + blue /= this.tanks.length; + + return new Int3(red, green, blue); + } + + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + + tag.setInteger("hasChanged", hasChanged); + + NBTTagList tagList = new NBTTagList(); + + for (int i = 0; i < destinationList.size(); i++) + { + NBTTagCompound savedTag = new NBTTagCompound(); + tagList.appendTag(destinationList.get(i).writeToNBT(savedTag)); + } + + tag.setTag("destinationList", tagList); + + NBTTagList reagentTagList = new NBTTagList(); //TODO + + for (Entry> entry : reagentTargetList.entrySet()) + { + NBTTagCompound savedTag = new NBTTagCompound(); + savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); + + NBTTagList coordinateTagList = new NBTTagList(); + + for (Int3 coord : entry.getValue()) + { + NBTTagCompound coordinateTag = new NBTTagCompound(); + + coord.writeToNBT(coordinateTag); + + coordinateTagList.appendTag(coordinateTag); + } + + savedTag.setTag("coordinateList", coordinateTagList); + + reagentTagList.appendTag(savedTag); + } + + tag.setTag("reagentTargetList", reagentTagList); + + NBTTagList tankDesignationList = new NBTTagList(); + + for (Entry entry : this.reagentTankDesignationList.entrySet()) + { + NBTTagCompound savedTag = new NBTTagCompound(); + + savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); + savedTag.setInteger("integer", entry.getValue()); + + tankDesignationList.appendTag(savedTag); + } + + tag.setTag("tankDesignationList", tankDesignationList); + + } + + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + + hasChanged = tag.getInteger("hasChanged"); + + NBTTagList tagList = tag.getTagList("destinationList", Constants.NBT.TAG_COMPOUND); + + destinationList = new LinkedList(); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound savedTag = tagList.getCompoundTagAt(i); + + destinationList.add(ColourAndCoords.readFromNBT(savedTag)); + } + + reagentTargetList = new HashMap(); + + NBTTagList reagentTagList = tag.getTagList("reagentTargetList", Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < reagentTagList.tagCount(); i++) + { + NBTTagCompound savedTag = reagentTagList.getCompoundTagAt(i); + + Reagent reagent = ReagentRegistry.getReagentForKey(savedTag.getString("reagent")); + + List coordList = new LinkedList(); + + NBTTagList coordinateList = savedTag.getTagList("coordinateList", Constants.NBT.TAG_COMPOUND); + + for (int j = 0; j < coordinateList.tagCount(); j++) + { + coordList.add(Int3.readFromNBT(coordinateList.getCompoundTagAt(j))); + } + + reagentTargetList.put(reagent, coordList); + } + + reagentTankDesignationList = new HashMap(); + + NBTTagList tankDesignationList = tag.getTagList("tankDesignationList", Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < tankDesignationList.tagCount(); i++) + { + NBTTagCompound savedTag = tankDesignationList.getCompoundTagAt(i); + + this.reagentTankDesignationList.put(ReagentRegistry.getReagentForKey(savedTag.getString("reagent")), new Integer(savedTag.getInteger("integer"))); + } + } + + public void readClientNBT(NBTTagCompound tag) + { + NBTTagList tagList = tag.getTagList("destinationList", Constants.NBT.TAG_COMPOUND); + + destinationList = new LinkedList(); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound savedTag = tagList.getCompoundTagAt(i); + + destinationList.add(ColourAndCoords.readFromNBT(savedTag)); + } + + NBTTagList reagentTagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND); - NBTTagList tankDesignationList = new NBTTagList(); - - for(Entry entry : this.reagentTankDesignationList.entrySet()) - { - NBTTagCompound savedTag = new NBTTagCompound(); - - savedTag.setString("reagent", ReagentRegistry.getKeyForReagent(entry.getKey())); - savedTag.setInteger("integer", entry.getValue()); - - tankDesignationList.appendTag(savedTag); - } - - tag.setTag("tankDesignationList", tankDesignationList); - - } - - @Override - public void readFromNBT(NBTTagCompound tag) - { - super.readFromNBT(tag); - - hasChanged = tag.getInteger("hasChanged"); - - NBTTagList tagList = tag.getTagList("destinationList", Constants.NBT.TAG_COMPOUND); - - destinationList = new LinkedList(); - - for(int i=0; i coordList = new LinkedList(); - - NBTTagList coordinateList = savedTag.getTagList("coordinateList", Constants.NBT.TAG_COMPOUND); - - for(int j=0; j 1) - { - hasChanged = 1; - }else if(hasChanged == 1) - { - hasChanged = 0; - } - - if(worldObj.getWorldTime() % 100 == 99) - { - this.updateColourList(); - } - - if(affectedByRedstone && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) - { - return; - } - - int totalTransfered = 0; - - for(Entry> entry : this.reagentTargetList.entrySet()) - { - for(Int3 coord : entry.getValue()) - { - if(totalTransfered >= this.tickRate) - { - break; - } - - ReagentStack maxDrainAmount = this.drain(ForgeDirection.UNKNOWN, new ReagentStack(entry.getKey(), this.tickRate - totalTransfered), false); - - if(maxDrainAmount == null) - { - continue; - } - - int amountLeft = maxDrainAmount.amount; - - if(amountLeft <= 0) - { - continue; - } - - int x = xCoord + coord.xCoord; - int y = yCoord + coord.yCoord; - int z = zCoord + coord.zCoord; - - TileEntity tile = worldObj.getTileEntity(x, y, z); - if(tile instanceof IReagentHandler) - { - int amount = Math.min(((IReagentHandler) tile).fill(ForgeDirection.UNKNOWN, maxDrainAmount, false), amountLeft); - if(amount > 0) - { - amountLeft -= amount; - totalTransfered += amount; - - ReagentStack stack = this.drain(ForgeDirection.UNKNOWN, new ReagentStack(entry.getKey(), amount), true); - ((IReagentHandler) tile).fill(ForgeDirection.UNKNOWN, stack, true); - } - } - } - } - }else - { - if(affectedByRedstone && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) - { - return; - } - - renderCount++; - - if(worldObj.getWorldTime() % 100 != 0) - { - return; - } - - this.sendPlayerStuffs(); - } - } - - - @SideOnly(Side.CLIENT) - public void sendPlayerStuffs() - { - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; - World world = mc.theWorld; - if(SpellHelper.canPlayerSeeAlchemy(player)) - { - for(ColourAndCoords colourSet : this.destinationList) - { - if(!(worldObj.getTileEntity(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord) instanceof IReagentHandler)) - { - continue; - } - EntityParticleBeam beam = new EntityParticleBeam(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); - double velocity = Math.sqrt(Math.pow(colourSet.xCoord, 2) + Math.pow(colourSet.yCoord, 2) + Math.pow(colourSet.zCoord, 2)); - double wantedVel = 0.3d; - beam.setVelocity(wantedVel*colourSet.xCoord/velocity, wantedVel*colourSet.yCoord/velocity, wantedVel*colourSet.zCoord/velocity); - beam.setColour(colourSet.colourRed / 255f, colourSet.colourGreen/255f, colourSet.colourBlue/255f); - beam.setDestination(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord); - worldObj.spawnEntityInWorld(beam); - } - } - } - - public void updateColourList() - { - if(worldObj.isRemote) - { - return; - } - - List newList = this.compileListForReagentTargets(this.reagentTargetList); - - if(newList != null && !newList.equals(destinationList)) - { - this.destinationList = newList; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } - - public List compileListForReagentTargets(Map> map) - { - List list = new LinkedList(); - - for(Entry> entry : map.entrySet()) - { - if(entry.getValue() != null) - { - Reagent reagent = entry.getKey(); - if(reagent == null) - { - continue; - } - List coords = entry.getValue(); - for(Int3 coord : coords) - { - if(coord == null) - { - continue; - } - list.add(new ColourAndCoords(reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), reagent.getColourIntensity(), coord.xCoord, coord.yCoord, coord.zCoord)); - } - } - } - - return list; - } - - public boolean addDestinationViaOffset(int red, int green, int blue, int intensity, int xOffset, int yOffset, int zOffset) - { - if(xOffset == 0 && yOffset == 0 && zOffset == 0) - { - return false; - } - - this.destinationList.add(new ColourAndCoords(red, green, blue, intensity, xOffset, yOffset, zOffset)); - - return true; - } - - public boolean addDestinationViaActual(int red, int green, int blue, int intensity, int x, int y, int z) - { - return this.addDestinationViaOffset(red, green, blue, intensity, x - this.xCoord, y - this.yCoord, z - this.zCoord); - } - - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeClientNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 90210, nbttagcompound); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - super.onDataPacket(net, packet); - readClientNBT(packet.func_148857_g()); - } - - public boolean addReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) - { - int totalConnections = 0; - - for(Entry> entry : this.reagentTargetList.entrySet()) - { - if(entry.getValue() != null) - { - totalConnections += entry.getValue().size(); - } - } - - if(totalConnections >= this.maxConnextions) - { - //Send message that it cannot be done? Maybe add a Player instance - return false; - } - - if(xOffset == 0 && yOffset == 0 && zOffset == 0) - { - return false; - } - - Int3 newCoord = new Int3(xOffset, yOffset, zOffset); - - if(this.reagentTargetList.containsKey(reagent)) - { - List coordList = this.reagentTargetList.get(reagent); - if(coordList == null) - { - List newCoordList = new LinkedList(); - newCoordList.add(newCoord); - this.reagentTargetList.put(reagent, newCoordList); - }else - { - coordList.add(newCoord); - } - - return true; - }else - { - List newCoordList = new LinkedList(); - newCoordList.add(newCoord); - this.reagentTargetList.put(reagent, newCoordList); - - return true; - } - } - - public boolean addReagentDestinationViaActual(Reagent reagent, int x, int y, int z) - { - return (this.addReagentDestinationViaOffset(reagent, x-xCoord, y-yCoord, z-zCoord)); - } - - public boolean removeReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) - { - if(this.reagentTargetList.containsKey(reagent)) - { - List coords = this.reagentTargetList.get(reagent); - if(coords != null) - { - Int3 reference = new Int3(xOffset, yOffset, zOffset); - - return coords.remove(reference); - } - } - return false; - } - - public boolean removeReagentDestinationViaActual(Reagent reagent, int x, int y, int z) - { - return this.removeReagentDestinationViaOffset(reagent, x-xCoord, y-yCoord, z-zCoord); - } - - @Override + } + + @Override + public void updateEntity() + { + if (!worldObj.isRemote) + { + if (hasChanged > 1) + { + hasChanged = 1; + } else if (hasChanged == 1) + { + hasChanged = 0; + } + + if (worldObj.getWorldTime() % 100 == 99) + { + this.updateColourList(); + } + + if (affectedByRedstone && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) + { + return; + } + + int totalTransfered = 0; + + for (Entry> entry : this.reagentTargetList.entrySet()) + { + for (Int3 coord : entry.getValue()) + { + if (totalTransfered >= this.tickRate) + { + break; + } + + ReagentStack maxDrainAmount = this.drain(ForgeDirection.UNKNOWN, new ReagentStack(entry.getKey(), this.tickRate - totalTransfered), false); + + if (maxDrainAmount == null) + { + continue; + } + + int amountLeft = maxDrainAmount.amount; + + if (amountLeft <= 0) + { + continue; + } + + int x = xCoord + coord.xCoord; + int y = yCoord + coord.yCoord; + int z = zCoord + coord.zCoord; + + TileEntity tile = worldObj.getTileEntity(x, y, z); + if (tile instanceof IReagentHandler) + { + int amount = Math.min(((IReagentHandler) tile).fill(ForgeDirection.UNKNOWN, maxDrainAmount, false), amountLeft); + if (amount > 0) + { + amountLeft -= amount; + totalTransfered += amount; + + ReagentStack stack = this.drain(ForgeDirection.UNKNOWN, new ReagentStack(entry.getKey(), amount), true); + ((IReagentHandler) tile).fill(ForgeDirection.UNKNOWN, stack, true); + } + } + } + } + } else + { + if (affectedByRedstone && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) + { + return; + } + + renderCount++; + + if (worldObj.getWorldTime() % 100 != 0) + { + return; + } + + this.sendPlayerStuffs(); + } + } + + + @SideOnly(Side.CLIENT) + public void sendPlayerStuffs() + { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + World world = mc.theWorld; + if (SpellHelper.canPlayerSeeAlchemy(player)) + { + for (ColourAndCoords colourSet : this.destinationList) + { + if (!(worldObj.getTileEntity(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord) instanceof IReagentHandler)) + { + continue; + } + EntityParticleBeam beam = new EntityParticleBeam(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); + double velocity = Math.sqrt(Math.pow(colourSet.xCoord, 2) + Math.pow(colourSet.yCoord, 2) + Math.pow(colourSet.zCoord, 2)); + double wantedVel = 0.3d; + beam.setVelocity(wantedVel * colourSet.xCoord / velocity, wantedVel * colourSet.yCoord / velocity, wantedVel * colourSet.zCoord / velocity); + beam.setColour(colourSet.colourRed / 255f, colourSet.colourGreen / 255f, colourSet.colourBlue / 255f); + beam.setDestination(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord); + worldObj.spawnEntityInWorld(beam); + } + } + } + + public void updateColourList() + { + if (worldObj.isRemote) + { + return; + } + + List newList = this.compileListForReagentTargets(this.reagentTargetList); + + if (newList != null && !newList.equals(destinationList)) + { + this.destinationList = newList; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + + public List compileListForReagentTargets(Map> map) + { + List list = new LinkedList(); + + for (Entry> entry : map.entrySet()) + { + if (entry.getValue() != null) + { + Reagent reagent = entry.getKey(); + if (reagent == null) + { + continue; + } + List coords = entry.getValue(); + for (Int3 coord : coords) + { + if (coord == null) + { + continue; + } + list.add(new ColourAndCoords(reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), reagent.getColourIntensity(), coord.xCoord, coord.yCoord, coord.zCoord)); + } + } + } + + return list; + } + + public boolean addDestinationViaOffset(int red, int green, int blue, int intensity, int xOffset, int yOffset, int zOffset) + { + if (xOffset == 0 && yOffset == 0 && zOffset == 0) + { + return false; + } + + this.destinationList.add(new ColourAndCoords(red, green, blue, intensity, xOffset, yOffset, zOffset)); + + return true; + } + + public boolean addDestinationViaActual(int red, int green, int blue, int intensity, int x, int y, int z) + { + return this.addDestinationViaOffset(red, green, blue, intensity, x - this.xCoord, y - this.yCoord, z - this.zCoord); + } + + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeClientNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 90210, nbttagcompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + super.onDataPacket(net, packet); + readClientNBT(packet.func_148857_g()); + } + + public boolean addReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) + { + int totalConnections = 0; + + for (Entry> entry : this.reagentTargetList.entrySet()) + { + if (entry.getValue() != null) + { + totalConnections += entry.getValue().size(); + } + } + + if (totalConnections >= this.maxConnextions) + { + //Send message that it cannot be done? Maybe add a Player instance + return false; + } + + if (xOffset == 0 && yOffset == 0 && zOffset == 0) + { + return false; + } + + Int3 newCoord = new Int3(xOffset, yOffset, zOffset); + + if (this.reagentTargetList.containsKey(reagent)) + { + List coordList = this.reagentTargetList.get(reagent); + if (coordList == null) + { + List newCoordList = new LinkedList(); + newCoordList.add(newCoord); + this.reagentTargetList.put(reagent, newCoordList); + } else + { + coordList.add(newCoord); + } + + return true; + } else + { + List newCoordList = new LinkedList(); + newCoordList.add(newCoord); + this.reagentTargetList.put(reagent, newCoordList); + + return true; + } + } + + public boolean addReagentDestinationViaActual(Reagent reagent, int x, int y, int z) + { + return (this.addReagentDestinationViaOffset(reagent, x - xCoord, y - yCoord, z - zCoord)); + } + + public boolean removeReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) + { + if (this.reagentTargetList.containsKey(reagent)) + { + List coords = this.reagentTargetList.get(reagent); + if (coords != null) + { + Int3 reference = new Int3(xOffset, yOffset, zOffset); + + return coords.remove(reference); + } + } + return false; + } + + public boolean removeReagentDestinationViaActual(Reagent reagent, int x, int y, int z) + { + return this.removeReagentDestinationViaOffset(reagent, x - xCoord, y - yCoord, z - zCoord); + } + + @Override public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) - { - if(doFill && !worldObj.isRemote) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - hasChanged = 2; - } - - return super.fill(from, resource, doFill); - } - - @Override + { + if (doFill && !worldObj.isRemote) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + hasChanged = 2; + } + + return super.fill(from, resource, doFill); + } + + @Override public ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain) - { - if(doDrain && !worldObj.isRemote) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - hasChanged = 2; - } - - return super.drain(from, resource, doDrain); - } + { + if (doDrain && !worldObj.isRemote) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + hasChanged = 2; + } + + return super.drain(from, resource, doDrain); + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java index 8558b667..de8d6967 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java @@ -1,158 +1,156 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import java.io.FileWriter; import java.io.IOException; import java.io.Writer; import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - public class TESchematicSaver extends TileEntity { - public Block targetBlock = ModBlocks.largeBloodStoneBrick; - - public void rightClickBlock(EntityPlayer player, int side) - { - BuildingSchematic schematic = new BuildingSchematic(); + public Block targetBlock = ModBlocks.largeBloodStoneBrick; - int negX = this.getNegXLimit(); - int negY = this.getNegYLimit(); - int negZ = this.getNegZLimit(); - int posX = this.getPosXLimit(); - int posY = this.getPosYLimit(); - int posZ = this.getPosZLimit(); - - for(int i=-negX+1; i<=posX-1; i++) - { - for(int j=-negY+1; j<=posY-1; j++) - { - for(int k=-negZ+1; k<=posZ-1; k++) - { - int meta = worldObj.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - Block block = worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k); - - if(!block.isAir(worldObj, xCoord + i, yCoord + j, zCoord + k)) - { - schematic.addBlockWithMeta(block, meta, i, j, k); - } - - } - } - - System.out.println("" + i); - } - - System.out.println("I got here!"); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - String json = gson.toJson(schematic); - System.out.println("Here, too!"); - Writer writer; - try - { - writer = new FileWriter("config/BloodMagic/schematics/" + new Random().nextInt() + ".json"); - writer.write(json); - writer.close(); - } - catch (IOException e) - { - e.printStackTrace(); - } - } - - public int getPosYLimit() - { - int i=1; - while(i<100) - { - if(targetBlock == (worldObj.getBlock(xCoord, yCoord + i, zCoord))) - { - return i; - } - - i++; - } - return 1; - } - - public int getNegYLimit() - { - int i=1; - while(i<100) - { - if(targetBlock == (worldObj.getBlock(xCoord, yCoord - i, zCoord))) - { - return i; - } - - i++; - } - return 1; - } - - public int getPosXLimit() - { - int i=1; - while(i<100) - { - if(targetBlock == (worldObj.getBlock(xCoord + i, yCoord, zCoord))) - { - return i; - } - - i++; - } - return 1; - } - - public int getNegXLimit() - { - int i=1; - while(i<100) - { - if(targetBlock == (worldObj.getBlock(xCoord - i, yCoord, zCoord))) - { - return i; - } - - i++; - } - return 1; - } - - public int getPosZLimit() - { - int i=1; - while(i<100) - { - if(targetBlock == (worldObj.getBlock(xCoord, yCoord, zCoord + i))) - { - return i; - } - - i++; - } - return 1; - } - - public int getNegZLimit() - { - int i=1; - while(i<100) - { - if(targetBlock == (worldObj.getBlock(xCoord, yCoord, zCoord - i))) - { - return i; - } - - i++; - } - return 1; - } + public void rightClickBlock(EntityPlayer player, int side) + { + BuildingSchematic schematic = new BuildingSchematic(); + + int negX = this.getNegXLimit(); + int negY = this.getNegYLimit(); + int negZ = this.getNegZLimit(); + int posX = this.getPosXLimit(); + int posY = this.getPosYLimit(); + int posZ = this.getPosZLimit(); + + for (int i = -negX + 1; i <= posX - 1; i++) + { + for (int j = -negY + 1; j <= posY - 1; j++) + { + for (int k = -negZ + 1; k <= posZ - 1; k++) + { + int meta = worldObj.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); + Block block = worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k); + + if (!block.isAir(worldObj, xCoord + i, yCoord + j, zCoord + k)) + { + schematic.addBlockWithMeta(block, meta, i, j, k); + } + + } + } + + System.out.println("" + i); + } + + System.out.println("I got here!"); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String json = gson.toJson(schematic); + System.out.println("Here, too!"); + Writer writer; + try + { + writer = new FileWriter("config/BloodMagic/schematics/" + new Random().nextInt() + ".json"); + writer.write(json); + writer.close(); + } catch (IOException e) + { + e.printStackTrace(); + } + } + + public int getPosYLimit() + { + int i = 1; + while (i < 100) + { + if (targetBlock == (worldObj.getBlock(xCoord, yCoord + i, zCoord))) + { + return i; + } + + i++; + } + return 1; + } + + public int getNegYLimit() + { + int i = 1; + while (i < 100) + { + if (targetBlock == (worldObj.getBlock(xCoord, yCoord - i, zCoord))) + { + return i; + } + + i++; + } + return 1; + } + + public int getPosXLimit() + { + int i = 1; + while (i < 100) + { + if (targetBlock == (worldObj.getBlock(xCoord + i, yCoord, zCoord))) + { + return i; + } + + i++; + } + return 1; + } + + public int getNegXLimit() + { + int i = 1; + while (i < 100) + { + if (targetBlock == (worldObj.getBlock(xCoord - i, yCoord, zCoord))) + { + return i; + } + + i++; + } + return 1; + } + + public int getPosZLimit() + { + int i = 1; + while (i < 100) + { + if (targetBlock == (worldObj.getBlock(xCoord, yCoord, zCoord + i))) + { + return i; + } + + i++; + } + return 1; + } + + public int getNegZLimit() + { + int i = 1; + while (i < 100) + { + if (targetBlock == (worldObj.getBlock(xCoord, yCoord, zCoord - i))) + { + return i; + } + + i++; + } + return 1; + } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java index 9f43b483..ca107fcd 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; @@ -7,17 +8,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; public class TESocket extends TileEntity implements IInventory { private ItemStack[] inv; private int resultID; private int resultDamage; - + public static final int sizeInv = 1; private boolean isActive; @@ -34,7 +33,7 @@ public class TESocket extends TileEntity implements IInventory public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); - NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < tagList.tagCount(); i++) { @@ -164,13 +163,11 @@ public class TESocket extends TileEntity implements IInventory @Override public void openInventory() { - // TODO Auto-generated method stub } @Override public void closeInventory() { - // TODO Auto-generated method stub } //Logic for the actual block is under here diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java index bf182598..47d787db 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java @@ -1,18 +1,12 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; +import WayofTime.alchemicalWizardry.ModBlocks; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fluids.IFluidBlock; -import WayofTime.alchemicalWizardry.ModBlocks; public class TESpectralBlock extends TileEntity -{ +{ private int ticksRemaining; public TESpectralBlock() @@ -33,58 +27,54 @@ public class TESpectralBlock extends TileEntity { super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("ticksRemaining", ticksRemaining); + par1NBTTagCompound.setInteger("ticksRemaining", ticksRemaining); } - + @Override public void updateEntity() { super.updateEntity(); - - if(worldObj.isRemote) + + if (worldObj.isRemote) { - return; + return; } - + this.ticksRemaining--; - - if(this.ticksRemaining<=0) + + if (this.ticksRemaining <= 0) { - worldObj.setBlockToAir(xCoord, yCoord, zCoord); + worldObj.setBlockToAir(xCoord, yCoord, zCoord); } - } - + } + public static boolean createSpectralBlockAtLocation(World world, int x, int y, int z, int duration) { - if(!world.isAirBlock(x, y, z)) - { - return false; - } - - //if(world.getTileEntity(x, y, z)==null) - { - world.setBlock(x, y, z, ModBlocks.spectralBlock); - TileEntity tile = world.getTileEntity(x, y, z); - if(tile instanceof TESpectralBlock) - { - ((TESpectralBlock) tile).setDuration(duration); - return true; - } - } - - return false; + if (!world.isAirBlock(x, y, z)) + { + return false; + } + world.setBlock(x, y, z, ModBlocks.spectralBlock); + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TESpectralBlock) + { + ((TESpectralBlock) tile).setDuration(duration); + return true; + } + + return false; } - + public void setDuration(int dur) { - this.ticksRemaining = dur; + this.ticksRemaining = dur; } - + public void resetDuration(int dur) { - if(this.ticksRemaining stringList = parad.effectList; -// SpellParadigmSelf spellParadSelf = SpellParadigmSelf.getParadigmForStringArray(stringList); -// for(String str : stringList) -// { -// ChatMessageComponent chat = new ChatMessageComponent(); -// chat.addText(str); -// entity.sendChatToPlayer(chat); -// } -// spellParadSelf.castSpell(world, entity, spellCasterStack); -// } -// else if(parad instanceof SpellParadigmProjectile) -// { -// List stringList = parad.effectList; -// SpellParadigmProjectile spellParadSelf = SpellParadigmProjectile.getParadigmForStringArray(stringList); -// for(String str : stringList) -// { -// ChatMessageComponent chat = new ChatMessageComponent(); -// chat.addText(str); -// entity.sendChatToPlayer(chat); -// } -// spellParadSelf.castSpell(world, entity, spellCasterStack); -// }else - { - parad.applyAllSpellEffects(); - parad.castSpell(world, entity, spellCasterStack); - } - - } - - @Override - public String getResourceLocationForMeta(int meta) + public SpellParadigm getSpellParadigm() { - switch(meta) - { - case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; - case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png"; - case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png"; - case 3: return "alchemicalwizardry:textures/models/SpellParadigmTool.png"; - } - return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + switch (meta) + { + case 0: + return new SpellParadigmProjectile(); + case 1: + return new SpellParadigmSelf(); + case 2: + return new SpellParadigmMelee(); + case 3: + return new SpellParadigmTool(); + } + return new SpellParadigmSelf(); } - - @Override + + @Override + protected void applySpellChange(SpellParadigm parad) + { + return; + } + + public boolean canInputRecieve() + { + return false; + } + + public void castSpell(World world, EntityPlayer entity, ItemStack spellCasterStack) + { + SpellParadigm parad = this.getSpellParadigm(); + this.modifySpellParadigm(parad); + parad.applyAllSpellEffects(); + parad.castSpell(world, entity, spellCasterStack); + } + + @Override + public String getResourceLocationForMeta(int meta) + { + switch (meta) + { + case 0: + return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; + case 1: + return "alchemicalwizardry:textures/models/SpellParadigmSelf.png"; + case 2: + return "alchemicalwizardry:textures/models/SpellParadigmMelee.png"; + case 3: + return "alchemicalwizardry:textures/models/SpellParadigmTool.png"; + } + return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png"; + } + + @Override public void setInputDirection(ForgeDirection direction) { } - - @Override - public ForgeDirection getInputDirection() - { - return ForgeDirection.UNKNOWN; - } + + @Override + public ForgeDirection getInputDirection() + { + return ForgeDirection.UNKNOWN; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java index 946b1ddb..a9cfaa4d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java @@ -1,8 +1,9 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import java.util.Iterator; -import java.util.List; - +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; @@ -11,15 +12,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; -import WayofTime.alchemicalWizardry.common.items.EnergyItems; -import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; + +import java.util.Iterator; +import java.util.List; public class TETeleposer extends TileEntity implements IInventory { @@ -27,7 +26,7 @@ public class TETeleposer extends TileEntity implements IInventory private int resultID; private int resultDamage; private int previousInput; - + public static final int sizeInv = 1; private boolean isActive; @@ -177,13 +176,11 @@ public class TETeleposer extends TileEntity implements IInventory @Override public void openInventory() { - // TODO Auto-generated method stub } @Override public void closeInventory() { - // TODO Auto-generated method stub } //Logic for the actual block is under here @@ -232,9 +229,7 @@ public class TETeleposer extends TileEntity implements IInventory entityCount++; } - //int d0 = focusLevel-1; AxisAlignedBB axisalignedbb2 = AxisAlignedBB.getBoundingBox(xf, yf + d0 + 1, zf, xf + 1, yf + 2 + d0, zf).expand(d0, d0, d0); - //axisalignedbb2.maxY = Math.min((double)worldF.getHeight(),yf+1+d0+d0); List list2 = worldF.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb2); Iterator iterator2 = list2.iterator(); EntityLivingBase entityplayer2; @@ -248,8 +243,6 @@ public class TETeleposer extends TileEntity implements IInventory if (EnergyItems.canSyphonInContainer(focus, damage * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) + damage * entityCount)) { for (int k = 0; k <= (focusLevel * 2 - 2); k++) - //for(int k=(focusLevel*2-1);k>=0;k--) - { for (int i = -(focusLevel - 1); i <= (focusLevel - 1); i++) { for (int j = -(focusLevel - 1); j <= (focusLevel - 1); j++) @@ -262,7 +255,6 @@ public class TETeleposer extends TileEntity implements IInventory } } } - } if (!worldF.equals(worldObj)) { @@ -282,7 +274,6 @@ public class TETeleposer extends TileEntity implements IInventory entityplayer1 = (EntityLivingBase) iterator1.next(); entityplayer1.worldObj = worldF; entityplayer1.setPositionAndUpdate(entityplayer1.posX - this.xCoord + xf, entityplayer1.posY - this.yCoord + yf, entityplayer1.posZ - this.zCoord + zf); - //entityplayer1.travelToDimension(worldF.provider.dimensionId); } while (iterator2.hasNext()) @@ -290,7 +281,6 @@ public class TETeleposer extends TileEntity implements IInventory entityplayer2 = (EntityLivingBase) iterator2.next(); entityplayer2.worldObj = worldF; entityplayer2.setPositionAndUpdate(entityplayer2.posX + this.xCoord - xf, entityplayer2.posY + this.yCoord - yf, entityplayer2.posZ + this.zCoord - zf); - //entityplayer2.travelToDimension(worldObj.provider.dimensionId); } } } @@ -313,8 +303,8 @@ public class TETeleposer extends TileEntity implements IInventory @Override public Packet getDescriptionPacket() - { - return NewPacketHandler.getPacket(this); + { + return NewPacketHandler.getPacket(this); } public void handlePacketData(int[] intData) diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java index 1ed5ae95..fbb7b54d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java @@ -1,15 +1,5 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -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; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe; @@ -24,6 +14,16 @@ import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +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; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.oredict.OreDictionary; public class TEWritingTable extends TileEntity implements IInventory { @@ -31,9 +31,9 @@ public class TEWritingTable extends TileEntity implements IInventory private int progress; private int progressNeeded = 100; private int amountUsed; - + private int accelerationTime; - + public static final int sizeInv = 7; public TEWritingTable() @@ -127,7 +127,7 @@ public class TEWritingTable extends TileEntity implements IInventory public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - NBTTagList tagList = tagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + NBTTagList tagList = tagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < tagList.tagCount(); i++) { @@ -142,7 +142,7 @@ public class TEWritingTable extends TileEntity implements IInventory progress = tagCompound.getInteger("progress"); amountUsed = tagCompound.getInteger("amountUsed"); - + accelerationTime = tagCompound.getInteger("accelerationTime"); } @@ -168,7 +168,7 @@ public class TEWritingTable extends TileEntity implements IInventory tagCompound.setTag("Inventory", itemList); tagCompound.setInteger("progress", progress); tagCompound.setInteger("amountUsed", amountUsed); - + tagCompound.setInteger("accelerationTime", accelerationTime); } @@ -181,14 +181,12 @@ public class TEWritingTable extends TileEntity implements IInventory @Override public boolean hasCustomInventoryName() { - // TODO Auto-generated method stub return false; } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - // TODO Auto-generated method stub return false; } @@ -296,7 +294,7 @@ public class TEWritingTable extends TileEntity implements IInventory return -1; } - + public boolean containsCombinationCatalyst() { if (getCombinationCatalystPosition() != -1) @@ -452,20 +450,11 @@ public class TEWritingTable extends TileEntity implements IInventory { return; } - -// if(worldTime%100==0) -// { -// if (worldObj != null) -// { -// worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); -// } -// } - - if(accelerationTime > 0) + if (accelerationTime > 0) { - accelerationTime--; + accelerationTime--; } - + if (containsPotionFlask() && containsRegisteredPotionIngredient()) { if (containsCatalyst()) @@ -520,8 +509,6 @@ public class TEWritingTable extends TileEntity implements IInventory { ((AlchemyFlask) flaskStack.getItem()).setDurationFactorOfPotion(flaskStack, potionID, catalystLevel); } - - //((AlchemyFlask)flaskStack.getItem()).setConcentrationOfPotion(flaskStack, Potion.regeneration.id, 2); this.setInventorySlotContents(6, flaskStack); this.decrStackSize(this.getPotionFlaskPosition(), 1); this.decrStackSize(this.getCatalystPosition(), 1); @@ -567,8 +554,6 @@ public class TEWritingTable extends TileEntity implements IInventory int potionID = AlchemicalPotionCreationHandler.getPotionIDForStack(ingredientStack); int tickDuration = AlchemicalPotionCreationHandler.getPotionTickDurationForStack(ingredientStack); float successChance = ((IBindingAgent) agentStack.getItem()).getSuccessRateForPotionNumber(potionEffectNumber); - //boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration(); - if (potionID == -1) { progress = 0; @@ -582,9 +567,6 @@ public class TEWritingTable extends TileEntity implements IInventory } ((AlchemyFlask) flaskStack.getItem()).addPotionEffect(flaskStack, potionID, tickDuration); - - //((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000); - if (successChance > worldObj.rand.nextFloat()) { this.setInventorySlotContents(6, flaskStack); @@ -619,7 +601,6 @@ public class TEWritingTable extends TileEntity implements IInventory if (progress >= progressNeeded) { ItemStack flaskStack = inv[this.getPotionFlaskPosition()]; - //ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()]; ItemStack blankSlate = inv[this.getBlankSlatePosition()]; if (flaskStack == null || blankSlate == null) @@ -633,15 +614,10 @@ public class TEWritingTable extends TileEntity implements IInventory return; } - - //boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration(); ((AlchemyFlask) flaskStack.getItem()).setIsPotionThrowable(true, flaskStack); - //((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000); - //if(successChance>worldObj.rand.nextFloat()) this.setInventorySlotContents(6, flaskStack); this.decrStackSize(this.getPotionFlaskPosition(), 1); this.decrStackSize(this.getBlankSlatePosition(), 1); - //this.decrStackSize(this.getRegisteredPotionIngredientPosition(), 1); progress = 0; if (worldObj != null) @@ -664,7 +640,6 @@ public class TEWritingTable extends TileEntity implements IInventory if (progress >= progressNeeded) { ItemStack flaskStack = inv[this.getPotionFlaskPosition()]; - //ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()]; ItemStack fillingAgent = inv[this.getFillingAgentPosition()]; if (flaskStack == null || fillingAgent == null) @@ -678,17 +653,12 @@ public class TEWritingTable extends TileEntity implements IInventory return; } - - //boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration(); int potionEffects = ((AlchemyFlask) flaskStack.getItem()).getNumberOfPotionEffects(flaskStack); int potionFillAmount = ((IFillingAgent) fillingAgent.getItem()).getFilledAmountForPotionNumber(potionEffects); flaskStack.setItemDamage(Math.max(0, flaskStack.getItemDamage() - potionFillAmount)); - //((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000); - //if(successChance>worldObj.rand.nextFloat()) this.setInventorySlotContents(6, flaskStack); this.decrStackSize(this.getPotionFlaskPosition(), 1); this.decrStackSize(this.getFillingAgentPosition(), 1); - //this.decrStackSize(this.getRegisteredPotionIngredientPosition(), 1); progress = 0; if (worldObj != null) @@ -697,8 +667,7 @@ public class TEWritingTable extends TileEntity implements IInventory } } } - } - else if (this.containsPotionFlask() && this.containsCombinationCatalyst()) + } else if (this.containsPotionFlask() && this.containsCombinationCatalyst()) { //TODO if (getStackInSlot(6) == null && CombinedPotionRegistry.hasCombinablePotionEffect(inv[this.getPotionFlaskPosition()])) @@ -713,7 +682,6 @@ public class TEWritingTable extends TileEntity implements IInventory if (progress >= progressNeeded) { ItemStack flaskStack = inv[this.getPotionFlaskPosition()]; - //ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()]; ItemStack combinationCatalyst = inv[this.getCombinationCatalystPosition()]; if (flaskStack == null || combinationCatalyst == null) @@ -727,11 +695,11 @@ public class TEWritingTable extends TileEntity implements IInventory return; } - + ItemStack newFlask = CombinedPotionRegistry.applyPotionEffect(flaskStack); - if(newFlask != null) + if (newFlask != null) { - this.setInventorySlotContents(6, newFlask); + this.setInventorySlotContents(6, newFlask); this.decrStackSize(this.getPotionFlaskPosition(), 1); this.decrStackSize(this.getCombinationCatalystPosition(), 1); @@ -744,8 +712,7 @@ public class TEWritingTable extends TileEntity implements IInventory } } } - } - else + } else { if (!isRecipeValid()) { @@ -763,22 +730,22 @@ public class TEWritingTable extends TileEntity implements IInventory worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } - + int acceleration = this.getSpeedIncrease(); if (getStackInSlot(6) == null) { - if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed*acceleration)) + if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed * acceleration)) { return; } - + if (worldTime % 4 == 0) { SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } - progress+=acceleration; + progress += acceleration; if (progress >= progressNeeded) { @@ -806,12 +773,12 @@ public class TEWritingTable extends TileEntity implements IInventory SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } - if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed*acceleration)) + if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed * acceleration)) { return; } - progress+=acceleration; + progress += acceleration; if (progress >= progressNeeded) { @@ -819,7 +786,7 @@ public class TEWritingTable extends TileEntity implements IInventory ItemStack result = getResultingItemStack().copy(); result.stackSize += getStackInSlot(6).stackSize; this.setInventorySlotContents(6, result); - + ItemStack[] composedRecipe = new ItemStack[5]; for (int i = 0; i < 5; i++) @@ -836,47 +803,45 @@ public class TEWritingTable extends TileEntity implements IInventory } } } - - //worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } - + public void decrementSlots(ItemStack[] recipe) //TODO Fix this. This doesn't work. { - boolean[] decrementedList = new boolean[]{false,false,false,false,false}; - - for(int i=0; i<(Math.min(recipe.length,5)); i++) - { - ItemStack decStack = recipe[i]; - - if(decStack == null) - { - continue; - } - - for(int j=0; j<5; j++) - { - ItemStack testStack = this.getStackInSlot(j+1); - - if(testStack != null && (testStack.isItemEqual(decStack) || (testStack.getItem() == decStack.getItem() && decStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) && !(decrementedList[j])) - { - if(testStack.getItem().hasContainerItem(testStack)) - { - this.inv[j+1] = testStack.getItem().getContainerItem(testStack); - }else - { - this.decrStackSize(j+1, 1); - } - - decrementedList[j] = true; - break; - } - } - } + boolean[] decrementedList = new boolean[]{false, false, false, false, false}; + + for (int i = 0; i < (Math.min(recipe.length, 5)); i++) + { + ItemStack decStack = recipe[i]; + + if (decStack == null) + { + continue; + } + + for (int j = 0; j < 5; j++) + { + ItemStack testStack = this.getStackInSlot(j + 1); + + if (testStack != null && (testStack.isItemEqual(decStack) || (testStack.getItem() == decStack.getItem() && decStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) && !(decrementedList[j])) + { + if (testStack.getItem().hasContainerItem(testStack)) + { + this.inv[j + 1] = testStack.getItem().getContainerItem(testStack); + } else + { + this.decrStackSize(j + 1, 1); + } + + decrementedList[j] = true; + break; + } + } + } } - + public ItemStack[] getRecipeForItems(ItemStack[] recipe, ItemStack bloodOrb) { - if (bloodOrb == null) + if (bloodOrb == null) { return null; } @@ -898,19 +863,19 @@ public class TEWritingTable extends TileEntity implements IInventory return null; } - + public int getSpeedIncrease() { - return accelerationTime > 0 ? 5 : 1; + return accelerationTime > 0 ? 5 : 1; } - + public boolean isWorking() { - return this.progress > 0; + return this.progress > 0; } - + public void setAccelerationTime(int accelerationTime) { - this.accelerationTime = accelerationTime; + this.accelerationTime = accelerationTime; } } \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerAltar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerAltar.java index 9f926427..ebb64d8e 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerAltar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerAltar.java @@ -54,14 +54,10 @@ public class ContainerAltar extends Container { ItemStack stack = null; Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) if (slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); stack = stackInSlot.copy(); - - //merges the item into player inventory since its in the tileEntity if (slot < 9) { if (!this.mergeItemStack(stackInSlot, 0, 35, true)) @@ -69,7 +65,6 @@ public class ContainerAltar extends Container return null; } } - //places it into the tileEntity is possible since its in the player inventory else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) { return null; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java index 09104284..1a644e98 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java @@ -14,16 +14,7 @@ public class ContainerTeleposer extends Container public ContainerTeleposer(InventoryPlayer inventoryPlayer, TETeleposer te) { tileEntity = te; - //the Slot constructor takes the IInventory and the slot number in that it binds to - //and the x-y coordinates it resides on-screen -// addSlotToContainer(new Slot(tileEntity, 0, 152, 110)); -// addSlotToContainer(new Slot(tileEntity, 1, 80, 18)); -// addSlotToContainer(new Slot(tileEntity, 2, 33, 52)); -// addSlotToContainer(new Slot(tileEntity, 3, 51, 110)); -// addSlotToContainer(new Slot(tileEntity, 4, 109, 110)); -// addSlotToContainer(new Slot(tileEntity, 5, 127, 52)); addSlotToContainer(new Slot(tileEntity, 0, 80, 67)); - //commonly used vanilla code that adds the player's inventory bindPlayerInventory(inventoryPlayer); } @@ -54,8 +45,6 @@ public class ContainerTeleposer extends Container { ItemStack stack = null; Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) if (slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); @@ -70,8 +59,6 @@ public class ContainerTeleposer extends Container slotObject.onSlotChange(stackInSlot, stack); } - - //merges the item into player inventory since its in the tileEntity if (slot < 1) { if (!this.mergeItemStack(stackInSlot, 7, 35, true)) @@ -79,7 +66,6 @@ public class ContainerTeleposer extends Container return null; } } - //places it into the tileEntity is possible since its in the player inventory else if (!this.mergeItemStack(stackInSlot, 0, 0, false)) { return null; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java index 03c42933..647f43e7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.tileEntity.container; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; public class ContainerWritingTable extends Container { @@ -15,8 +15,6 @@ public class ContainerWritingTable extends Container public ContainerWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable te) { tileEntity = te; - //the Slot constructor takes the IInventory and the slot number in that it binds to - //and the x-y coordinates it resides on-screen addSlotToContainer(new Slot(tileEntity, 0, 152, 110)); addSlotToContainer(new Slot(tileEntity, 1, 80, 18)); addSlotToContainer(new Slot(tileEntity, 2, 33, 52)); @@ -24,7 +22,6 @@ public class ContainerWritingTable extends Container addSlotToContainer(new Slot(tileEntity, 4, 109, 110)); addSlotToContainer(new Slot(tileEntity, 5, 127, 52)); addSlotToContainer(new Slot(tileEntity, 6, 80, 67)); - //commonly used vanilla code that adds the player's inventory bindPlayerInventory(inventoryPlayer); } @@ -55,30 +52,23 @@ public class ContainerWritingTable extends Container { ItemStack stack = null; Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) if (slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); stack = stackInSlot.copy(); - - //merges the item into player inventory since its in the tileEntity if (slot <= 6) { if (!this.mergeItemStack(stackInSlot, 7, 43, true)) { return null; } - } - else if(stack.getItem() instanceof IBloodOrb) + } else if (stack.getItem() instanceof IBloodOrb) { - if (!this.mergeItemStack(stackInSlot, 0, 1, false)) + if (!this.mergeItemStack(stackInSlot, 0, 1, false)) { return null; } - } - //places it into the tileEntity is possible since its in the player inventory - else if (!this.mergeItemStack(stackInSlot, 1, 6, false)) + } else if (!this.mergeItemStack(stackInSlot, 1, 6, false)) { return null; } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java index a6d5f58a..450e63ac 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java @@ -1,21 +1,18 @@ package WayofTime.alchemicalWizardry.common.tileEntity.gui; +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer; import net.minecraft.client.gui.inventory.GuiBrewingStand; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; -import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer; - public class GuiTeleposer extends GuiContainer { public GuiTeleposer(InventoryPlayer inventoryPlayer, TETeleposer tileEntity) { - //the container is instanciated and passed to the superclass for handling super(new ContainerTeleposer(inventoryPlayer, tileEntity)); xSize = 176; ySize = 222; @@ -24,7 +21,6 @@ public class GuiTeleposer extends GuiContainer @Override protected void drawGuiContainerForegroundLayer(int param1, int param2) { - //draw text and stuff here //the parameters for drawString are: string, x, y, color fontRendererObj.drawString("Teleposer", 8, 6, 4210752); //draws "Inventory" or your regional equivalent @@ -35,7 +31,6 @@ public class GuiTeleposer extends GuiContainer protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { //draw your Gui here, only thing you need to change is the path - //ResourceLocation texture = mc.renderEngine.getTexture("/gui/trap.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry", "gui/Teleposer.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(test); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java index 53a74f19..c6d9d572 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java @@ -13,7 +13,6 @@ public class GuiWritingTable extends GuiContainer { public GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity) { - //the container is instanciated and passed to the superclass for handling super(new ContainerWritingTable(inventoryPlayer, tileEntity)); xSize = 176; ySize = 222; @@ -33,7 +32,6 @@ public class GuiWritingTable extends GuiContainer protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { //draw your Gui here, only thing you need to change is the path - //ResourceLocation texture = mc.renderEngine.getTexture("/gui/trap.png"); ResourceLocation test = new ResourceLocation("alchemicalwizardry", "gui/WritingTable.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(test); diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/bloodaltar.obj b/1.7.10/main/resources/assets/alchemicalwizardry/bloodaltar.obj new file mode 100644 index 00000000..88037009 --- /dev/null +++ b/1.7.10/main/resources/assets/alchemicalwizardry/bloodaltar.obj @@ -0,0 +1,262 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:11:26 + +mtllib bloodaltar.mtl + +# +# object headusOBJexport002 +# + +v -4.5000 -0.0003 7.0000 +v 4.5000 -0.0003 7.0000 +v 4.0172 8.0000 6.2483 +v -4.0172 8.0000 6.2483 +v 6.9379 -0.0003 4.4994 +v 7.0199 -0.0003 -4.4998 +v 6.2600 8.0000 -4.0177 +v 6.1868 8.0000 4.0159 +v -4.0172 8.0000 -6.2496 +v 4.0172 8.0000 -6.2496 +v 4.5000 -0.0003 -7.0000 +v -4.5000 -0.0003 -7.0000 +v -6.2489 8.0000 4.0165 +v -6.2489 8.0000 -4.0622 +v -7.0000 -0.0003 -4.5497 +v -7.0000 -0.0003 4.5000 +v -5.6437 -0.0003 -7.7219 +v -7.6983 -0.0003 -5.7082 +v -6.9967 8.0000 -5.2528 +v -5.1927 8.0000 -7.0210 +v -5.2002 8.0000 7.0079 +v -7.0086 8.0000 5.1996 +v -7.7102 -0.0003 5.6512 +v -5.6513 -0.0003 7.7101 +v 5.6513 -0.0003 7.7101 +v 7.7102 -0.0003 5.6512 +v 7.0086 8.0000 5.1996 +v 5.2002 8.0000 7.0079 +v 7.7102 -0.0003 -5.6513 +v 5.6513 -0.0003 -7.7102 +v 5.2003 8.0000 -7.0092 +v 7.0086 8.0000 -5.2009 +v 1.7912 8.0000 3.2817 +v -1.7910 8.0000 3.2817 +v 3.2857 8.0000 -1.7950 +v 3.2857 8.0000 1.7872 +v -1.7906 8.0000 -3.2897 +v 1.7912 8.0000 -3.2895 +v -3.2855 8.0000 1.7872 +v -3.2853 8.0000 -1.8147 +v -1.2845 6.5000 2.0590 +v -1.2889 6.5000 -2.0668 +v -2.0626 6.5000 -1.3033 +v -2.0627 6.5000 1.2808 +v 1.2846 6.5000 2.0590 +v 2.0629 6.5000 1.2808 +v 2.0629 6.5000 -1.2885 +v 1.2847 6.5000 -2.0667 +# 48 vertices + +vn 0.0000 0.0935 0.9956 +vn 0.9955 0.0940 0.0091 +vn 0.0000 0.0934 -0.9956 +vn -0.9956 0.0935 -0.0000 +vn -0.1018 -0.5549 -0.8257 +vn -0.8232 -0.5551 -0.1189 +vn -0.9907 0.0943 -0.0983 +vn -0.0769 0.0913 -0.9928 +vn -0.0882 0.0938 0.9917 +vn -0.9919 0.0919 0.0872 +vn -0.8248 -0.5547 0.1099 +vn -0.1106 -0.5553 0.8243 +vn 0.1099 -0.5547 0.8248 +vn 0.8274 -0.5533 0.0960 +vn 0.9933 0.0927 0.0690 +vn 0.0872 0.0920 0.9919 +vn 0.8238 -0.5552 -0.1145 +vn 0.1106 -0.5553 -0.8243 +vn 0.0882 0.0937 -0.9917 +vn 0.9916 0.0921 -0.0908 +vn 0.2232 -0.9083 -0.3537 +vn -0.3592 -0.9076 0.2175 +vn -0.3569 -0.9078 -0.2202 +vn 0.2206 -0.9080 0.3561 +vn -0.2201 -0.9078 0.3569 +vn 0.3437 -0.9101 -0.2313 +vn 0.3617 -0.9067 0.2168 +vn -0.2206 -0.9081 -0.3561 +vn 0.0000 1.0000 -0.0000 +vn -0.5381 0.0439 0.8417 +vn 0.5465 0.0428 -0.8364 +vn -0.8417 0.0438 -0.5381 +vn -0.5397 0.0463 -0.8406 +vn 0.8456 0.0447 0.5319 +vn -0.8459 0.0470 0.5313 +vn 0.5397 0.0464 0.8406 +vn 0.1872 0.8722 -0.4520 +vn 0.1856 0.8723 0.4523 +vn 0.4516 0.8720 0.1888 +vn 0.4520 0.8722 -0.1872 +vn -0.1872 0.8722 -0.4520 +vn 0.2870 0.6616 -0.6928 +vn -0.2870 0.6616 -0.6928 +vn -0.4519 0.8722 -0.1872 +vn -0.6928 0.6616 -0.2869 +vn -0.4519 0.8722 0.1872 +vn -0.6928 0.6616 0.2869 +vn -0.1872 0.8722 0.4519 +vn -0.2870 0.6616 0.6927 +vn 0.2848 0.6611 0.6941 +vn 0.6914 0.6621 0.2891 +vn 0.6928 0.6616 -0.2869 +vn 0.8207 0.0426 -0.5698 +# 53 vertex normals + +vt -0.0000 0.2656 0.0000 +vt 0.2031 0.2656 0.0000 +vt 0.2031 0.5000 0.0000 +vt 0.0000 0.5000 0.0000 +vt 0.3906 0.2656 0.0000 +vt 0.5938 0.2656 0.0000 +vt 0.5938 0.5000 0.0000 +vt 0.3906 0.5000 0.0000 +vt 0.2031 0.2344 0.0000 +vt -0.0000 0.2344 0.0000 +vt -0.0000 0.0000 0.0000 +vt 0.2031 0.0000 0.0000 +vt 0.5938 0.2344 0.0000 +vt 0.3906 0.2344 0.0000 +vt 0.3906 -0.0000 0.0000 +vt 0.5938 0.0000 0.0000 +vt 0.2500 0.0000 0.0000 +vt 0.3438 0.0000 0.0000 +vt 0.3438 0.2344 0.0000 +vt 0.2500 0.2344 0.0000 +vt 0.7344 0.2344 0.0000 +vt 0.6406 0.2344 0.0000 +vt 0.6406 0.0000 0.0000 +vt 0.7344 -0.0000 0.0000 +vt 0.2500 0.2656 0.0000 +vt 0.3438 0.2656 0.0000 +vt 0.3438 0.5000 0.0000 +vt 0.2656 0.5000 0.0000 +vt 0.6406 0.2656 0.0000 +vt 0.7344 0.2656 0.0000 +vt 0.7344 0.5000 0.0000 +vt 0.6406 0.5000 0.0000 +vt 0.0938 0.5781 0.0000 +vt 0.0313 0.6406 0.0000 +vt 0.0000 0.6094 0.0000 +vt 0.0625 0.5469 0.0000 +vt 0.0313 0.9063 0.0000 +vt 0.0938 0.9688 0.0000 +vt 0.0625 1.0000 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.3750 0.9688 0.0000 +vt 0.4375 0.9063 0.0000 +vt 0.4688 0.9375 0.0000 +vt 0.4063 1.0000 0.0000 +vt 0.4375 0.6406 0.0000 +vt 0.3750 0.5781 0.0000 +vt 0.4063 0.5469 0.0000 +vt 0.4688 0.6094 0.0000 +vt 0.9097 0.6270 0.0000 +vt 0.8522 0.7042 0.0000 +vt 0.7593 0.7045 0.0000 +vt 0.7012 0.6278 0.0000 +vt 0.9689 0.8931 0.0000 +vt 0.8915 0.8357 0.0000 +vt 0.8911 0.7428 0.0000 +vt 0.9662 0.6847 0.0000 +vt 0.7025 0.9520 0.0000 +vt 0.7600 0.8750 0.0000 +vt 0.8529 0.8747 0.0000 +vt 0.9109 0.9512 0.0000 +vt 0.6436 0.6859 0.0000 +vt 0.7207 0.7435 0.0000 +vt 0.7210 0.8369 0.0000 +vt 0.6444 0.8955 0.0000 +vt 0.9884 0.9237 0.0000 +vt 0.9417 0.9708 0.0000 +vt 0.7813 0.2656 0.0000 +vt 0.7813 0.5000 0.0000 +vt 0.6721 0.9722 0.0000 +vt 0.6251 0.9265 0.0000 +vt 0.6237 0.6553 0.0000 +vt 0.6705 0.6082 0.0000 +vt 0.7813 -0.0000 0.0000 +vt 0.7813 0.2344 0.0000 +vt 0.9403 0.6072 0.0000 +vt 0.9874 0.6539 0.0000 +vt 0.7725 0.7362 0.0000 +vt 0.7728 0.8432 0.0000 +vt 0.7527 0.8235 0.0000 +vt 0.7524 0.7565 0.0000 +vt 0.8392 0.7360 0.0000 +vt 0.8595 0.7561 0.0000 +vt 0.8597 0.8227 0.0000 +vt 0.8396 0.8430 0.0000 +# 84 texture coords + +g headusOBJexport002 +usemtl Material__46 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/9/3 10/10/3 11/11/3 12/12/3 +f 13/13/4 14/14/4 15/15/4 16/16/4 +s 1 +f 17/17/5 18/18/6 19/19/7 20/20/8 +f 21/21/9 22/22/10 23/23/11 24/24/12 +f 25/25/13 26/26/14 27/27/15 28/28/16 +f 29/29/17 30/30/18 31/31/19 32/32/20 +f 12/33/21 15/34/22 18/35/6 17/36/5 +f 16/37/23 1/38/24 24/39/12 23/40/11 +f 2/41/25 5/42/26 26/43/14 25/44/13 +f 6/45/27 11/46/28 30/47/18 29/48/17 +s 2 +f 3/49/29 33/50/29 34/51/29 4/52/29 +f 7/53/29 35/54/29 36/55/29 8/56/29 +f 9/57/29 37/58/29 38/59/29 10/60/29 +f 13/61/29 39/62/29 40/63/29 14/64/29 +f 9/57/29 14/64/29 40/63/29 37/58/29 +f 4/52/29 34/51/29 39/62/29 13/61/29 +f 8/56/29 36/55/29 33/50/29 3/49/29 +f 10/60/29 38/59/29 35/54/29 7/53/29 +s 1 +f 25/25/13 28/28/16 3/3/30 2/2/25 +s 2 +f 10/60/29 7/53/29 32/65/29 31/66/29 +s 1 +f 17/17/5 20/20/8 9/9/31 12/12/21 +f 23/23/11 22/22/10 13/13/32 16/16/23 +f 11/67/28 10/68/33 31/31/19 30/30/18 +f 29/29/17 32/32/20 7/7/34 6/6/27 +s 2 +f 14/64/29 9/57/29 20/69/29 19/70/29 +s 1 +f 15/15/22 14/14/35 19/19/7 18/18/6 +s 2 +f 4/52/29 13/61/29 22/71/29 21/72/29 +s 1 +f 1/73/24 4/74/36 21/21/9 24/24/12 +s 2 +f 8/56/29 3/49/29 28/75/29 27/76/29 +s 1 +f 41/77/37 42/78/38 43/79/39 44/80/40 +f 45/81/41 41/77/37 34/51/42 33/50/43 +f 46/82/44 45/81/41 33/50/43 36/55/45 +f 47/83/46 46/82/44 36/55/45 35/54/47 +f 48/84/48 47/83/46 35/54/47 38/59/49 +f 42/78/38 48/84/48 38/59/49 37/58/50 +f 43/79/39 42/78/38 37/58/50 40/63/51 +f 44/80/40 43/79/39 40/63/51 39/62/52 +f 41/77/37 44/80/40 39/62/52 34/51/42 +f 48/84/48 45/81/41 46/82/44 47/83/46 +f 45/81/41 48/84/48 42/78/38 41/77/37 +f 16/37/23 15/34/22 12/33/21 1/38/24 +f 2/41/25 11/46/28 6/45/27 5/42/26 +f 11/46/28 2/41/25 1/38/24 12/33/21 +f 5/5/26 8/8/53 27/27/15 26/26/14 +# 46 polygons + diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/bloodlevel.obj b/1.7.10/main/resources/assets/alchemicalwizardry/bloodlevel.obj new file mode 100644 index 00000000..f301ee48 --- /dev/null +++ b/1.7.10/main/resources/assets/alchemicalwizardry/bloodlevel.obj @@ -0,0 +1,64 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:12:01 + +mtllib bloodlevel.mtl + +# +# object headusOBJexport001 +# + +v -1.2846 0.0000 2.0630 +v -1.2890 0.0000 -2.0628 +v -2.0627 0.0000 -1.2993 +v -2.0628 0.0000 1.2848 +v 1.2845 0.0000 2.0630 +v -1.7911 0.0000 3.2857 +v 1.7911 0.0000 3.2857 +v 2.0628 0.0000 1.2848 +v 3.2856 0.0000 1.7912 +v 2.0628 0.0000 -1.2845 +v 3.2856 0.0000 -1.7910 +v 1.2846 0.0000 -2.0627 +v 1.7911 0.0000 -3.2855 +v -1.7907 0.0000 -3.2857 +v -3.2854 0.0000 -1.8107 +v -3.2856 0.0000 1.7912 +# 16 vertices + +vn 0.0000 1.0000 -0.0000 +# 1 vertex normals + +vt 0.3045 0.1861 0.0000 +vt 0.3038 0.8139 0.0000 +vt 0.1861 0.6977 0.0000 +vt 0.1861 0.3045 0.0000 +vt 0.6955 0.1861 0.0000 +vt 0.2274 -0.0000 0.0000 +vt 0.7726 -0.0000 0.0000 +vt 0.8139 0.3045 0.0000 +vt 1.0000 0.2274 0.0000 +vt 0.8139 0.6955 0.0000 +vt 1.0000 0.7725 0.0000 +vt 0.6955 0.8139 0.0000 +vt 0.7726 1.0000 0.0000 +vt 0.2275 1.0000 0.0000 +vt 0.0000 0.7755 0.0000 +vt 0.0000 0.2274 0.0000 +# 16 texture coords + +g headusOBJexport001 +usemtl Material__46 +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/1 1/1/1 6/6/1 7/7/1 +f 8/8/1 5/5/1 7/7/1 9/9/1 +f 10/10/1 8/8/1 9/9/1 11/11/1 +f 12/12/1 10/10/1 11/11/1 13/13/1 +f 2/2/1 12/12/1 13/13/1 14/14/1 +f 3/3/1 2/2/1 14/14/1 15/15/1 +f 4/4/1 3/3/1 15/15/1 16/16/1 +f 1/1/1 4/4/1 16/16/1 6/6/1 +f 12/12/1 5/5/1 8/8/1 10/10/1 +f 5/5/1 12/12/1 2/2/1 1/1/1 +# 11 polygons + diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang b/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang index f8b7f85e..dbfec98f 100644 --- a/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang +++ b/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang @@ -53,6 +53,7 @@ tile.blockSpellEffect.earth.name=Earth Former tile.alchemicCalcinator.name=Alchemic Calcinator tile.crystalBelljar.name=Crystal Belljar tile.blockReagentConduit.name=Alchemy Relay +tile.lifeEssenceFluidBlock.name=Life Essence #Item Localization item.weakBloodOrb.name=Weak Blood Orb diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar-fixeUV.obj b/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar-fixeUV.obj new file mode 100644 index 00000000..83d13903 --- /dev/null +++ b/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar-fixeUV.obj @@ -0,0 +1,262 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 15.08.2013 16:23:16 + +mtllib bloodaltar-fixeUV.mtl + +# +# object headusOBJexport002 +# + +v -4.5000 -0.0003 7.0000 +v 4.5000 -0.0003 7.0000 +v 4.0172 8.0000 6.2483 +v -4.0172 8.0000 6.2483 +v 6.9379 -0.0003 4.4994 +v 7.0199 -0.0003 -4.4998 +v 6.2600 8.0000 -4.0177 +v 6.1868 8.0000 4.0159 +v -4.0172 8.0000 -6.2496 +v 4.0172 8.0000 -6.2496 +v 4.5000 -0.0003 -7.0000 +v -4.5000 -0.0003 -7.0000 +v -6.2489 8.0000 4.0165 +v -6.2489 8.0000 -4.0622 +v -7.0000 -0.0003 -4.5497 +v -7.0000 -0.0003 4.5000 +v -5.6437 -0.0003 -7.7219 +v -7.6983 -0.0003 -5.7082 +v -6.9967 8.0000 -5.2528 +v -5.1927 8.0000 -7.0210 +v -5.2002 8.0000 7.0079 +v -7.0086 8.0000 5.1996 +v -7.7102 -0.0003 5.6512 +v -5.6513 -0.0003 7.7101 +v 5.6513 -0.0003 7.7101 +v 7.7102 -0.0003 5.6512 +v 7.0086 8.0000 5.1996 +v 5.2002 8.0000 7.0079 +v 7.7102 -0.0003 -5.6513 +v 5.6513 -0.0003 -7.7102 +v 5.2003 8.0000 -7.0092 +v 7.0086 8.0000 -5.2009 +v 1.7912 8.0000 3.2817 +v -1.7910 8.0000 3.2817 +v 3.2857 8.0000 -1.7950 +v 3.2857 8.0000 1.7872 +v -1.7906 8.0000 -3.2897 +v 1.7912 8.0000 -3.2895 +v -3.2855 8.0000 1.7872 +v -3.2853 8.0000 -1.8147 +v -1.2845 6.5000 2.0590 +v -1.2889 6.5000 -2.0668 +v -2.0626 6.5000 -1.3033 +v -2.0627 6.5000 1.2808 +v 1.2846 6.5000 2.0590 +v 2.0629 6.5000 1.2808 +v 2.0629 6.5000 -1.2885 +v 1.2847 6.5000 -2.0667 +# 48 vertices + +vn 0.0000 0.0935 0.9956 +vn 0.9955 0.0940 0.0091 +vn 0.0000 0.0934 -0.9956 +vn -0.9956 0.0935 -0.0000 +vn -0.1018 -0.5549 -0.8257 +vn -0.8232 -0.5551 -0.1189 +vn -0.9907 0.0943 -0.0983 +vn -0.0769 0.0913 -0.9928 +vn -0.0882 0.0938 0.9917 +vn -0.9919 0.0919 0.0872 +vn -0.8248 -0.5547 0.1099 +vn -0.1106 -0.5553 0.8243 +vn 0.1099 -0.5547 0.8248 +vn 0.8274 -0.5533 0.0960 +vn 0.9933 0.0927 0.0690 +vn 0.0872 0.0920 0.9919 +vn 0.8238 -0.5552 -0.1145 +vn 0.1106 -0.5553 -0.8243 +vn 0.0882 0.0937 -0.9917 +vn 0.9916 0.0921 -0.0908 +vn 0.2232 -0.9083 -0.3537 +vn -0.3592 -0.9076 0.2175 +vn -0.3569 -0.9078 -0.2202 +vn 0.2206 -0.9080 0.3561 +vn -0.2201 -0.9078 0.3569 +vn 0.3437 -0.9101 -0.2313 +vn 0.3617 -0.9067 0.2168 +vn -0.2206 -0.9081 -0.3561 +vn 0.0000 1.0000 -0.0000 +vn -0.5381 0.0439 0.8417 +vn 0.5465 0.0428 -0.8364 +vn -0.8417 0.0438 -0.5381 +vn -0.5397 0.0463 -0.8406 +vn 0.8456 0.0447 0.5319 +vn -0.8459 0.0470 0.5313 +vn 0.5397 0.0464 0.8406 +vn 0.1872 0.8722 -0.4520 +vn 0.1856 0.8723 0.4523 +vn 0.4516 0.8720 0.1888 +vn 0.4520 0.8722 -0.1872 +vn -0.1872 0.8722 -0.4520 +vn 0.2870 0.6616 -0.6928 +vn -0.2870 0.6616 -0.6928 +vn -0.4519 0.8722 -0.1872 +vn -0.6928 0.6616 -0.2869 +vn -0.4519 0.8722 0.1872 +vn -0.6928 0.6616 0.2869 +vn -0.1872 0.8722 0.4519 +vn -0.2870 0.6616 0.6927 +vn 0.2848 0.6611 0.6941 +vn 0.6914 0.6621 0.2891 +vn 0.6928 0.6616 -0.2869 +vn 0.8207 0.0426 -0.5698 +# 53 vertex normals + +vt -0.0000 0.2656 0.0000 +vt 0.2031 0.2656 0.0000 +vt 0.2031 0.5000 0.0000 +vt 0.0000 0.5000 0.0000 +vt 0.3906 0.2656 0.0000 +vt 0.5938 0.2656 0.0000 +vt 0.5938 0.5000 0.0000 +vt 0.3906 0.5000 0.0000 +vt 0.2031 0.2344 0.0000 +vt -0.0000 0.2344 0.0000 +vt -0.0000 0.0000 0.0000 +vt 0.2031 0.0000 0.0000 +vt 0.5938 0.2344 0.0000 +vt 0.3906 0.2344 0.0000 +vt 0.3906 -0.0000 0.0000 +vt 0.5938 0.0000 0.0000 +vt 0.2500 0.0000 0.0000 +vt 0.3438 0.0000 0.0000 +vt 0.3438 0.2344 0.0000 +vt 0.2500 0.2344 0.0000 +vt 0.7344 0.2344 0.0000 +vt 0.6406 0.2344 0.0000 +vt 0.6406 0.0000 0.0000 +vt 0.7344 -0.0000 0.0000 +vt 0.2500 0.2656 0.0000 +vt 0.3438 0.2656 0.0000 +vt 0.3438 0.5000 0.0000 +vt 0.2500 0.5000 0.0000 +vt 0.6406 0.2656 0.0000 +vt 0.7344 0.2656 0.0000 +vt 0.7344 0.5000 0.0000 +vt 0.6406 0.5000 0.0000 +vt 0.0938 0.5781 0.0000 +vt 0.0313 0.6406 0.0000 +vt 0.0000 0.6094 0.0000 +vt 0.0625 0.5469 0.0000 +vt 0.0313 0.9063 0.0000 +vt 0.0938 0.9688 0.0000 +vt 0.0625 1.0000 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.3750 0.9688 0.0000 +vt 0.4375 0.9063 0.0000 +vt 0.4688 0.9375 0.0000 +vt 0.4063 1.0000 0.0000 +vt 0.4375 0.6406 0.0000 +vt 0.3750 0.5781 0.0000 +vt 0.4063 0.5469 0.0000 +vt 0.4688 0.6094 0.0000 +vt 0.9097 0.6270 0.0000 +vt 0.8522 0.7042 0.0000 +vt 0.7593 0.7045 0.0000 +vt 0.7012 0.6278 0.0000 +vt 0.9689 0.8931 0.0000 +vt 0.8915 0.8357 0.0000 +vt 0.8911 0.7428 0.0000 +vt 0.9662 0.6847 0.0000 +vt 0.7025 0.9520 0.0000 +vt 0.7600 0.8750 0.0000 +vt 0.8529 0.8747 0.0000 +vt 0.9109 0.9512 0.0000 +vt 0.6436 0.6859 0.0000 +vt 0.7207 0.7435 0.0000 +vt 0.7210 0.8369 0.0000 +vt 0.6444 0.8955 0.0000 +vt 0.9884 0.9237 0.0000 +vt 0.9417 0.9708 0.0000 +vt 0.7813 0.2656 0.0000 +vt 0.7813 0.5000 0.0000 +vt 0.6721 0.9722 0.0000 +vt 0.6251 0.9265 0.0000 +vt 0.6237 0.6553 0.0000 +vt 0.6705 0.6082 0.0000 +vt 0.7813 -0.0000 0.0000 +vt 0.7813 0.2344 0.0000 +vt 0.9403 0.6072 0.0000 +vt 0.9874 0.6539 0.0000 +vt 0.7725 0.7362 0.0000 +vt 0.7728 0.8432 0.0000 +vt 0.7527 0.8235 0.0000 +vt 0.7524 0.7565 0.0000 +vt 0.8392 0.7360 0.0000 +vt 0.8595 0.7561 0.0000 +vt 0.8597 0.8227 0.0000 +vt 0.8396 0.8430 0.0000 +# 84 texture coords + +g headusOBJexport002 +usemtl Material__46 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/9/3 10/10/3 11/11/3 12/12/3 +f 13/13/4 14/14/4 15/15/4 16/16/4 +s 1 +f 17/17/5 18/18/6 19/19/7 20/20/8 +f 21/21/9 22/22/10 23/23/11 24/24/12 +f 25/25/13 26/26/14 27/27/15 28/28/16 +f 29/29/17 30/30/18 31/31/19 32/32/20 +f 12/33/21 15/34/22 18/35/6 17/36/5 +f 16/37/23 1/38/24 24/39/12 23/40/11 +f 2/41/25 5/42/26 26/43/14 25/44/13 +f 6/45/27 11/46/28 30/47/18 29/48/17 +s 2 +f 3/49/29 33/50/29 34/51/29 4/52/29 +f 7/53/29 35/54/29 36/55/29 8/56/29 +f 9/57/29 37/58/29 38/59/29 10/60/29 +f 13/61/29 39/62/29 40/63/29 14/64/29 +f 9/57/29 14/64/29 40/63/29 37/58/29 +f 4/52/29 34/51/29 39/62/29 13/61/29 +f 8/56/29 36/55/29 33/50/29 3/49/29 +f 10/60/29 38/59/29 35/54/29 7/53/29 +s 1 +f 25/25/13 28/28/16 3/3/30 2/2/25 +s 2 +f 10/60/29 7/53/29 32/65/29 31/66/29 +s 1 +f 17/17/5 20/20/8 9/9/31 12/12/21 +f 23/23/11 22/22/10 13/13/32 16/16/23 +f 11/67/28 10/68/33 31/31/19 30/30/18 +f 29/29/17 32/32/20 7/7/34 6/6/27 +s 2 +f 14/64/29 9/57/29 20/69/29 19/70/29 +s 1 +f 15/15/22 14/14/35 19/19/7 18/18/6 +s 2 +f 4/52/29 13/61/29 22/71/29 21/72/29 +s 1 +f 1/73/24 4/74/36 21/21/9 24/24/12 +s 2 +f 8/56/29 3/49/29 28/75/29 27/76/29 +s 1 +f 41/77/37 42/78/38 43/79/39 44/80/40 +f 45/81/41 41/77/37 34/51/42 33/50/43 +f 46/82/44 45/81/41 33/50/43 36/55/45 +f 47/83/46 46/82/44 36/55/45 35/54/47 +f 48/84/48 47/83/46 35/54/47 38/59/49 +f 42/78/38 48/84/48 38/59/49 37/58/50 +f 43/79/39 42/78/38 37/58/50 40/63/51 +f 44/80/40 43/79/39 40/63/51 39/62/52 +f 41/77/37 44/80/40 39/62/52 34/51/42 +f 48/84/48 45/81/41 46/82/44 47/83/46 +f 45/81/41 48/84/48 42/78/38 41/77/37 +f 16/37/23 15/34/22 12/33/21 1/38/24 +f 2/41/25 11/46/28 6/45/27 5/42/26 +f 11/46/28 2/41/25 1/38/24 12/33/21 +f 5/5/26 8/8/53 27/27/15 26/26/14 +# 46 polygons + diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar.obj b/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar.obj new file mode 100644 index 00000000..88037009 --- /dev/null +++ b/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodaltar.obj @@ -0,0 +1,262 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:11:26 + +mtllib bloodaltar.mtl + +# +# object headusOBJexport002 +# + +v -4.5000 -0.0003 7.0000 +v 4.5000 -0.0003 7.0000 +v 4.0172 8.0000 6.2483 +v -4.0172 8.0000 6.2483 +v 6.9379 -0.0003 4.4994 +v 7.0199 -0.0003 -4.4998 +v 6.2600 8.0000 -4.0177 +v 6.1868 8.0000 4.0159 +v -4.0172 8.0000 -6.2496 +v 4.0172 8.0000 -6.2496 +v 4.5000 -0.0003 -7.0000 +v -4.5000 -0.0003 -7.0000 +v -6.2489 8.0000 4.0165 +v -6.2489 8.0000 -4.0622 +v -7.0000 -0.0003 -4.5497 +v -7.0000 -0.0003 4.5000 +v -5.6437 -0.0003 -7.7219 +v -7.6983 -0.0003 -5.7082 +v -6.9967 8.0000 -5.2528 +v -5.1927 8.0000 -7.0210 +v -5.2002 8.0000 7.0079 +v -7.0086 8.0000 5.1996 +v -7.7102 -0.0003 5.6512 +v -5.6513 -0.0003 7.7101 +v 5.6513 -0.0003 7.7101 +v 7.7102 -0.0003 5.6512 +v 7.0086 8.0000 5.1996 +v 5.2002 8.0000 7.0079 +v 7.7102 -0.0003 -5.6513 +v 5.6513 -0.0003 -7.7102 +v 5.2003 8.0000 -7.0092 +v 7.0086 8.0000 -5.2009 +v 1.7912 8.0000 3.2817 +v -1.7910 8.0000 3.2817 +v 3.2857 8.0000 -1.7950 +v 3.2857 8.0000 1.7872 +v -1.7906 8.0000 -3.2897 +v 1.7912 8.0000 -3.2895 +v -3.2855 8.0000 1.7872 +v -3.2853 8.0000 -1.8147 +v -1.2845 6.5000 2.0590 +v -1.2889 6.5000 -2.0668 +v -2.0626 6.5000 -1.3033 +v -2.0627 6.5000 1.2808 +v 1.2846 6.5000 2.0590 +v 2.0629 6.5000 1.2808 +v 2.0629 6.5000 -1.2885 +v 1.2847 6.5000 -2.0667 +# 48 vertices + +vn 0.0000 0.0935 0.9956 +vn 0.9955 0.0940 0.0091 +vn 0.0000 0.0934 -0.9956 +vn -0.9956 0.0935 -0.0000 +vn -0.1018 -0.5549 -0.8257 +vn -0.8232 -0.5551 -0.1189 +vn -0.9907 0.0943 -0.0983 +vn -0.0769 0.0913 -0.9928 +vn -0.0882 0.0938 0.9917 +vn -0.9919 0.0919 0.0872 +vn -0.8248 -0.5547 0.1099 +vn -0.1106 -0.5553 0.8243 +vn 0.1099 -0.5547 0.8248 +vn 0.8274 -0.5533 0.0960 +vn 0.9933 0.0927 0.0690 +vn 0.0872 0.0920 0.9919 +vn 0.8238 -0.5552 -0.1145 +vn 0.1106 -0.5553 -0.8243 +vn 0.0882 0.0937 -0.9917 +vn 0.9916 0.0921 -0.0908 +vn 0.2232 -0.9083 -0.3537 +vn -0.3592 -0.9076 0.2175 +vn -0.3569 -0.9078 -0.2202 +vn 0.2206 -0.9080 0.3561 +vn -0.2201 -0.9078 0.3569 +vn 0.3437 -0.9101 -0.2313 +vn 0.3617 -0.9067 0.2168 +vn -0.2206 -0.9081 -0.3561 +vn 0.0000 1.0000 -0.0000 +vn -0.5381 0.0439 0.8417 +vn 0.5465 0.0428 -0.8364 +vn -0.8417 0.0438 -0.5381 +vn -0.5397 0.0463 -0.8406 +vn 0.8456 0.0447 0.5319 +vn -0.8459 0.0470 0.5313 +vn 0.5397 0.0464 0.8406 +vn 0.1872 0.8722 -0.4520 +vn 0.1856 0.8723 0.4523 +vn 0.4516 0.8720 0.1888 +vn 0.4520 0.8722 -0.1872 +vn -0.1872 0.8722 -0.4520 +vn 0.2870 0.6616 -0.6928 +vn -0.2870 0.6616 -0.6928 +vn -0.4519 0.8722 -0.1872 +vn -0.6928 0.6616 -0.2869 +vn -0.4519 0.8722 0.1872 +vn -0.6928 0.6616 0.2869 +vn -0.1872 0.8722 0.4519 +vn -0.2870 0.6616 0.6927 +vn 0.2848 0.6611 0.6941 +vn 0.6914 0.6621 0.2891 +vn 0.6928 0.6616 -0.2869 +vn 0.8207 0.0426 -0.5698 +# 53 vertex normals + +vt -0.0000 0.2656 0.0000 +vt 0.2031 0.2656 0.0000 +vt 0.2031 0.5000 0.0000 +vt 0.0000 0.5000 0.0000 +vt 0.3906 0.2656 0.0000 +vt 0.5938 0.2656 0.0000 +vt 0.5938 0.5000 0.0000 +vt 0.3906 0.5000 0.0000 +vt 0.2031 0.2344 0.0000 +vt -0.0000 0.2344 0.0000 +vt -0.0000 0.0000 0.0000 +vt 0.2031 0.0000 0.0000 +vt 0.5938 0.2344 0.0000 +vt 0.3906 0.2344 0.0000 +vt 0.3906 -0.0000 0.0000 +vt 0.5938 0.0000 0.0000 +vt 0.2500 0.0000 0.0000 +vt 0.3438 0.0000 0.0000 +vt 0.3438 0.2344 0.0000 +vt 0.2500 0.2344 0.0000 +vt 0.7344 0.2344 0.0000 +vt 0.6406 0.2344 0.0000 +vt 0.6406 0.0000 0.0000 +vt 0.7344 -0.0000 0.0000 +vt 0.2500 0.2656 0.0000 +vt 0.3438 0.2656 0.0000 +vt 0.3438 0.5000 0.0000 +vt 0.2656 0.5000 0.0000 +vt 0.6406 0.2656 0.0000 +vt 0.7344 0.2656 0.0000 +vt 0.7344 0.5000 0.0000 +vt 0.6406 0.5000 0.0000 +vt 0.0938 0.5781 0.0000 +vt 0.0313 0.6406 0.0000 +vt 0.0000 0.6094 0.0000 +vt 0.0625 0.5469 0.0000 +vt 0.0313 0.9063 0.0000 +vt 0.0938 0.9688 0.0000 +vt 0.0625 1.0000 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.3750 0.9688 0.0000 +vt 0.4375 0.9063 0.0000 +vt 0.4688 0.9375 0.0000 +vt 0.4063 1.0000 0.0000 +vt 0.4375 0.6406 0.0000 +vt 0.3750 0.5781 0.0000 +vt 0.4063 0.5469 0.0000 +vt 0.4688 0.6094 0.0000 +vt 0.9097 0.6270 0.0000 +vt 0.8522 0.7042 0.0000 +vt 0.7593 0.7045 0.0000 +vt 0.7012 0.6278 0.0000 +vt 0.9689 0.8931 0.0000 +vt 0.8915 0.8357 0.0000 +vt 0.8911 0.7428 0.0000 +vt 0.9662 0.6847 0.0000 +vt 0.7025 0.9520 0.0000 +vt 0.7600 0.8750 0.0000 +vt 0.8529 0.8747 0.0000 +vt 0.9109 0.9512 0.0000 +vt 0.6436 0.6859 0.0000 +vt 0.7207 0.7435 0.0000 +vt 0.7210 0.8369 0.0000 +vt 0.6444 0.8955 0.0000 +vt 0.9884 0.9237 0.0000 +vt 0.9417 0.9708 0.0000 +vt 0.7813 0.2656 0.0000 +vt 0.7813 0.5000 0.0000 +vt 0.6721 0.9722 0.0000 +vt 0.6251 0.9265 0.0000 +vt 0.6237 0.6553 0.0000 +vt 0.6705 0.6082 0.0000 +vt 0.7813 -0.0000 0.0000 +vt 0.7813 0.2344 0.0000 +vt 0.9403 0.6072 0.0000 +vt 0.9874 0.6539 0.0000 +vt 0.7725 0.7362 0.0000 +vt 0.7728 0.8432 0.0000 +vt 0.7527 0.8235 0.0000 +vt 0.7524 0.7565 0.0000 +vt 0.8392 0.7360 0.0000 +vt 0.8595 0.7561 0.0000 +vt 0.8597 0.8227 0.0000 +vt 0.8396 0.8430 0.0000 +# 84 texture coords + +g headusOBJexport002 +usemtl Material__46 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/9/3 10/10/3 11/11/3 12/12/3 +f 13/13/4 14/14/4 15/15/4 16/16/4 +s 1 +f 17/17/5 18/18/6 19/19/7 20/20/8 +f 21/21/9 22/22/10 23/23/11 24/24/12 +f 25/25/13 26/26/14 27/27/15 28/28/16 +f 29/29/17 30/30/18 31/31/19 32/32/20 +f 12/33/21 15/34/22 18/35/6 17/36/5 +f 16/37/23 1/38/24 24/39/12 23/40/11 +f 2/41/25 5/42/26 26/43/14 25/44/13 +f 6/45/27 11/46/28 30/47/18 29/48/17 +s 2 +f 3/49/29 33/50/29 34/51/29 4/52/29 +f 7/53/29 35/54/29 36/55/29 8/56/29 +f 9/57/29 37/58/29 38/59/29 10/60/29 +f 13/61/29 39/62/29 40/63/29 14/64/29 +f 9/57/29 14/64/29 40/63/29 37/58/29 +f 4/52/29 34/51/29 39/62/29 13/61/29 +f 8/56/29 36/55/29 33/50/29 3/49/29 +f 10/60/29 38/59/29 35/54/29 7/53/29 +s 1 +f 25/25/13 28/28/16 3/3/30 2/2/25 +s 2 +f 10/60/29 7/53/29 32/65/29 31/66/29 +s 1 +f 17/17/5 20/20/8 9/9/31 12/12/21 +f 23/23/11 22/22/10 13/13/32 16/16/23 +f 11/67/28 10/68/33 31/31/19 30/30/18 +f 29/29/17 32/32/20 7/7/34 6/6/27 +s 2 +f 14/64/29 9/57/29 20/69/29 19/70/29 +s 1 +f 15/15/22 14/14/35 19/19/7 18/18/6 +s 2 +f 4/52/29 13/61/29 22/71/29 21/72/29 +s 1 +f 1/73/24 4/74/36 21/21/9 24/24/12 +s 2 +f 8/56/29 3/49/29 28/75/29 27/76/29 +s 1 +f 41/77/37 42/78/38 43/79/39 44/80/40 +f 45/81/41 41/77/37 34/51/42 33/50/43 +f 46/82/44 45/81/41 33/50/43 36/55/45 +f 47/83/46 46/82/44 36/55/45 35/54/47 +f 48/84/48 47/83/46 35/54/47 38/59/49 +f 42/78/38 48/84/48 38/59/49 37/58/50 +f 43/79/39 42/78/38 37/58/50 40/63/51 +f 44/80/40 43/79/39 40/63/51 39/62/52 +f 41/77/37 44/80/40 39/62/52 34/51/42 +f 48/84/48 45/81/41 46/82/44 47/83/46 +f 45/81/41 48/84/48 42/78/38 41/77/37 +f 16/37/23 15/34/22 12/33/21 1/38/24 +f 2/41/25 11/46/28 6/45/27 5/42/26 +f 11/46/28 2/41/25 1/38/24 12/33/21 +f 5/5/26 8/8/53 27/27/15 26/26/14 +# 46 polygons + diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodlevel.obj b/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodlevel.obj new file mode 100644 index 00000000..f301ee48 --- /dev/null +++ b/1.7.10/main/resources/assets/alchemicalwizardry/models/bloodlevel.obj @@ -0,0 +1,64 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:12:01 + +mtllib bloodlevel.mtl + +# +# object headusOBJexport001 +# + +v -1.2846 0.0000 2.0630 +v -1.2890 0.0000 -2.0628 +v -2.0627 0.0000 -1.2993 +v -2.0628 0.0000 1.2848 +v 1.2845 0.0000 2.0630 +v -1.7911 0.0000 3.2857 +v 1.7911 0.0000 3.2857 +v 2.0628 0.0000 1.2848 +v 3.2856 0.0000 1.7912 +v 2.0628 0.0000 -1.2845 +v 3.2856 0.0000 -1.7910 +v 1.2846 0.0000 -2.0627 +v 1.7911 0.0000 -3.2855 +v -1.7907 0.0000 -3.2857 +v -3.2854 0.0000 -1.8107 +v -3.2856 0.0000 1.7912 +# 16 vertices + +vn 0.0000 1.0000 -0.0000 +# 1 vertex normals + +vt 0.3045 0.1861 0.0000 +vt 0.3038 0.8139 0.0000 +vt 0.1861 0.6977 0.0000 +vt 0.1861 0.3045 0.0000 +vt 0.6955 0.1861 0.0000 +vt 0.2274 -0.0000 0.0000 +vt 0.7726 -0.0000 0.0000 +vt 0.8139 0.3045 0.0000 +vt 1.0000 0.2274 0.0000 +vt 0.8139 0.6955 0.0000 +vt 1.0000 0.7725 0.0000 +vt 0.6955 0.8139 0.0000 +vt 0.7726 1.0000 0.0000 +vt 0.2275 1.0000 0.0000 +vt 0.0000 0.7755 0.0000 +vt 0.0000 0.2274 0.0000 +# 16 texture coords + +g headusOBJexport001 +usemtl Material__46 +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/1 1/1/1 6/6/1 7/7/1 +f 8/8/1 5/5/1 7/7/1 9/9/1 +f 10/10/1 8/8/1 9/9/1 11/11/1 +f 12/12/1 10/10/1 11/11/1 13/13/1 +f 2/2/1 12/12/1 13/13/1 14/14/1 +f 3/3/1 2/2/1 14/14/1 15/15/1 +f 4/4/1 3/3/1 15/15/1 16/16/1 +f 1/1/1 4/4/1 16/16/1 6/6/1 +f 12/12/1 5/5/1 8/8/1 10/10/1 +f 5/5/1 12/12/1 2/2/1 1/1/1 +# 11 polygons +