From 1aac4686dbe315d94516cb98452c3f26eb5025e2 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 31 Jul 2015 12:09:09 -0400 Subject: [PATCH] Attempt to fix repository --- .../forestry/api/apiculture/BeeManager.java | 49 + .../api/apiculture/EnumBeeChromosome.java | 102 + .../forestry/api/apiculture/EnumBeeType.java | 24 + .../api/apiculture/FlowerManager.java | 39 + .../api/apiculture/IAlleleBeeEffect.java | 36 + .../api/apiculture/IAlleleBeeSpecies.java | 69 + .../apiculture/IAlleleBeeSpeciesCustom.java | 40 + .../api/apiculture/IAlvearyComponent.java | 32 + .../api/apiculture/IApiaristTracker.java | 57 + .../api/apiculture/IArmorApiarist.java | 29 + .../java/forestry/api/apiculture/IBee.java | 88 + .../forestry/api/apiculture/IBeeFactory.java | 39 + .../forestry/api/apiculture/IBeeGenome.java | 48 + .../forestry/api/apiculture/IBeeHousing.java | 27 + .../api/apiculture/IBeeIconProvider.java | 14 + .../forestry/api/apiculture/IBeeListener.java | 46 + .../forestry/api/apiculture/IBeeModifier.java | 71 + .../forestry/api/apiculture/IBeeMutation.java | 29 + .../api/apiculture/IBeeMutationCustom.java | 12 + .../api/apiculture/IBeeMutationFactory.java | 23 + .../forestry/api/apiculture/IBeeRoot.java | 128 ++ .../api/apiculture/IBeekeepingLogic.java | 27 + .../api/apiculture/IBeekeepingMode.java | 70 + .../forestry/api/apiculture/IHiveDrop.java | 38 + .../forestry/api/apiculture/IHiveFrame.java | 27 + .../api/apiculture/IJubilanceFactory.java | 16 + .../api/apiculture/IJubilanceProvider.java | 15 + .../api/apiculture/hives/HiveManager.java | 13 + .../apiculture/hives/IHiveDescription.java | 48 + .../api/apiculture/hives/IHiveGen.java | 29 + .../api/apiculture/hives/IHiveGenHelper.java | 23 + .../api/apiculture/hives/IHiveRegistry.java | 33 + .../api/apiculture/hives/package-info.java | 8 + .../forestry/api/apiculture/package-info.java | 8 + .../api/arboriculture/EnumGermlingType.java | 23 + .../arboriculture/EnumGrowthConditions.java | 10 + .../api/arboriculture/EnumTreeChromosome.java | 96 + .../api/arboriculture/IAlleleFruit.java | 17 + .../api/arboriculture/IAlleleGrowth.java | 17 + .../api/arboriculture/IAlleleLeafEffect.java | 20 + .../api/arboriculture/IAlleleTreeSpecies.java | 69 + .../api/arboriculture/IArboristTracker.java | 12 + .../api/arboriculture/IFruitProvider.java | 74 + .../api/arboriculture/IGrowthProvider.java | 38 + .../api/arboriculture/ILeafTickHandler.java | 12 + .../api/arboriculture/IToolGrafter.java | 24 + .../forestry/api/arboriculture/ITree.java | 100 + .../api/arboriculture/ITreeGenome.java | 46 + .../api/arboriculture/ITreeModifier.java | 45 + .../api/arboriculture/ITreeMutation.java | 34 + .../forestry/api/arboriculture/ITreeRoot.java | 113 ++ .../api/arboriculture/ITreekeepingMode.java | 22 + .../api/arboriculture/package-info.java | 8 + .../forestry/api/circuits/ChipsetManager.java | 13 + .../java/forestry/api/circuits/ICircuit.java | 32 + .../forestry/api/circuits/ICircuitBoard.java | 32 + .../forestry/api/circuits/ICircuitLayout.java | 16 + .../api/circuits/ICircuitLibrary.java | 10 + .../api/circuits/ICircuitRegistry.java | 37 + .../forestry/api/circuits/ISolderManager.java | 14 + .../forestry/api/circuits/package-info.java | 8 + .../java/forestry/api/core/BiomeHelper.java | 36 + .../java/forestry/api/core/EnumHumidity.java | 43 + .../forestry/api/core/EnumTemperature.java | 71 + .../forestry/api/core/ErrorStateRegistry.java | 77 + .../java/forestry/api/core/ForestryAPI.java | 52 + .../java/forestry/api/core/ForestryEvent.java | 60 + .../forestry/api/core/IArmorNaturalist.java | 25 + .../java/forestry/api/core/IErrorState.java | 41 + .../forestry/api/core/IForestryConstants.java | 24 + src/api/java/forestry/api/core/IGameMode.java | 41 + .../java/forestry/api/core/IIconProvider.java | 25 + .../java/forestry/api/core/INBTTagable.java | 14 + .../forestry/api/core/IStructureLogic.java | 20 + .../forestry/api/core/ITextureManager.java | 21 + .../forestry/api/core/ITileStructure.java | 63 + .../java/forestry/api/core/IToolPipette.java | 54 + .../java/forestry/api/core/IToolScoop.java | 13 + src/api/java/forestry/api/core/Tabs.java | 19 + .../java/forestry/api/core/package-info.java | 8 + .../java/forestry/api/farming/Farmables.java | 20 + src/api/java/forestry/api/farming/ICrop.java | 21 + .../forestry/api/farming/IFarmComponent.java | 17 + .../forestry/api/farming/IFarmHousing.java | 74 + .../forestry/api/farming/IFarmInterface.java | 20 + .../forestry/api/farming/IFarmListener.java | 77 + .../java/forestry/api/farming/IFarmLogic.java | 43 + .../java/forestry/api/farming/IFarmable.java | 60 + .../forestry/api/farming/package-info.java | 8 + .../forestry/api/food/BeverageManager.java | 13 + .../forestry/api/food/IBeverageEffect.java | 17 + .../forestry/api/food/IInfuserManager.java | 24 + .../forestry/api/food/IIngredientManager.java | 16 + .../java/forestry/api/food/package-info.java | 8 + .../forestry/api/fuels/EngineBronzeFuel.java | 34 + .../forestry/api/fuels/EngineCopperFuel.java | 31 + .../forestry/api/fuels/FermenterFuel.java | 29 + .../java/forestry/api/fuels/FuelManager.java | 40 + .../forestry/api/fuels/GeneratorFuel.java | 31 + .../forestry/api/fuels/MoistenerFuel.java | 34 + .../forestry/api/fuels/RainSubstrate.java | 40 + .../java/forestry/api/fuels/package-info.java | 8 + .../forestry/api/genetics/AlleleManager.java | 36 + .../forestry/api/genetics/EnumTolerance.java | 16 + .../java/forestry/api/genetics/IAllele.java | 39 + .../forestry/api/genetics/IAlleleArea.java | 15 + .../forestry/api/genetics/IAlleleBoolean.java | 16 + .../forestry/api/genetics/IAlleleEffect.java | 26 + .../forestry/api/genetics/IAlleleFactory.java | 80 + .../forestry/api/genetics/IAlleleFloat.java | 15 + .../forestry/api/genetics/IAlleleFlowers.java | 16 + .../forestry/api/genetics/IAlleleHandler.java | 41 + .../forestry/api/genetics/IAlleleInteger.java | 15 + .../api/genetics/IAllelePlantType.java | 16 + .../api/genetics/IAlleleRegistry.java | 218 +++ .../forestry/api/genetics/IAlleleSpecies.java | 115 ++ .../api/genetics/IAlleleSpeciesCustom.java | 23 + .../api/genetics/IAlleleTolerance.java | 15 + .../api/genetics/IBreedingTracker.java | 93 + .../forestry/api/genetics/IChromosome.java | 25 + .../api/genetics/IChromosomeType.java | 24 + .../api/genetics/IClassification.java | 107 ++ .../forestry/api/genetics/IClimateHelper.java | 53 + .../forestry/api/genetics/IEffectData.java | 27 + .../java/forestry/api/genetics/IFlower.java | 20 + .../api/genetics/IFlowerGrowthRule.java | 15 + .../api/genetics/IFlowerProvider.java | 43 + .../api/genetics/IFlowerRegistry.java | 43 + .../forestry/api/genetics/IFruitBearer.java | 50 + .../forestry/api/genetics/IFruitFamily.java | 32 + .../java/forestry/api/genetics/IGenome.java | 30 + .../java/forestry/api/genetics/IHousing.java | 57 + .../forestry/api/genetics/IIndividual.java | 53 + .../api/genetics/IIndividualLiving.java | 45 + .../forestry/api/genetics/ILegacyHandler.java | 17 + .../java/forestry/api/genetics/IMutation.java | 68 + .../api/genetics/IMutationCondition.java | 23 + .../api/genetics/IMutationCustom.java | 47 + .../forestry/api/genetics/IPollinatable.java | 48 + .../forestry/api/genetics/ISpeciesRoot.java | 163 ++ .../forestry/api/genetics/package-info.java | 8 + .../EnumButterflyChromosome.java | 98 + .../api/lepidopterology/EnumFlutterType.java | 15 + .../IAlleleButterflyEffect.java | 21 + .../IAlleleButterflySpecies.java | 59 + .../api/lepidopterology/IButterfly.java | 77 + .../api/lepidopterology/IButterflyGenome.java | 42 + .../lepidopterology/IButterflyMutation.java | 14 + .../lepidopterology/IButterflyNursery.java | 21 + .../api/lepidopterology/IButterflyRoot.java | 74 + .../api/lepidopterology/IEntityButterfly.java | 29 + .../ILepidopteristTracker.java | 14 + .../api/lepidopterology/package-info.java | 8 + .../java/forestry/api/mail/EnumAddressee.java | 26 + .../java/forestry/api/mail/EnumPostage.java | 20 + src/api/java/forestry/api/mail/ILetter.java | 59 + .../forestry/api/mail/ILetterHandler.java | 13 + .../java/forestry/api/mail/IMailAddress.java | 23 + .../java/forestry/api/mail/IPostOffice.java | 30 + .../java/forestry/api/mail/IPostRegistry.java | 58 + .../forestry/api/mail/IPostalCarrier.java | 48 + .../java/forestry/api/mail/IPostalState.java | 14 + src/api/java/forestry/api/mail/IStamps.java | 14 + .../java/forestry/api/mail/ITradeStation.java | 24 + .../java/forestry/api/mail/PostManager.java | 11 + .../forestry/api/mail/TradeStationInfo.java | 29 + .../java/forestry/api/mail/package-info.java | 8 + .../api/recipes/ICarpenterManager.java | 67 + .../api/recipes/ICentrifugeManager.java | 79 + .../api/recipes/ICraftingProvider.java | 17 + .../api/recipes/IFabricatorManager.java | 18 + .../api/recipes/IFermenterManager.java | 53 + .../api/recipes/IMoistenerManager.java | 33 + .../api/recipes/ISqueezerManager.java | 51 + .../forestry/api/recipes/IStillManager.java | 34 + .../api/recipes/IVariableFermentable.java | 21 + .../forestry/api/recipes/RecipeManagers.java | 45 + .../forestry/api/recipes/package-info.java | 8 + .../forestry/api/storage/BackpackEvent.java | 25 + .../forestry/api/storage/BackpackManager.java | 27 + .../api/storage/BackpackResupplyEvent.java | 24 + .../api/storage/BackpackStowEvent.java | 27 + .../api/storage/EnumBackpackType.java | 10 + .../api/storage/IBackpackDefinition.java | 47 + .../api/storage/IBackpackInterface.java | 22 + .../forestry/api/storage/ICrateRegistry.java | 32 + .../forestry/api/storage/StorageManager.java | 12 + .../forestry/api/storage/package-info.java | 8 + .../java/forestry/api/world/ITreeGenData.java | 30 + .../api/world/IWorldGenInterface.java | 22 + .../forestry/api/world/WorldGenManager.java | 10 + .../java/forestry/api/world/package-info.java | 8 + .../api/IHeatExchangerLogic.java | 77 + .../pneumaticCraft/api/PneumaticRegistry.java | 158 ++ .../api/actuator/IActuator.java | 32 + .../api/block/BlockSupplier.java | 77 + .../api/block/IPneumaticWrenchable.java | 14 + .../api/client/GuiAnimatedStatSupplier.java | 49 + .../api/client/GuiElementRenderer.java | 32 + .../api/client/IGuiAnimatedStat.java | 179 ++ .../AssemblyRenderOverriding.java | 55 + .../pneumaticHelmet/IBlockTrackEntry.java | 80 + .../pneumaticHelmet/IEntityTrackEntry.java | 49 + .../client/pneumaticHelmet/IGuiScreen.java | 15 + .../pneumaticHelmet/IHackableBlock.java | 69 + .../pneumaticHelmet/IHackableEntity.java | 59 + .../client/pneumaticHelmet/IOptionPage.java | 46 + .../IUpgradeRenderHandler.java | 92 + .../RenderHandlerRegistry.java | 10 + .../api/drone/DroneConstructingEvent.java | 11 + .../api/drone/IBlockInteractHandler.java | 26 + .../api/drone/ICustomBlockInteract.java | 45 + .../java/pneumaticCraft/api/drone/IDrone.java | 61 + .../api/drone/IPathNavigator.java | 11 + .../api/drone/IPathfindHandler.java | 26 + .../drone/SpecialVariableRetrievalEvent.java | 60 + .../api/item/IInventoryItem.java | 20 + .../api/item/IPressurizable.java | 35 + .../api/item/IProgrammable.java | 34 + .../pneumaticCraft/api/item/ItemSupplier.java | 47 + .../java/pneumaticCraft/api/package-info.java | 5 + .../api/recipe/AssemblyRecipe.java | 49 + .../api/recipe/IPressureChamberRecipe.java | 34 + .../api/recipe/PressureChamberRecipe.java | 24 + .../api/tileentity/AirHandlerSupplier.java | 51 + .../api/tileentity/IAirHandler.java | 114 ++ .../api/tileentity/IHeatExchanger.java | 24 + .../api/tileentity/IManoMeasurable.java | 14 + .../api/tileentity/IPneumaticMachine.java | 30 + .../api/universalSensor/EntityPollSensor.java | 31 + .../IBlockAndCoordinateEventSensor.java | 59 + .../IBlockAndCoordinatePollSensor.java | 63 + .../universalSensor/IEventSensorSetting.java | 23 + .../universalSensor/IPollSensorSetting.java | 27 + .../api/universalSensor/ISensorSetting.java | 59 + .../universalSensor/PlayerEventSensor.java | 33 + .../universalSensor/SensorRegistrator.java | 33 + src/api/java/thaumcraft/api/IGoggles.java | 22 + src/api/java/thaumcraft/api/IRepairable.java | 13 + .../thaumcraft/api/IRepairableExtended.java | 17 + src/api/java/thaumcraft/api/IRunicArmor.java | 22 + src/api/java/thaumcraft/api/IScribeTools.java | 14 + .../java/thaumcraft/api/IVisDiscountGear.java | 20 + src/api/java/thaumcraft/api/ItemApi.java | 70 + src/api/java/thaumcraft/api/ItemRunic.java | 21 + .../java/thaumcraft/api/ThaumcraftApi.java | 507 +++++ .../thaumcraft/api/ThaumcraftApiHelper.java | 269 +++ .../java/thaumcraft/api/TileThaumcraft.java | 63 + .../java/thaumcraft/api/WorldCoordinates.java | 117 ++ .../java/thaumcraft/api/aspects/Aspect.java | 201 ++ .../thaumcraft/api/aspects/AspectList.java | 256 +++ .../api/aspects/AspectSourceHelper.java | 58 + .../api/aspects/IAspectContainer.java | 80 + .../thaumcraft/api/aspects/IAspectSource.java | 16 + .../api/aspects/IEssentiaContainerItem.java | 36 + .../api/aspects/IEssentiaTransport.java | 100 + .../api/crafting/CrucibleRecipe.java | 95 + .../api/crafting/IArcaneRecipe.java | 35 + .../api/crafting/IInfusionStabiliser.java | 19 + .../crafting/InfusionEnchantmentRecipe.java | 156 ++ .../api/crafting/InfusionRecipe.java | 128 ++ .../api/crafting/ShapedArcaneRecipe.java | 261 +++ .../api/crafting/ShapelessArcaneRecipe.java | 157 ++ .../DamageSourceIndirectThaumcraftEntity.java | 32 + .../damagesource/DamageSourceThaumcraft.java | 46 + .../thaumcraft/api/entities/ITaintedMob.java | 5 + src/api/java/thaumcraft/api/nodes/INode.java | 53 + .../java/thaumcraft/api/nodes/IRevealer.java | 22 + .../thaumcraft/api/nodes/NodeModifier.java | 6 + .../java/thaumcraft/api/nodes/NodeType.java | 6 + src/api/java/thaumcraft/api/package-info.java | 4 + .../api/potions/PotionFluxTaint.java | 67 + .../api/research/IScanEventHandler.java | 9 + .../api/research/ResearchCategories.java | 101 + .../api/research/ResearchCategoryList.java | 37 + .../thaumcraft/api/research/ResearchItem.java | 367 ++++ .../thaumcraft/api/research/ResearchPage.java | 193 ++ .../thaumcraft/api/research/ScanResult.java | 39 + .../thaumcraft/api/visnet/TileVisNode.java | 188 ++ .../thaumcraft/api/visnet/VisNetHandler.java | 284 +++ .../java/thaumcraft/api/wands/IWandFocus.java | 64 + .../api/wands/IWandRodOnUpdate.java | 16 + .../api/wands/IWandTriggerManager.java | 12 + .../java/thaumcraft/api/wands/IWandable.java | 25 + .../thaumcraft/api/wands/ItemFocusBasic.java | 166 ++ .../java/thaumcraft/api/wands/StaffRod.java | 48 + .../java/thaumcraft/api/wands/WandCap.java | 129 ++ .../java/thaumcraft/api/wands/WandRod.java | 158 ++ .../api/wands/WandTriggerRegistry.java | 72 + .../java/vazkii/botania/api/BotaniaAPI.java | 363 ++++ .../api/internal/DummyManaNetwork.java | 51 + .../api/internal/DummyMethodHandler.java | 135 ++ .../botania/api/internal/DummyPage.java | 35 + .../botania/api/internal/DummySubTile.java | 18 + .../api/internal/IGuiLexiconEntry.java | 57 + .../api/internal/IInternalMethodHandler.java | 81 + .../botania/api/internal/IManaBurst.java | 62 + .../botania/api/internal/IManaNetwork.java | 68 + .../botania/api/item/IExoflameHeatable.java | 44 + .../api/item/IExtendedPlayerController.java | 29 + .../botania/api/item/IPetalApothecary.java | 30 + .../botania/api/item/IPixieSpawner.java | 30 + .../botania/api/lexicon/IAddonEntry.java | 29 + .../vazkii/botania/api/lexicon/ILexicon.java | 21 + .../botania/api/lexicon/ILexiconable.java | 29 + .../api/lexicon/IRecipeKeyProvider.java | 24 + .../botania/api/lexicon/KnowledgeType.java | 20 + .../botania/api/lexicon/LexiconCategory.java | 32 + .../botania/api/lexicon/LexiconEntry.java | 97 + .../botania/api/lexicon/LexiconPage.java | 67 + .../api/lexicon/LexiconRecipeMappings.java | 66 + .../botania/api/mana/BurstProperties.java | 37 + .../botania/api/mana/IClientManaHandler.java | 21 + .../api/mana/ICreativeManaProvider.java | 26 + .../vazkii/botania/api/mana/IKeyLocked.java | 30 + .../botania/api/mana/ILaputaImmobile.java | 23 + .../java/vazkii/botania/api/mana/ILens.java | 43 + .../vazkii/botania/api/mana/ILensEffect.java | 49 + .../vazkii/botania/api/mana/IManaBlock.java | 26 + .../botania/api/mana/IManaCollector.java | 43 + .../botania/api/mana/IManaCollisionGhost.java | 22 + .../vazkii/botania/api/mana/IManaItem.java | 69 + .../vazkii/botania/api/mana/IManaPool.java | 31 + .../botania/api/mana/IManaReceiver.java | 35 + .../vazkii/botania/api/mana/IManaTrigger.java | 24 + .../botania/api/mana/IManaUsingItem.java | 26 + .../api/mana/IPoolOverlayProvider.java | 26 + .../botania/api/mana/ITinyPlanetExcempt.java | 24 + .../botania/api/mana/ManaItemHandler.java | 201 ++ .../botania/api/mana/ManaNetworkEvent.java | 57 + .../botania/api/mana/TileSignature.java | 15 + .../api/mana/spark/ISparkAttachable.java | 54 + .../botania/api/mana/spark/ISparkEntity.java | 65 + .../botania/api/mana/spark/SparkHelper.java | 33 + .../java/vazkii/botania/api/package-info.java | 4 + .../vazkii/botania/api/recipe/IElvenItem.java | 14 + .../botania/api/recipe/IFlowerComponent.java | 26 + .../botania/api/recipe/RecipeElvenTrade.java | 94 + .../api/recipe/RecipeManaInfusion.java | 81 + .../botania/api/recipe/RecipePetals.java | 97 + .../botania/api/recipe/RecipeRuneAltar.java | 31 + .../botania/api/subtile/ISpecialFlower.java | 21 + .../api/subtile/ISubTileContainer.java | 30 + .../botania/api/subtile/SubTileEntity.java | 126 ++ .../api/subtile/SubTileFunctional.java | 212 +++ .../api/subtile/SubTileGenerating.java | 245 +++ .../botania/api/wand/ICoordBoundItem.java | 18 + .../vazkii/botania/api/wand/ITileBound.java | 31 + .../botania/api/wand/IWandBindable.java | 36 + .../vazkii/botania/api/wand/IWandHUD.java | 26 + .../vazkii/botania/api/wand/IWandable.java | 29 + .../api/wand/IWireframeAABBProvider.java | 25 + .../botania/api/wiki/IWikiProvider.java | 39 + .../botania/api/wiki/SimpleWikiProvider.java | 73 + .../vazkii/botania/api/wiki/WikiHooks.java | 43 + .../AlchemicalWizardry.java | 218 ++- .../BloodMagicConfiguration.java | 105 +- .../alchemicalWizardry/ModBlocks.java | 221 ++- .../alchemicalWizardry/ModItems.java | 445 +++-- .../api/ILimitingLogic.java | 2 +- .../alchemicalWizardry/api/Int3.java | 7 +- .../api/RoutingFocusParadigm.java | 4 +- .../api/RoutingFocusPosAndFacing.java | 6 +- .../AlchemicalPotionCreationHandler.java | 2 +- .../api/alchemy/AlchemyRecipeRegistry.java | 2 +- .../api/alchemy/energy/IReagentHandler.java | 14 +- .../api/alchemy/energy/ReagentRegistry.java | 4 +- .../api/alchemy/energy/ReagentStack.java | 3 +- .../alchemy/energy/TileReagentHandler.java | 14 +- .../energy/TileSegmentedReagentHandler.java | 26 +- .../api/altarRecipeRegistry/AltarRecipe.java | 2 +- .../AltarRecipeRegistry.java | 4 +- .../api/bindingRegistry/BindingRegistry.java | 2 +- .../bindingRegistry/UnbindingRegistry.java | 2 +- .../api/compress/CompressionRegistry.java | 4 +- .../api/event/AddToNetworkEvent.java | 4 +- .../api/event/ItemBindEvent.java | 4 +- .../api/event/ItemDrainInContainerEvent.java | 2 +- .../api/event/ItemDrainNetworkEvent.java | 2 +- .../api/event/PlayerAddToNetworkEvent.java | 2 +- .../api/event/PlayerDrainNetworkEvent.java | 2 +- .../api/event/RitualActivatedEvent.java | 2 +- .../api/event/RitualEvent.java | 2 +- .../api/event/RitualRunEvent.java | 5 +- .../api/event/SacrificeKnifeUsedEvent.java | 4 +- .../api/event/SoulNetworkEvent.java | 3 +- .../api/event/TeleposeEvent.java | 74 +- .../api/guide/OrbRecipeRenderer.java | 270 +-- .../api/guide/PageAltarRecipe.java | 138 +- .../api/guide/PageMultiBlock.java | 290 +-- .../api/guide/PageRitualMultiBlock.java | 175 +- .../api/harvest/HarvestRegistry.java | 18 +- .../api/harvest/IHarvestHandler.java | 8 +- .../api/items/ItemSpellMultiTool.java | 103 +- .../api/items/ShapedBloodOrbRecipe.java | 20 +- .../api/items/ShapelessBloodOrbRecipe.java | 8 +- .../api/items/interfaces/IRitualDiviner.java | 10 +- .../api/renderer/MRSRenderer.java | 12 +- .../api/rituals/IMasterRitualStone.java | 15 +- .../api/rituals/IRitualStone.java | 10 +- .../api/rituals/LocalRitualStorage.java | 26 +- .../api/rituals/RitualEffect.java | 11 +- .../api/rituals/Rituals.java | 31 +- .../api/sacrifice/PlayerSacrificeHandler.java | 17 +- .../soulNetwork/ComplexNetworkHandler.java | 39 +- .../api/soulNetwork/SoulNetworkHandler.java | 34 +- .../api/spell/APISpellHelper.java | 43 +- .../api/spell/EntitySpellProjectile.java | 132 +- .../spell/ExtrapolatedMeleeEntityEffect.java | 2 +- .../api/spell/IOnBreakBlock.java | 6 +- .../spell/MeleeSpellCenteredWorldEffect.java | 13 +- .../api/spell/SpellEffectRegistry.java | 8 +- .../api/spell/SpellParadigm.java | 2 +- .../api/spell/SpellParadigmMelee.java | 9 +- .../api/spell/SpellParadigmProjectile.java | 4 +- .../api/spell/SpellParadigmSelf.java | 7 +- .../api/spell/SpellParadigmTool.java | 43 +- .../summoningRegistry/SummoningRegistry.java | 2 +- .../api/tile/ISpellTile.java | 4 +- .../client/BlockRenderer.java | 14 - .../client/ClientEventHandler.java | 50 +- .../client/ClientProxy.java | 38 +- .../client/ClientUtils.java | 348 ++++ .../client/POVArmourModelWrapper.java | 47 + .../client/gui/ConfigGui.java | 32 +- .../client/gui/ConfigGuiFactory.java | 10 +- .../client/nei/NEIAlchemyRecipeHandler.java | 6 +- .../client/nei/NEIAltarRecipeHandler.java | 40 +- .../client/nei/NEIBloodOrbShapedHandler.java | 2 +- .../nei/NEIBloodOrbShapelessHandler.java | 12 +- .../client/nei/NEIConfig.java | 5 +- .../client/renderer/HUDElement.java | 30 +- .../client/renderer/HUDUtils.java | 36 +- .../client/renderer/RenderFakeBlocks.java | 69 +- .../client/renderer/RenderHelper.java | 38 +- .../client/renderer/RitualDivinerRender.java | 32 +- .../common/AlchemicalWizardryEventHooks.java | 94 +- .../common/AlchemicalWizardryFuelHandler.java | 8 +- .../common/ClientToServerPacketHandler.java | 6 +- .../common/CommonProxy.java | 42 +- .../common/CoordAndRange.java | 12 - .../common/EntityAITargetAggro.java | 2 +- .../alchemicalWizardry/common/ItemType.java | 4 +- .../common/LifeBucketHandler.java | 16 +- .../common/LifeEssence.java | 3 +- .../common/MessageKeyPressed.java | 6 +- .../common/ModLivingDropsEvent.java | 4 +- .../common/NewPacketHandler.java | 406 ++-- .../achievements/AchievementTrigger.java | 27 +- .../common/achievements/AchievementsMod.java | 2 +- .../achievements/AchievementsRegistry.java | 71 +- .../achievements/ICraftAchievement.java | 11 - .../achievements/IPickupAchievement.java | 11 - .../common/achievements/ModAchievements.java | 55 +- .../alchemy/CombinedPotionRegistry.java | 2 +- ...BlockArmourForge.java => ArmourForge.java} | 82 +- ...ator.java => BlockAlchemicCalcinator.java} | 43 +- .../common/block/BlockAltar.java | 95 +- .../common/block/BlockBelljar.java | 56 +- .../common/block/BlockBloodLightSource.java | 29 +- .../common/block/BlockBloodRune.java | 101 - .../common/block/BlockBloodStoneBrick.java | 14 - .../common/block/BlockConduit.java | 53 +- ...ncenseCrucible.java => BlockCrucible.java} | 84 +- .../common/block/BlockCrystal.java | 47 +- .../common/block/BlockDemonPortal.java | 28 +- .../common/block/BlockEfficiencyRune.java | 17 - .../common/block/BlockEmptySocket.java | 20 - .../common/block/BlockEnchantmentGlyph.java | 57 +- .../common/block/BlockHomHeart.java | 98 + .../block/BlockLargeBloodStoneBrick.java | 14 - .../common/block/BlockLifeEssence.java | 29 - .../common/block/BlockMasterStone.java | 36 +- .../common/block/BlockMimic.java | 210 --- .../common/block/BlockOrientable.java | 28 +- .../common/block/BlockPedestal.java | 68 +- .../common/block/BlockPlinth.java | 68 +- .../common/block/BlockReagentConduit.java | 26 +- .../common/block/BlockRitualStone.java | 69 - .../common/block/BlockRuneOfSacrifice.java | 17 - .../block/BlockRuneOfSelfSacrifice.java | 17 - .../common/block/BlockSchematicSaver.java | 12 +- ...lockFilledSocket.java => BlockSocket.java} | 64 +- .../common/block/BlockSpectralContainer.java | 27 +- .../common/block/BlockSpeedRune.java | 17 - .../common/block/BlockSpellEffect.java | 13 +- .../common/block/BlockSpellEnhancement.java | 12 +- .../common/block/BlockSpellModifier.java | 12 +- .../common/block/BlockSpellParadigm.java | 28 +- .../common/block/BlockSpellTable.java | 63 - .../common/block/BlockStabilityGlyph.java | 38 +- .../common/block/BlockTeleposer.java | 145 +- ...emistrySet.java => BlockWritingTable.java} | 84 +- .../common/block/BloodRune.java | 132 ++ .../common/block/BloodStoneBrick.java | 27 + .../common/block/EfficiencyRune.java | 31 + .../common/block/EmptySocket.java | 33 + .../common/block/IOrientable.java | 10 +- ...alStone.java => ImperfectRitualStone.java} | 44 +- .../common/block/LargeBloodStoneBrick.java | 27 + .../common/block/LifeEssenceBlock.java | 49 + .../common/block/MimicBlock.java | 231 +++ .../common/block/RitualStone.java | 133 ++ .../common/block/RuneOfSacrifice.java | 31 + .../common/block/RuneOfSelfSacrifice.java | 31 + ...{BlockSpectral.java => SpectralBlock.java} | 44 +- .../common/block/SpeedRune.java | 31 + .../bloodAltarUpgrade/AltarComponent.java | 6 - .../bloodAltarUpgrade/UpgradedAltars.java | 184 +- .../common/book/BloodMagicGuide.java | 1672 ++++++++--------- .../common/commands/CommandBind.java | 76 + .../common/commands/CommandSN.java | 137 ++ .../common/commands/CommandUnbind.java | 52 + .../compress/StorageBlockCraftingManager.java | 4 +- .../common/demonVillage/BlockSet.java | 26 +- .../demonVillage/BuildingSchematic.java | 20 +- .../common/demonVillage/DemonBuilding.java | 14 +- .../common/demonVillage/DemonVillagePath.java | 96 +- .../common/demonVillage/GridSpaceHolder.java | 20 +- .../common/demonVillage/TileBlockSet.java | 8 + .../ai/EntityAIOccasionalRangedAttack.java | 3 +- .../ai/EntityDemonAIHurtByTarget.java | 10 +- .../demonHoard/DemonHoardPacket.java | 5 +- .../demonHoard/DemonPacketRegistry.java | 2 +- .../demon/EntityMinorDemonGrunt.java | 61 +- .../demonHoard/demon/IHoardDemon.java | 11 +- .../loot/DemonVillageLootRegistry.java | 16 +- .../tileEntity/BlockDemonChest.java | 19 +- .../demonVillage/tileEntity/TEDemonChest.java | 29 +- .../tileEntity/TEDemonPortal.java | 197 +- .../common/entity/mob/BookEntityItem.java | 2 +- .../common/entity/mob/EntityBileDemon.java | 372 +++- .../common/entity/mob/EntityBoulderFist.java | 366 +++- .../common/entity/mob/EntityDemon.java | 396 +--- .../common/entity/mob/EntityElemental.java | 299 +-- .../common/entity/mob/EntityFallenAngel.java | 358 +++- .../entity/mob/EntityFireElemental.java | 1 - .../entity/mob/EntityHolyElemental.java | 1 - .../common/entity/mob/EntityIceDemon.java | 355 +++- .../entity/mob/EntityLowerGuardian.java | 379 +++- .../common/entity/mob/EntityShade.java | 359 +++- .../entity/mob/EntityShadeElemental.java | 1 - .../entity/mob/EntitySmallEarthGolem.java | 354 +++- .../entity/mob/EntityWaterElemental.java | 1 - .../entity/mob/EntityWingedFireDemon.java | 364 +++- .../entity/mob/MailOrderEntityItem.java | 19 +- .../projectile/EnergyBlastProjectile.java | 101 +- .../entity/projectile/EntityBeamParticle.java | 16 + .../EntityBloodLightProjectile.java | 50 +- .../EntityEnergyBazookaMainProjectile.java | 7 +- ...ntityEnergyBazookaSecondaryProjectile.java | 184 +- .../entity/projectile/EntityMeteor.java | 4 +- .../entity/projectile/EntityParticleBeam.java | 54 +- .../projectile/ExplosionProjectile.java | 7 +- .../entity/projectile/FireProjectile.java | 20 +- .../entity/projectile/HolyProjectile.java | 15 +- .../entity/projectile/IceProjectile.java | 18 +- .../projectile/LightningBoltProjectile.java | 7 +- .../entity/projectile/MudProjectile.java | 9 +- .../entity/projectile/TeleportProjectile.java | 11 +- .../entity/projectile/WaterProjectile.java | 11 +- .../entity/projectile/WindGustProjectile.java | 9 +- .../common/guide/RecipeHolder.java | 4 +- .../harvest/AgriCraftCropHarvestHandler.java | 83 + .../harvest/BloodMagicHarvestHandler.java | 22 +- .../harvest/CactusReedHarvestHandler.java | 14 +- .../GenericItemStackHarvestHandler.java | 36 +- ...GenericPamSeedlessFruitHarvestHandler.java | 136 +- .../harvest/GenericSeededHarvestHandler.java | 275 ++- .../common/harvest/GourdHarvestHandler.java | 12 +- .../harvest/PamHarvestCompatRegistry.java | 250 +-- .../common/items/AWBaseItems.java | 45 + .../common/items/ActivationCrystal.java | 45 +- .../common/items/AirScribeTool.java | 11 + .../common/items/ApprenticeBloodOrb.java | 13 +- .../common/items/ArchmageBloodOrb.java | 13 +- .../common/items/ArmourInhibitor.java | 112 +- .../common/items/BaseItems.java | 23 - .../common/items/BlankSpell.java | 75 +- .../common/items/BloodShard.java | 30 +- .../common/items/BoundAxe.java | 137 +- .../common/items/BoundPickaxe.java | 193 +- .../common/items/BoundShovel.java | 164 +- .../{CreativeOrb.java => CheatyItem.java} | 91 +- .../common/items/CreativeDagger.java | 22 +- .../common/items/DaggerOfSacrifice.java | 48 +- .../common/items/DawnScribeTool.java | 11 + .../common/items/DemonCrystal.java | 167 -- .../common/items/DemonPlacer.java | 247 +++ .../items/DemonicTelepositionFocus.java | 14 +- .../common/items/DuskScribeTool.java | 11 + .../common/items/EarthScribeTool.java | 11 + .../items/{Orb.java => EnergyBattery.java} | 54 +- .../common/items/EnergyBazooka.java | 72 +- .../{EnergyBlaster.java => EnergyBlast.java} | 75 +- .../{BindableItems.java => EnergyItems.java} | 43 +- .../{BoundBlade.java => EnergySword.java} | 74 +- .../items/EnhancedTelepositionFocus.java | 14 +- .../common/items/FireScribeTool.java | 11 + .../common/items/ItemAlchemyBase.java | 42 +- .../common/items/ItemBlockCrystalBelljar.java | 19 +- .../common/items/ItemBloodLetterPack.java | 38 +- .../common/items/ItemBloodRuneBlock.java | 7 +- .../common/items/ItemComplexSpellCrystal.java | 29 +- .../common/items/ItemComponents.java | 40 +- .../common/items/ItemCrystalBlock.java | 7 +- .../{KeyOfBinding.java => ItemDiabloKey.java} | 38 +- .../items/ItemEnchantmentGlyphBlock.java | 16 +- .../common/items/ItemIncense.java | 46 +- .../common/items/ItemMailOrderCatalogue.java | 11 + .../common/items/ItemRitualDismantler.java | 81 +- .../common/items/ItemRitualDiviner.java | 69 +- .../common/items/ItemSpellEffectBlock.java | 6 +- .../items/ItemSpellEnhancementBlock.java | 3 +- .../common/items/ItemSpellModifierBlock.java | 7 +- .../common/items/ItemSpellParadigmBlock.java | 4 + .../common/items/ItemStabilityGlyphBlock.java | 10 +- .../common/items/LavaCrystal.java | 52 +- .../common/items/LifeBucket.java | 10 + .../common/items/MagicianBloodOrb.java | 13 +- .../common/items/MasterBloodOrb.java | 13 +- .../common/items/OrbOfTesting.java | 45 + .../items/ReinforcedTelepositionFocus.java | 14 +- .../common/items/SacrificialDagger.java | 42 +- .../common/items/ScribeTool.java | 6 +- .../common/items/TelepositionFocus.java | 26 +- .../common/items/TranscendentBloodOrb.java | 13 +- .../common/items/WaterScribeTool.java | 13 + .../common/items/armour/BoundArmour.java | 350 ++-- .../common/items/armour/OmegaArmour.java | 31 +- .../common/items/armour/OmegaArmourEarth.java | 57 +- .../common/items/armour/OmegaArmourFire.java | 62 +- .../common/items/armour/OmegaArmourWater.java | 62 +- .../common/items/armour/OmegaArmourWind.java | 57 +- ...calRouter.java => ItemAttunedCrystal.java} | 120 +- ...anser.java => ItemDestinationClearer.java} | 33 +- ...lSegmenter.java => ItemTankSegmenter.java} | 98 +- .../common/items/forestry/ItemBloodFrame.java | 290 +-- .../common/items/potion/AlchemyFlask.java | 47 +- .../common/items/potion/AlchemyReagent.java | 69 +- .../potion/AverageLengtheningCatalyst.java | 11 + .../items/potion/AveragePowerCatalyst.java | 11 + .../items/potion/CombinationalCatalyst.java | 14 +- .../items/potion/EnhancedFillingAgent.java | 13 + .../potion/GreaterLengtheningCatalyst.java | 11 + .../items/potion/GreaterPowerCatalyst.java | 11 + .../items/potion/LengtheningCatalyst.java | 2 + .../potion/MundaneLengtheningCatalyst.java | 11 + .../items/potion/MundanePowerCatalyst.java | 11 + .../common/items/potion/PowerCatalyst.java | 2 + .../items/potion/StandardBindingAgent.java | 20 +- .../items/potion/StandardFillingAgent.java | 13 + .../common/items/potion/WeakBindingAgent.java | 11 + .../common/items/potion/WeakFillingAgent.java | 22 +- .../items/routing/InputRoutingFocus.java | 11 + .../items/routing/OutputRoutingFocus.java | 75 +- .../common/items/routing/RoutingFocus.java | 33 +- .../common/items/sigil/SigilAir.java | 26 +- .../common/items/sigil/SigilBloodLight.java | 76 +- .../common/items/sigil/SigilDivination.java | 39 +- .../common/items/sigil/SigilFluid.java | 138 +- .../common/items/sigil/SigilHarvest.java | 82 +- .../common/items/sigil/SigilLava.java | 75 +- .../items/sigil/SigilOfElementalAffinity.java | 81 +- .../items/sigil/SigilOfEnderSeverance.java | 78 +- .../common/items/sigil/SigilOfGrowth.java | 118 +- .../common/items/sigil/SigilOfHaste.java | 76 +- .../common/items/sigil/SigilOfMagnetism.java | 78 +- .../common/items/sigil/SigilOfSupression.java | 110 +- .../items/sigil/SigilOfTheAssassin.java | 51 +- .../common/items/sigil/SigilOfTheBridge.java | 95 +- .../items/sigil/SigilOfTheFastMiner.java | 79 +- .../common/items/sigil/SigilOfWind.java | 86 +- .../{SigilCompress.java => SigilPackRat.java} | 79 +- .../common/items/sigil/SigilSeer.java | 23 +- .../common/items/sigil/SigilToggleable.java | 17 - .../common/items/sigil/SigilVoid.java | 65 +- .../common/items/sigil/SigilWater.java | 117 +- .../items/sigil/holding/ContainerHolding.java | 4 +- .../items/sigil/holding/GuiHolding.java | 5 +- .../sigil/holding/HoldingPacketHandler.java | 6 +- .../sigil/holding/HoldingPacketProcessor.java | 6 +- .../items/sigil/holding/InventoryHolding.java | 45 +- .../items/sigil/holding/ScrollHelper.java | 10 +- .../items/sigil/holding/SigilOfHolding.java | 177 +- .../items/thaumcraft/ItemSanguineArmour.java | 384 ++-- .../common/omega/IEnchantmentGlyph.java | 6 +- .../common/omega/IStabilityGlyph.java | 3 +- .../common/omega/OmegaParadigm.java | 5 +- .../common/omega/OmegaParadigmEarth.java | 12 +- .../common/omega/OmegaParadigmFire.java | 19 +- .../common/omega/OmegaParadigmWater.java | 13 +- .../common/omega/OmegaParadigmWind.java | 9 +- .../common/omega/OmegaRegistry.java | 2 +- .../common/omega/OmegaStructureHandler.java | 152 +- ...onBloodMagic.java => PotionAmphibian.java} | 7 +- .../common/potion/PotionBoost.java | 18 + .../common/potion/PotionDeaf.java | 18 + .../common/potion/PotionDemonCloak.java | 18 + .../common/potion/PotionDrowning.java | 18 + .../common/potion/PotionFeatherFall.java | 18 + .../common/potion/PotionFireFuse.java | 18 + .../common/potion/PotionFlameCloak.java | 18 + .../common/potion/PotionFlight.java | 18 + .../common/potion/PotionHeavyHeart.java | 18 + .../common/potion/PotionIceCloak.java | 18 + .../common/potion/PotionInhibit.java | 18 + .../common/potion/PotionPlanarBinding.java | 18 + .../potion/PotionProjectileProtect.java | 18 + .../common/potion/PotionReciprocation.java | 18 + .../common/potion/PotionSoulFray.java | 34 + .../common/potion/PotionSoulHarden.java | 18 + .../renderer/AlchemyCircleRenderer.java | 22 +- .../common/renderer/BeamRenderer.java | 146 ++ .../block/RenderAlchemicCalcinator.java | 420 +++++ .../block/RenderAlchemicalCalcinator.java | 201 -- .../common/renderer/block/RenderAltar.java | 80 - .../renderer/block/RenderChemistrySet.java | 166 -- .../common/renderer/block/RenderConduit.java | 17 +- .../renderer/block/RenderCrystalBelljar.java | 81 +- .../renderer/block/RenderMasterStone.java | 6 +- .../common/renderer/block/RenderPedestal.java | 174 +- .../common/renderer/block/RenderPlinth.java | 174 +- .../renderer/block/RenderReagentConduit.java | 41 +- .../block/RenderSpellEffectBlock.java | 16 +- .../block/RenderSpellEnhancementBlock.java | 16 +- .../block/RenderSpellModifierBlock.java | 16 +- .../block/RenderSpellParadigmBlock.java | 16 +- .../renderer/block/RenderWritingTable.java | 318 ++++ .../renderer/block/TEAltarRenderer.java | 232 +++ .../TEAlchemicalCalcinatorItemRenderer.java | 15 +- .../block/itemRender/TEAltarItemRenderer.java | 17 +- .../itemRender/TEBellJarItemRenderer.java | 69 +- .../itemRender/TEConduitItemRenderer.java | 18 +- .../TESpellEffectBlockItemRenderer.java | 17 +- .../TESpellEnhancementBlockItemRenderer.java | 17 +- .../TESpellModifierBlockItemRenderer.java | 17 +- .../TESpellParadigmBlockItemRenderer.java | 17 +- ...r.java => TEWritingTableItemRenderer.java} | 14 +- .../common/renderer/mob/RenderBileDemon.java | 3 +- .../renderer/mob/RenderBoulderFist.java | 3 +- .../common/renderer/mob/RenderElemental.java | 3 +- .../renderer/mob/RenderFallenAngel.java | 9 +- .../common/renderer/mob/RenderIceDemon.java | 5 +- .../renderer/mob/RenderLowerGuardian.java | 5 +- .../renderer/mob/RenderMinorDemonGrunt.java | 3 +- .../mob/RenderMinorDemonGruntGuardian.java | 3 +- .../common/renderer/mob/RenderShade.java | 3 +- .../renderer/mob/RenderSmallEarthGolem.java | 3 +- .../renderer/mob/RenderWingedFireDemon.java | 3 +- .../renderer/model/ModelBloodAltar.java | 30 +- .../common/renderer/model/ModelConduit.java | 4 +- .../common/renderer/model/ModelElemental.java | 12 +- .../renderer/model/ModelSpellEffectBlock.java | 4 +- .../model/ModelSpellEnhancementBlock.java | 4 +- .../model/ModelSpellModifierBlock.java | 4 +- .../model/ModelSpellParadigmBlock.java | 4 +- ...emistrySet.java => ModelWritingTable.java} | 4 +- .../RenderEnergyBazookaMainProjectile.java | 14 +- .../RenderEnergyBlastProjectile.java | 39 +- .../projectile/RenderFireProjectile.java | 41 + .../renderer/projectile/RenderMeteor.java | 15 +- .../common/rituals/LocalStorageAlphaPact.java | 50 +- .../common/rituals/RitualEffectAlphaPact.java | 357 ++-- .../rituals/RitualEffectAnimalGrowth.java | 33 +- .../rituals/RitualEffectApiaryOverclock.java | 25 +- .../rituals/RitualEffectAutoAlchemy.java | 81 +- .../common/rituals/RitualEffectBinding.java | 106 +- .../rituals/RitualEffectBiomeChanger.java | 114 +- .../rituals/RitualEffectContainment.java | 38 +- .../common/rituals/RitualEffectCrafting.java | 43 +- .../common/rituals/RitualEffectCrushing.java | 116 +- .../rituals/RitualEffectDemonPortal.java | 28 +- .../common/rituals/RitualEffectEllipsoid.java | 49 +- .../rituals/RitualEffectEvaporation.java | 117 +- .../common/rituals/RitualEffectExpulsion.java | 83 +- .../rituals/RitualEffectFeatheredEarth.java | 34 +- .../rituals/RitualEffectFeatheredKnife.java | 17 +- .../common/rituals/RitualEffectFlight.java | 17 +- .../rituals/RitualEffectFullStomach.java | 19 +- .../common/rituals/RitualEffectGrowth.java | 35 +- .../common/rituals/RitualEffectHarvest.java | 34 +- .../common/rituals/RitualEffectHealing.java | 30 +- .../rituals/RitualEffectInterdiction.java | 25 +- .../rituals/RitualEffectItemRouting.java | 51 +- .../rituals/RitualEffectItemSuction.java | 35 +- .../common/rituals/RitualEffectJumping.java | 15 +- .../common/rituals/RitualEffectLava.java | 59 +- .../common/rituals/RitualEffectLeap.java | 11 +- .../rituals/RitualEffectLifeConduit.java | 22 +- .../common/rituals/RitualEffectMagnetic.java | 35 +- .../rituals/RitualEffectOmegaStalling.java | 15 +- .../common/rituals/RitualEffectOmegaTest.java | 35 +- .../common/rituals/RitualEffectSpawnWard.java | 49 +- .../rituals/RitualEffectSphereCreator.java | 30 +- .../rituals/RitualEffectSummonMeteor.java | 13 +- .../rituals/RitualEffectSupression.java | 42 +- .../common/rituals/RitualEffectUnbinding.java | 25 +- .../rituals/RitualEffectVeilOfEvil.java | 37 +- .../common/rituals/RitualEffectWater.java | 66 +- .../rituals/RitualEffectWellOfSuffering.java | 36 +- .../routing/RoutingFocusLogicIgnMeta.java | 2 +- .../routing/RoutingFocusLogicLimit.java | 1 - .../routing/RoutingFocusLogicModItems.java | 4 +- .../common/spell/complex/SpellModifier.java | 21 - .../spell/complex/SpellModifierDefault.java | 9 - .../spell/complex/SpellModifierDefensive.java | 9 - .../complex/SpellModifierEnvironmental.java | 9 - .../spell/complex/SpellModifierOffensive.java | 9 - .../spell/complex/effect/SpellHelper.java | 229 +-- .../cse/earth/CSEMeleeDefaultEarth.java | 1 - .../cse/earth/CSEMeleeDefensiveEarth.java | 1 - .../cse/earth/CSEMeleeEnvironmentalEarth.java | 1 - .../cse/earth/CSEMeleeOffensiveEarth.java | 1 - .../cse/earth/CSEProjectileDefaultEarth.java | 1 - .../CSEProjectileEnvironmentalEarth.java | 1 - .../earth/CSEProjectileOffensiveEarth.java | 1 - .../effect/cse/earth/CSESelfDefaultEarth.java | 1 - .../cse/earth/CSESelfDefensiveEarth.java | 1 - .../cse/earth/CSESelfOffensiveEarth.java | 1 - .../effect/cse/earth/CSEToolDefaultEarth.java | 4 - .../cse/earth/CSEToolEnvironmentalEarth.java | 1 - .../cse/earth/CSEToolOffensiveEarth.java | 1 - .../cse/ice/CSEMeleeEnvironmentalIce.java | 2 +- .../effect/cse/wind/CSEMeleeDefaultWind.java | 1 - .../cse/wind/CSEProjectileDefensiveWind.java | 2 +- .../earth/MeleeDefaultEarth.java | 17 +- .../earth/MeleeDefensiveEarth.java | 17 +- .../earth/MeleeEnvironmentalEarth.java | 22 +- .../earth/MeleeOffensiveEarth.java | 10 +- .../earth/ProjectileDefaultEarth.java | 28 +- .../earth/ProjectileDefensiveEarth.java | 28 +- .../earth/ProjectileEnvironmentalEarth.java | 38 +- .../earth/ProjectileOffensiveEarth.java | 26 +- .../impactEffects/earth/SelfDefaultEarth.java | 20 +- .../earth/SelfDefensiveEarth.java | 2 +- .../earth/SelfOffensiveEarth.java | 16 +- .../earth/ToolEnvironmentalEarth.java | 30 +- .../earth/ToolOffensiveEarth.java | 7 +- .../fire/MeleeDefensiveFire.java | 27 +- .../fire/MeleeEnvironmentalFire.java | 10 +- .../fire/ProjectileDefaultFire.java | 30 +- .../fire/ProjectileDefensiveFire.java | 21 +- .../fire/ProjectileEnvironmentalFire.java | 18 +- .../fire/ProjectileOffensiveFire.java | 20 +- .../impactEffects/fire/SelfDefensiveFire.java | 21 +- .../fire/SelfEnvironmentalFire.java | 23 +- .../impactEffects/fire/ToolDefaultFire.java | 3 +- .../fire/ToolEnvironmentalFire.java | 18 +- .../impactEffects/ice/MeleeDefaultIce.java | 1 - .../impactEffects/ice/MeleeDefensiveIce.java | 29 +- .../impactEffects/ice/MeleeOffensiveIce.java | 19 +- .../ice/ProjectileDefaultIce.java | 19 +- .../ice/ProjectileDefensiveIce.java | 16 +- .../ice/ProjectileEnvironmentalIce.java | 14 +- .../ice/ProjectileOffensiveIce.java | 2 +- .../impactEffects/ice/SelfDefaultIce.java | 19 +- .../ice/SelfEnvironmentalIce.java | 27 +- .../impactEffects/ice/ToolDefaultIce.java | 5 - .../impactEffects/ice/ToolDefensiveIce.java | 31 +- .../impactEffects/tool/DigAreaEffect.java | 100 +- .../impactEffects/tool/DigAreaTunnel.java | 40 +- .../impactEffects/tool/RightClickTunnel.java | 40 +- .../wind/MeleeEnvironmentalWind.java | 17 +- .../wind/ProjectileDefaultWind.java | 5 +- .../wind/ProjectileEnvironmentalWind.java | 14 +- .../wind/ProjectileOffensiveWind.java | 6 +- .../impactEffects/wind/ToolDefensiveWind.java | 5 +- .../wind/ToolEnvironmentalWind.java | 20 +- .../impactEffects/wind/ToolOffensiveWind.java | 2 +- .../spell/simple/HomSpellComponent.java | 1 - .../common/spell/simple/ISimpleSpell.java | 8 +- .../common/spell/simple/SpellEarthBender.java | 127 +- .../common/spell/simple/SpellExplosions.java | 18 +- .../common/spell/simple/SpellFireBurst.java | 93 +- .../common/spell/simple/SpellFrozenWater.java | 117 +- .../common/spell/simple/SpellHolyBlast.java | 27 +- .../spell/simple/SpellLightningBolt.java | 23 +- .../common/spell/simple/SpellTeleport.java | 129 +- .../common/spell/simple/SpellWateryGrave.java | 45 +- .../common/spell/simple/SpellWindGust.java | 32 +- .../summoning/meteor/MeteorParadigm.java | 30 +- .../summoning/meteor/MeteorRegistry.java | 13 +- .../common/thread/GAPIChecker.java | 28 +- .../common/thread/ThreadDownloadGAPI.java | 2 +- ...cinator.java => TEAlchemicCalcinator.java} | 83 +- .../common/tileEntity/TEAltar.java | 91 +- .../common/tileEntity/TEBelljar.java | 46 +- .../common/tileEntity/TEConduit.java | 9 +- .../common/tileEntity/TECrucible.java | 87 +- .../{TESpellTable.java => TEHomHeart.java} | 83 +- .../common/tileEntity/TEInventory.java | 39 +- .../common/tileEntity/TEMasterStone.java | 92 +- .../common/tileEntity/TEMimicBlock.java | 50 +- .../common/tileEntity/TEOrientable.java | 34 +- .../common/tileEntity/TEPedestal.java | 16 +- .../common/tileEntity/TEPlinth.java | 52 +- .../common/tileEntity/TEReagentConduit.java | 122 +- .../common/tileEntity/TESchematicSaver.java | 43 +- .../common/tileEntity/TESocket.java | 9 +- .../common/tileEntity/TESpectralBlock.java | 29 +- .../tileEntity/TESpectralContainer.java | 30 +- .../common/tileEntity/TESpellBlock.java | 13 +- .../common/tileEntity/TESpellEffectBlock.java | 2 +- .../tileEntity/TESpellEnhancementBlock.java | 6 +- .../tileEntity/TESpellModifierBlock.java | 2 +- .../tileEntity/TESpellParadigmBlock.java | 18 +- .../common/tileEntity/TETeleposer.java | 43 +- ...EChemistrySet.java => TEWritingTable.java} | 82 +- .../container/ContainerWritingTable.java | 6 +- .../common/tileEntity/gui/GuiHandler.java | 25 +- ...ChemistrySet.java => GuiWritingTable.java} | 6 +- .../common/tweaker/Alchemy.java | 257 +-- .../common/tweaker/Binding.java | 260 +-- .../common/tweaker/BloodAltar.java | 266 +-- .../common/tweaker/BloodOrb.java | 294 +-- .../common/tweaker/FallingTower.java | 278 +-- .../common/tweaker/HarvestMoon.java | 180 +- .../common/tweaker/MTHelper.java | 164 +- .../tweaker/MineTweakerIntegration.java | 38 +- .../blockstates/base_rune.json | 44 - .../blockstates/soul_armour_forge.json | 5 - .../assets/alchemicalwizardry/lang/en_US.lang | 548 +++--- .../assets/alchemicalwizardry/lang/zh_CN.lang | 268 ++- .../models/block/soul_armour_forge.json | 6 - .../models/item/soul_armour_forge.json | 10 - .../assets/alchemicalwizardryBooks/books.txt | 259 +++ .../alchemicalwizardryBooks/books/book.txt | 370 ++++ .../alchemicalwizardryBooks/lang/en_US.lang | 414 ++++ .../resources/assets/forge/lang/en_US.lang | 5 + .../resources/assets/forge/lang/es_ES.lang | 212 +++ .../resources/assets/forge/lang/fr_FR.lang | 5 + 932 files changed, 39272 insertions(+), 11544 deletions(-) create mode 100644 src/api/java/forestry/api/apiculture/BeeManager.java create mode 100644 src/api/java/forestry/api/apiculture/EnumBeeChromosome.java create mode 100644 src/api/java/forestry/api/apiculture/EnumBeeType.java create mode 100644 src/api/java/forestry/api/apiculture/FlowerManager.java create mode 100644 src/api/java/forestry/api/apiculture/IAlleleBeeEffect.java create mode 100644 src/api/java/forestry/api/apiculture/IAlleleBeeSpecies.java create mode 100644 src/api/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java create mode 100644 src/api/java/forestry/api/apiculture/IAlvearyComponent.java create mode 100644 src/api/java/forestry/api/apiculture/IApiaristTracker.java create mode 100644 src/api/java/forestry/api/apiculture/IArmorApiarist.java create mode 100644 src/api/java/forestry/api/apiculture/IBee.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeFactory.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeGenome.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeHousing.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeIconProvider.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeListener.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeModifier.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeMutation.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeMutationCustom.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeMutationFactory.java create mode 100644 src/api/java/forestry/api/apiculture/IBeeRoot.java create mode 100644 src/api/java/forestry/api/apiculture/IBeekeepingLogic.java create mode 100644 src/api/java/forestry/api/apiculture/IBeekeepingMode.java create mode 100644 src/api/java/forestry/api/apiculture/IHiveDrop.java create mode 100644 src/api/java/forestry/api/apiculture/IHiveFrame.java create mode 100644 src/api/java/forestry/api/apiculture/IJubilanceFactory.java create mode 100644 src/api/java/forestry/api/apiculture/IJubilanceProvider.java create mode 100644 src/api/java/forestry/api/apiculture/hives/HiveManager.java create mode 100644 src/api/java/forestry/api/apiculture/hives/IHiveDescription.java create mode 100644 src/api/java/forestry/api/apiculture/hives/IHiveGen.java create mode 100644 src/api/java/forestry/api/apiculture/hives/IHiveGenHelper.java create mode 100644 src/api/java/forestry/api/apiculture/hives/IHiveRegistry.java create mode 100644 src/api/java/forestry/api/apiculture/hives/package-info.java create mode 100644 src/api/java/forestry/api/apiculture/package-info.java create mode 100644 src/api/java/forestry/api/arboriculture/EnumGermlingType.java create mode 100644 src/api/java/forestry/api/arboriculture/EnumGrowthConditions.java create mode 100644 src/api/java/forestry/api/arboriculture/EnumTreeChromosome.java create mode 100644 src/api/java/forestry/api/arboriculture/IAlleleFruit.java create mode 100644 src/api/java/forestry/api/arboriculture/IAlleleGrowth.java create mode 100644 src/api/java/forestry/api/arboriculture/IAlleleLeafEffect.java create mode 100644 src/api/java/forestry/api/arboriculture/IAlleleTreeSpecies.java create mode 100644 src/api/java/forestry/api/arboriculture/IArboristTracker.java create mode 100644 src/api/java/forestry/api/arboriculture/IFruitProvider.java create mode 100644 src/api/java/forestry/api/arboriculture/IGrowthProvider.java create mode 100644 src/api/java/forestry/api/arboriculture/ILeafTickHandler.java create mode 100644 src/api/java/forestry/api/arboriculture/IToolGrafter.java create mode 100644 src/api/java/forestry/api/arboriculture/ITree.java create mode 100644 src/api/java/forestry/api/arboriculture/ITreeGenome.java create mode 100644 src/api/java/forestry/api/arboriculture/ITreeModifier.java create mode 100644 src/api/java/forestry/api/arboriculture/ITreeMutation.java create mode 100644 src/api/java/forestry/api/arboriculture/ITreeRoot.java create mode 100644 src/api/java/forestry/api/arboriculture/ITreekeepingMode.java create mode 100644 src/api/java/forestry/api/arboriculture/package-info.java create mode 100644 src/api/java/forestry/api/circuits/ChipsetManager.java create mode 100644 src/api/java/forestry/api/circuits/ICircuit.java create mode 100644 src/api/java/forestry/api/circuits/ICircuitBoard.java create mode 100644 src/api/java/forestry/api/circuits/ICircuitLayout.java create mode 100644 src/api/java/forestry/api/circuits/ICircuitLibrary.java create mode 100644 src/api/java/forestry/api/circuits/ICircuitRegistry.java create mode 100644 src/api/java/forestry/api/circuits/ISolderManager.java create mode 100644 src/api/java/forestry/api/circuits/package-info.java create mode 100644 src/api/java/forestry/api/core/BiomeHelper.java create mode 100644 src/api/java/forestry/api/core/EnumHumidity.java create mode 100644 src/api/java/forestry/api/core/EnumTemperature.java create mode 100644 src/api/java/forestry/api/core/ErrorStateRegistry.java create mode 100644 src/api/java/forestry/api/core/ForestryAPI.java create mode 100644 src/api/java/forestry/api/core/ForestryEvent.java create mode 100644 src/api/java/forestry/api/core/IArmorNaturalist.java create mode 100644 src/api/java/forestry/api/core/IErrorState.java create mode 100644 src/api/java/forestry/api/core/IForestryConstants.java create mode 100644 src/api/java/forestry/api/core/IGameMode.java create mode 100644 src/api/java/forestry/api/core/IIconProvider.java create mode 100644 src/api/java/forestry/api/core/INBTTagable.java create mode 100644 src/api/java/forestry/api/core/IStructureLogic.java create mode 100644 src/api/java/forestry/api/core/ITextureManager.java create mode 100644 src/api/java/forestry/api/core/ITileStructure.java create mode 100644 src/api/java/forestry/api/core/IToolPipette.java create mode 100644 src/api/java/forestry/api/core/IToolScoop.java create mode 100644 src/api/java/forestry/api/core/Tabs.java create mode 100644 src/api/java/forestry/api/core/package-info.java create mode 100644 src/api/java/forestry/api/farming/Farmables.java create mode 100644 src/api/java/forestry/api/farming/ICrop.java create mode 100644 src/api/java/forestry/api/farming/IFarmComponent.java create mode 100644 src/api/java/forestry/api/farming/IFarmHousing.java create mode 100644 src/api/java/forestry/api/farming/IFarmInterface.java create mode 100644 src/api/java/forestry/api/farming/IFarmListener.java create mode 100644 src/api/java/forestry/api/farming/IFarmLogic.java create mode 100644 src/api/java/forestry/api/farming/IFarmable.java create mode 100644 src/api/java/forestry/api/farming/package-info.java create mode 100644 src/api/java/forestry/api/food/BeverageManager.java create mode 100644 src/api/java/forestry/api/food/IBeverageEffect.java create mode 100644 src/api/java/forestry/api/food/IInfuserManager.java create mode 100644 src/api/java/forestry/api/food/IIngredientManager.java create mode 100644 src/api/java/forestry/api/food/package-info.java create mode 100644 src/api/java/forestry/api/fuels/EngineBronzeFuel.java create mode 100644 src/api/java/forestry/api/fuels/EngineCopperFuel.java create mode 100644 src/api/java/forestry/api/fuels/FermenterFuel.java create mode 100644 src/api/java/forestry/api/fuels/FuelManager.java create mode 100644 src/api/java/forestry/api/fuels/GeneratorFuel.java create mode 100644 src/api/java/forestry/api/fuels/MoistenerFuel.java create mode 100644 src/api/java/forestry/api/fuels/RainSubstrate.java create mode 100644 src/api/java/forestry/api/fuels/package-info.java create mode 100644 src/api/java/forestry/api/genetics/AlleleManager.java create mode 100644 src/api/java/forestry/api/genetics/EnumTolerance.java create mode 100644 src/api/java/forestry/api/genetics/IAllele.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleArea.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleBoolean.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleEffect.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleFactory.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleFloat.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleFlowers.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleHandler.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleInteger.java create mode 100644 src/api/java/forestry/api/genetics/IAllelePlantType.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleRegistry.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleSpecies.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleSpeciesCustom.java create mode 100644 src/api/java/forestry/api/genetics/IAlleleTolerance.java create mode 100644 src/api/java/forestry/api/genetics/IBreedingTracker.java create mode 100644 src/api/java/forestry/api/genetics/IChromosome.java create mode 100644 src/api/java/forestry/api/genetics/IChromosomeType.java create mode 100644 src/api/java/forestry/api/genetics/IClassification.java create mode 100644 src/api/java/forestry/api/genetics/IClimateHelper.java create mode 100644 src/api/java/forestry/api/genetics/IEffectData.java create mode 100644 src/api/java/forestry/api/genetics/IFlower.java create mode 100644 src/api/java/forestry/api/genetics/IFlowerGrowthRule.java create mode 100644 src/api/java/forestry/api/genetics/IFlowerProvider.java create mode 100644 src/api/java/forestry/api/genetics/IFlowerRegistry.java create mode 100644 src/api/java/forestry/api/genetics/IFruitBearer.java create mode 100644 src/api/java/forestry/api/genetics/IFruitFamily.java create mode 100644 src/api/java/forestry/api/genetics/IGenome.java create mode 100644 src/api/java/forestry/api/genetics/IHousing.java create mode 100644 src/api/java/forestry/api/genetics/IIndividual.java create mode 100644 src/api/java/forestry/api/genetics/IIndividualLiving.java create mode 100644 src/api/java/forestry/api/genetics/ILegacyHandler.java create mode 100644 src/api/java/forestry/api/genetics/IMutation.java create mode 100644 src/api/java/forestry/api/genetics/IMutationCondition.java create mode 100644 src/api/java/forestry/api/genetics/IMutationCustom.java create mode 100644 src/api/java/forestry/api/genetics/IPollinatable.java create mode 100644 src/api/java/forestry/api/genetics/ISpeciesRoot.java create mode 100644 src/api/java/forestry/api/genetics/package-info.java create mode 100644 src/api/java/forestry/api/lepidopterology/EnumButterflyChromosome.java create mode 100644 src/api/java/forestry/api/lepidopterology/EnumFlutterType.java create mode 100644 src/api/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java create mode 100644 src/api/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java create mode 100644 src/api/java/forestry/api/lepidopterology/IButterfly.java create mode 100644 src/api/java/forestry/api/lepidopterology/IButterflyGenome.java create mode 100644 src/api/java/forestry/api/lepidopterology/IButterflyMutation.java create mode 100644 src/api/java/forestry/api/lepidopterology/IButterflyNursery.java create mode 100644 src/api/java/forestry/api/lepidopterology/IButterflyRoot.java create mode 100644 src/api/java/forestry/api/lepidopterology/IEntityButterfly.java create mode 100644 src/api/java/forestry/api/lepidopterology/ILepidopteristTracker.java create mode 100644 src/api/java/forestry/api/lepidopterology/package-info.java create mode 100644 src/api/java/forestry/api/mail/EnumAddressee.java create mode 100644 src/api/java/forestry/api/mail/EnumPostage.java create mode 100644 src/api/java/forestry/api/mail/ILetter.java create mode 100644 src/api/java/forestry/api/mail/ILetterHandler.java create mode 100644 src/api/java/forestry/api/mail/IMailAddress.java create mode 100644 src/api/java/forestry/api/mail/IPostOffice.java create mode 100644 src/api/java/forestry/api/mail/IPostRegistry.java create mode 100644 src/api/java/forestry/api/mail/IPostalCarrier.java create mode 100644 src/api/java/forestry/api/mail/IPostalState.java create mode 100644 src/api/java/forestry/api/mail/IStamps.java create mode 100644 src/api/java/forestry/api/mail/ITradeStation.java create mode 100644 src/api/java/forestry/api/mail/PostManager.java create mode 100644 src/api/java/forestry/api/mail/TradeStationInfo.java create mode 100644 src/api/java/forestry/api/mail/package-info.java create mode 100644 src/api/java/forestry/api/recipes/ICarpenterManager.java create mode 100644 src/api/java/forestry/api/recipes/ICentrifugeManager.java create mode 100644 src/api/java/forestry/api/recipes/ICraftingProvider.java create mode 100644 src/api/java/forestry/api/recipes/IFabricatorManager.java create mode 100644 src/api/java/forestry/api/recipes/IFermenterManager.java create mode 100644 src/api/java/forestry/api/recipes/IMoistenerManager.java create mode 100644 src/api/java/forestry/api/recipes/ISqueezerManager.java create mode 100644 src/api/java/forestry/api/recipes/IStillManager.java create mode 100644 src/api/java/forestry/api/recipes/IVariableFermentable.java create mode 100644 src/api/java/forestry/api/recipes/RecipeManagers.java create mode 100644 src/api/java/forestry/api/recipes/package-info.java create mode 100644 src/api/java/forestry/api/storage/BackpackEvent.java create mode 100644 src/api/java/forestry/api/storage/BackpackManager.java create mode 100644 src/api/java/forestry/api/storage/BackpackResupplyEvent.java create mode 100644 src/api/java/forestry/api/storage/BackpackStowEvent.java create mode 100644 src/api/java/forestry/api/storage/EnumBackpackType.java create mode 100644 src/api/java/forestry/api/storage/IBackpackDefinition.java create mode 100644 src/api/java/forestry/api/storage/IBackpackInterface.java create mode 100644 src/api/java/forestry/api/storage/ICrateRegistry.java create mode 100644 src/api/java/forestry/api/storage/StorageManager.java create mode 100644 src/api/java/forestry/api/storage/package-info.java create mode 100644 src/api/java/forestry/api/world/ITreeGenData.java create mode 100644 src/api/java/forestry/api/world/IWorldGenInterface.java create mode 100644 src/api/java/forestry/api/world/WorldGenManager.java create mode 100644 src/api/java/forestry/api/world/package-info.java create mode 100644 src/api/java/pneumaticCraft/api/IHeatExchangerLogic.java create mode 100644 src/api/java/pneumaticCraft/api/PneumaticRegistry.java create mode 100644 src/api/java/pneumaticCraft/api/actuator/IActuator.java create mode 100644 src/api/java/pneumaticCraft/api/block/BlockSupplier.java create mode 100644 src/api/java/pneumaticCraft/api/block/IPneumaticWrenchable.java create mode 100644 src/api/java/pneumaticCraft/api/client/GuiAnimatedStatSupplier.java create mode 100644 src/api/java/pneumaticCraft/api/client/GuiElementRenderer.java create mode 100644 src/api/java/pneumaticCraft/api/client/IGuiAnimatedStat.java create mode 100644 src/api/java/pneumaticCraft/api/client/assemblymachine/AssemblyRenderOverriding.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IBlockTrackEntry.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IEntityTrackEntry.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IGuiScreen.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableBlock.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableEntity.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IOptionPage.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IUpgradeRenderHandler.java create mode 100644 src/api/java/pneumaticCraft/api/client/pneumaticHelmet/RenderHandlerRegistry.java create mode 100644 src/api/java/pneumaticCraft/api/drone/DroneConstructingEvent.java create mode 100644 src/api/java/pneumaticCraft/api/drone/IBlockInteractHandler.java create mode 100644 src/api/java/pneumaticCraft/api/drone/ICustomBlockInteract.java create mode 100644 src/api/java/pneumaticCraft/api/drone/IDrone.java create mode 100644 src/api/java/pneumaticCraft/api/drone/IPathNavigator.java create mode 100644 src/api/java/pneumaticCraft/api/drone/IPathfindHandler.java create mode 100644 src/api/java/pneumaticCraft/api/drone/SpecialVariableRetrievalEvent.java create mode 100644 src/api/java/pneumaticCraft/api/item/IInventoryItem.java create mode 100644 src/api/java/pneumaticCraft/api/item/IPressurizable.java create mode 100644 src/api/java/pneumaticCraft/api/item/IProgrammable.java create mode 100644 src/api/java/pneumaticCraft/api/item/ItemSupplier.java create mode 100644 src/api/java/pneumaticCraft/api/package-info.java create mode 100644 src/api/java/pneumaticCraft/api/recipe/AssemblyRecipe.java create mode 100644 src/api/java/pneumaticCraft/api/recipe/IPressureChamberRecipe.java create mode 100644 src/api/java/pneumaticCraft/api/recipe/PressureChamberRecipe.java create mode 100644 src/api/java/pneumaticCraft/api/tileentity/AirHandlerSupplier.java create mode 100644 src/api/java/pneumaticCraft/api/tileentity/IAirHandler.java create mode 100644 src/api/java/pneumaticCraft/api/tileentity/IHeatExchanger.java create mode 100644 src/api/java/pneumaticCraft/api/tileentity/IManoMeasurable.java create mode 100644 src/api/java/pneumaticCraft/api/tileentity/IPneumaticMachine.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/EntityPollSensor.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinateEventSensor.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinatePollSensor.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/IEventSensorSetting.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/IPollSensorSetting.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/ISensorSetting.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/PlayerEventSensor.java create mode 100644 src/api/java/pneumaticCraft/api/universalSensor/SensorRegistrator.java create mode 100644 src/api/java/thaumcraft/api/IGoggles.java create mode 100644 src/api/java/thaumcraft/api/IRepairable.java create mode 100644 src/api/java/thaumcraft/api/IRepairableExtended.java create mode 100644 src/api/java/thaumcraft/api/IRunicArmor.java create mode 100644 src/api/java/thaumcraft/api/IScribeTools.java create mode 100644 src/api/java/thaumcraft/api/IVisDiscountGear.java create mode 100644 src/api/java/thaumcraft/api/ItemApi.java create mode 100644 src/api/java/thaumcraft/api/ItemRunic.java create mode 100644 src/api/java/thaumcraft/api/ThaumcraftApi.java create mode 100644 src/api/java/thaumcraft/api/ThaumcraftApiHelper.java create mode 100644 src/api/java/thaumcraft/api/TileThaumcraft.java create mode 100644 src/api/java/thaumcraft/api/WorldCoordinates.java create mode 100644 src/api/java/thaumcraft/api/aspects/Aspect.java create mode 100644 src/api/java/thaumcraft/api/aspects/AspectList.java create mode 100644 src/api/java/thaumcraft/api/aspects/AspectSourceHelper.java create mode 100644 src/api/java/thaumcraft/api/aspects/IAspectContainer.java create mode 100644 src/api/java/thaumcraft/api/aspects/IAspectSource.java create mode 100644 src/api/java/thaumcraft/api/aspects/IEssentiaContainerItem.java create mode 100644 src/api/java/thaumcraft/api/aspects/IEssentiaTransport.java create mode 100644 src/api/java/thaumcraft/api/crafting/CrucibleRecipe.java create mode 100644 src/api/java/thaumcraft/api/crafting/IArcaneRecipe.java create mode 100644 src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java create mode 100644 src/api/java/thaumcraft/api/crafting/InfusionEnchantmentRecipe.java create mode 100644 src/api/java/thaumcraft/api/crafting/InfusionRecipe.java create mode 100644 src/api/java/thaumcraft/api/crafting/ShapedArcaneRecipe.java create mode 100644 src/api/java/thaumcraft/api/crafting/ShapelessArcaneRecipe.java create mode 100644 src/api/java/thaumcraft/api/damagesource/DamageSourceIndirectThaumcraftEntity.java create mode 100644 src/api/java/thaumcraft/api/damagesource/DamageSourceThaumcraft.java create mode 100644 src/api/java/thaumcraft/api/entities/ITaintedMob.java create mode 100644 src/api/java/thaumcraft/api/nodes/INode.java create mode 100644 src/api/java/thaumcraft/api/nodes/IRevealer.java create mode 100644 src/api/java/thaumcraft/api/nodes/NodeModifier.java create mode 100644 src/api/java/thaumcraft/api/nodes/NodeType.java create mode 100644 src/api/java/thaumcraft/api/package-info.java create mode 100644 src/api/java/thaumcraft/api/potions/PotionFluxTaint.java create mode 100644 src/api/java/thaumcraft/api/research/IScanEventHandler.java create mode 100644 src/api/java/thaumcraft/api/research/ResearchCategories.java create mode 100644 src/api/java/thaumcraft/api/research/ResearchCategoryList.java create mode 100644 src/api/java/thaumcraft/api/research/ResearchItem.java create mode 100644 src/api/java/thaumcraft/api/research/ResearchPage.java create mode 100644 src/api/java/thaumcraft/api/research/ScanResult.java create mode 100644 src/api/java/thaumcraft/api/visnet/TileVisNode.java create mode 100644 src/api/java/thaumcraft/api/visnet/VisNetHandler.java create mode 100644 src/api/java/thaumcraft/api/wands/IWandFocus.java create mode 100644 src/api/java/thaumcraft/api/wands/IWandRodOnUpdate.java create mode 100644 src/api/java/thaumcraft/api/wands/IWandTriggerManager.java create mode 100644 src/api/java/thaumcraft/api/wands/IWandable.java create mode 100644 src/api/java/thaumcraft/api/wands/ItemFocusBasic.java create mode 100644 src/api/java/thaumcraft/api/wands/StaffRod.java create mode 100644 src/api/java/thaumcraft/api/wands/WandCap.java create mode 100644 src/api/java/thaumcraft/api/wands/WandRod.java create mode 100644 src/api/java/thaumcraft/api/wands/WandTriggerRegistry.java create mode 100644 src/api/java/vazkii/botania/api/BotaniaAPI.java create mode 100644 src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java create mode 100644 src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java create mode 100644 src/api/java/vazkii/botania/api/internal/DummyPage.java create mode 100644 src/api/java/vazkii/botania/api/internal/DummySubTile.java create mode 100644 src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java create mode 100644 src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java create mode 100644 src/api/java/vazkii/botania/api/internal/IManaBurst.java create mode 100644 src/api/java/vazkii/botania/api/internal/IManaNetwork.java create mode 100644 src/api/java/vazkii/botania/api/item/IExoflameHeatable.java create mode 100644 src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java create mode 100644 src/api/java/vazkii/botania/api/item/IPetalApothecary.java create mode 100644 src/api/java/vazkii/botania/api/item/IPixieSpawner.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/ILexicon.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/ILexiconable.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/LexiconPage.java create mode 100644 src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java create mode 100644 src/api/java/vazkii/botania/api/mana/BurstProperties.java create mode 100644 src/api/java/vazkii/botania/api/mana/IClientManaHandler.java create mode 100644 src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java create mode 100644 src/api/java/vazkii/botania/api/mana/IKeyLocked.java create mode 100644 src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java create mode 100644 src/api/java/vazkii/botania/api/mana/ILens.java create mode 100644 src/api/java/vazkii/botania/api/mana/ILensEffect.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaBlock.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaCollector.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaItem.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaPool.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaReceiver.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaTrigger.java create mode 100644 src/api/java/vazkii/botania/api/mana/IManaUsingItem.java create mode 100644 src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java create mode 100644 src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java create mode 100644 src/api/java/vazkii/botania/api/mana/ManaItemHandler.java create mode 100644 src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java create mode 100644 src/api/java/vazkii/botania/api/mana/TileSignature.java create mode 100644 src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java create mode 100644 src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java create mode 100644 src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java create mode 100644 src/api/java/vazkii/botania/api/package-info.java create mode 100644 src/api/java/vazkii/botania/api/recipe/IElvenItem.java create mode 100644 src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java create mode 100644 src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java create mode 100644 src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java create mode 100644 src/api/java/vazkii/botania/api/recipe/RecipePetals.java create mode 100644 src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java create mode 100644 src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java create mode 100644 src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java create mode 100644 src/api/java/vazkii/botania/api/subtile/SubTileEntity.java create mode 100644 src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java create mode 100644 src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java create mode 100644 src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java create mode 100644 src/api/java/vazkii/botania/api/wand/ITileBound.java create mode 100644 src/api/java/vazkii/botania/api/wand/IWandBindable.java create mode 100644 src/api/java/vazkii/botania/api/wand/IWandHUD.java create mode 100644 src/api/java/vazkii/botania/api/wand/IWandable.java create mode 100644 src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java create mode 100644 src/api/java/vazkii/botania/api/wiki/IWikiProvider.java create mode 100644 src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java create mode 100644 src/api/java/vazkii/botania/api/wiki/WikiHooks.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/client/ClientUtils.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/client/POVArmourModelWrapper.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/achievements/ICraftAchievement.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/achievements/IPickupAchievement.java rename src/main/java/WayofTime/alchemicalWizardry/common/block/{BlockArmourForge.java => ArmourForge.java} (73%) rename src/main/java/WayofTime/alchemicalWizardry/common/block/{BlockAlchemicalCalcinator.java => BlockAlchemicCalcinator.java} (75%) delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodStoneBrick.java rename src/main/java/WayofTime/alchemicalWizardry/common/block/{BlockIncenseCrucible.java => BlockCrucible.java} (59%) delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEfficiencyRune.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEmptySocket.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLargeBloodStoneBrick.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLifeEssence.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMimic.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRitualStone.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSacrifice.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSelfSacrifice.java rename src/main/java/WayofTime/alchemicalWizardry/common/block/{BlockFilledSocket.java => BlockSocket.java} (60%) delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpeedRune.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellTable.java rename src/main/java/WayofTime/alchemicalWizardry/common/block/{BlockChemistrySet.java => BlockWritingTable.java} (50%) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java rename src/main/java/WayofTime/alchemicalWizardry/common/block/{BlockImperfectRitualStone.java => ImperfectRitualStone.java} (70%) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/MimicBlock.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java rename src/main/java/WayofTime/alchemicalWizardry/common/block/{BlockSpectral.java => SpectralBlock.java} (54%) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/harvest/AgriCraftCropHarvestHandler.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/BaseItems.java rename src/main/java/WayofTime/alchemicalWizardry/common/items/{CreativeOrb.java => CheatyItem.java} (58%) delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/DemonCrystal.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java rename src/main/java/WayofTime/alchemicalWizardry/common/items/{Orb.java => EnergyBattery.java} (83%) rename src/main/java/WayofTime/alchemicalWizardry/common/items/{EnergyBlaster.java => EnergyBlast.java} (67%) rename src/main/java/WayofTime/alchemicalWizardry/common/items/{BindableItems.java => EnergyItems.java} (87%) rename src/main/java/WayofTime/alchemicalWizardry/common/items/{BoundBlade.java => EnergySword.java} (67%) rename src/main/java/WayofTime/alchemicalWizardry/common/items/{KeyOfBinding.java => ItemDiabloKey.java} (76%) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java rename src/main/java/WayofTime/alchemicalWizardry/common/items/energy/{AlchemicalRouter.java => ItemAttunedCrystal.java} (78%) rename src/main/java/WayofTime/alchemicalWizardry/common/items/energy/{AlchemicalCleanser.java => ItemDestinationClearer.java} (69%) rename src/main/java/WayofTime/alchemicalWizardry/common/items/energy/{AlchemicalSegmenter.java => ItemTankSegmenter.java} (74%) rename src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/{SigilCompress.java => SigilPackRat.java} (60%) delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilToggleable.java rename src/main/java/WayofTime/alchemicalWizardry/common/potion/{PotionBloodMagic.java => PotionAmphibian.java} (53%) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionBoost.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDeaf.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDemonCloak.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDrowning.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFeatherFall.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFireFuse.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlight.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionHeavyHeart.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionInhibit.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionPlanarBinding.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionProjectileProtect.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionReciprocation.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulHarden.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicalCalcinator.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAltar.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderChemistrySet.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java rename src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/{TEChemistrySetItemRenderer.java => TEWritingTableItemRenderer.java} (85%) rename src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/{ModelChemistrySet.java => ModelWritingTable.java} (98%) create mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderFireProjectile.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java rename src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/{TEAlchemicalCalcinator.java => TEAlchemicCalcinator.java} (86%) rename src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/{TESpellTable.java => TEHomHeart.java} (55%) rename src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/{TEChemistrySet.java => TEWritingTable.java} (88%) rename src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/{GuiChemistrySet.java => GuiWritingTable.java} (87%) delete mode 100644 src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json delete mode 100644 src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json delete mode 100644 src/main/resources/assets/alchemicalwizardry/models/block/soul_armour_forge.json delete mode 100644 src/main/resources/assets/alchemicalwizardry/models/item/soul_armour_forge.json create mode 100644 src/main/resources/assets/alchemicalwizardryBooks/books.txt create mode 100644 src/main/resources/assets/alchemicalwizardryBooks/books/book.txt create mode 100644 src/main/resources/assets/alchemicalwizardryBooks/lang/en_US.lang create mode 100644 src/main/resources/assets/forge/lang/en_US.lang create mode 100644 src/main/resources/assets/forge/lang/es_ES.lang create mode 100644 src/main/resources/assets/forge/lang/fr_FR.lang diff --git a/src/api/java/forestry/api/apiculture/BeeManager.java b/src/api/java/forestry/api/apiculture/BeeManager.java new file mode 100644 index 00000000..80b03a46 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/BeeManager.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.ArrayList; +import java.util.HashMap; + +import net.minecraft.item.ItemStack; +/** + * + * Some miscellaneous lists and settings for bees. + * + * @author SirSengir + */ +public class BeeManager { + + /** + * 0 - Common Village Bees 1 - Uncommon Village Bees (20 % of spawns) + */ + public static ArrayList[] villageBees; + + /** + * List of items that can induce swarming. Integer denotes x in 1000 chance. + */ + public static HashMap inducers = new HashMap(); + + /** + * Convenient access to AlleleManager.alleleRegistry.getSpeciesRoot("rootBees") + */ + public static IBeeRoot beeRoot; + + /** + * Used to create new bees. + */ + public static IBeeFactory beeFactory; + + /** + * Used to create new bee mutations. + */ + public static IBeeMutationFactory beeMutationFactory; + + /** + * Used to get Forestry's jubilance implementations. + */ + public static IJubilanceFactory jubilanceFactory; +} diff --git a/src/api/java/forestry/api/apiculture/EnumBeeChromosome.java b/src/api/java/forestry/api/apiculture/EnumBeeChromosome.java new file mode 100644 index 00000000..165247ef --- /dev/null +++ b/src/api/java/forestry/api/apiculture/EnumBeeChromosome.java @@ -0,0 +1,102 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IAlleleArea; +import forestry.api.genetics.IAlleleBoolean; +import forestry.api.genetics.IAlleleFloat; +import forestry.api.genetics.IAlleleFlowers; +import forestry.api.genetics.IAlleleInteger; +import forestry.api.genetics.IAlleleTolerance; +import forestry.api.genetics.IChromosomeType; +import forestry.api.genetics.ISpeciesRoot; + +/** + * Enum representing the order of chromosomes in a bee's genome and what they control. + * + * @author SirSengir + */ +public enum EnumBeeChromosome implements IChromosomeType { + /** + * Species of the bee. Alleles here must implement {@link IAlleleBeeSpecies}. + */ + SPECIES(IAlleleBeeSpecies.class), + /** + * (Production) Speed of the bee. + */ + SPEED(IAlleleFloat.class), + /** + * Lifespan of the bee. + */ + LIFESPAN(IAlleleInteger.class), + /** + * Fertility of the bee. Determines number of offspring. + */ + FERTILITY(IAlleleInteger.class), + /** + * Temperature difference to its native supported one the bee can tolerate. + */ + TEMPERATURE_TOLERANCE(IAlleleTolerance.class), + /** + * Slightly incorrectly named. If true, a naturally dirunal bee can work during the night. If true, a naturally nocturnal bee can work during the day. + */ + NOCTURNAL(IAlleleBoolean.class), + /** + * Not used / superseded by fixed values for the species. Probably going to be replaced with a boolean for FIRE_RESIST. + */ + @Deprecated + HUMIDITY(IAllele.class), + /** + * Humidity difference to its native supported one the bee can tolerate. + */ + HUMIDITY_TOLERANCE(IAlleleTolerance.class), + /** + * If true the bee can work during rain. + */ + TOLERANT_FLYER(IAlleleBoolean.class), + /** + * If true, the bee can work without a clear view of the sky. + */ + CAVE_DWELLING(IAlleleBoolean.class), + /** + * Contains the supported flower provider. + */ + FLOWER_PROVIDER(IAlleleFlowers.class), + /** + * Determines pollination speed. + */ + FLOWERING(IAlleleInteger.class), + /** + * Determines the size of the bee's territory. + */ + TERRITORY(IAlleleArea.class), + /** + * Determines the bee's effect. + */ + EFFECT(IAlleleBeeEffect.class); + + Class clss; + + EnumBeeChromosome(Class clss) { + this.clss = clss; + } + + @Override + public Class getAlleleClass() { + return clss; + } + + @Override + public String getName() { + return this.toString().toLowerCase(); + } + + @Override + public ISpeciesRoot getSpeciesRoot() { + return BeeManager.beeRoot; + } +} diff --git a/src/api/java/forestry/api/apiculture/EnumBeeType.java b/src/api/java/forestry/api/apiculture/EnumBeeType.java new file mode 100644 index 00000000..e3e45c2b --- /dev/null +++ b/src/api/java/forestry/api/apiculture/EnumBeeType.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.Locale; + +public enum EnumBeeType { + DRONE, PRINCESS, QUEEN, LARVAE, NONE; + + public static final EnumBeeType[] VALUES = values(); + + String name; + + private EnumBeeType() { + this.name = this.toString().toLowerCase(Locale.ENGLISH); + } + + public String getName() { + return name; + } +} diff --git a/src/api/java/forestry/api/apiculture/FlowerManager.java b/src/api/java/forestry/api/apiculture/FlowerManager.java new file mode 100644 index 00000000..667b4489 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/FlowerManager.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; + +import forestry.api.genetics.IFlowerProvider; +import forestry.api.genetics.IFlowerRegistry; + +public class FlowerManager { + /** + * ItemStacks representing simple flower blocks. Meta-sensitive, processed by the basic {@link IFlowerProvider}. + * + * @deprecated since Forestry 3.4. Use {@link #IFlowerRegistry.registerPlantableFlower(ItemStack flower, double weight, String... flowerTypes)} instead. + *
e.g. FlowerManager.flowerRegister.registerPlantableFlower(new ItemStack(Blocks.red_flower), 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
+ */ + @Deprecated + public static ArrayList plainFlowers = new ArrayList(); + + /** + *
e.g. FlowerManager.flowerRegister.registerPlantableFlower(new ItemStack(Blocks.red_flower), 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
+ */ + public static IFlowerRegistry flowerRegistry; + + public static final String FlowerTypeVanilla = "flowersVanilla"; + public static final String FlowerTypeNether = "flowersNether"; + public static final String FlowerTypeCacti = "flowersCacti"; + public static final String FlowerTypeMushrooms = "flowersMushrooms"; + public static final String FlowerTypeEnd = "flowersEnd"; + public static final String FlowerTypeJungle = "flowersJungle"; + public static final String FlowerTypeSnow = "flowersSnow"; + public static final String FlowerTypeWheat = "flowersWheat"; + public static final String FlowerTypeGourd = "flowersGourd"; +} diff --git a/src/api/java/forestry/api/apiculture/IAlleleBeeEffect.java b/src/api/java/forestry/api/apiculture/IAlleleBeeEffect.java new file mode 100644 index 00000000..b2dddb31 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IAlleleBeeEffect.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.IAlleleEffect; +import forestry.api.genetics.IEffectData; + +public interface IAlleleBeeEffect extends IAlleleEffect { + + /** + * Called by apiaries to cause an effect in the world. + * + * @param genome + * Genome of the bee queen causing this effect + * @param storedData + * Object containing the stored effect data for the apiary/hive the bee is in. + * @param housing {@link IBeeHousing} the bee currently resides in. + * @return storedData, may have been manipulated. + */ + IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); + + /** + * Is called to produce bee effects. + * + * @param genome + * @param storedData + * Object containing the stored effect data for the apiary/hive the bee is in. + * @param housing {@link IBeeHousing} the bee currently resides in. + * @return storedData, may have been manipulated. + */ + IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); + +} diff --git a/src/api/java/forestry/api/apiculture/IAlleleBeeSpecies.java b/src/api/java/forestry/api/apiculture/IAlleleBeeSpecies.java new file mode 100644 index 00000000..86346639 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IAlleleBeeSpecies.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import forestry.api.genetics.IAlleleSpecies; + +public interface IAlleleBeeSpecies extends IAlleleSpecies { + + /** + * @return the IBeeRoot + */ + IBeeRoot getRoot(); + + /** + * @return true if this species is only active at night. + */ + boolean isNocturnal(); + + /** + * @return Map of possible products with the chance for drop each bee cycle. (0 - 1] + */ + Map getProductChances(); + + /** + * @return Map of possible specialities with the chance for drop each bee cycle. (0 - 1] + */ + Map getSpecialtyChances(); + + /** + * Only jubilant bees produce specialities. + * @return true if the bee is jubilant, false otherwise. + */ + boolean isJubilant(IBeeGenome genome, IBeeHousing housing); + + @SideOnly(Side.CLIENT) + IIcon getIcon(EnumBeeType type, int renderPass); + + /** + * @deprecated since Forestry 3.6. + * @return Path of the texture to use for entity rendering. + */ + @Deprecated + String getEntityTexture(); + + /** + * @deprecated Since Forestry 3.6 use getProductChances() + * @return Map of possible products with the chance for drop each bee cycle. (0 - 100) + */ + @Deprecated + Map getProducts(); + + /** + * @deprecated Since Forestry 3.6 use getSpecialtyChances() + * @return Map of possible specialities with the chance for drop each bee cycle. (0 - 100) + */ + @Deprecated + Map getSpecialty(); +} diff --git a/src/api/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java b/src/api/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java new file mode 100644 index 00000000..06664b2f --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import net.minecraft.item.ItemStack; + +import forestry.api.genetics.IAlleleSpeciesCustom; + +public interface IAlleleBeeSpeciesCustom extends IAlleleBeeSpecies, IAlleleSpeciesCustom { + + /** + * Add a product for this bee species. + * Chance is between 0 and 1. + */ + IAlleleBeeSpeciesCustom addProduct(ItemStack product, Float chance); + + /** + * Add a specialty product for this bee species. + * Bees only produce their specialty when they are Jubilant (see IJubilanceProvider) + * Chance is between 0 and 1. + */ + IAlleleBeeSpeciesCustom addSpecialty(ItemStack specialty, Float chance); + + /** + * Set the Jubilance Provider for this bee species. + * Bees only produce their specialty when they are Jubilant (see IJubilanceProvider) + */ + IAlleleBeeSpeciesCustom setJubilanceProvider(IJubilanceProvider provider); + + /** + * Make this species only active at night. + */ + IAlleleBeeSpeciesCustom setNocturnal(); + + /** Use this if you have custom icons for bees. */ + IAlleleBeeSpeciesCustom setCustomBeeIconProvider(IBeeIconProvider beeIconProvider); +} diff --git a/src/api/java/forestry/api/apiculture/IAlvearyComponent.java b/src/api/java/forestry/api/apiculture/IAlvearyComponent.java new file mode 100644 index 00000000..80cf98b1 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IAlvearyComponent.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.core.ITileStructure; + +/** + * Needs to be implemented by TileEntities that want to be part of an alveary. + */ +public interface IAlvearyComponent extends ITileStructure { + + void registerBeeModifier(IBeeModifier modifier); + + void removeBeeModifier(IBeeModifier modifier); + + void registerBeeListener(IBeeListener event); + + void removeBeeListener(IBeeListener event); + + void addTemperatureChange(float change, float boundaryDown, float boundaryUp); + + void addHumidityChange(float change, float boundaryDown, float boundaryUp); + + /** + * @return true if this TE has a function other than a plain alveary block. Returning true prevents the TE from becoming master. + */ + boolean hasFunction(); + +} diff --git a/src/api/java/forestry/api/apiculture/IApiaristTracker.java b/src/api/java/forestry/api/apiculture/IApiaristTracker.java new file mode 100644 index 00000000..0c65f56b --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IApiaristTracker.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.IBreedingTracker; +import forestry.api.genetics.IIndividual; + +/** + * Can be used to garner information on bee breeding. See {@link forestry.api.genetics.ISpeciesRoot} for retrieval functions. + * + * @author SirSengir + */ +public interface IApiaristTracker extends IBreedingTracker { + + /** + * Register the birth of a queen. Will mark species as discovered. + * + * @param queen + * Created queen. + */ + void registerQueen(IIndividual queen); + + /** + * @return Amount of queens bred with this tracker. + */ + int getQueenCount(); + + /** + * Register the birth of a princess. Will mark species as discovered. + * + * @param princess + * Created princess. + */ + void registerPrincess(IIndividual princess); + + /** + * @return Amount of princesses bred with this tracker. + */ + int getPrincessCount(); + + /** + * Register the birth of a drone. Will mark species as discovered. + * + * @param drone + * Created drone. + */ + void registerDrone(IIndividual drone); + + /** + * @return Amount of drones bred with this tracker. + */ + int getDroneCount(); + +} diff --git a/src/api/java/forestry/api/apiculture/IArmorApiarist.java b/src/api/java/forestry/api/apiculture/IArmorApiarist.java new file mode 100644 index 00000000..fef81eb5 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IArmorApiarist.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +/** + * When implemented by armor piece items, allows them to act as apiarist's armor. + */ +public interface IArmorApiarist { + /** + * Called when the apiarist's armor acts as protection against an attack. + * + * @param player + * Player being attacked + * @param armor + * Armor item + * @param cause + * Optional cause of attack, such as a bee effect identifier + * @param doProtect + * Whether or not to actually do the side effects of protection + * @return Whether or not the armor should protect the player from that attack + */ + public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect); +} diff --git a/src/api/java/forestry/api/apiculture/IBee.java b/src/api/java/forestry/api/apiculture/IBee.java new file mode 100644 index 00000000..b77b752e --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBee.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.BiomeGenBase; + +import forestry.api.core.IErrorState; +import forestry.api.genetics.IEffectData; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.IIndividualLiving; + +/** + * Other implementations than Forestry's default one are not supported. + * + * @author SirSengir + */ +public interface IBee extends IIndividualLiving { + + /** + * @return Bee's genetic information. + */ + IBeeGenome getGenome(); + + /** + * @return Genetic information of the bee's mate, null if unmated. + */ + IBeeGenome getMate(); + + /** + * @return true if the individual is originally of natural origin. + */ + boolean isNatural(); + + /** + * @return generation this individual is removed from the original individual. + */ + int getGeneration(); + + /** + * Set the natural flag on this bee. + * @param flag + */ + void setIsNatural(boolean flag); + + IEffectData[] doEffect(IEffectData[] storedData, IBeeHousing housing); + + IEffectData[] doFX(IEffectData[] storedData, IBeeHousing housing); + + /** + * @return true if the bee may spawn offspring + */ + boolean canSpawn(); + + /** + * Determines whether the queen can work. + * + * @param housing the {@link IBeeHousing} the bee currently resides in. + * @return the error code encountered. + */ + IErrorState canWork(IBeeHousing housing); + + boolean hasFlower(IBeeHousing housing); + + ArrayList getSuitableBiomes(); + + ItemStack[] getProduceList(); + + ItemStack[] getSpecialtyList(); + + ItemStack[] produceStacks(IBeeHousing housing); + + IBee spawnPrincess(IBeeHousing housing); + + IBee[] spawnDrones(IBeeHousing housing); + + void plantFlowerRandom(IBeeHousing housing); + + IIndividual retrievePollen(IBeeHousing housing); + + boolean pollinateRandom(IBeeHousing housing, IIndividual pollen); + +} diff --git a/src/api/java/forestry/api/apiculture/IBeeFactory.java b/src/api/java/forestry/api/apiculture/IBeeFactory.java new file mode 100644 index 00000000..c164731c --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeFactory.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.IClassification; + +public interface IBeeFactory { + + /** + * Creates a new bee species. + * Automatically registered with AlleleManager.alleleRegistry.registerAllele() + * See IAlleleBeeSpeciesCustom and IAlleleSpeciesCustom for adding additional properties to the returned species. + * + * @param uid Unique Identifier for this species + * @param dominant Whether this species is genetically dominant (false means it is recessive) + * @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry. + * @param unlocalizedName Unlocalized name for this species + * @param unlocalizedDescription Unlocalized description for this species + * @param branch Classification of this species + * @param binomial Binomial name of the species sans genus ("Apis"). "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null. + * @param primaryColor The outline color of this species + * @param secondaryColor The body color of this species + * @return a new bee species allele. + */ + IAlleleBeeSpeciesCustom createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor); + + /** + * Creates a new bee branch. + * Must be registered with AlleleManager.alleleRegistry.getClassification("family.apidae").addMemberGroup(); + * + * @param uid Unique Identifier for this branch + * @param scientific approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis" + * @return a new bee branch + */ + IClassification createBranch(String uid, String scientific); +} diff --git a/src/api/java/forestry/api/apiculture/IBeeGenome.java b/src/api/java/forestry/api/apiculture/IBeeGenome.java new file mode 100644 index 00000000..642eeeb5 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeGenome.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.EnumTolerance; +import forestry.api.genetics.IFlowerProvider; +import forestry.api.genetics.IGenome; + +/** + * Only the default implementation is supported. + * + * @author SirSengir + * + */ +public interface IBeeGenome extends IGenome { + + IAlleleBeeSpecies getPrimary(); + + IAlleleBeeSpecies getSecondary(); + + float getSpeed(); + + int getLifespan(); + + int getFertility(); + + EnumTolerance getToleranceTemp(); + + EnumTolerance getToleranceHumid(); + + boolean getNocturnal(); + + boolean getTolerantFlyer(); + + boolean getCaveDwelling(); + + IFlowerProvider getFlowerProvider(); + + int getFlowering(); + + int[] getTerritory(); + + IAlleleBeeEffect getEffect(); + +} diff --git a/src/api/java/forestry/api/apiculture/IBeeHousing.java b/src/api/java/forestry/api/apiculture/IBeeHousing.java new file mode 100644 index 00000000..5d795a3b --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeHousing.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import net.minecraft.item.ItemStack; + +import forestry.api.genetics.IHousing; + +public interface IBeeHousing extends IBeeModifier, IBeeListener, IHousing { + + ItemStack getQueen(); + + ItemStack getDrone(); + + void setQueen(ItemStack itemstack); + + void setDrone(ItemStack itemstack); + + /** + * @return true if princesses and drones can (currently) mate in this housing to generate queens. + */ + boolean canBreed(); + +} diff --git a/src/api/java/forestry/api/apiculture/IBeeIconProvider.java b/src/api/java/forestry/api/apiculture/IBeeIconProvider.java new file mode 100644 index 00000000..d29a722b --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeIconProvider.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +public interface IBeeIconProvider { + void registerIcons(IIconRegister register); + IIcon getIcon(EnumBeeType type, int renderPass); +} diff --git a/src/api/java/forestry/api/apiculture/IBeeListener.java b/src/api/java/forestry/api/apiculture/IBeeListener.java new file mode 100644 index 00000000..7fd5865c --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeListener.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import net.minecraft.item.ItemStack; + +import forestry.api.genetics.IIndividual; + +public interface IBeeListener { + + /** + * Called on queen update. + * + * @param queen + */ + void onQueenChange(ItemStack queen); + + /** + * Called when the bees wear out the housing's equipment. + * + * @param amount + * Integer indicating the amount worn out. + */ + void wearOutEquipment(int amount); + + /** + * Called just before the children are generated, and the queen removed. + * + * @param queen + */ + void onQueenDeath(IBee queen); + + /** + * Called after the children have been spawned, but before the queen appears + * + * @param queen + */ + void onPostQueenDeath(IBee queen); + + boolean onPollenRetrieved(IBee queen, IIndividual pollen, boolean isHandled); + + boolean onEggLaid(IBee queen); +} diff --git a/src/api/java/forestry/api/apiculture/IBeeModifier.java b/src/api/java/forestry/api/apiculture/IBeeModifier.java new file mode 100644 index 00000000..4f9f7bbe --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeModifier.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +public interface IBeeModifier { + + /** + * @param genome Genome of the bee this modifier is called for. + * @param currentModifier Current modifier. + * @return Float used to modify the base territory. + */ + float getTerritoryModifier(IBeeGenome genome, float currentModifier); + + /** + * @param genome Genome of the bee this modifier is called for. + * @param mate + * @param currentModifier Current modifier. + * @return Float used to modify the base mutation chance. + */ + float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier); + + /** + * @param genome Genome of the bee this modifier is called for. + * @param currentModifier Current modifier. + * @return Float used to modify the life span of queens. + */ + float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier); + + /** + * @param genome Genome of the bee this modifier is called for. + * @param currentModifier Current modifier. + * @return Float modifying the production speed of queens. + */ + float getProductionModifier(IBeeGenome genome, float currentModifier); + + /** + * @param genome Genome of the bee this modifier is called for. + * @return Float modifying the flowering of queens. + */ + float getFloweringModifier(IBeeGenome genome, float currentModifier); + + /** + * @param genome Genome of the bee this modifier is called for. + * @return Float modifying the chance for a swarmer queen to die off. + */ + float getGeneticDecay(IBeeGenome genome, float currentModifier); + + /** + * @return Boolean indicating if housing can ignore rain + */ + boolean isSealed(); + + /** + * @return Boolean indicating if housing can ignore darkness/night + */ + boolean isSelfLighted(); + + /** + * @return Boolean indicating if housing can ignore not seeing the sky + */ + boolean isSunlightSimulated(); + + /** + * @return Boolean indicating whether this housing simulates the nether + */ + boolean isHellish(); + +} diff --git a/src/api/java/forestry/api/apiculture/IBeeMutation.java b/src/api/java/forestry/api/apiculture/IBeeMutation.java new file mode 100644 index 00000000..6421c8f6 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeMutation.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IGenome; +import forestry.api.genetics.IMutation; + +public interface IBeeMutation extends IMutation { + + IBeeRoot getRoot(); + + /** + * @param housing + * @param allele0 + * @param allele1 + * @param genome0 + * @param genome1 + * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously! + * @deprecated since Forestry 3.6, use the IAlleleBeeSpecies / IBeeGenome version + */ + @Deprecated + float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); + + float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1); +} diff --git a/src/api/java/forestry/api/apiculture/IBeeMutationCustom.java b/src/api/java/forestry/api/apiculture/IBeeMutationCustom.java new file mode 100644 index 00000000..d97a839a --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeMutationCustom.java @@ -0,0 +1,12 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.IMutationCustom; + +public interface IBeeMutationCustom extends IBeeMutation, IMutationCustom { + +} diff --git a/src/api/java/forestry/api/apiculture/IBeeMutationFactory.java b/src/api/java/forestry/api/apiculture/IBeeMutationFactory.java new file mode 100644 index 00000000..315a4c6f --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeMutationFactory.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.genetics.IAllele; + +public interface IBeeMutationFactory { + /** + * Creates a new bee mutation. + * Automatically registered with BeeManager.beeRoot.registerMutation() + * See IBeeMutationCustom and IMutationCustom for adding additional properties to the returned mutation. + * + * @param parentBee0 A parent bee for this mutation + * @param parentBee1 A parent bee for this mutation + * @param result The resulting alleles for this mutation + * @param chance The chance that breeding the two parent bees will result in this mutation + * @return a new bee mutation. + */ + IBeeMutationCustom createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance); +} diff --git a/src/api/java/forestry/api/apiculture/IBeeRoot.java b/src/api/java/forestry/api/apiculture/IBeeRoot.java new file mode 100644 index 00000000..b4bbb291 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeeRoot.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +import com.mojang.authlib.GameProfile; + +import forestry.api.core.IStructureLogic; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.ISpeciesRoot; + +public interface IBeeRoot extends ISpeciesRoot { + + /** + * @return true if passed item is a Forestry bee. Equal to getType(ItemStack stack) != EnumBeeType.NONE + */ + @Override + boolean isMember(ItemStack stack); + + /** + * @return {@link IBee} pattern parsed from the passed stack's nbt data. + */ + @Override + IBee getMember(ItemStack stack); + + @Override + IBee getMember(NBTTagCompound compound); + + /* GENOME CONVERSION */ + @Override + IBee templateAsIndividual(IAllele[] template); + + @Override + IBee templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); + + @Override + IBeeGenome templateAsGenome(IAllele[] template); + + @Override + IBeeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); + + /* BREEDING TRACKER */ + /** + * @param world + * @return {@link IApiaristTracker} associated with the passed world. + */ + IApiaristTracker getBreedingTracker(World world, GameProfile player); + + /* BEE SPECIFIC */ + /** + * @return type of bee encoded on the itemstack. EnumBeeType.NONE if it isn't a bee. + */ + EnumBeeType getType(ItemStack stack); + + /** + * @return true if passed item is a drone. Equal to getType(ItemStack stack) == EnumBeeType.DRONE + */ + boolean isDrone(ItemStack stack); + + /** + * @return true if passed item is mated (i.e. a queen) + */ + boolean isMated(ItemStack stack); + + /** + * @param genome + * Valid {@link IBeeGenome} + * @return {@link IBee} from the passed genome + */ + IBee getBee(World world, IBeeGenome genome); + + /** + * Creates an IBee suitable for a queen containing the necessary second genome for the mate. + * + * @param genome + * Valid {@link IBeeGenome} + * @param mate + * Valid {@link IBee} representing the mate. + * @return Mated {@link IBee} from the passed genomes. + */ + IBee getBee(World world, IBeeGenome genome, IBee mate); + + /* TEMPLATES */ + @Override + ArrayList getIndividualTemplates(); + + /* MUTATIONS */ + @Override + Collection getMutations(boolean shuffle); + + /* GAME MODE */ + void resetBeekeepingMode(); + + ArrayList getBeekeepingModes(); + + IBeekeepingMode getBeekeepingMode(World world); + + IBeekeepingMode getBeekeepingMode(String name); + + void registerBeekeepingMode(IBeekeepingMode mode); + + void setBeekeepingMode(World world, String name); + + /* MISC */ + /** + * @param housing + * Object implementing IBeeHousing. + * @return IBeekeepingLogic + */ + IBeekeepingLogic createBeekeepingLogic(IBeeHousing housing); + + /** + * TileEntities wanting to function as alveary components need to implement structure logic for validation. + * + * @return IStructureLogic for alvearies. + */ + IStructureLogic createAlvearyStructureLogic(IAlvearyComponent structure); + +} diff --git a/src/api/java/forestry/api/apiculture/IBeekeepingLogic.java b/src/api/java/forestry/api/apiculture/IBeekeepingLogic.java new file mode 100644 index 00000000..0a4da7b3 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeekeepingLogic.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import forestry.api.core.INBTTagable; +import forestry.api.genetics.IEffectData; + +public interface IBeekeepingLogic extends INBTTagable { + + /* STATE INFORMATION */ + int getBreedingTime(); + + int getTotalBreedingTime(); + + IBee getQueen(); + + IBeeHousing getHousing(); + + IEffectData[] getEffectData(); + + /* UPDATING */ + void update(); + +} diff --git a/src/api/java/forestry/api/apiculture/IBeekeepingMode.java b/src/api/java/forestry/api/apiculture/IBeekeepingMode.java new file mode 100644 index 00000000..80d30981 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IBeekeepingMode.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.ArrayList; + +import net.minecraft.world.World; + +public interface IBeekeepingMode extends IBeeModifier { + + /** + * @return Localized name of this beekeeping mode. + */ + String getName(); + + /** + * @return Localized list of strings outlining the behaviour of this beekeeping mode. + */ + ArrayList getDescription(); + + /** + * @return Float used to modify the wear on comb frames. + */ + float getWearModifier(); + + /** + * @param queen + * @return fertility taking into account the birthing queen and surroundings. + */ + int getFinalFertility(IBee queen, World world, int x, int y, int z); + + /** + * @param queen + * @return true if the queen is genetically "fatigued" and should not be reproduced anymore. + */ + boolean isFatigued(IBee queen, IBeeHousing housing); + + /** + * @param queen + * @param housing + * @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect. + */ + boolean isOverworked(IBee queen, IBeeHousing housing); + + /** + * + * @param queen + * @param offspring + * @param housing + * @return true if the genetic structure of the queen is breaking down during spawning of the offspring (with chance). will trigger a negative effect. + */ + boolean isDegenerating(IBee queen, IBee offspring, IBeeHousing housing); + + /** + * @param queen + * @return true if an offspring of this queen is considered a natural + */ + boolean isNaturalOffspring(IBee queen); + + /** + * @param queen + * @return true if this mode allows the passed queen or princess to be multiplied + */ + boolean mayMultiplyPrincess(IBee queen); + + +} diff --git a/src/api/java/forestry/api/apiculture/IHiveDrop.java b/src/api/java/forestry/api/apiculture/IHiveDrop.java new file mode 100644 index 00000000..ea175f8b --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IHiveDrop.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * Bees can be seeded either as hive drops or as mutation results. + * + * Add IHiveDrops with HiveManager.get___Hive.addDrop + * + * @author SirSengir + */ +public interface IHiveDrop { + + ItemStack getPrincess(World world, int x, int y, int z, int fortune); + + Collection getDrones(World world, int x, int y, int z, int fortune); + + Collection getAdditional(World world, int x, int y, int z, int fortune); + + /** + * Chance to drop. Default drops have 80 (= 80 %). + * + * @param world Minecraft world this is called for. + * @param x x-Coordinate of the broken hive. + * @param y y-Coordinate of the broken hive. + * @param z z-Coordinate of the broken hive. + * @return Chance for drop as an integer of 0 - 100. + */ + int getChance(World world, int x, int y, int z); +} diff --git a/src/api/java/forestry/api/apiculture/IHiveFrame.java b/src/api/java/forestry/api/apiculture/IHiveFrame.java new file mode 100644 index 00000000..dabc9e01 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IHiveFrame.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import net.minecraft.item.ItemStack; + +public interface IHiveFrame extends IBeeModifier { + + /** + * Wears out a frame. + * + * @param housing + * IBeeHousing the frame is contained in. + * @param frame + * ItemStack containing the actual frame. + * @param queen + * Current queen in the caller. + * @param wear + * Integer denoting the amount worn out. The wear modifier of the current beekeeping mode has already been taken into account. + * @return ItemStack containing the actual frame with adjusted damage. + */ + ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear); + +} diff --git a/src/api/java/forestry/api/apiculture/IJubilanceFactory.java b/src/api/java/forestry/api/apiculture/IJubilanceFactory.java new file mode 100644 index 00000000..1b81a9d0 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IJubilanceFactory.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +import net.minecraft.block.Block; + +public interface IJubilanceFactory { + /** The default Jubilance Provider is satisfied when the humidity and temperature are ideal for the bee. */ + IJubilanceProvider getDefault(); + + /** The Requires Resource Jubilance Provider is satisfied when a specific block is under the hive. */ + IJubilanceProvider getRequiresResource(Block block, int meta); +} diff --git a/src/api/java/forestry/api/apiculture/IJubilanceProvider.java b/src/api/java/forestry/api/apiculture/IJubilanceProvider.java new file mode 100644 index 00000000..faf34d05 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/IJubilanceProvider.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture; + +public interface IJubilanceProvider { + + /** + * Returns true when conditions are right to make this species Jubilant. + * Jubilant bees can produce their Specialty products. + */ + boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing); +} diff --git a/src/api/java/forestry/api/apiculture/hives/HiveManager.java b/src/api/java/forestry/api/apiculture/hives/HiveManager.java new file mode 100644 index 00000000..17ca7d20 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/hives/HiveManager.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture.hives; + +public class HiveManager { + + public static IHiveRegistry hiveRegistry; + public static IHiveGenHelper genHelper; + +} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveDescription.java b/src/api/java/forestry/api/apiculture/hives/IHiveDescription.java new file mode 100644 index 00000000..82d761db --- /dev/null +++ b/src/api/java/forestry/api/apiculture/hives/IHiveDescription.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture.hives; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; + +public interface IHiveDescription { + + /** + * The hive generator for this hive. + */ + IHiveGen getHiveGen(); + + /** + * The hive block to be placed in the world. + */ + Block getBlock(); + int getMeta(); + + /** + * returns true if the hive can be generated in these conditions. + * Used as a fast early-elimination check for hives that have no hope of spawning in the area. + */ + boolean isGoodBiome(BiomeGenBase biome); + boolean isGoodHumidity(EnumHumidity humidity); + boolean isGoodTemperature(EnumTemperature temperature); + + /** + * float representing the relative chance a hive will generate in a chunk. + * Default is 1.0, higher numbers result in more hives, smaller will result in fewer. + * Tree hives want around 3.0 to 4.0 since there are less locations to generate on. + */ + float getGenChance(); + + /** + * Called after successful hive generation. + * world, x, y, z give the location of the new hive. + **/ + void postGen(World world, int x, int y, int z); +} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveGen.java b/src/api/java/forestry/api/apiculture/hives/IHiveGen.java new file mode 100644 index 00000000..57569d26 --- /dev/null +++ b/src/api/java/forestry/api/apiculture/hives/IHiveGen.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture.hives; + +import net.minecraft.world.World; + +public interface IHiveGen { + + /** + * return a Y value that the hive should try to generate at. + * returns negative if the hive can't be placed anywhere. + */ + int getYForHive(World world, int x, int z); + + /** + * returns true if the hive can be generated at this location. + * Used for advanced conditions, like checking that the ground below the hive is a certain type. + */ + boolean isValidLocation(World world, int x, int y, int z); + + /** + * returns true if the hive can safely replace the block at this location. + */ + boolean canReplace(World world, int x, int y, int z); + +} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveGenHelper.java b/src/api/java/forestry/api/apiculture/hives/IHiveGenHelper.java new file mode 100644 index 00000000..0eb6400c --- /dev/null +++ b/src/api/java/forestry/api/apiculture/hives/IHiveGenHelper.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture.hives; + +import net.minecraft.block.Block; + +public interface IHiveGenHelper { + + /** + * Returns a hiveGen for a hive that spawns on the ground. + * validGroundBlocks specifies which block materials it can spawn on. + */ + IHiveGen ground(Block... validGroundBlocks); + + /** + * Returns a hiveGen for a hive that spawns in trees. + */ + IHiveGen tree(); + +} diff --git a/src/api/java/forestry/api/apiculture/hives/IHiveRegistry.java b/src/api/java/forestry/api/apiculture/hives/IHiveRegistry.java new file mode 100644 index 00000000..73f3524c --- /dev/null +++ b/src/api/java/forestry/api/apiculture/hives/IHiveRegistry.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.apiculture.hives; + +import java.util.List; + +import forestry.api.apiculture.IHiveDrop; + +public interface IHiveRegistry { + + /* Forestry Hive Names */ + public static final String forest = "Forestry:forest"; + public static final String meadows = "Forestry:meadows"; + public static final String desert = "Forestry:desert"; + public static final String jungle = "Forestry:jungle"; + public static final String end = "Forestry:end"; + public static final String snow = "Forestry:snow"; + public static final String swamp = "Forestry:swamp"; + + /** + * Adds a new hive to be generated in the world. + */ + void registerHive(String hiveName, IHiveDescription hiveDescription); + + /** + * Add drops to a registered hive. + */ + void addDrops(String hiveName, IHiveDrop... drops); + void addDrops(String hiveName, List drop); +} diff --git a/src/api/java/forestry/api/apiculture/hives/package-info.java b/src/api/java/forestry/api/apiculture/hives/package-info.java new file mode 100644 index 00000000..a045530c --- /dev/null +++ b/src/api/java/forestry/api/apiculture/hives/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="4.1.0", owner="ForestryAPI|apiculture", provides="ForestryAPI|hives") +package forestry.api.apiculture.hives; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/apiculture/package-info.java b/src/api/java/forestry/api/apiculture/package-info.java new file mode 100644 index 00000000..3114e3eb --- /dev/null +++ b/src/api/java/forestry/api/apiculture/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="3.3.0", owner="ForestryAPI|core", provides="ForestryAPI|apiculture") +package forestry.api.apiculture; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/arboriculture/EnumGermlingType.java b/src/api/java/forestry/api/arboriculture/EnumGermlingType.java new file mode 100644 index 00000000..a564be0d --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/EnumGermlingType.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +public enum EnumGermlingType { + SAPLING("sapling"), BLOSSOM("blossom"), POLLEN("pollen"), GERMLING("germling"), NONE("none"); + + public static final EnumGermlingType[] VALUES = values(); + + private final String name; + + private EnumGermlingType(String name) { + this.name = name; + } + + public String getName() { + return name; + } + +} diff --git a/src/api/java/forestry/api/arboriculture/EnumGrowthConditions.java b/src/api/java/forestry/api/arboriculture/EnumGrowthConditions.java new file mode 100644 index 00000000..8b28601c --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/EnumGrowthConditions.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +public enum EnumGrowthConditions { + HOSTILE, PALTRY, NORMAL, GOOD, EXCELLENT +} diff --git a/src/api/java/forestry/api/arboriculture/EnumTreeChromosome.java b/src/api/java/forestry/api/arboriculture/EnumTreeChromosome.java new file mode 100644 index 00000000..8f74d0c2 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/EnumTreeChromosome.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IAlleleArea; +import forestry.api.genetics.IAlleleBoolean; +import forestry.api.genetics.IAlleleFloat; +import forestry.api.genetics.IAlleleInteger; +import forestry.api.genetics.IAllelePlantType; +import forestry.api.genetics.IChromosomeType; +import forestry.api.genetics.IFruitFamily; +import forestry.api.genetics.ISpeciesRoot; +import net.minecraftforge.common.EnumPlantType; + +public enum EnumTreeChromosome implements IChromosomeType { + + /** + * Determines the following: - WorldGen, including the used wood blocks - {@link IFruitFamily}s supported. Limits which {@link IFruitProvider} + * will actually yield fruit with this species. - Native {@link EnumPlantType} for this tree. Combines with the PLANT chromosome. + */ + SPECIES(IAlleleTreeSpecies.class), + /** + * {@link IGrowthProvider}, determines conditions required by the tree to grow. + */ + GROWTH(IAlleleGrowth.class), + /** + * A float modifying the height of the tree. Taken into account at worldgen. + */ + HEIGHT(IAlleleFloat.class), + /** + * Chance for saplings. + */ + FERTILITY(IAlleleFloat.class), + /** + * {@link IFruitProvider}, determines if and what fruits are grown on the tree. Limited by the {@link IFruitFamily}s the species supports. + */ + FRUITS(IAlleleFruit.class), + /** + * Chance for fruit leaves and/or drops. + */ + YIELD(IAlleleFloat.class), + /** + * May add additional tolerances for {@link EnumPlantTypes}. + */ + PLANT(IAllelePlantType.class), + /** + * Determines the speed at which fruit will ripen on this tree. + */ + SAPPINESS(IAlleleFloat.class), + /** + * Territory for leaf effects. Unused. + */ + TERRITORY(IAlleleArea.class), + /** + * Leaf effect. Unused. + */ + EFFECT(IAlleleLeafEffect.class), + /** + * Amount of random ticks which need to elapse before a sapling will grow into a tree. + */ + MATURATION(IAlleleInteger.class), + + GIRTH(IAlleleInteger.class), + /** + * Determines if the tree can burn. + */ + FIREPROOF(IAlleleBoolean.class), + ; + + Class clss; + + EnumTreeChromosome(Class clss) { + this.clss = clss; + } + + @Override + public Class getAlleleClass() { + return clss; + } + + @Override + public String getName() { + return this.toString().toLowerCase(); + } + + @Override + public ISpeciesRoot getSpeciesRoot() { + return AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees"); + } + +} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleFruit.java b/src/api/java/forestry/api/arboriculture/IAlleleFruit.java new file mode 100644 index 00000000..0f54db51 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IAlleleFruit.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import forestry.api.genetics.IAllele; + +/** + * Simple allele encapsulating an {@link IFruitProvider}. + */ +public interface IAlleleFruit extends IAllele { + + IFruitProvider getProvider(); + +} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleGrowth.java b/src/api/java/forestry/api/arboriculture/IAlleleGrowth.java new file mode 100644 index 00000000..6cb4b438 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IAlleleGrowth.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import forestry.api.genetics.IAllele; + +/** + * Simple allele encapsulating an {@link IGrowthProvider}. + */ +public interface IAlleleGrowth extends IAllele { + + IGrowthProvider getProvider(); + +} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleLeafEffect.java b/src/api/java/forestry/api/arboriculture/IAlleleLeafEffect.java new file mode 100644 index 00000000..d52d963a --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IAlleleLeafEffect.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import net.minecraft.world.World; + +import forestry.api.genetics.IAlleleEffect; +import forestry.api.genetics.IEffectData; + +/** + * Simple allele encapsulating a leaf effect. (Not implemented) + */ +public interface IAlleleLeafEffect extends IAlleleEffect { + + IEffectData doEffect(ITreeGenome genome, IEffectData storedData, World world, int x, int y, int z); + +} diff --git a/src/api/java/forestry/api/arboriculture/IAlleleTreeSpecies.java b/src/api/java/forestry/api/arboriculture/IAlleleTreeSpecies.java new file mode 100644 index 00000000..be057254 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IAlleleTreeSpecies.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraftforge.common.EnumPlantType; + +import forestry.api.genetics.IAlleleSpecies; +import forestry.api.genetics.IFruitFamily; + +public interface IAlleleTreeSpecies extends IAlleleSpecies { + + ITreeRoot getRoot(); + + /** + * @return Native plant type of this species. + */ + EnumPlantType getPlantType(); + + /** + * @return List of all {@link IFruitFamily}s which can grow on leaves generated by this species. + */ + Collection getSuitableFruit(); + + /** + * @param tree + * @param world + * @param x + * @param y + * @param z + * @return Tree generator for the tree at the given location. + */ + WorldGenerator getGenerator(ITree tree, World world, int x, int y, int z); + + /** + * @return All available generator classes for this species. + */ + Class[] getGeneratorClasses(); + + /* TEXTURES AND OVERRIDES */ + int getLeafColour(ITree tree); + + short getLeafIconIndex(ITree tree, boolean fancy); + + @SideOnly(Side.CLIENT) + IIcon getGermlingIcon(EnumGermlingType type, int renderPass); + + @SideOnly(Side.CLIENT) + int getGermlingColour(EnumGermlingType type, int renderPass); + + /** + * + * @return Array of ItemStacks representing logs that these tree produces, the first one being the primary one + */ + ItemStack[] getLogStacks(); + +} diff --git a/src/api/java/forestry/api/arboriculture/IArboristTracker.java b/src/api/java/forestry/api/arboriculture/IArboristTracker.java new file mode 100644 index 00000000..9777e876 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IArboristTracker.java @@ -0,0 +1,12 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import forestry.api.genetics.IBreedingTracker; + +public interface IArboristTracker extends IBreedingTracker { + +} diff --git a/src/api/java/forestry/api/arboriculture/IFruitProvider.java b/src/api/java/forestry/api/arboriculture/IFruitProvider.java new file mode 100644 index 00000000..ef54fc99 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IFruitProvider.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import forestry.api.genetics.IFruitFamily; + +public interface IFruitProvider { + + IFruitFamily getFamily(); + + int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime); + + boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z); + + int getRipeningPeriod(); + + // / Products, Chance + ItemStack[] getProducts(); + + // / Specialty, Chance + ItemStack[] getSpecialty(); + + ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime); + + /** + * @return Short, human-readable identifier used in the treealyzer. + */ + String getDescription(); + + /* TEXTURE OVERLAY */ + /** + * @param genome + * @param world + * @param x + * @param y + * @param z + * @param ripeningTime + * Elapsed ripening time for the fruit. + * @param fancy + * @return IIcon index of the texture to overlay on the leaf block. + */ + short getIconIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy); + + /** + * @return true if this fruit provider requires fruit blocks to spawn, false otherwise. + */ + boolean requiresFruitBlocks(); + + /** + * Tries to spawn a fruit block at the potential position when the tree generates. + * + * @param genome + * @param world + * @param x + * @param y + * @param z + * @return true if a fruit block was spawned, false otherwise. + */ + boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z); + + @SideOnly(Side.CLIENT) + void registerIcons(IIconRegister register); +} diff --git a/src/api/java/forestry/api/arboriculture/IGrowthProvider.java b/src/api/java/forestry/api/arboriculture/IGrowthProvider.java new file mode 100644 index 00000000..92e553e0 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IGrowthProvider.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import net.minecraft.world.World; + +public interface IGrowthProvider { + + /** + * Check to see whether a sapling at the given location with the given genome can grow into a tree. + * + * @param genome Genome of the tree this is called for. + * @param world Minecraft world the tree will inhabit. + * @param xPos x-Coordinate to attempt growth at. + * @param yPos y-Coordinate to attempt growth at. + * @param zPos z-Coordinate to attempt growth at. + * @param expectedGirth Trunk size of the tree to generate. + * @param expectedHeight Height of the tree to generate. + * @return true if the tree can grow at the given coordinates, false otherwise. + */ + boolean canGrow(ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth, int expectedHeight); + + EnumGrowthConditions getGrowthConditions(ITreeGenome genome, World world, int xPos, int yPos, int zPos); + + /** + * @return Short, human-readable identifier used in the treealyzer. + */ + String getDescription(); + + /** + * @return Detailed description of growth behaviour used in the treealyzer. + */ + String[] getInfo(); + +} diff --git a/src/api/java/forestry/api/arboriculture/ILeafTickHandler.java b/src/api/java/forestry/api/arboriculture/ILeafTickHandler.java new file mode 100644 index 00000000..4d7fba44 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/ILeafTickHandler.java @@ -0,0 +1,12 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import net.minecraft.world.World; + +public interface ILeafTickHandler { + boolean onRandomLeafTick(ITree tree, World world, int biomeId, int x, int y, int z, boolean isDestroyed); +} diff --git a/src/api/java/forestry/api/arboriculture/IToolGrafter.java b/src/api/java/forestry/api/arboriculture/IToolGrafter.java new file mode 100644 index 00000000..339725e6 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/IToolGrafter.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IToolGrafter { + /** + * Called by leaves to determine the increase in sapling droprate. + * + * @param stack ItemStack containing the grafter. + * @param world Minecraft world the player and the target block inhabit. + * @param x x-Coordinate of the broken leaf block. + * @param y y-Coordinate of the broken leaf block. + * @param z z-Coordinate of the broken leaf block. + * @return Float representing the factor the usual drop chance is to be multiplied by. + */ + float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z); +} diff --git a/src/api/java/forestry/api/arboriculture/ITree.java b/src/api/java/forestry/api/arboriculture/ITree.java new file mode 100644 index 00000000..5cbd736f --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/ITree.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import java.util.EnumSet; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.common.EnumPlantType; + +import forestry.api.genetics.IEffectData; +import forestry.api.genetics.IIndividual; +import forestry.api.world.ITreeGenData; + +public interface ITree extends IIndividual, ITreeGenData { + + void mate(ITree other); + + IEffectData[] doEffect(IEffectData[] storedData, World world, int biomeid, int x, int y, int z); + + IEffectData[] doFX(IEffectData[] storedData, World world, int biomeid, int x, int y, int z); + + ITreeGenome getGenome(); + + ITreeGenome getMate(); + + EnumSet getPlantTypes(); + + ITree[] getSaplings(World world, int x, int y, int z, float modifier); + + ItemStack[] getProduceList(); + + ItemStack[] getSpecialtyList(); + + ItemStack[] produceStacks(World world, int x, int y, int z, int ripeningTime); + + /** + * + * @param world + * @param x + * @param y + * @param z + * @return Boolean indicating whether a sapling can stay planted at the given position. + */ + boolean canStay(World world, int x, int y, int z); + + /** + * + * @param world + * @param x + * @param y + * @param z + * @return Boolean indicating whether a sapling at the given position can grow into a tree. + */ + boolean canGrow(World world, int x, int y, int z, int expectedGirth, int expectedHeight); + + /** + * @return Integer denoting the maturity (block ticks) required for a sapling to attempt to grow into a tree. + */ + int getRequiredMaturity(); + + /** + * @return Integer denoting how resilient leaf blocks are against adverse influences (i.e. caterpillars). + */ + int getResilience(); + + /** + * @param world + * @param x + * @param y + * @param z + * @return Integer denoting the size of the tree trunk. + */ + int getGirth(World world, int x, int y, int z); + + + + /** + * + * @param world + * @param x + * @param y + * @param z + * @return Growth conditions at the given position. + */ + EnumGrowthConditions getGrowthCondition(World world, int x, int y, int z); + + WorldGenerator getTreeGenerator(World world, int x, int y, int z, boolean wasBonemealed); + + ITree copy(); + + boolean isPureBred(EnumTreeChromosome chromosome); + + boolean canBearFruit(); +} diff --git a/src/api/java/forestry/api/arboriculture/ITreeGenome.java b/src/api/java/forestry/api/arboriculture/ITreeGenome.java new file mode 100644 index 00000000..ee5a1f02 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/ITreeGenome.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import java.util.EnumSet; + +import net.minecraftforge.common.EnumPlantType; + +import forestry.api.genetics.IGenome; + +public interface ITreeGenome extends IGenome { + + IAlleleTreeSpecies getPrimary(); + + IAlleleTreeSpecies getSecondary(); + + IFruitProvider getFruitProvider(); + + IGrowthProvider getGrowthProvider(); + + float getHeight(); + + float getFertility(); + + /** + * @return Determines either a) how many fruit leaves there are or b) the chance for any fruit leave to drop a sapling. Exact usage determined by the + * IFruitProvider + */ + float getYield(); + + float getSappiness(); + + EnumSet getPlantTypes(); + + /** + * @return Amount of random block ticks required for a sapling to mature into a fully grown tree. + */ + int getMaturationTime(); + + int getGirth(); + + IAlleleLeafEffect getEffect(); +} diff --git a/src/api/java/forestry/api/arboriculture/ITreeModifier.java b/src/api/java/forestry/api/arboriculture/ITreeModifier.java new file mode 100644 index 00000000..775f91eb --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/ITreeModifier.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +public interface ITreeModifier { + + /** + * + * @param genome + * @return Float used to modify the height. + */ + float getHeightModifier(ITreeGenome genome, float currentModifier); + + /** + * + * @param genome + * @return Float used to modify the yield. + */ + float getYieldModifier(ITreeGenome genome, float currentModifier); + + /** + * + * @param genome + * @return Float used to modify the sappiness. + */ + float getSappinessModifier(ITreeGenome genome, float currentModifier); + + /** + * + * @param genome + * @return Float used to modify the maturation. + */ + float getMaturationModifier(ITreeGenome genome, float currentModifier); + + /** + * @param genome0 + * @param genome1 + * @return Float used to modify the base mutation chance. + */ + float getMutationModifier(ITreeGenome genome0, ITreeGenome genome1, float currentModifier); + +} diff --git a/src/api/java/forestry/api/arboriculture/ITreeMutation.java b/src/api/java/forestry/api/arboriculture/ITreeMutation.java new file mode 100644 index 00000000..65804969 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/ITreeMutation.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import net.minecraft.world.World; + +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IGenome; +import forestry.api.genetics.IMutation; +import forestry.api.genetics.ISpeciesRoot; + +public interface ITreeMutation extends IMutation { + + /** + * @return {@link ISpeciesRoot} this mutation is associated with. + */ + ITreeRoot getRoot(); + + /** + * @param world + * @param x + * @param y + * @param z + * @param allele0 + * @param allele1 + * @param genome0 + * @param genome1 + * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously! + */ + float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); +} diff --git a/src/api/java/forestry/api/arboriculture/ITreeRoot.java b/src/api/java/forestry/api/arboriculture/ITreeRoot.java new file mode 100644 index 00000000..e966ca04 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/ITreeRoot.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +import com.mojang.authlib.GameProfile; + +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IChromosome; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.ISpeciesRoot; + +public interface ITreeRoot extends ISpeciesRoot { + + @Override + boolean isMember(ItemStack itemstack); + + @Override + ITree getMember(ItemStack itemstack); + + @Override + ITree getMember(NBTTagCompound compound); + + @Override + ITree templateAsIndividual(IAllele[] template); + + @Override + ITree templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); + + @Override + ITreeGenome templateAsGenome(IAllele[] template); + + @Override + ITreeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); + + /** + * @param world + * @return {@link IArboristTracker} associated with the passed world. + */ + @Override + IArboristTracker getBreedingTracker(World world, GameProfile player); + + /* TREE SPECIFIC */ + /** + * Register a leaf tick handler. + * @param handler the {@link ILeafTickHandler} to register. + */ + void registerLeafTickHandler(ILeafTickHandler handler); + + Collection getLeafTickHandlers(); + + /** + * @return type of tree encoded on the itemstack. EnumBeeType.NONE if it isn't a tree. + */ + EnumGermlingType getType(ItemStack stack); + + ITree getTree(World world, int x, int y, int z); + + ITree getTree(World world, ITreeGenome genome); + + boolean plantSapling(World world, ITree tree, GameProfile owner, int x, int y, int z); + + /** + * @deprecated since Forestry 3.5.0. Use ITreeGenData setLeavesDecorative. + */ + @Deprecated + // decorative=true for creative and player-placed leaves. No decay, pollination, or drops. + boolean setLeaves(World world, IIndividual tree, GameProfile owner, int x, int y, int z, boolean decorative); + + /** + * @deprecated since Forestry 3.5.0. Use ITreeGenData setLeaves. + */ + @Deprecated + // set normal leaves created as worldgen + boolean setLeaves(World world, IIndividual tree, GameProfile owner, int x, int y, int z); + + @Override + IChromosome[] templateAsChromosomes(IAllele[] template); + + @Override + IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive); + + boolean setFruitBlock(World world, IAlleleFruit allele, float sappiness, short[] indices, int x, int y, int z); + + /* GAME MODE */ + ArrayList getTreekeepingModes(); + + ITreekeepingMode getTreekeepingMode(World world); + + ITreekeepingMode getTreekeepingMode(String name); + + void registerTreekeepingMode(ITreekeepingMode mode); + + void setTreekeepingMode(World world, String name); + + /* TEMPLATES */ + @Override + ArrayList getIndividualTemplates(); + + /* MUTATIONS */ + @Override + Collection getMutations(boolean shuffle); + +} diff --git a/src/api/java/forestry/api/arboriculture/ITreekeepingMode.java b/src/api/java/forestry/api/arboriculture/ITreekeepingMode.java new file mode 100644 index 00000000..cc5224d8 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/ITreekeepingMode.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.arboriculture; + +import java.util.ArrayList; + +public interface ITreekeepingMode extends ITreeModifier { + + /** + * @return Localized name of this treekeeping mode. + */ + String getName(); + + /** + * @return Localized list of strings outlining the behaviour of this treekeeping mode. + */ + ArrayList getDescription(); + +} diff --git a/src/api/java/forestry/api/arboriculture/package-info.java b/src/api/java/forestry/api/arboriculture/package-info.java new file mode 100644 index 00000000..de961141 --- /dev/null +++ b/src/api/java/forestry/api/arboriculture/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="2.3.0", owner="ForestryAPI|core", provides="ForestryAPI|arboriculture") +package forestry.api.arboriculture; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/circuits/ChipsetManager.java b/src/api/java/forestry/api/circuits/ChipsetManager.java new file mode 100644 index 00000000..c5f0db5c --- /dev/null +++ b/src/api/java/forestry/api/circuits/ChipsetManager.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.circuits; + +public class ChipsetManager { + + public static ISolderManager solderManager; + public static ICircuitRegistry circuitRegistry; + +} diff --git a/src/api/java/forestry/api/circuits/ICircuit.java b/src/api/java/forestry/api/circuits/ICircuit.java new file mode 100644 index 00000000..01b7e79d --- /dev/null +++ b/src/api/java/forestry/api/circuits/ICircuit.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.circuits; + +import java.util.List; + +import net.minecraft.tileentity.TileEntity; + +public interface ICircuit { + String getUID(); + + boolean requiresDiscovery(); + + int getLimit(); + + String getName(); + + boolean isCircuitable(TileEntity tile); + + void onInsertion(int slot, TileEntity tile); + + void onLoad(int slot, TileEntity tile); + + void onRemoval(int slot, TileEntity tile); + + void onTick(int slot, TileEntity tile); + + void addTooltip(List list); +} diff --git a/src/api/java/forestry/api/circuits/ICircuitBoard.java b/src/api/java/forestry/api/circuits/ICircuitBoard.java new file mode 100644 index 00000000..3b424d75 --- /dev/null +++ b/src/api/java/forestry/api/circuits/ICircuitBoard.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.circuits; + +import java.util.List; + +import net.minecraft.tileentity.TileEntity; + +import forestry.api.core.INBTTagable; + +public interface ICircuitBoard extends INBTTagable { + + int getPrimaryColor(); + + int getSecondaryColor(); + + void addTooltip(List list); + + void onInsertion(TileEntity tile); + + void onLoad(TileEntity tile); + + void onRemoval(TileEntity tile); + + void onTick(TileEntity tile); + + ICircuit[] getCircuits(); + +} diff --git a/src/api/java/forestry/api/circuits/ICircuitLayout.java b/src/api/java/forestry/api/circuits/ICircuitLayout.java new file mode 100644 index 00000000..e90853b9 --- /dev/null +++ b/src/api/java/forestry/api/circuits/ICircuitLayout.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.circuits; + +public interface ICircuitLayout { + + String getUID(); + + String getName(); + + String getUsage(); + +} diff --git a/src/api/java/forestry/api/circuits/ICircuitLibrary.java b/src/api/java/forestry/api/circuits/ICircuitLibrary.java new file mode 100644 index 00000000..0d65ba45 --- /dev/null +++ b/src/api/java/forestry/api/circuits/ICircuitLibrary.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.circuits; + +public interface ICircuitLibrary { + +} diff --git a/src/api/java/forestry/api/circuits/ICircuitRegistry.java b/src/api/java/forestry/api/circuits/ICircuitRegistry.java new file mode 100644 index 00000000..9fb2b94d --- /dev/null +++ b/src/api/java/forestry/api/circuits/ICircuitRegistry.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.circuits; + +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface ICircuitRegistry { + + /* CIRCUITS */ + Map getRegisteredCircuits(); + + void registerCircuit(ICircuit circuit); + + ICircuit getCircuit(String uid); + + ICircuitLibrary getCircuitLibrary(World world, String playername); + + /* LAYOUTS */ + Map getRegisteredLayouts(); + + void registerLayout(ICircuitLayout layout); + + ICircuitLayout getLayout(String uid); + + ICircuitLayout getDefaultLayout(); + + ICircuitBoard getCircuitboard(ItemStack itemstack); + + boolean isChipset(ItemStack itemstack); + +} diff --git a/src/api/java/forestry/api/circuits/ISolderManager.java b/src/api/java/forestry/api/circuits/ISolderManager.java new file mode 100644 index 00000000..af9b41f1 --- /dev/null +++ b/src/api/java/forestry/api/circuits/ISolderManager.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.circuits; + +import net.minecraft.item.ItemStack; + +public interface ISolderManager { + + void addRecipe(ICircuitLayout layout, ItemStack resource, ICircuit circuit); + +} diff --git a/src/api/java/forestry/api/circuits/package-info.java b/src/api/java/forestry/api/circuits/package-info.java new file mode 100644 index 00000000..88612198 --- /dev/null +++ b/src/api/java/forestry/api/circuits/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="2.0.0", owner="ForestryAPI|core", provides="ForestryAPI|circuits") +package forestry.api.circuits; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/core/BiomeHelper.java b/src/api/java/forestry/api/core/BiomeHelper.java new file mode 100644 index 00000000..bc20cd66 --- /dev/null +++ b/src/api/java/forestry/api/core/BiomeHelper.java @@ -0,0 +1,36 @@ +package forestry.api.core; + +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.world.biome.BiomeGenBase; + +import net.minecraftforge.common.BiomeDictionary; + +public class BiomeHelper { + + private static final Map isBiomeHellishCache = new HashMap(); + + /** + * Determines if it can rain or snow in the given biome. + */ + public static boolean canRainOrSnow(BiomeGenBase biomeGenBase) { + return biomeGenBase.getEnableSnow() || biomeGenBase.canSpawnLightningBolt(); + } + + /** + * Determines if a given BiomeGenBase is of HELLISH temperature, since it is treated separately from actual temperature values. + * Uses the BiomeDictionary. + * @param biomeGen BiomeGenBase of the biome in question + * @return true, if the BiomeGenBase is a Nether-type biome; false otherwise. + */ + public static boolean isBiomeHellish(BiomeGenBase biomeGen) { + if (isBiomeHellishCache.containsKey(biomeGen)) { + return isBiomeHellishCache.get(biomeGen); + } + + boolean isBiomeHellish = BiomeDictionary.isBiomeOfType(biomeGen, BiomeDictionary.Type.NETHER); + isBiomeHellishCache.put(biomeGen, isBiomeHellish); + return isBiomeHellish; + } +} diff --git a/src/api/java/forestry/api/core/EnumHumidity.java b/src/api/java/forestry/api/core/EnumHumidity.java new file mode 100644 index 00000000..a8743169 --- /dev/null +++ b/src/api/java/forestry/api/core/EnumHumidity.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +/** + * Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location. + * + * This enum concerns humidity. + */ +public enum EnumHumidity { + ARID("Arid"), NORMAL("Normal"), DAMP("Damp"); + + public final String name; + + private EnumHumidity(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + /** + * Determines the EnumHumidity given a floating point representation of Minecraft Rainfall. + * To check if rainfall is possible in a biome, use BiomeHelper.canRainOrSnow(). + * @param rawHumidity raw rainfall value + * @return EnumHumidity corresponding to rainfall value + */ + public static EnumHumidity getFromValue(float rawHumidity) { + if (rawHumidity > 0.85f) { // matches BiomeGenBase.isHighHumidity() + return DAMP; + } + else if (rawHumidity >= 0.3f) { + return NORMAL; + } + else { + return ARID; + } + } +} diff --git a/src/api/java/forestry/api/core/EnumTemperature.java b/src/api/java/forestry/api/core/EnumTemperature.java new file mode 100644 index 00000000..b0c4c889 --- /dev/null +++ b/src/api/java/forestry/api/core/EnumTemperature.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.util.IIcon; +import net.minecraft.world.biome.BiomeGenBase; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location. + * + * This enum concerns temperature. + */ +public enum EnumTemperature { + NONE("None", "habitats/ocean"), ICY("Icy", "habitats/snow"), COLD("Cold", "habitats/taiga"), + NORMAL("Normal", "habitats/plains"), WARM("Warm", "habitats/jungle"), HOT("Hot", "habitats/desert"), HELLISH("Hellish", "habitats/nether"); + + public final String name; + public final String iconIndex; + + private EnumTemperature(String name, String iconIndex) { + this.name = name; + this.iconIndex = iconIndex; + } + + public String getName() { + return this.name; + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return ForestryAPI.textureManager.getDefault(iconIndex); + } + + /** + * Determines the EnumTemperature given a floating point representation of + * Minecraft temperature. Hellish biomes are handled based on their biome + * type - check BiomeHelper.isBiomeHellish. + * @param rawTemp raw temperature value + * @return EnumTemperature corresponding to value of rawTemp + */ + public static EnumTemperature getFromValue(float rawTemp) { + if (rawTemp > 1.00f) { + return HOT; + } + else if (rawTemp > 0.80f) { + return WARM; + } + else if (rawTemp > 0.30f) { + return NORMAL; + } + else if (rawTemp > 0.0f) { + return COLD; + } + else { + return ICY; + } + } + + public static EnumTemperature getFromBiome(BiomeGenBase biomeGenBase) { + if (BiomeHelper.isBiomeHellish(biomeGenBase)) { + return HELLISH; + } + return getFromValue(biomeGenBase.temperature); + } +} diff --git a/src/api/java/forestry/api/core/ErrorStateRegistry.java b/src/api/java/forestry/api/core/ErrorStateRegistry.java new file mode 100644 index 00000000..67e5c466 --- /dev/null +++ b/src/api/java/forestry/api/core/ErrorStateRegistry.java @@ -0,0 +1,77 @@ +/* + ******************************************************************************* + * Copyright (c) 2011-2014 SirSengir. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Various Contributors including, but not limited to: + * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges + ******************************************************************************* + */ +package forestry.api.core; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import net.minecraft.client.renderer.texture.IIconRegister; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * + * @author CovertJaguar + */ +public class ErrorStateRegistry { + + private static final BiMap states = HashBiMap.create(); + private static final Map stateNames = new HashMap(); + private static final Set stateView = Collections.unmodifiableSet(states.inverse().keySet()); + + public static void registerErrorState(IErrorState state) { + if (states.containsKey(state.getID())) + throw new RuntimeException("Forestry Error State does not possess a unique id."); + states.put(state.getID(), state); + addStateName(state, state.getUniqueName()); + } + + public static void addAlias(IErrorState state, String name) { + if (!states.values().contains(state)) + throw new RuntimeException("Forestry Error State did not exist while trying to register alias."); + addStateName(state, name); + } + + private static void addStateName(IErrorState state, String name) { + if (!name.contains(":")) + throw new RuntimeException("Forestry Error State name must be in the format :."); + if (stateNames.containsKey(name)) + throw new RuntimeException("Forestry Error State does not possess a unique name."); + stateNames.put(name, state); + } + + public static IErrorState getErrorState(short id) { + return states.get(id); + } + + public static IErrorState getErrorState(String name) { + return stateNames.get(name); + } + + public static Set getErrorStates() { + return stateView; + } + + @SideOnly(Side.CLIENT) + public static void initIcons(IIconRegister register) { + for (IErrorState code : states.values()) { + code.registerIcons(register); + } + } +} diff --git a/src/api/java/forestry/api/core/ForestryAPI.java b/src/api/java/forestry/api/core/ForestryAPI.java new file mode 100644 index 00000000..24c5b7eb --- /dev/null +++ b/src/api/java/forestry/api/core/ForestryAPI.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Forestry's API is divided into several subcategories to make it easier to understand. + * + * If you need to distribute API files, try to only include the parts you are actually + * using to minimize conflicts due to API changes. + * + * .core - Miscallenous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods. + * .fuels - Managers and classes to facilitate adding fuels to various engines and machines. + * .recipes - Managers and helpers to facilitate adding new recipes to various machines. + * .storage - Managers, events and interfaces for defining new backpacks and handling backpack behaviour. + * .mail - Anything related to handling letters and adding new mail carrier systems. + * .genetics - Shared code for all genetic subclasses. + * \ .apiculture - Bees. + * \ .arboriculture - Trees. + * \ .lepidopterology - Butterflies. + * + * Note that if Forestry is not present, all these references will be null. + */ +public class ForestryAPI { + + /** + * The main mod instance for Forestry. + */ + public static Object instance; + + /** + * A {@link ITextureManager} needed for some things in the API. + */ + @SideOnly(Side.CLIENT) + public static ITextureManager textureManager; + + /** + * The currently active {@link IGameMode}. + */ + public static IGameMode activeMode; + + /** + * Provides information on certain Forestry constants (Villager IDs, Chest gen keys, etc) + */ + public static IForestryConstants forestryConstants; + +} diff --git a/src/api/java/forestry/api/core/ForestryEvent.java b/src/api/java/forestry/api/core/ForestryEvent.java new file mode 100644 index 00000000..86aac9bc --- /dev/null +++ b/src/api/java/forestry/api/core/ForestryEvent.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.entity.player.EntityPlayer; + +import com.mojang.authlib.GameProfile; + +import cpw.mods.fml.common.eventhandler.Event; + +import forestry.api.genetics.IAlleleSpecies; +import forestry.api.genetics.IBreedingTracker; +import forestry.api.genetics.IMutation; +import forestry.api.genetics.ISpeciesRoot; + +public abstract class ForestryEvent extends Event { + + private static abstract class BreedingEvent extends ForestryEvent { + public final ISpeciesRoot root; + public final IBreedingTracker tracker; + public final GameProfile username; + + private BreedingEvent(ISpeciesRoot root, GameProfile username, IBreedingTracker tracker) { + super(); + this.root = root; + this.username = username; + this.tracker = tracker; + } + } + + public static class SpeciesDiscovered extends BreedingEvent { + public final IAlleleSpecies species; + public SpeciesDiscovered(ISpeciesRoot root, GameProfile username, IAlleleSpecies species, IBreedingTracker tracker) { + super(root, username, tracker); + this.species = species; + } + } + + public static class MutationDiscovered extends BreedingEvent { + public final IMutation allele; + public MutationDiscovered(ISpeciesRoot root, GameProfile username, IMutation allele, IBreedingTracker tracker) { + super(root, username, tracker); + this.allele = allele; + } + } + + public static class SyncedBreedingTracker extends ForestryEvent { + public final IBreedingTracker tracker; + public final EntityPlayer player; + public SyncedBreedingTracker(IBreedingTracker tracker, EntityPlayer player) { + super(); + this.tracker = tracker; + this.player = player; + } + + } +} diff --git a/src/api/java/forestry/api/core/IArmorNaturalist.java b/src/api/java/forestry/api/core/IArmorNaturalist.java new file mode 100644 index 00000000..87400e27 --- /dev/null +++ b/src/api/java/forestry/api/core/IArmorNaturalist.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public interface IArmorNaturalist { + + /** + * Called when the naturalist's armor acts as spectacles for seeing pollinated tree leaves/flowers. + * + * @param player + * Player doing the viewing + * @param armor + * Armor item + * @param doSee + * Whether or not to actually do the side effects of viewing + * @return true if the armor actually allows the player to see pollination. + */ + public boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee); +} diff --git a/src/api/java/forestry/api/core/IErrorState.java b/src/api/java/forestry/api/core/IErrorState.java new file mode 100644 index 00000000..b17305fb --- /dev/null +++ b/src/api/java/forestry/api/core/IErrorState.java @@ -0,0 +1,41 @@ +/* + ******************************************************************************* + * Copyright (c) 2011-2014 SirSengir. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Various Contributors including, but not limited to: + * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges + ******************************************************************************* + */ +package forestry.api.core; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * + * @author CovertJaguar + */ +public interface IErrorState { + + short getID(); + + String getUniqueName(); + + String getDescription(); + + String getHelp(); + + @SideOnly(Side.CLIENT) + void registerIcons(IIconRegister register); + + @SideOnly(value = Side.CLIENT) + IIcon getIcon(); + +} diff --git a/src/api/java/forestry/api/core/IForestryConstants.java b/src/api/java/forestry/api/core/IForestryConstants.java new file mode 100644 index 00000000..4cf876f6 --- /dev/null +++ b/src/api/java/forestry/api/core/IForestryConstants.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +public interface IForestryConstants { + + /** + * @return The villager ID for the Apiarist Villager. + */ + public int getApicultureVillagerID(); + + /** + * @return The villager ID for the Arborist Villager. + */ + public int getArboricultureVillagerID(); + + /** + * @return The ChestGenHooks key for adding items to the Forestry Villager chest. + */ + public String getVillagerChestGenKey(); +} diff --git a/src/api/java/forestry/api/core/IGameMode.java b/src/api/java/forestry/api/core/IGameMode.java new file mode 100644 index 00000000..0b2b0c55 --- /dev/null +++ b/src/api/java/forestry/api/core/IGameMode.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.item.ItemStack; + +public interface IGameMode { + + /** + * @return Human-readable identifier for the game mode. (i.e. 'EASY', 'NORMAL', 'HARD') + */ + String getIdentifier(); + + /** + * @param ident Identifier for the setting. (See the gamemode config.) + * @return Value of the requested setting, false if unknown setting. + */ + boolean getBooleanSetting(String ident); + + /** + * @param ident Identifier for the setting. (See the gamemode config.) + * @return Value of the requested setting, 0 if unknown setting. + */ + int getIntegerSetting(String ident); + + /** + * @param ident Identifier for the setting. (See the gamemode config.) + * @return Value of the requested setting, 0 if unknown setting. + */ + float getFloatSetting(String ident); + + /** + * @param ident Identifier for the setting. (See the gamemode config.) + * @return Value of the requested setting, an itemstack containing an apple if unknown setting. + */ + ItemStack getStackSetting(String ident); + +} diff --git a/src/api/java/forestry/api/core/IIconProvider.java b/src/api/java/forestry/api/core/IIconProvider.java new file mode 100644 index 00000000..308e3ce5 --- /dev/null +++ b/src/api/java/forestry/api/core/IIconProvider.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Provides icons, needed in some interfaces, most notably for bees and trees. + */ +public interface IIconProvider { + + @SideOnly(Side.CLIENT) + IIcon getIcon(short texUID); + + @SideOnly(Side.CLIENT) + void registerIcons(IIconRegister register); + +} diff --git a/src/api/java/forestry/api/core/INBTTagable.java b/src/api/java/forestry/api/core/INBTTagable.java new file mode 100644 index 00000000..1d3f8580 --- /dev/null +++ b/src/api/java/forestry/api/core/INBTTagable.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.nbt.NBTTagCompound; + +public interface INBTTagable { + void readFromNBT(NBTTagCompound nbttagcompound); + + void writeToNBT(NBTTagCompound nbttagcompound); +} diff --git a/src/api/java/forestry/api/core/IStructureLogic.java b/src/api/java/forestry/api/core/IStructureLogic.java new file mode 100644 index 00000000..aa93d171 --- /dev/null +++ b/src/api/java/forestry/api/core/IStructureLogic.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +public interface IStructureLogic extends INBTTagable { + + /** + * @return String unique to the type of structure controlled by this structure logic. + */ + String getTypeUID(); + + /** + * Called by {@link ITileStructure}'s validateStructure(). + */ + void validateStructure(); + +} diff --git a/src/api/java/forestry/api/core/ITextureManager.java b/src/api/java/forestry/api/core/ITextureManager.java new file mode 100644 index 00000000..a259fcae --- /dev/null +++ b/src/api/java/forestry/api/core/ITextureManager.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface ITextureManager { + + void registerIconProvider(IIconProvider provider); + + IIcon getIcon(short texUID); + + IIcon getDefault(String ident); +} diff --git a/src/api/java/forestry/api/core/ITileStructure.java b/src/api/java/forestry/api/core/ITileStructure.java new file mode 100644 index 00000000..c8c29cad --- /dev/null +++ b/src/api/java/forestry/api/core/ITileStructure.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.tileentity.TileEntity; + +/** + * The basis for multiblock components. + */ +public interface ITileStructure { + + /** + * @return String unique to the type of structure controlled by this structure logic. Should map to {@link IStructureLogic} + */ + String getTypeUID(); + + /** + * Should map to {@link IStructureLogic} + */ + void validateStructure(); + + /** + * Called when the structure resets. + */ + void onStructureReset(); + + /** + * @return TileEntity that is the master in this structure, null if no structure exists. + */ + ITileStructure getCentralTE(); + + /** + * Called to set the master TileEntity. Implementing TileEntity should keep track of the master's coordinates, not refer to the TE object itself. + * + * @param tile + */ + void setCentralTE(TileEntity tile); + + /** + * @return ISidedInventory representing the inventory accessed from this block. + */ + ISidedInventory getStructureInventory(); + + /** + * Only called on Forestry's own blocks. + */ + void makeMaster(); + + /** + * @return true if this TE is the master in a structure, false otherwise. + */ + boolean isMaster(); + + /** + * @return true if the TE is master or has a master. + */ + boolean isIntegratedIntoStructure(); + +} diff --git a/src/api/java/forestry/api/core/IToolPipette.java b/src/api/java/forestry/api/core/IToolPipette.java new file mode 100644 index 00000000..f5f1a633 --- /dev/null +++ b/src/api/java/forestry/api/core/IToolPipette.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2011-2014 SirSengir. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Various Contributors including, but not limited to: + * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.item.ItemStack; + +import net.minecraftforge.fluids.FluidStack; + +/** + * Taken from BuildCraft 5.0.x + */ +public interface IToolPipette { + + /** + * @param pipette + * ItemStack of the pipette. + * @return Capacity of the pipette. + */ + int getCapacity(ItemStack pipette); + + /** + * @param pipette + * @return true if the pipette can pipette. + */ + boolean canPipette(ItemStack pipette); + + /** + * Fills the pipette with the given liquid stack. + * + * @param pipette + * @param liquid + * @param doFill + * @return Amount of liquid used in filling the pipette. + */ + int fill(ItemStack pipette, FluidStack liquid, boolean doFill); + + /** + * Drains liquid from the pipette + * + * @param pipette + * @param maxDrain + * @param doDrain + * @return Fluid stack representing the liquid and amount drained from the pipette. + */ + FluidStack drain(ItemStack pipette, int maxDrain, boolean doDrain); +} diff --git a/src/api/java/forestry/api/core/IToolScoop.java b/src/api/java/forestry/api/core/IToolScoop.java new file mode 100644 index 00000000..583b6c7e --- /dev/null +++ b/src/api/java/forestry/api/core/IToolScoop.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +/** + * Marks a tool as a scoop. + */ +public interface IToolScoop { + +} diff --git a/src/api/java/forestry/api/core/Tabs.java b/src/api/java/forestry/api/core/Tabs.java new file mode 100644 index 00000000..4ce85838 --- /dev/null +++ b/src/api/java/forestry/api/core/Tabs.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.creativetab.CreativeTabs; + +/** + * References to the specialised tabs added by Forestry to creative inventory. + */ +public class Tabs { + + public static CreativeTabs tabApiculture; + public static CreativeTabs tabArboriculture; + public static CreativeTabs tabLepidopterology; + +} diff --git a/src/api/java/forestry/api/core/package-info.java b/src/api/java/forestry/api/core/package-info.java new file mode 100644 index 00000000..3db8ba25 --- /dev/null +++ b/src/api/java/forestry/api/core/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="3.0.0", owner="Forestry", provides="ForestryAPI|core") +package forestry.api.core; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/farming/Farmables.java b/src/api/java/forestry/api/farming/Farmables.java new file mode 100644 index 00000000..bc4c159c --- /dev/null +++ b/src/api/java/forestry/api/farming/Farmables.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import java.util.Collection; +import java.util.HashMap; + +public class Farmables { + /** + * Can be used to add IFarmables to some of the vanilla farm logics. + * + * Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom + */ + public static HashMap> farmables = new HashMap>(); + + public static IFarmInterface farmInterface; +} diff --git a/src/api/java/forestry/api/farming/ICrop.java b/src/api/java/forestry/api/farming/ICrop.java new file mode 100644 index 00000000..22575477 --- /dev/null +++ b/src/api/java/forestry/api/farming/ICrop.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import java.util.Collection; + +import net.minecraft.item.ItemStack; + +public interface ICrop { + + /** + * Harvests this crop. Performs the necessary manipulations to set the crop into a "harvested" state. + * + * @return Products harvested. + */ + Collection harvest(); + +} diff --git a/src/api/java/forestry/api/farming/IFarmComponent.java b/src/api/java/forestry/api/farming/IFarmComponent.java new file mode 100644 index 00000000..3387f7a3 --- /dev/null +++ b/src/api/java/forestry/api/farming/IFarmComponent.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import forestry.api.core.ITileStructure; + +public interface IFarmComponent extends ITileStructure { + + boolean hasFunction(); + + void registerListener(IFarmListener listener); + + void removeListener(IFarmListener listener); +} diff --git a/src/api/java/forestry/api/farming/IFarmHousing.java b/src/api/java/forestry/api/farming/IFarmHousing.java new file mode 100644 index 00000000..acdd982d --- /dev/null +++ b/src/api/java/forestry/api/farming/IFarmHousing.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +public interface IFarmHousing { + + int[] getCoords(); + + int[] getArea(); + + int[] getOffset(); + + World getWorld(); + + /** + * Will run the work cycle on a master TE. Will do nothing on any other farm component. + * + * @return true if any work was done, false otherwise. + */ + boolean doWork(); + + boolean hasLiquid(FluidStack liquid); + + void removeLiquid(FluidStack liquid); + + boolean hasResources(ItemStack[] resources); + + void removeResources(ItemStack[] resources); + + /** + * Callback for {@link IFarmLogic}s to plant a sapling, seed, germling, stem. Will remove the appropriate germling from the farm's inventory. It's up to the + * logic to only call this on a valid location. + * + * @param farmable + * @param world + * @param x + * @param y + * @param z + * @return true if planting was successful, false otherwise. + */ + boolean plantGermling(IFarmable farmable, World world, int x, int y, int z); + + /* INTERACTION WITH HATCHES */ + boolean acceptsAsGermling(ItemStack itemstack); + + boolean acceptsAsResource(ItemStack itemstack); + + boolean acceptsAsFertilizer(ItemStack itemstack); + + /* LOGIC */ + /** + * Set a farm logic for the given direction. UP/DOWN/UNKNOWN are invalid! + * + * @param direction + * @param logic + */ + void setFarmLogic(ForgeDirection direction, IFarmLogic logic); + + /** + * Reset the farm logic for the given direction to default. UP/DOWN/UNKNOWN are invalid! + * + * @param direction + */ + void resetFarmLogic(ForgeDirection direction); +} diff --git a/src/api/java/forestry/api/farming/IFarmInterface.java b/src/api/java/forestry/api/farming/IFarmInterface.java new file mode 100644 index 00000000..08968747 --- /dev/null +++ b/src/api/java/forestry/api/farming/IFarmInterface.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import forestry.api.core.IStructureLogic; + +public interface IFarmInterface { + + /** + * Creates {@link IStructureLogic} for use in farm components. + * + * @param structure + * {@link IFarmComponent} to create the logic for. + * @return {@link IStructureLogic} for use in farm components + */ + IStructureLogic createFarmStructureLogic(IFarmComponent structure); +} diff --git a/src/api/java/forestry/api/farming/IFarmListener.java b/src/api/java/forestry/api/farming/IFarmListener.java new file mode 100644 index 00000000..461525ff --- /dev/null +++ b/src/api/java/forestry/api/farming/IFarmListener.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import java.util.Collection; + +import net.minecraft.item.ItemStack; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IFarmListener { + + /** + * Called before a crop is harvested. + * + * @param crop + * ICrop about to be harvested. + * @return true to cancel further processing of this crop. + */ + boolean beforeCropHarvest(ICrop crop); + + /** + * Called after a crop has been harvested, but before harvested items are stowed in the farms inventory. + * + * @param harvested + * Collection of harvested stacks. May be manipulated. Ensure removal of stacks with 0 or less items! + * @param crop + * Harvested {@link ICrop} + */ + void afterCropHarvest(Collection harvested, ICrop crop); + + /** + * Called after the stack of collected items has been returned by the farm logic, but before it is added to the farm's pending queue. + * + * @param collected + * Collection of collected stacks. May be manipulated. Ensure removal of stacks with 0 or less items! + * @param logic + */ + void hasCollected(Collection collected, IFarmLogic logic); + + /** + * Called after farmland has successfully been cultivated by a farm logic. + * + * @param logic + * @param x + * @param y + * @param z + * @param direction + * @param extent + */ + void hasCultivated(IFarmLogic logic, int x, int y, int z, ForgeDirection direction, int extent); + + /** + * Called after the stack of harvested crops has been returned by the farm logic, but before it is added to the farm's pending queue. + * + * @param harvested + * @param logic + * @param x + * @param y + * @param z + * @param direction + * @param extent + */ + void hasScheduledHarvest(Collection harvested, IFarmLogic logic, int x, int y, int z, ForgeDirection direction, int extent); + + /** + * Can be used to cancel farm task on a per side/{@link IFarmLogic} basis. + * + * @param logic + * @param direction + * @return true to skip any work action on the given logic and direction for this work cycle. + */ + boolean cancelTask(IFarmLogic logic, ForgeDirection direction); +} diff --git a/src/api/java/forestry/api/farming/IFarmLogic.java b/src/api/java/forestry/api/farming/IFarmLogic.java new file mode 100644 index 00000000..1c2482c0 --- /dev/null +++ b/src/api/java/forestry/api/farming/IFarmLogic.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IFarmLogic { + + int getFertilizerConsumption(); + + int getWaterConsumption(float hydrationModifier); + + boolean isAcceptedResource(ItemStack itemstack); + + boolean isAcceptedGermling(ItemStack itemstack); + + Collection collect(); + + boolean cultivate(int x, int y, int z, ForgeDirection direction, int extent); + + Collection harvest(int x, int y, int z, ForgeDirection direction, int extent); + + IFarmLogic setManual(boolean manual); + + @SideOnly(Side.CLIENT) + IIcon getIcon(); + + ResourceLocation getSpriteSheet(); + + String getName(); +} diff --git a/src/api/java/forestry/api/farming/IFarmable.java b/src/api/java/forestry/api/farming/IFarmable.java new file mode 100644 index 00000000..440ae599 --- /dev/null +++ b/src/api/java/forestry/api/farming/IFarmable.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.farming; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * IGermling describes a crop or other harvestable object and can be used to inspect item stacks and blocks for matches. + */ +public interface IFarmable { + + /** + * @param world + * @param x + * @param y + * @param z + * @return true if the block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop. + */ + boolean isSaplingAt(World world, int x, int y, int z); + + /** + * @param world + * @param x + * @param y + * @param z + * @return {@link ICrop} if the block at the given location is a harvestable and mature crop, null otherwise. + */ + ICrop getCropAt(World world, int x, int y, int z); + + /** + * @param itemstack + * @return true if the item is a valid germling (plantable sapling, seed, etc.) for this type. + */ + boolean isGermling(ItemStack itemstack); + + /** + * @param itemstack + * @return true if the item is something that can drop from this type without actually being harvested as a crop. (Apples or sapling from decaying leaves.) + */ + boolean isWindfall(ItemStack itemstack); + + /** + * Plants a sapling by manipulating the world. The {@link IFarmLogic} should have verified the given location as valid. Called by the {@link IFarmHousing} + * which handles resources. + * + * @param germling + * @param world + * @param x + * @param y + * @param z + * @return true on success, false otherwise. + */ + boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z); + +} diff --git a/src/api/java/forestry/api/farming/package-info.java b/src/api/java/forestry/api/farming/package-info.java new file mode 100644 index 00000000..4460886c --- /dev/null +++ b/src/api/java/forestry/api/farming/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="1.1.0", owner="ForestryAPI|core", provides="ForestryAPI|farming") +package forestry.api.farming; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/food/BeverageManager.java b/src/api/java/forestry/api/food/BeverageManager.java new file mode 100644 index 00000000..2b0143ab --- /dev/null +++ b/src/api/java/forestry/api/food/BeverageManager.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.food; + +public class BeverageManager { + public static IBeverageEffect[] effectList = new IBeverageEffect[128]; + + public static IInfuserManager infuserManager; + public static IIngredientManager ingredientManager; +} diff --git a/src/api/java/forestry/api/food/IBeverageEffect.java b/src/api/java/forestry/api/food/IBeverageEffect.java new file mode 100644 index 00000000..6a787411 --- /dev/null +++ b/src/api/java/forestry/api/food/IBeverageEffect.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.food; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public interface IBeverageEffect { + int getId(); + + void doEffect(World world, EntityPlayer player); + + String getDescription(); +} diff --git a/src/api/java/forestry/api/food/IInfuserManager.java b/src/api/java/forestry/api/food/IInfuserManager.java new file mode 100644 index 00000000..d778ffa4 --- /dev/null +++ b/src/api/java/forestry/api/food/IInfuserManager.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.food; + +import net.minecraft.item.ItemStack; + +public interface IInfuserManager { + + void addMixture(int meta, ItemStack ingredient, IBeverageEffect effect); + + void addMixture(int meta, ItemStack[] ingredients, IBeverageEffect effect); + + ItemStack getSeasoned(ItemStack base, ItemStack[] ingredients); + + boolean hasMixtures(ItemStack[] ingredients); + + boolean isIngredient(ItemStack itemstack); + + ItemStack[] getRequired(ItemStack[] ingredients); + +} diff --git a/src/api/java/forestry/api/food/IIngredientManager.java b/src/api/java/forestry/api/food/IIngredientManager.java new file mode 100644 index 00000000..fab0e012 --- /dev/null +++ b/src/api/java/forestry/api/food/IIngredientManager.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.food; + +import net.minecraft.item.ItemStack; + +public interface IIngredientManager { + + String getDescription(ItemStack itemstack); + + void addIngredient(ItemStack ingredient, String description); + +} diff --git a/src/api/java/forestry/api/food/package-info.java b/src/api/java/forestry/api/food/package-info.java new file mode 100644 index 00000000..372c3016 --- /dev/null +++ b/src/api/java/forestry/api/food/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="1.1.0", owner="ForestryAPI|core", provides="ForestryAPI|food") +package forestry.api.food; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/fuels/EngineBronzeFuel.java b/src/api/java/forestry/api/fuels/EngineBronzeFuel.java new file mode 100644 index 00000000..cbab0caf --- /dev/null +++ b/src/api/java/forestry/api/fuels/EngineBronzeFuel.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.fuels; + +import net.minecraftforge.fluids.Fluid; + +public class EngineBronzeFuel { + /** + * Item that is valid fuel for a biogas engine. + */ + public final Fluid liquid; + /** + * Power produced by this fuel per work cycle of the engine. + */ + public final int powerPerCycle; + /** + * How many work cycles a single "stack" of this type lasts. + */ + public final int burnDuration; + /** + * By how much the normal heat dissipation rate of 1 is multiplied when using this fuel type. + */ + public final int dissipationMultiplier; + + public EngineBronzeFuel(Fluid liquid, int powerPerCycle, int burnDuration, int dissipationMultiplier) { + this.liquid = liquid; + this.powerPerCycle = powerPerCycle; + this.burnDuration = burnDuration; + this.dissipationMultiplier = dissipationMultiplier; + } +} diff --git a/src/api/java/forestry/api/fuels/EngineCopperFuel.java b/src/api/java/forestry/api/fuels/EngineCopperFuel.java new file mode 100644 index 00000000..af568dd4 --- /dev/null +++ b/src/api/java/forestry/api/fuels/EngineCopperFuel.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.fuels; + +import net.minecraft.item.ItemStack; + +public class EngineCopperFuel { + + /** + * Item that is valid fuel for a peat-fired engine. + */ + public final ItemStack fuel; + /** + * Power produced by this fuel per work cycle. + */ + public final int powerPerCycle; + /** + * Amount of work cycles this item lasts before being consumed. + */ + public final int burnDuration; + + public EngineCopperFuel(ItemStack fuel, int powerPerCycle, int burnDuration) { + this.fuel = fuel; + this.powerPerCycle = powerPerCycle; + this.burnDuration = burnDuration; + } + +} diff --git a/src/api/java/forestry/api/fuels/FermenterFuel.java b/src/api/java/forestry/api/fuels/FermenterFuel.java new file mode 100644 index 00000000..32989a80 --- /dev/null +++ b/src/api/java/forestry/api/fuels/FermenterFuel.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.fuels; + +import net.minecraft.item.ItemStack; + +public class FermenterFuel { + /** + * Item that is a valid fuel for the fermenter (i.e. fertilizer). + */ + public final ItemStack item; + /** + * How much is fermeted per work cycle, i.e. how much biomass is produced per cycle. + */ + public final int fermentPerCycle; + /** + * Amount of work cycles a single item of this fuel lasts before expiring. + */ + public final int burnDuration; + + public FermenterFuel(ItemStack item, int fermentPerCycle, int burnDuration) { + this.item = item; + this.fermentPerCycle = fermentPerCycle; + this.burnDuration = burnDuration; + } +} diff --git a/src/api/java/forestry/api/fuels/FuelManager.java b/src/api/java/forestry/api/fuels/FuelManager.java new file mode 100644 index 00000000..f53d6fb7 --- /dev/null +++ b/src/api/java/forestry/api/fuels/FuelManager.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.fuels; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + +import java.util.HashMap; + + +public class FuelManager { + /** + * Add new fuels for the fermenter here (i.e. fertilizer). + */ + public static HashMap fermenterFuel; + /** + * Add new resources for the moistener here (i.e. wheat) + */ + public static HashMap moistenerResource; + /** + * Add new substrates for the rainmaker here + */ + public static HashMap rainSubstrate; + /** + * Add new fuels for EngineBronze (= biogas engine) here + */ + public static HashMap bronzeEngineFuel; + /** + * Add new fuels for EngineCopper (= peat-fired engine) here + */ + public static HashMap copperEngineFuel; + /** + * Add new fuels for Generator here + */ + public static HashMap generatorFuel; + +} diff --git a/src/api/java/forestry/api/fuels/GeneratorFuel.java b/src/api/java/forestry/api/fuels/GeneratorFuel.java new file mode 100644 index 00000000..16e2ee4d --- /dev/null +++ b/src/api/java/forestry/api/fuels/GeneratorFuel.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.fuels; + +import net.minecraftforge.fluids.FluidStack; + +public class GeneratorFuel { + + /** + * LiquidStack representing the fuel type and amount consumed per triggered cycle. + */ + public final FluidStack fuelConsumed; + /** + * EU emitted per tick while this fuel is being consumed in the generator (i.e. biofuel = 32, biomass = 8). + */ + public final int eu; + /** + * Rate at which the fuel is consumed. 1 - Every tick 2 - Every second tick 3 - Every third tick etc. + */ + public final int rate; + + public GeneratorFuel(FluidStack fuelConsumed, int eu, int rate) { + this.fuelConsumed = fuelConsumed; + this.eu = eu; + this.rate = rate; + } + +} diff --git a/src/api/java/forestry/api/fuels/MoistenerFuel.java b/src/api/java/forestry/api/fuels/MoistenerFuel.java new file mode 100644 index 00000000..4c4c7a0b --- /dev/null +++ b/src/api/java/forestry/api/fuels/MoistenerFuel.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.fuels; + +import net.minecraft.item.ItemStack; + +public class MoistenerFuel { + /** + * The item to use + */ + public final ItemStack item; + /** + * The item that leaves the moistener's working slot (i.e. mouldy wheat, decayed wheat, mulch) + */ + public final ItemStack product; + /** + * How much this item contributes to the final product of the moistener (i.e. mycelium) + */ + public final int moistenerValue; + /** + * What stage this product represents. Resources with lower stage value will be consumed first. + */ + public final int stage; + + public MoistenerFuel(ItemStack item, ItemStack product, int stage, int moistenerValue) { + this.item = item; + this.product = product; + this.stage = stage; + this.moistenerValue = moistenerValue; + } +} diff --git a/src/api/java/forestry/api/fuels/RainSubstrate.java b/src/api/java/forestry/api/fuels/RainSubstrate.java new file mode 100644 index 00000000..ab0deb5a --- /dev/null +++ b/src/api/java/forestry/api/fuels/RainSubstrate.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.fuels; + +import net.minecraft.item.ItemStack; + +public class RainSubstrate { + /** + * Rain substrate capable of activating the rainmaker. + */ + public ItemStack item; + /** + * Duration of the rain shower triggered by this substrate in Minecraft ticks. + */ + public int duration; + /** + * Speed of activation sequence triggered. + */ + public float speed; + + public boolean reverse; + + public RainSubstrate(ItemStack item, int duration, float speed) { + this(item, duration, speed, false); + } + + public RainSubstrate(ItemStack item, float speed) { + this(item, 0, speed, true); + } + + public RainSubstrate(ItemStack item, int duration, float speed, boolean reverse) { + this.item = item; + this.duration = duration; + this.speed = speed; + this.reverse = reverse; + } +} diff --git a/src/api/java/forestry/api/fuels/package-info.java b/src/api/java/forestry/api/fuels/package-info.java new file mode 100644 index 00000000..748fa228 --- /dev/null +++ b/src/api/java/forestry/api/fuels/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="2.0.1", owner="ForestryAPI|core", provides="ForestryAPI|fuels") +package forestry.api.fuels; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/genetics/AlleleManager.java b/src/api/java/forestry/api/genetics/AlleleManager.java new file mode 100644 index 00000000..6e351162 --- /dev/null +++ b/src/api/java/forestry/api/genetics/AlleleManager.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.HashMap; + +import net.minecraft.item.ItemStack; + +/** + * Holds a static reference to the {@link IAlleleRegistry}. + */ +public class AlleleManager { + /** + * Main access point for all things related to genetics. See {@link IAlleleRegistry} for details. + */ + public static IAlleleRegistry alleleRegistry; + /** + * Translates plain leaf blocks into genetic data. Used by bees and butterflies to convert and pollinate foreign leaf blocks. + */ + public static HashMap ersatzSpecimen = new HashMap(); + /** + * Translates plain saplings into genetic data. Used by the treealyzer and the farm to convert foreign saplings. + */ + public static HashMap ersatzSaplings = new HashMap(); + /** + * Queryable instance of an {@link IClimateHelper} for easier implementation. + */ + public static IClimateHelper climateHelper; + /** + * Creates Forestry alleles. + */ + public static IAlleleFactory alleleFactory; +} diff --git a/src/api/java/forestry/api/genetics/EnumTolerance.java b/src/api/java/forestry/api/genetics/EnumTolerance.java new file mode 100644 index 00000000..6ff0085e --- /dev/null +++ b/src/api/java/forestry/api/genetics/EnumTolerance.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +public enum EnumTolerance { + NONE, + + BOTH_1, BOTH_2, BOTH_3, BOTH_4, BOTH_5, + + UP_1, UP_2, UP_3, UP_4, UP_5, + + DOWN_1, DOWN_2, DOWN_3, DOWN_4, DOWN_5 +} diff --git a/src/api/java/forestry/api/genetics/IAllele.java b/src/api/java/forestry/api/genetics/IAllele.java new file mode 100644 index 00000000..52747410 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAllele.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * An {@link IIndividual}'s {@link IGenome} is composed of {@link IChromosome}s consisting each of a primary and secondary {@link IAllele}. + * + * {@link IAllele}s hold all information regarding an {@link IIndividual}'s traits, from species to size, temperature tolerances, etc. + * + * Should be extended for different types of alleles. ISpeciesAllele, IBiomeAllele, etc. + * + * @author SirSengir + */ +public interface IAllele { + + /** + * @return A unique string identifier for this allele. + */ + String getUID(); + + /** + * @return true if the allele is dominant, false otherwise. + */ + boolean isDominant(); + + /** + * @return Localized short, human-readable identifier used in tooltips and beealyzer. + */ + String getName(); + + /** + * @return The unlocalized identifier + */ + String getUnlocalizedName(); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleArea.java b/src/api/java/forestry/api/genetics/IAlleleArea.java new file mode 100644 index 00000000..7277ff0a --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleArea.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * Simple interface to allow adding additional alleles containing float values. + */ +public interface IAlleleArea extends IAllele { + + int[] getValue(); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleBoolean.java b/src/api/java/forestry/api/genetics/IAlleleBoolean.java new file mode 100644 index 00000000..887da3b9 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleBoolean.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * Simple interface to allow adding additional alleles containing float values. + */ +public interface IAlleleBoolean extends IAllele { + + boolean getValue(); + + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleEffect.java b/src/api/java/forestry/api/genetics/IAlleleEffect.java new file mode 100644 index 00000000..7b94e6b1 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleEffect.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * Basic effect allele. + */ +public interface IAlleleEffect extends IAllele { + /** + * @return true if this effect can combine with the effect on other allele (i.e. run before or after). combination can only occur if both effects are + * combinable. + */ + boolean isCombinable(); + + /** + * Returns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect. + * + * @param storedData + * @return {@link IEffectData} for the next cycle. + */ + IEffectData validateStorage(IEffectData storedData); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleFactory.java b/src/api/java/forestry/api/genetics/IAlleleFactory.java new file mode 100644 index 00000000..2b390069 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleFactory.java @@ -0,0 +1,80 @@ +package forestry.api.genetics; + +/** + * Creates new alleles with smart localization. + * + * + * UID is created like this: + * modId + '.' + category + WordUtils.capitalize(valueName); + * For Example: + * modId:forestry, category:height, valueName:smallest => forestry.heightSmallest + * This is mainly for legacy compatibility and may change in future major versions. + * + * + * The default localization uses: + * [modId].allele.[valueName] + * + * Languages that need category-specific names can override it by defining: + * [modId].allele.[category].[valueName] + * + * For example: + * en_US + * forestry.allele.smallest=Smallest + * ru_RU + * forestry.allele.smallest=????? ????????? + * forestry.allele.height.smallest=????? ?????? + */ +public interface IAlleleFactory { + /** + * @param modId mod prefix for uid and localization (i.e. "forestry") + * @param category allele category for uid and localization (i.e. "height") + * @param valueName allele value name for uid and localization (i.e. "smallest") + * @param value allele float value + * @param isDominant allele dominance + * @return a new IAlleleFloat + */ + IAlleleFloat createFloat(String modId, String category, String valueName, float value, boolean isDominant); + + /** + * @param modId mod prefix for uid and localization (i.e. "forestry") + * @param category allele category for uid and localization (i.e. "territory") + * @param valueName allele value name for uid and localization (i.e. "large") + * @param xDimValue allele area X Size + * @param yDimValue allele area Y Size + * @param zDimValue allele area Z Size + * @param isDominant allele dominance + * @return a new IAlleleArea + */ + IAlleleArea createArea(String modId, String category, String valueName, int xDimValue, int yDimValue, int zDimValue, boolean isDominant); + + /** + * @param modId mod prefix for uid and localization (i.e. "forestry") + * @param category allele category for uid and localization (i.e. "fertility") + * @param valueName allele value name for uid and localization (i.e. "low") + * @param value allele int value + * @param isDominant allele dominance + * @return a new IAlleleInteger + */ + IAlleleInteger createInteger(String modId, String category, String valueName, int value, boolean isDominant); + + /** + * @param modId mod prefix for uid and localization (i.e. "forestry") + * @param category allele category for uid and localization (i.e. "fireproof") + * @param value allele boolean value + * @param isDominant allele dominance + * @return a new IAlleleBoolean + * Note that valueName will always be "true" or "false" + */ + IAlleleBoolean createBoolean(String modId, String category, boolean value, boolean isDominant); + + /** + * @param modId mod prefix for uid (i.e. "forestry") + * @param category allele category for uid (i.e. "flowers") + * @param valueName allele value name for uid (i.e. "vanilla") + * @param value allele IFlowerProvider value + * @param isDominant allele dominance + * @return a new IAlleleFlowers + * IAlleleFlowers localization is handled by the IFlowerProvider.getDescription(), unlike the other alleles. + */ + IAlleleFlowers createFlowers(String modId, String category, String valueName, IFlowerProvider value, boolean isDominant); +} diff --git a/src/api/java/forestry/api/genetics/IAlleleFloat.java b/src/api/java/forestry/api/genetics/IAlleleFloat.java new file mode 100644 index 00000000..6ca28776 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleFloat.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * Simple interface to allow adding additional alleles containing float values. + */ +public interface IAlleleFloat extends IAllele { + + float getValue(); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleFlowers.java b/src/api/java/forestry/api/genetics/IAlleleFlowers.java new file mode 100644 index 00000000..0368ca41 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleFlowers.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + + +public interface IAlleleFlowers extends IAllele { + + /** + * @return FlowerProvider + */ + IFlowerProvider getProvider(); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleHandler.java b/src/api/java/forestry/api/genetics/IAlleleHandler.java new file mode 100644 index 00000000..3d052afe --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleHandler.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * @author Alex Binnie + * + * Handler for events that occur in IAlleleRegistry, such as registering alleles, branches etc. Useful for handling plugin specific behavior (i.e. + * creating a list of all bee species etc.) + * + */ +public interface IAlleleHandler { + + /** + * Called when an allele is registered with {@link IAlleleRegistry}. + * + * @param allele + * Allele which was registered. + */ + public void onRegisterAllele(IAllele allele); + + /** + * Called when a classification is registered with {@link IAlleleRegistry}. + * + * @param classification + * Classification which was registered. + */ + public void onRegisterClassification(IClassification classification); + + /** + * Called when a fruit family is registered with {@link IAlleleRegistry}. + * + * @param family + * Fruit family which was registered. + */ + public void onRegisterFruitFamily(IFruitFamily family); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleInteger.java b/src/api/java/forestry/api/genetics/IAlleleInteger.java new file mode 100644 index 00000000..6991efe5 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleInteger.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * Simple interface to allow adding additional alleles containing integer values. + */ +public interface IAlleleInteger extends IAllele { + + int getValue(); + +} diff --git a/src/api/java/forestry/api/genetics/IAllelePlantType.java b/src/api/java/forestry/api/genetics/IAllelePlantType.java new file mode 100644 index 00000000..211237f2 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAllelePlantType.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.EnumSet; + +import net.minecraftforge.common.EnumPlantType; + +public interface IAllelePlantType extends IAllele { + + public EnumSet getPlantTypes(); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleRegistry.java b/src/api/java/forestry/api/genetics/IAlleleRegistry.java new file mode 100644 index 00000000..9b0907b0 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleRegistry.java @@ -0,0 +1,218 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.Collection; +import java.util.Map; + +import net.minecraft.item.ItemStack; + +import com.mojang.authlib.GameProfile; + +import forestry.api.genetics.IClassification.EnumClassLevel; + +/** + * Manages {@link ISpeciesRoot}, {@link IAllele}s, {@link IFruitFamily}s, {@link IClassification}, the blacklist and allows creation of research notes. + * + * @author SirSengir + */ +public interface IAlleleRegistry { + + /* SPECIES ROOT CLASSES */ + /** + * Register a {@link ISpeciesRoot}. + * @param root {@link ISpeciesRoot} to register. + */ + void registerSpeciesRoot(ISpeciesRoot root); + + /** + * @return Map of all registered {@link ISpeciesRoot}. + */ + Map getSpeciesRoot(); + + /** + * Retrieve the {@link ISpeciesRoot} with the given uid. + * @param uid Unique id for the species class, i.e. "rootBees", "rootTrees", "rootButterflies". + * @return {@link ISpeciesRoot} if it exists, null otherwise. + */ + ISpeciesRoot getSpeciesRoot(String uid); + + /** + * Retrieve a matching {@link ISpeciesRoot} for the given itemstack. + * @param stack An itemstack possibly containing NBT data which can be converted by a species root. + * @return {@link ISpeciesRoot} if found, null otherwise. + */ + ISpeciesRoot getSpeciesRoot(ItemStack stack); + + /** + * Retrieve a matching {@link ISpeciesRoot} for the given {@link IIndividual}-class. + * @param clz Class extending {@link IIndividual}. + * @return {@link ISpeciesRoot} if found, null otherwise. + */ + ISpeciesRoot getSpeciesRoot(Class clz); + + /* INDIVIDUAL */ + /** + * Tests the itemstack for genetic information. + * + * @param stack + * @return true if the itemstack is an individual. + */ + boolean isIndividual(ItemStack stack); + + /** + * Retrieve genetic information from an itemstack. + * + * @param stack + * Stack to retrieve genetic information for. + * @return IIndividual containing genetic information, null if none could be extracted. + */ + IIndividual getIndividual(ItemStack stack); + + /* ALLELES */ + + /** + * @return HashMap of all currently registered alleles. + */ + Map getRegisteredAlleles(); + + /** + * Registers an allele. + * + * @param allele + * IAllele to register. + */ + void registerAllele(IAllele allele); + + /** + * @return HashMap of all registered deprecated alleles and their corresponding replacements + */ + Map getDeprecatedAlleleReplacements(); + + /** + * Registers an old allele UID and the new IAllele to replace instances of it with. + * + * @param deprecatedAlleleUID + * the old allele's UID + * @param replacement + * the IAllele that the deprecated Allele will be replaced with. + */ + void registerDeprecatedAlleleReplacement(String deprecatedAlleleUID, IAllele replacement); + + /** + * Gets an allele + * + * @param uid + * String based unique identifier of the allele to retrieve. + * @return IAllele if found or a replacement is found in the Deprecated Allele map, null otherwise. + */ + IAllele getAllele(String uid); + + /* CLASSIFICATIONS */ + /** + * @return HashMap of all currently registered classifications. + */ + Map getRegisteredClassifications(); + + /** + * Registers a classification. + * + * @param classification + * IClassification to register. + */ + void registerClassification(IClassification classification); + + /** + * Creates and returns a classification. + * + * @param level + * EnumClassLevel of the classification to create. + * @param uid + * String based unique identifier. Implementation will throw an exception if the key is already taken. + * @param scientific + * Binomial for the given classification. + * @return Created {@link IClassification} for easier chaining. + */ + IClassification createAndRegisterClassification(EnumClassLevel level, String uid, String scientific); + + /** + * Gets a classification. + * + * @param uid + * String based unique identifier of the classification to retrieve. + * @return {@link IClassification} if found, null otherwise. + */ + IClassification getClassification(String uid); + + /* FRUIT FAMILIES */ + /** + * Get all registered fruit families. + * + * @return A map of registered fruit families and their UIDs. + */ + Map getRegisteredFruitFamilies(); + + /** + * Registers a new fruit family. + * + * @param family + */ + void registerFruitFamily(IFruitFamily family); + + /** + * Retrieves a fruit family identified by uid. + * + * @param uid + * @return {IFruitFamily} if found, false otherwise. + */ + IFruitFamily getFruitFamily(String uid); + + /* ALLELE HANDLERS */ + /** + * Registers a new IAlleleHandler + * + * @param handler + * IAlleleHandler to register. + */ + void registerAlleleHandler(IAlleleHandler handler); + + /* BLACKLIST */ + /** + * Blacklist an allele identified by its UID from mutation. + * + * @param uid + * UID of the allele to blacklist. + */ + void blacklistAllele(String uid); + + /** + * @return Current blacklisted alleles. + */ + Collection getAlleleBlacklist(); + + /** + * @param uid + * UID of the species to vet. + * @return true if the allele is blacklisted. + */ + boolean isBlacklisted(String uid); + + /* RESEARCH */ + /** + * @param researcher Username of the player who researched this note. + * @param species {@link IAlleleSpecies} to encode on the research note. + * @return An itemstack containing a research note with the given species encoded onto it. + */ + ItemStack getSpeciesNoteStack(GameProfile researcher, IAlleleSpecies species); + + /** + * @param researcher Username of the player who researched this note. + * @param mutation {@link IMutation} to encode on the research note. + * @return An itemstack containing a research note with the given mutation encoded onto it. + */ + ItemStack getMutationNoteStack(GameProfile researcher, IMutation mutation); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleSpecies.java b/src/api/java/forestry/api/genetics/IAlleleSpecies.java new file mode 100644 index 00000000..5a75adef --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleSpecies.java @@ -0,0 +1,115 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.mojang.authlib.GameProfile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; +import forestry.api.core.IIconProvider; + +/** + * Basic species allele. + */ +public interface IAlleleSpecies extends IAllele { + + /** + * @return the {@link ISpeciesRoot} associated with this species. + */ + ISpeciesRoot getRoot(); + + /** + * @return Localized short description of this species. (May be null.) + */ + String getDescription(); + + /** + * Binomial name of the species sans genus ("Apis"). Returning "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun + * names or return null. + * + * @return flavour text (may be null) + */ + String getBinomial(); + + /** + * Authority for the binomial name, e.g. "Sengir" on species of base Forestry. + * + * @return flavour text (may be null) + */ + String getAuthority(); + + /** + * @return Branch this species is associated with. + */ + IClassification getBranch(); + + /* RESEARCH */ + /** + * Complexity determines the difficulty researching a species. The values of primary and secondary are + * added together (and rounded) to determine the amount of pairs needed for successful research. + * @return Values between 3 - 11 are useful. + */ + int getComplexity(); + + /** + * @param itemstack + * @return A float signifying the chance for the passed itemstack to yield a research success. + */ + float getResearchSuitability(ItemStack itemstack); + + /** + * @param world + * @param gameProfile + * @param individual + * @param bountyLevel + * @return Array of itemstacks representing the bounty for this research success. + */ + ItemStack[] getResearchBounty(World world, GameProfile gameProfile, IIndividual individual, int bountyLevel); + + /* CLIMATE */ + /** + * @return Preferred temperature + */ + EnumTemperature getTemperature(); + + /** + * @return Preferred humidity + */ + EnumHumidity getHumidity(); + + /* MISC */ + /** + * @return true if the species icon should have a glowing effect. + */ + boolean hasEffect(); + + /** + * @return true if the species should not be displayed in NEI or creative inventory. + */ + boolean isSecret(); + + /** + * @return true to have the species count against the species total. + */ + boolean isCounted(); + + /* APPEARANCE */ + /** + * @param renderPass Render pass to get the colour for. + * @return Colour to use for the render pass. + */ + int getIconColour(int renderPass); + + @SideOnly(Side.CLIENT) + IIconProvider getIconProvider(); + +} diff --git a/src/api/java/forestry/api/genetics/IAlleleSpeciesCustom.java b/src/api/java/forestry/api/genetics/IAlleleSpeciesCustom.java new file mode 100644 index 00000000..ff138162 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleSpeciesCustom.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; + +public interface IAlleleSpeciesCustom extends IAlleleSpecies { + + IAlleleSpeciesCustom setTemperature(EnumTemperature temperature); + IAlleleSpeciesCustom setHumidity(EnumHumidity humidity); + + IAlleleSpeciesCustom setHasEffect(); + + /** Secret species are not shown in creative mode. */ + IAlleleSpeciesCustom setIsSecret(); + + /** Uncounted species do not count toward total species discovered. */ + IAlleleSpeciesCustom setIsNotCounted(); +} diff --git a/src/api/java/forestry/api/genetics/IAlleleTolerance.java b/src/api/java/forestry/api/genetics/IAlleleTolerance.java new file mode 100644 index 00000000..f5ba9e67 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IAlleleTolerance.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * Simple interface to allow adding additional alleles containing float values. + */ +public interface IAlleleTolerance extends IAllele { + + EnumTolerance getValue(); + +} diff --git a/src/api/java/forestry/api/genetics/IBreedingTracker.java b/src/api/java/forestry/api/genetics/IBreedingTracker.java new file mode 100644 index 00000000..e3614481 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IBreedingTracker.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +import forestry.api.apiculture.IBeekeepingMode; + +/** + * Keeps track of who bred and/or discovered which species in a world. + * + * @author SirSengir + */ +public interface IBreedingTracker { + + /** + * @return Name of the current {@link IBeekeepingMode}. + */ + String getModeName(); + + /** + * Set the current {@link IBeekeepingMode}. + */ + void setModeName(String name); + + /** + * @return Amount of species discovered. + */ + int getSpeciesBred(); + + /** + * Register the birth of an individual. Will mark it as discovered. + * + * @param individual + */ + void registerBirth(IIndividual individual); + + /** + * Register the pickup of an individual. + * + * @param individual + */ + void registerPickup(IIndividual individual); + + /** + * Marks a species as discovered. Should only be called from registerIndividual normally. + * + * @param species + */ + void registerSpecies(IAlleleSpecies species); + + /** + * Register a successful mutation. Will mark it as discovered. + * + * @param mutation + */ + void registerMutation(IMutation mutation); + + /** + * Queries the tracker for discovered species. + * + * @param mutation + * Mutation to query for. + * @return true if the mutation has been discovered. + */ + boolean isDiscovered(IMutation mutation); + + /** + * Queries the tracker for discovered species. + * + * @param species + * Species to check. + * @return true if the species has been bred. + */ + boolean isDiscovered(IAlleleSpecies species); + + /** + * Synchronizes the tracker to the client side. Should be called before opening any gui needing that information. + * + * @param player + */ + void synchToPlayer(EntityPlayer player); + + /* LOADING & SAVING */ + void decodeFromNBT(NBTTagCompound nbttagcompound); + + void encodeToNBT(NBTTagCompound nbttagcompound); + +} diff --git a/src/api/java/forestry/api/genetics/IChromosome.java b/src/api/java/forestry/api/genetics/IChromosome.java new file mode 100644 index 00000000..d501efba --- /dev/null +++ b/src/api/java/forestry/api/genetics/IChromosome.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import forestry.api.core.INBTTagable; + +/** + * Implementations other than Forestry's default one are not supported! + * + * @author SirSengir + */ +public interface IChromosome extends INBTTagable { + + IAllele getPrimaryAllele(); + + IAllele getSecondaryAllele(); + + IAllele getInactiveAllele(); + + IAllele getActiveAllele(); + +} diff --git a/src/api/java/forestry/api/genetics/IChromosomeType.java b/src/api/java/forestry/api/genetics/IChromosomeType.java new file mode 100644 index 00000000..a3b1f8e0 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IChromosomeType.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/* + * Interface to be implemented by the enums representing the various chromosomes + */ +public interface IChromosomeType { + + /* + * Get class which all alleles on this chromosome must interface + */ + Class getAlleleClass(); + + String getName(); + + ISpeciesRoot getSpeciesRoot(); + + int ordinal(); + +} diff --git a/src/api/java/forestry/api/genetics/IClassification.java b/src/api/java/forestry/api/genetics/IClassification.java new file mode 100644 index 00000000..f365b915 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IClassification.java @@ -0,0 +1,107 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * Biological classifications from domain down to genus. + * + * Used by the *alyzers to display hierarchies. + */ +public interface IClassification { + + public enum EnumClassLevel { + + DOMAIN(0x777fff, true), KINGDOM(0x77c3ff), PHYLUM(0x77ffb6, true), DIVISION(0x77ffb6, true), CLASS(0x7bff77), ORDER(0xbeff77), FAMILY(0xfffd77), + SUBFAMILY(0xfffd77), TRIBE(0xfffd77), GENUS(0xffba77); + + private int colour; + private boolean isDroppable; + + private EnumClassLevel(int colour) { + this(colour, false); + } + + private EnumClassLevel(int colour, boolean isDroppable) { + this.colour = colour; + this.isDroppable = isDroppable; + } + + /** + * @return Colour to use for displaying this classification. + */ + public int getColour() { + return colour; + } + + /** + * @return Indicates whether display of this classification level can be ommitted in case of space constraints. + */ + public boolean isDroppable() { + return isDroppable; + } + } + + /** + * @return Level inside the full hierarchy this particular classification is located at. + */ + EnumClassLevel getLevel(); + + /** + * @return Unique String identifier. + */ + String getUID(); + + /** + * @return Localized branch name for user display. + */ + String getName(); + + /** + * A branch approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis" + * + * @return flavour text (may be null) + */ + String getScientific(); + + /** + * @return Localized description of this branch. (May be null.) + */ + String getDescription(); + + /** + * @return Member groups of this one. + */ + IClassification[] getMemberGroups(); + + /** + * Adds subgroups to this group. + */ + void addMemberGroup(IClassification group); + + /** + * @return Member species of this group. + */ + IAlleleSpecies[] getMemberSpecies(); + + /** + * Used by the allele registry to populate internal collection of branch members on the fly. + * + * @param species + */ + void addMemberSpecies(IAlleleSpecies species); + + /** + * @return Parent classification, null if this is root. + */ + IClassification getParent(); + + /** + * Only used internally by the AlleleRegistry if this classification has been added to another one. + * + * @param parent + */ + void setParent(IClassification parent); +} diff --git a/src/api/java/forestry/api/genetics/IClimateHelper.java b/src/api/java/forestry/api/genetics/IClimateHelper.java new file mode 100644 index 00000000..48146042 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IClimateHelper.java @@ -0,0 +1,53 @@ +package forestry.api.genetics; + +import java.util.Collection; + +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; + +public interface IClimateHelper { + /** + * Determines whether the given temperature and humidity are within the given constraints. + * @param temperature The temperature to test. + * @param humidity The humidity to test. + * @param baseTemp Base temperature for the test. + * @param tolTemp Temperature tolerance to apply. + * @param baseHumid Base humidity for the test. + * @param tolHumid Humidity tolerance to apply. + * @return true if both temperature and humidity fit the given constraints. + */ + boolean isWithinLimits(EnumTemperature temperature, EnumHumidity humidity, + EnumTemperature baseTemp, EnumTolerance tolTemp, + EnumHumidity baseHumid, EnumTolerance tolHumid); + + boolean isWithinLimits(EnumTemperature temperature, EnumTemperature baseTemp, EnumTolerance tolTemp); + boolean isWithinLimits(EnumHumidity humidity, EnumHumidity baseHumid, EnumTolerance tolHumid); + + /** + * Gets a collection of humidities which fit the given parameters. + * @param prefered Base humidity from which to measure. + * @param tolerance Tolerance to apply to the base humidity. + * @return A collection of humidities which fall within the given parameters. + */ + Collection getToleratedHumidity(EnumHumidity prefered, EnumTolerance tolerance); + /** + * Gets a collection of temperatures which fit the given parameters. + * @param prefered Base temperature from which to measure. + * @param tolerance Tolerance to apply to the base temperatures. + * @return A collection of temperatures which fall within the given parameters. + */ + Collection getToleratedTemperature(EnumTemperature prefered, EnumTolerance tolerance); + + /** + * Gets a localized, human readable string for the given temperature. + * @param temperature Temperature to generate the string for. + * @return A localized, human readable string for the given temperature. + */ + String toDisplay(EnumTemperature temperature); + /** + * Gets a localized, human readable string for the given humidity. + * @param humidity Humidity to generate the string for. + * @return A localized, human readable string for the given humidity. + */ + String toDisplay(EnumHumidity humidity); +} \ No newline at end of file diff --git a/src/api/java/forestry/api/genetics/IEffectData.java b/src/api/java/forestry/api/genetics/IEffectData.java new file mode 100644 index 00000000..909ab78d --- /dev/null +++ b/src/api/java/forestry/api/genetics/IEffectData.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import forestry.api.core.INBTTagable; + +/** + * Container to hold some temporary data for bee, tree and butterfly effects. + * + * @author SirSengir + */ +public interface IEffectData extends INBTTagable { + void setInteger(int index, int val); + + void setFloat(int index, float val); + + void setBoolean(int index, boolean val); + + int getInteger(int index); + + float getFloat(int index); + + boolean getBoolean(int index); +} diff --git a/src/api/java/forestry/api/genetics/IFlower.java b/src/api/java/forestry/api/genetics/IFlower.java new file mode 100644 index 00000000..79ef8115 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IFlower.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.block.Block; + +public interface IFlower extends Comparable { + + Block getBlock(); + int getMeta(); + + double getWeight(); + void setWeight(double weight); + + boolean isPlantable(); + +} diff --git a/src/api/java/forestry/api/genetics/IFlowerGrowthRule.java b/src/api/java/forestry/api/genetics/IFlowerGrowthRule.java new file mode 100644 index 00000000..55237399 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IFlowerGrowthRule.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.world.World; + +/** + * Basic condition for flower growing + */ +public interface IFlowerGrowthRule { + boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z); +} diff --git a/src/api/java/forestry/api/genetics/IFlowerProvider.java b/src/api/java/forestry/api/genetics/IFlowerProvider.java new file mode 100644 index 00000000..9849da03 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IFlowerProvider.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IFlowerProvider { + /** + * @return True if the block at the passed coordinates is a valid flower for the species. + */ + boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z); + + boolean isAcceptedPollinatable(World world, IPollinatable pollinatable); + + /** + * @return True if a flower was planted. + */ + boolean growFlower(World world, IIndividual individual, int x, int y, int z); + + /** + * @return Short, human-readable identifier used in the beealyzer. + */ + String getDescription(); + + /** + * Allows the flower provider to affect the produce at the given location. + * + * @return Array of itemstacks being the (modified or unmodified) produce. + */ + ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products); + + /** + * @return List of valid flowers for the flower provider. The first in the array is for use as an icon. + * Returns an empty list if the flower provider does not have any valid flowers. + */ + List getFlowers(); +} diff --git a/src/api/java/forestry/api/genetics/IFlowerRegistry.java b/src/api/java/forestry/api/genetics/IFlowerRegistry.java new file mode 100644 index 00000000..ce6cb42c --- /dev/null +++ b/src/api/java/forestry/api/genetics/IFlowerRegistry.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public interface IFlowerRegistry { + + List getAcceptableFlowers(String flowerType); + + boolean growFlower(String flowerType, World world, IIndividual individual, int x, int y, int z); + + boolean isAcceptedFlower(String flowerType, World world, IIndividual individual, int x, int y, int z); + + /** + * Registers a non-plantable flower, but bees accept them. + * + * @param flowerTypes See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX + */ + void registerAcceptableFlower(Block flowerBlock, String... flowerTypes); + void registerAcceptableFlower(Block flowerBlock, int flowerMeta, String... flowerTypes); + + void registerGrowthRule(IFlowerGrowthRule rule, String... flowerTypes); + + /** + * Registers a plantable flower. + * The distribution is based on its own weight and the total number of plants for this flowerType. + * + * @param weight Weight for the Flower (Vanilla = 1.0, Modded flowers < 1.0) + * @param flowerTypes See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX + */ + void registerPlantableFlower(Block flowerBlock, int flowerMeta, double weight, String... flowerTypes); + + IFlower getRandomPlantableFlower(String flowerType, Random rand); + +} diff --git a/src/api/java/forestry/api/genetics/IFruitBearer.java b/src/api/java/forestry/api/genetics/IFruitBearer.java new file mode 100644 index 00000000..5316f9eb --- /dev/null +++ b/src/api/java/forestry/api/genetics/IFruitBearer.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.Collection; + +import net.minecraft.item.ItemStack; + +/** + * Can be implemented by tile entities which can bear fruit. + * + * @author SirSengir + */ +public interface IFruitBearer { + + /** + * @return true if the actual tile can bear fruits. + */ + boolean hasFruit(); + + /** + * @return Family of the potential fruits on this tile. + */ + IFruitFamily getFruitFamily(); + + /** + * Picks the fruits of this tile, resetting it to unripe fruits. + * + * @param tool + * Tool used in picking the fruits. May be null. + * @return Picked fruits. + */ + Collection pickFruit(ItemStack tool); + + /** + * @return float indicating the ripeness of the fruit with >= 1.0f indicating full ripeness. + */ + float getRipeness(); + + /** + * Increases the ripeness of the fruit. + * + * @param add + * Float to add to the ripeness. Will truncate to valid values. + */ + void addRipeness(float add); +} diff --git a/src/api/java/forestry/api/genetics/IFruitFamily.java b/src/api/java/forestry/api/genetics/IFruitFamily.java new file mode 100644 index 00000000..d48a4d8a --- /dev/null +++ b/src/api/java/forestry/api/genetics/IFruitFamily.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +public interface IFruitFamily { + + /** + * @return Unique String identifier. + */ + String getUID(); + + /** + * @return Localized family name for user display. + */ + String getName(); + + /** + * A scientific-y name for this fruit family + * + * @return flavour text (may be null) + */ + String getScientific(); + + /** + * @return Localized description of this fruit family. (May be null.) + */ + String getDescription(); + +} diff --git a/src/api/java/forestry/api/genetics/IGenome.java b/src/api/java/forestry/api/genetics/IGenome.java new file mode 100644 index 00000000..0d3ad231 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IGenome.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import forestry.api.core.INBTTagable; + +/** + * Holds the {@link IChromosome}s which comprise the traits of a given individual. + * + * Only the default implementation is supported. + */ +public interface IGenome extends INBTTagable { + + IAlleleSpecies getPrimary(); + + IAlleleSpecies getSecondary(); + + IChromosome[] getChromosomes(); + + IAllele getActiveAllele(IChromosomeType chromosomeType); + + IAllele getInactiveAllele(IChromosomeType chromosomeType); + + boolean isGeneticEqual(IGenome other); + + ISpeciesRoot getSpeciesRoot(); +} diff --git a/src/api/java/forestry/api/genetics/IHousing.java b/src/api/java/forestry/api/genetics/IHousing.java new file mode 100644 index 00000000..5a510311 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IHousing.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import com.mojang.authlib.GameProfile; + +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; +import forestry.api.core.IErrorState; + +/** + * Any housing, hatchery or nest which is a fixed location in the world. + */ +public interface IHousing { + + /** + * @return String containing the login of this housing's owner. + */ + GameProfile getOwnerName(); + + World getWorld(); + + int getXCoord(); + + int getYCoord(); + + int getZCoord(); + + BiomeGenBase getBiome(); + + EnumTemperature getTemperature(); + + EnumHumidity getHumidity(); + + void setErrorState(IErrorState state); + + IErrorState getErrorState(); + + /** + * Adds products to the housing's inventory. + * + * @param product + * ItemStack with the product to add. + * @param all + * if true, success requires that all products are added + * @return Boolean indicating success or failure. + */ + boolean addProduct(ItemStack product, boolean all); + +} diff --git a/src/api/java/forestry/api/genetics/IIndividual.java b/src/api/java/forestry/api/genetics/IIndividual.java new file mode 100644 index 00000000..f86aa582 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IIndividual.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.List; + +import forestry.api.core.INBTTagable; + +/** + * An actual individual with genetic information. + * + * Only the default implementation is supported. + */ +public interface IIndividual extends INBTTagable { + + String getIdent(); + + String getDisplayName(); + + void addTooltip(List list); + + /** + * Call to mark the IIndividual as analyzed. + * @return true if the IIndividual has not been analyzed previously. + */ + boolean analyze(); + + boolean isAnalyzed(); + + boolean hasEffect(); + + boolean isSecret(); + + IGenome getGenome(); + + /** + * Check whether the genetic makeup of two IIndividuals is identical. Ignores additional data like generations, irregular mating, etc.. + * @param other + * @return true if the given other IIndividual has the amount of chromosomes and their alleles are identical. + */ + boolean isGeneticEqual(IIndividual other); + + /** + * @return A deep copy of this individual. + */ + IIndividual copy(); + + boolean isPureBred(IChromosomeType chromosomeType); + +} diff --git a/src/api/java/forestry/api/genetics/IIndividualLiving.java b/src/api/java/forestry/api/genetics/IIndividualLiving.java new file mode 100644 index 00000000..67ce0a97 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IIndividualLiving.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.world.World; + +public interface IIndividualLiving extends IIndividual { + + /** + * @return Genetic information of the mate, null if unmated. + */ + IGenome getMate(); + + /** + * @return Current health of the individual. + */ + int getHealth(); + + /** + * @return Maximum health of the individual. + */ + int getMaxHealth(); + + /** + * Age the individual. + * @param world + * @param ageModifier + */ + void age(World world, float ageModifier); + + /** + * Mate with the given individual. + * @param individual the {@link IIndividual} to mate this one with. + */ + void mate(IIndividual individual); + + /** + * @return true if the individual is among the living. + */ + boolean isAlive(); + +} diff --git a/src/api/java/forestry/api/genetics/ILegacyHandler.java b/src/api/java/forestry/api/genetics/ILegacyHandler.java new file mode 100644 index 00000000..901afa7f --- /dev/null +++ b/src/api/java/forestry/api/genetics/ILegacyHandler.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +/** + * AlleleManager.alleleRegistry can be cast to this type. + * @deprecated Since Forestry 3.6. Use IAlleleRegistry. + */ +@Deprecated +public interface ILegacyHandler { + void registerLegacyMapping(int id, String uid); + + IAllele getFromLegacyMap(int id); +} diff --git a/src/api/java/forestry/api/genetics/IMutation.java b/src/api/java/forestry/api/genetics/IMutation.java new file mode 100644 index 00000000..8c15ca58 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IMutation.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.Collection; + +/** + * Individuals can be seeded either as hive drops or as mutation results. + * + * {@link IAlleleRegistry} manages these. + * + * @author SirSengir + */ +public interface IMutation { + + /** + * @return {@link ISpeciesRoot} this mutation is associated with. + */ + ISpeciesRoot getRoot(); + + /** + * @return first of the alleles implementing IAlleleSpecies required for this mutation. + */ + IAllele getAllele0(); + + /** + * @return second of the alleles implementing IAlleleSpecies required for this mutation. + */ + IAllele getAllele1(); + + /** + * @return Array of {@link IAllele} representing the full default genome of the mutated side. + * + * Make sure to return a proper array for the species class. Returning an allele of the wrong type will cause cast errors on runtime. + */ + IAllele[] getTemplate(); + + /** + * @return Unmodified base chance for mutation to fire. + */ + float getBaseChance(); + + /** + * @return Collection of localized, human-readable strings describing special mutation conditions, if any. + */ + Collection getSpecialConditions(); + + /** + * @param allele + * @return true if the passed allele is one of the alleles participating in this mutation. + */ + boolean isPartner(IAllele allele); + + /** + * @param allele + * @return the other allele which was not passed as argument. + */ + IAllele getPartner(IAllele allele); + + /** + * @return true if the mutation should not be displayed in the beealyzer. + */ + boolean isSecret(); + +} diff --git a/src/api/java/forestry/api/genetics/IMutationCondition.java b/src/api/java/forestry/api/genetics/IMutationCondition.java new file mode 100644 index 00000000..ac8de0a2 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IMutationCondition.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.world.World; + +public interface IMutationCondition { + + /** + * Returns a float from 0 to 1 representing the chance for mutation to occur. + * Most will return 1 if the condition is met and 0 otherwise, + * but the float offers flexibility for more advanced conditions. + */ + float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); + + /** + * A localized description of the mutation condition. (i.e. "A temperature of HOT is required.") + */ + String getDescription(); +} diff --git a/src/api/java/forestry/api/genetics/IMutationCustom.java b/src/api/java/forestry/api/genetics/IMutationCustom.java new file mode 100644 index 00000000..f6d366cd --- /dev/null +++ b/src/api/java/forestry/api/genetics/IMutationCustom.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import net.minecraft.block.Block; + +import net.minecraftforge.common.BiomeDictionary; + +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; + +/** Set custom mutation requirements */ +public interface IMutationCustom extends IMutation { + + /** Prevent this mutation from being shown in the analyzers */ + IMutationCustom setIsSecret(); + + /** Require a specific temperature for this mutation to occur */ + IMutationCustom restrictTemperature(EnumTemperature temperature); + IMutationCustom restrictTemperature(EnumTemperature minTemperature, EnumTemperature maxTemperature); + + /** Require a specific humidity for this mutation to occur */ + IMutationCustom restrictHumidity(EnumHumidity humidity); + IMutationCustom restrictHumidity(EnumHumidity minHumidity, EnumHumidity maxHumidity); + + /** + * Restrict this mutation to certain types of biomes. + * @param types The types of biomes this mutation can occur. + */ + IMutationCustom restrictBiomeType(BiomeDictionary.Type... types); + + /** Restrict the days of the year that this mutation can occur */ + IMutationCustom restrictDateRange(int startMonth, int startDay, int endMonth, int endDay); + + /** Restrict the time of day that this mutation can occur */ + IMutationCustom requireDay(); + IMutationCustom requireNight(); + + /** Require a specific resource to be under the location of the mutation */ + IMutationCustom requireResource(Block block, int meta); + + /** Require some other custom mutation condition */ + IMutationCustom addMutationCondition(IMutationCondition mutationCondition); +} diff --git a/src/api/java/forestry/api/genetics/IPollinatable.java b/src/api/java/forestry/api/genetics/IPollinatable.java new file mode 100644 index 00000000..5b0694d7 --- /dev/null +++ b/src/api/java/forestry/api/genetics/IPollinatable.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.EnumSet; + +import net.minecraftforge.common.EnumPlantType; + +/** + * Can be implemented by tile entities, if they wish to be pollinatable. + * + * @author SirSengir + */ +public interface IPollinatable { + + /** + * @return plant types this pollinatable is classified as. (Can be used by bees to determine whether to interact or not. + */ + EnumSet getPlantType(); + + /** + * @return IIndividual containing the genetic information of this IPollinatable + */ + IIndividual getPollen(); + + /** + * Checks whether this {@link IPollinatable} can mate with the given pollen. + * + * Must be the one to check genetic equivalency. + * + * @param pollen + * IIndividual representing the pollen. + * @return true if mating is possible, false otherwise. + */ + boolean canMateWith(IIndividual pollen); + + /** + * Pollinates this entity. + * + * @param pollen + * IIndividual representing the pollen. + */ + void mateWith(IIndividual pollen); + +} diff --git a/src/api/java/forestry/api/genetics/ISpeciesRoot.java b/src/api/java/forestry/api/genetics/ISpeciesRoot.java new file mode 100644 index 00000000..7424405d --- /dev/null +++ b/src/api/java/forestry/api/genetics/ISpeciesRoot.java @@ -0,0 +1,163 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.genetics; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Map; +import java.util.Random; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +import com.mojang.authlib.GameProfile; + +/** + * Describes a class of species (i.e. bees, trees, butterflies), provides helper functions and access to common functionality. + */ +public interface ISpeciesRoot { + + /** + * @return A unique identifier for the species class. Should consist of "root" + a common name for the species class in camel-case, i.e. "rootBees", "rootTrees", "rootButterflies". + */ + String getUID(); + + /** + * @return Class of the sub-interface inheriting from {@link IIndividual}. + */ + Class getMemberClass(); + + /** + * @return Integer denoting the number of (counted) species of this type in the world. + */ + int getSpeciesCount(); + + /** + * Used to check whether a given itemstack contains genetic data corresponding to an {@link IIndividual} of this class. + * @param stack itemstack to check. + * @return true if the itemstack contains an {@link IIndividual} of this class, false otherwise. + */ + boolean isMember(ItemStack stack); + + /** + * Used to check whether a given itemstack contains genetic data corresponding to an {@link IIndividual} of this class and matches the given type. + * @param stack itemstack to check. + * @param type Integer denoting the type needed to match. (i.e. butterfly vs. butterfly serum; bee queens, princesses, drones; etc.) + * @return true if the itemstack contains an {@link IIndividual} of this class, false otherwise. + */ + boolean isMember(ItemStack stack, int type); + + /** + * Used to check whether the given {@link IIndividual} is member of this class. + * @param individual {@link IIndividual} to check. + * @return true if the individual is member of this class, false otherwise. + */ + boolean isMember(IIndividual individual); + + IIndividual getMember(ItemStack stack); + + IIndividual getMember(NBTTagCompound compound); + + ItemStack getMemberStack(IIndividual individual, int type); + + /* BREEDING TRACKER */ + IBreedingTracker getBreedingTracker(World world, GameProfile player); + + /* GENOME MANIPULATION */ + IIndividual templateAsIndividual(IAllele[] template); + + IIndividual templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); + + IChromosome[] templateAsChromosomes(IAllele[] template); + + IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive); + + IGenome templateAsGenome(IAllele[] template); + + IGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); + + /* TEMPLATES */ + /** + * Registers a bee template using the UID of the first allele as identifier. + * + * @param template + */ + void registerTemplate(IAllele[] template); + + /** + * Registers a bee template using the passed identifier. + * + * @param template + */ + void registerTemplate(String identifier, IAllele[] template); + + /** + * Retrieves a registered template using the passed identifier. + * + * @param identifier + * @return Array of {@link IAllele} representing a genome. + */ + IAllele[] getTemplate(String identifier); + + /** + * @return Default individual template for use when stuff breaks. + */ + IAllele[] getDefaultTemplate(); + + /** + * @param rand Random to use. + * @return A random template from the pool of registered species templates. + */ + IAllele[] getRandomTemplate(Random rand); + + Map getGenomeTemplates(); + ArrayList getIndividualTemplates(); + + /* MUTATIONS */ + /** + * Use to register mutations. + * + * @param mutation + */ + void registerMutation(IMutation mutation); + + /** + * @return All registered mutations. + */ + Collection getMutations(boolean shuffle); + + /** + * @param other Allele to match mutations against. + * @return All registered mutations the given allele is part of. + */ + Collection getCombinations(IAllele other); + + Collection getPaths(IAllele result, IChromosomeType chromosomeType); + + /* RESEARCH */ + /** + * @return List of generic catalysts which should be accepted for research by species of this class. + */ + Map getResearchCatalysts(); + + /** + * Sets an item stack as a valid (generic) research catalyst for this class. + * @param itemstack ItemStack to set as suitable. + * @param suitability Float between 0 and 1 to indicate suitability. + */ + void setResearchSuitability(ItemStack itemstack, float suitability); + + /** + * @return Array of {@link IChromosomeType} which are in this species genome + */ + IChromosomeType[] getKaryotype(); + + /** + * @return {@link IChromosomeType} which is the "key" for this species class, usually the species chromosome. + */ + IChromosomeType getKaryotypeKey(); +} diff --git a/src/api/java/forestry/api/genetics/package-info.java b/src/api/java/forestry/api/genetics/package-info.java new file mode 100644 index 00000000..fdd093bb --- /dev/null +++ b/src/api/java/forestry/api/genetics/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="3.2.0", owner="ForestryAPI|core", provides="ForestryAPI|genetics") +package forestry.api.genetics; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/lepidopterology/EnumButterflyChromosome.java b/src/api/java/forestry/api/lepidopterology/EnumButterflyChromosome.java new file mode 100644 index 00000000..9f89f7f8 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/EnumButterflyChromosome.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IAlleleArea; +import forestry.api.genetics.IAlleleBoolean; +import forestry.api.genetics.IAlleleFloat; +import forestry.api.genetics.IAlleleFlowers; +import forestry.api.genetics.IAlleleInteger; +import forestry.api.genetics.IAlleleTolerance; +import forestry.api.genetics.IChromosomeType; +import forestry.api.genetics.ISpeciesRoot; + +public enum EnumButterflyChromosome implements IChromosomeType { + /** + * Species of the bee. Alleles here must implement {@link IAlleleButterflySpecies}. + */ + SPECIES(IAlleleButterflySpecies.class), + /** + * Physical size. + */ + SIZE(IAlleleFloat.class), + /** + * Flight speed. + */ + SPEED(IAlleleFloat.class), + /** + * How long the butterfly can last without access to matching pollinatables. + */ + LIFESPAN(IAlleleInteger.class), + /** + * Species with a higher metabolism have a higher appetite and may cause more damage to their environment. + */ + METABOLISM(IAlleleInteger.class), + /** + * Determines likelyhood of caterpillars and length of caterpillar/pupation phase. Also: Number of max caterpillars after mating? + */ + FERTILITY(IAlleleInteger.class), + /** + * Not sure yet. + */ + TEMPERATURE_TOLERANCE(IAlleleTolerance.class), + /** + * Not sure yet. + */ + HUMIDITY_TOLERANCE(IAlleleTolerance.class), + /** + * Only nocturnal butterflys/moths will fly at night. Allows daylight activity for naturally nocturnal species. + */ + NOCTURNAL(IAlleleBoolean.class), + /** + * Only tolerant flyers will fly in the rain. + */ + TOLERANT_FLYER(IAlleleBoolean.class), + /** + * Fire resistance. + */ + FIRE_RESIST(IAlleleBoolean.class), + /** + * Required flowers/leaves. + */ + FLOWER_PROVIDER(IAlleleFlowers.class), + /** + * Extra effect to surroundings. (?) + */ + EFFECT(IAlleleButterflyEffect.class), + /** + * Not used yet + */ + TERRITORY(IAlleleArea.class), + ; + + Class clss; + + EnumButterflyChromosome(Class clss) { + this.clss = clss; + } + + @Override + public Class getAlleleClass() { + return clss; + } + + @Override + public String getName() { + return this.toString().toLowerCase(); + } + + @Override + public ISpeciesRoot getSpeciesRoot() { + return AlleleManager.alleleRegistry.getSpeciesRoot("rootButterflies"); + } +} diff --git a/src/api/java/forestry/api/lepidopterology/EnumFlutterType.java b/src/api/java/forestry/api/lepidopterology/EnumFlutterType.java new file mode 100644 index 00000000..f197d7b7 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/EnumFlutterType.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +public enum EnumFlutterType { + BUTTERFLY, + SERUM, + CATERPILLAR, + NONE; + + public static final EnumFlutterType[] VALUES = values(); +} diff --git a/src/api/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java b/src/api/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java new file mode 100644 index 00000000..6457dbe8 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import forestry.api.genetics.IAlleleEffect; +import forestry.api.genetics.IEffectData; + +public interface IAlleleButterflyEffect extends IAlleleEffect { + + /** + * Used by butterflies to trigger effects in the world. + * @param butterfly {@link IEntityButterfly} + * @param storedData + * @return {@link forestry.api.genetics.IEffectData} for the next cycle. + */ + IEffectData doEffect(IEntityButterfly butterfly, IEffectData storedData); + +} diff --git a/src/api/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java b/src/api/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java new file mode 100644 index 00000000..c1536118 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import java.util.EnumSet; +import java.util.Map; + +import net.minecraft.item.ItemStack; + +import net.minecraftforge.common.BiomeDictionary; + +import forestry.api.genetics.IAlleleSpecies; + +public interface IAlleleButterflySpecies extends IAlleleSpecies { + + /** + * @return the IBeeRoot + */ + IButterflyRoot getRoot(); + + /** + * @return Path of the texture to use for entity rendering. + */ + String getEntityTexture(); + + /** + * Allows butterflies to restrict random spawns beyond the restrictions set by getTemperature() and getHumidity(). + * + * @return EnumSet of biome tags this butterfly species can be spawned in. + */ + EnumSet getSpawnBiomes(); + + /** + * @return true if a prospective spawn biome must not match a biome tag outside of getSpawnBiomes. + */ + boolean strictSpawnMatch(); + + /** + * @return Float between 0 and 1 representing the rarity of the species, will affect spawn rate. + */ + float getRarity(); + + /** + * @return Float representing the distance below which this butterfly will take flight if it detects a player which is not sneaking. + */ + float getFlightDistance(); + + /** + * @return true if this species is only active at night. + */ + boolean isNocturnal(); + + Map getButterflyLoot(); + + Map getCaterpillarLoot(); +} diff --git a/src/api/java/forestry/api/lepidopterology/IButterfly.java b/src/api/java/forestry/api/lepidopterology/IButterfly.java new file mode 100644 index 00000000..c3013247 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IButterfly.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import forestry.api.genetics.IIndividualLiving; + +public interface IButterfly extends IIndividualLiving { + + IButterflyGenome getGenome(); + + /** + * @return Genetic information of the mate, null if unmated. + */ + IButterflyGenome getMate(); + + /** + * @return Physical size of the butterfly. + */ + float getSize(); + + /** + * @param world + * @param x + * @param y + * @param z + * @return true if the butterfly can naturally spawn at the given location at this time. (Used to auto-spawn butterflies from tree leaves.) + */ + boolean canSpawn(World world, double x, double y, double z); + + /** + * @param world + * @param x + * @param y + * @param z + * @return true if the butterfly can take flight at the given location at this time. (Used to auto-spawn butterflies from dropped items.) + */ + boolean canTakeFlight(World world, double x, double y, double z); + + /** + * @param world + * @param x + * @param y + * @param z + * @return true if the environment (temperature, humidity) is valid for the butterfly at the given location. + */ + boolean isAcceptedEnvironment(World world, double x, double y, double z); + + IButterfly spawnCaterpillar(IButterflyNursery nursery); + + /** + * @param entity + * @param playerKill Whether or not the butterfly was killed by a player. + * @param lootLevel Loot level according to the weapon used to kill the butterfly. + * @return Array of itemstacks to drop on death of the given entity. + */ + ItemStack[] getLootDrop(IEntityButterfly entity, boolean playerKill, int lootLevel); + + /** + * @param nursery + * @param playerKill Whether or not the nursery was broken by a player. + * @param lootLevel Fortune level. + * @return Array of itemstacks to drop on breaking of the nursery. + */ + ItemStack[] getCaterpillarDrop(IButterflyNursery nursery, boolean playerKill, int lootLevel); + + /** + * Create an exact copy of this butterfly. + */ + IButterfly copy(); + +} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyGenome.java b/src/api/java/forestry/api/lepidopterology/IButterflyGenome.java new file mode 100644 index 00000000..93816600 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IButterflyGenome.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import forestry.api.genetics.EnumTolerance; +import forestry.api.genetics.IFlowerProvider; +import forestry.api.genetics.IGenome; + +public interface IButterflyGenome extends IGenome { + + IAlleleButterflySpecies getPrimary(); + + IAlleleButterflySpecies getSecondary(); + + float getSize(); + + int getLifespan(); + + int getMetabolism(); + + int getFertility(); + + float getSpeed(); + + EnumTolerance getToleranceTemp(); + + EnumTolerance getToleranceHumid(); + + boolean getNocturnal(); + + boolean getTolerantFlyer(); + + boolean getFireResist(); + + IFlowerProvider getFlowerProvider(); + + IAlleleButterflyEffect getEffect(); + +} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyMutation.java b/src/api/java/forestry/api/lepidopterology/IButterflyMutation.java new file mode 100644 index 00000000..027e96eb --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IButterflyMutation.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IGenome; +import forestry.api.genetics.IMutation; + +public interface IButterflyMutation extends IMutation { + float getChance(IButterflyNursery housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); +} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyNursery.java b/src/api/java/forestry/api/lepidopterology/IButterflyNursery.java new file mode 100644 index 00000000..56e42f2e --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IButterflyNursery.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import forestry.api.genetics.IHousing; +import forestry.api.genetics.IIndividual; + +public interface IButterflyNursery extends IHousing { + + IButterfly getCaterpillar(); + + IIndividual getNanny(); + + void setCaterpillar(IButterfly butterfly); + + boolean canNurse(IButterfly butterfly); + +} diff --git a/src/api/java/forestry/api/lepidopterology/IButterflyRoot.java b/src/api/java/forestry/api/lepidopterology/IButterflyRoot.java new file mode 100644 index 00000000..7028df15 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IButterflyRoot.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +import com.mojang.authlib.GameProfile; + +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.ISpeciesRoot; + +public interface IButterflyRoot extends ISpeciesRoot { + + @Override + boolean isMember(ItemStack stack); + + @Override + IButterfly getMember(ItemStack stack); + + @Override + IButterfly getMember(NBTTagCompound compound); + + @Override + ItemStack getMemberStack(IIndividual butterfly, int type); + + /* GENOME CONVERSION */ + @Override + IButterfly templateAsIndividual(IAllele[] template); + + @Override + IButterfly templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive); + + @Override + IButterflyGenome templateAsGenome(IAllele[] template); + + @Override + IButterflyGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); + + /* BUTTERFLY SPECIFIC */ + ILepidopteristTracker getBreedingTracker(World world, GameProfile player); + + /** + * Spawns the given butterfly in the world. + * @param butterfly + * @return butterfly entity on success, null otherwise. + */ + EntityLiving spawnButterflyInWorld(World world, IButterfly butterfly, double x, double y, double z); + + /** + * @return true if passed item is mated. + */ + boolean isMated(ItemStack stack); + + /* TEMPLATES */ + @Override + ArrayList getIndividualTemplates(); + + /* MUTATIONS */ + @Override + Collection getMutations(boolean shuffle); + + EnumFlutterType getType(ItemStack stack); + +} diff --git a/src/api/java/forestry/api/lepidopterology/IEntityButterfly.java b/src/api/java/forestry/api/lepidopterology/IEntityButterfly.java new file mode 100644 index 00000000..963c7210 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/IEntityButterfly.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.passive.IAnimals; + +import forestry.api.genetics.IIndividual; + +public interface IEntityButterfly extends IAnimals { + + void changeExhaustion(int change); + + int getExhaustion(); + + IButterfly getButterfly(); + + /** + * @return The entity as an EntityCreature to save casting. + */ + EntityCreature getEntity(); + + IIndividual getPollen(); + + void setPollen(IIndividual pollen); +} diff --git a/src/api/java/forestry/api/lepidopterology/ILepidopteristTracker.java b/src/api/java/forestry/api/lepidopterology/ILepidopteristTracker.java new file mode 100644 index 00000000..79926975 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/ILepidopteristTracker.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.lepidopterology; + +import forestry.api.genetics.IBreedingTracker; + +public interface ILepidopteristTracker extends IBreedingTracker { + + void registerCatch(IButterfly butterfly); + +} diff --git a/src/api/java/forestry/api/lepidopterology/package-info.java b/src/api/java/forestry/api/lepidopterology/package-info.java new file mode 100644 index 00000000..070b4322 --- /dev/null +++ b/src/api/java/forestry/api/lepidopterology/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="1.1", owner="ForestryAPI|core", provides="ForestryAPI|lepidopterology") +package forestry.api.lepidopterology; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/mail/EnumAddressee.java b/src/api/java/forestry/api/mail/EnumAddressee.java new file mode 100644 index 00000000..28c73847 --- /dev/null +++ b/src/api/java/forestry/api/mail/EnumAddressee.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import java.util.Locale; + +public enum EnumAddressee { + PLAYER, TRADER; + + public static EnumAddressee fromString(String ident) { + ident = ident.toLowerCase(Locale.ENGLISH); + for(EnumAddressee addr : values()) { + if(addr.toString().equals(ident)) + return addr; + } + + return null; + } + + public String toString() { + return super.toString().toLowerCase(Locale.ENGLISH); + } +} diff --git a/src/api/java/forestry/api/mail/EnumPostage.java b/src/api/java/forestry/api/mail/EnumPostage.java new file mode 100644 index 00000000..772114fb --- /dev/null +++ b/src/api/java/forestry/api/mail/EnumPostage.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +public enum EnumPostage { + P_0(0), P_1(1), P_2(2), P_5(5), P_10(10), P_20(20), P_50(50), P_100(100), P_200(200); + + private final int value; + + private EnumPostage(int value) { + this.value = value; + } + + public int getValue() { + return this.value; + } +} diff --git a/src/api/java/forestry/api/mail/ILetter.java b/src/api/java/forestry/api/mail/ILetter.java new file mode 100644 index 00000000..42df8acb --- /dev/null +++ b/src/api/java/forestry/api/mail/ILetter.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +import forestry.api.core.INBTTagable; + +public interface ILetter extends IInventory, INBTTagable { + + ItemStack[] getPostage(); + + void setProcessed(boolean flag); + + boolean isProcessed(); + + boolean isMailable(); + + void setSender(IMailAddress address); + + IMailAddress getSender(); + + boolean hasRecipient(); + + void setRecipient(IMailAddress address); + + IMailAddress[] getRecipients(); + + String getRecipientString(); + + void setText(String text); + + String getText(); + + void addTooltip(List list); + + boolean isPostPaid(); + + int requiredPostage(); + + void invalidatePostage(); + + ItemStack[] getAttachments(); + + void addAttachment(ItemStack itemstack); + + void addAttachments(ItemStack[] itemstacks); + + int countAttachments(); + + void addStamps(ItemStack stamps); + +} diff --git a/src/api/java/forestry/api/mail/ILetterHandler.java b/src/api/java/forestry/api/mail/ILetterHandler.java new file mode 100644 index 00000000..576a0d7d --- /dev/null +++ b/src/api/java/forestry/api/mail/ILetterHandler.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface ILetterHandler { + IPostalState handleLetter(World world, IMailAddress recipient, ItemStack letterStack, boolean doLodge); +} diff --git a/src/api/java/forestry/api/mail/IMailAddress.java b/src/api/java/forestry/api/mail/IMailAddress.java new file mode 100644 index 00000000..8441b09a --- /dev/null +++ b/src/api/java/forestry/api/mail/IMailAddress.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import com.mojang.authlib.GameProfile; + +import forestry.api.core.INBTTagable; + +public interface IMailAddress extends INBTTagable { + + EnumAddressee getType(); + String getName(); + + boolean isValid(); + + boolean isPlayer(); + boolean isTrader(); + + GameProfile getPlayerProfile(); +} diff --git a/src/api/java/forestry/api/mail/IPostOffice.java b/src/api/java/forestry/api/mail/IPostOffice.java new file mode 100644 index 00000000..a8a14eac --- /dev/null +++ b/src/api/java/forestry/api/mail/IPostOffice.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IPostOffice { + + void collectPostage(ItemStack[] stamps); + + IPostalState lodgeLetter(World world, ItemStack itemstack, boolean doLodge); + + ItemStack getAnyStamp(int max); + + ItemStack getAnyStamp(EnumPostage postage, int max); + + ItemStack getAnyStamp(EnumPostage[] postages, int max); + + void registerTradeStation(ITradeStation trade); + + void deregisterTradeStation(ITradeStation trade); + + Map getActiveTradeStations(World world); +} diff --git a/src/api/java/forestry/api/mail/IPostRegistry.java b/src/api/java/forestry/api/mail/IPostRegistry.java new file mode 100644 index 00000000..f20352d9 --- /dev/null +++ b/src/api/java/forestry/api/mail/IPostRegistry.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.mojang.authlib.GameProfile; + +public interface IPostRegistry { + + /* POST OFFICE */ + IPostOffice getPostOffice(World world); + + /* MAIL ADDRESSES */ + IMailAddress getMailAddress(GameProfile gameProfile); + IMailAddress getMailAddress(String traderName); + + /* LETTERS */ + boolean isLetter(ItemStack itemstack); + + ILetter createLetter(IMailAddress sender, IMailAddress recipient); + + ILetter getLetter(ItemStack itemstack); + + ItemStack createLetterStack(ILetter letter); + + /* CARRIERS */ + /** + * Registers a new {@link IPostalCarrier}. See {@link IPostalCarrier} for details. + * @param carrier {@link IPostalCarrier} to register. + */ + void registerCarrier(IPostalCarrier carrier); + + IPostalCarrier getCarrier(EnumAddressee uid); + + Map getRegisteredCarriers(); + + /* TRADE STATIONS */ + void deleteTradeStation(World world, IMailAddress address); + + ITradeStation getOrCreateTradeStation(World world, GameProfile owner, IMailAddress address); + + ITradeStation getTradeStation(World world, IMailAddress address); + + boolean isAvailableTradeAddress(World world, IMailAddress address); + + boolean isValidTradeAddress(World world, IMailAddress address); + + /* PO BOXES */ + boolean isValidPOBox(World world, IMailAddress address); + +} diff --git a/src/api/java/forestry/api/mail/IPostalCarrier.java b/src/api/java/forestry/api/mail/IPostalCarrier.java new file mode 100644 index 00000000..28db78ae --- /dev/null +++ b/src/api/java/forestry/api/mail/IPostalCarrier.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Postal Carriers are systems which can be hooked into Forestry's mail system to handle mail delivery. + * + * The two available carriers in vanilla Forestry are + * "player" - Delivers mail to individual players. + * "trader" - Handles mail addressed to trade stations. + */ +public interface IPostalCarrier { + + /** + * @return An EnumAddressee identifying the type of carrier + */ + EnumAddressee getType(); + + /** + * @return A human-readable name for this carrier. + */ + String getName(); + + @SideOnly(Side.CLIENT) + IIcon getIcon(); + + /** + * Handle delivery of a letter addressed to this carrier. + * @param world The world the {@link IPostOffice} handles. + * @param office {link @IPostOffice} which received this letter and handed it to the carrier. + * @param recipient An identifier for the recipient as typed by the player into the address field. + * @param letterstack ItemStack representing the letter. See {@link IPostRegistry} for helper functions to validate and extract it. + * @param doDeliver Whether or not the letter is supposed to actually be delivered or if delivery is only to be simulated. + * @return {link IPostalState} holding information on success or failure for delivery. + */ + IPostalState deliverLetter(World world, IPostOffice office, IMailAddress recipient, ItemStack letterstack, boolean doDeliver); + +} diff --git a/src/api/java/forestry/api/mail/IPostalState.java b/src/api/java/forestry/api/mail/IPostalState.java new file mode 100644 index 00000000..bc843621 --- /dev/null +++ b/src/api/java/forestry/api/mail/IPostalState.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +public interface IPostalState { + boolean isOk(); + + String getIdentifier(); + + int ordinal(); +} diff --git a/src/api/java/forestry/api/mail/IStamps.java b/src/api/java/forestry/api/mail/IStamps.java new file mode 100644 index 00000000..4332a811 --- /dev/null +++ b/src/api/java/forestry/api/mail/IStamps.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import net.minecraft.item.ItemStack; + +public interface IStamps { + + EnumPostage getPostage(ItemStack itemstack); + +} diff --git a/src/api/java/forestry/api/mail/ITradeStation.java b/src/api/java/forestry/api/mail/ITradeStation.java new file mode 100644 index 00000000..78a498a0 --- /dev/null +++ b/src/api/java/forestry/api/mail/ITradeStation.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import net.minecraft.inventory.IInventory; + +public interface ITradeStation extends ILetterHandler, IInventory { + + IMailAddress getAddress(); + + boolean isValid(); + + void invalidate(); + + void setVirtual(boolean isVirtual); + + boolean isVirtual(); + + TradeStationInfo getTradeInfo(); + +} diff --git a/src/api/java/forestry/api/mail/PostManager.java b/src/api/java/forestry/api/mail/PostManager.java new file mode 100644 index 00000000..c3f0e45b --- /dev/null +++ b/src/api/java/forestry/api/mail/PostManager.java @@ -0,0 +1,11 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + + +public class PostManager { + public static IPostRegistry postRegistry; +} diff --git a/src/api/java/forestry/api/mail/TradeStationInfo.java b/src/api/java/forestry/api/mail/TradeStationInfo.java new file mode 100644 index 00000000..14424bed --- /dev/null +++ b/src/api/java/forestry/api/mail/TradeStationInfo.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.mail; + +import java.lang.IllegalArgumentException; +import net.minecraft.item.ItemStack; +import com.mojang.authlib.GameProfile; + +public class TradeStationInfo { + public final IMailAddress address; + public final GameProfile owner; + public final ItemStack tradegood; + public final ItemStack[] required; + public final IPostalState state; + + public TradeStationInfo(IMailAddress address, GameProfile owner, ItemStack tradegood, ItemStack[] required, IPostalState state) { + if (!address.isTrader()) { + throw new IllegalArgumentException("TradeStation address must be a trader"); + } + this.address = address; + this.owner = owner; + this.tradegood = tradegood; + this.required = required; + this.state = state; + } +} diff --git a/src/api/java/forestry/api/mail/package-info.java b/src/api/java/forestry/api/mail/package-info.java new file mode 100644 index 00000000..a1050727 --- /dev/null +++ b/src/api/java/forestry/api/mail/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|mail") +package forestry.api.mail; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/recipes/ICarpenterManager.java b/src/api/java/forestry/api/recipes/ICarpenterManager.java new file mode 100644 index 00000000..8e3eabbe --- /dev/null +++ b/src/api/java/forestry/api/recipes/ICarpenterManager.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.ShapedRecipes; + +import net.minecraftforge.fluids.FluidStack; + +/** + * Provides an interface to the recipe manager of the carpenter. + * + * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even + * if your mod loads before Forestry. + * + * Accessible via {@link RecipeManagers} + * + * Only shaped recipes can be added currently. + * + * @author SirSengir + */ +public interface ICarpenterManager extends ICraftingProvider { + /** + * Add a shaped recipe to the carpenter. + * + * @param box + * ItemStack of one item representing the required box (carton, crate) for this recipe. May be null. + * @param product + * Crafting result. + * @param materials + * Materials needed in the crafting matrix. This gets passed directly to {@link ShapedRecipes}. Notation is the same. + */ + public void addRecipe(ItemStack box, ItemStack product, Object... materials); + + /** + * Add a shaped recipe to the carpenter. + * + * @param packagingTime + * Number of work cycles required to craft the recipe once. + * @param box + * ItemStack of one item representing the required box (carton, crate) for this recipe. May be null. + * @param product + * Crafting result. + * @param materials + * Materials needed in the crafting matrix. This gets passed directly to {@link ShapedRecipes}. Notation is the same. + */ + public void addRecipe(int packagingTime, ItemStack box, ItemStack product, Object... materials); + + /** + * Add a shaped recipe to the carpenter. + * + * @param packagingTime + * Number of work cycles required to craft the recipe once. + * @param liquid + * Liquid required in carpenter's tank. + * @param box + * ItemStack of one item representing the required box (carton, crate) for this recipe. May be null. + * @param product + * Crafting result. + * @param materials + * Materials needed in the crafting matrix. This gets passed directly to {@link ShapedRecipes}. Notation is the same. + */ + public void addRecipe(int packagingTime, FluidStack liquid, ItemStack box, ItemStack product, Object... materials); +} diff --git a/src/api/java/forestry/api/recipes/ICentrifugeManager.java b/src/api/java/forestry/api/recipes/ICentrifugeManager.java new file mode 100644 index 00000000..910bd32c --- /dev/null +++ b/src/api/java/forestry/api/recipes/ICentrifugeManager.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import java.util.HashMap; + +import net.minecraft.item.ItemStack; + +/** + * Provides an interface to the recipe manager of the centrifuge. + * + * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even + * if your mod loads before Forestry. + * + * Accessible via {@link RecipeManagers} + * + * @author SirSengir + */ +public interface ICentrifugeManager extends ICraftingProvider { + + /** + * Add a recipe to the centrifuge + * + * @param timePerItem + * Time to centrifugate one item of the given type + * @param resource + * ItemStack containing information on item id and damage. Stack size will be ignored. + * @param products + * HashMap specifying the possible products and the chances of them resulting from centrifugation. + */ + public void addRecipe(int timePerItem, ItemStack resource, HashMap products); + + /** + * Add a recipe to the centrifuge + * + * @param timePerItem + * Time to centrifugate one item of the given type + * @param resource + * ItemStack containing information on item id and damage. Stack size will be ignored. + * @param produce + * Array of ItemStacks that can be the result of this recipe. + * @param chances + * Array of integers corresponding and matching to produce providing the chance (0-100) for the ItemStack at the given index to be + * produced. + */ + public void addRecipe(int timePerItem, ItemStack resource, ItemStack[] produce, int[] chances); + + /** + * Add a recipe to the centrifuge + * + * @param timePerItem + * Time to centrifugate one item of the given type + * @param resource + * ItemStack containing information on item id and damage. Stack size will be ignored. + * @param primary + * Primary product produced by centrifugating one item. Yield 100 %. + * @param secondary + * Secondary product that may be produced when centrifugating the given item. May be null. + * @param chance + * Chance (1 - 100) for centrifugation to yield the secondary product. + */ + public void addRecipe(int timePerItem, ItemStack resource, ItemStack primary, ItemStack secondary, int chance); + + /** + * Add a recipe to the centrifuge + * + * @param timePerItem + * Time to centrifugate one item of the given type + * @param resource + * ItemStack containing information on item id and damage. Stack size will be ignored. + * @param primary + * Primary product produced by centrifugating one item. Yield 100 %. + */ + public void addRecipe(int timePerItem, ItemStack resource, ItemStack primary); + +} diff --git a/src/api/java/forestry/api/recipes/ICraftingProvider.java b/src/api/java/forestry/api/recipes/ICraftingProvider.java new file mode 100644 index 00000000..502dffb4 --- /dev/null +++ b/src/api/java/forestry/api/recipes/ICraftingProvider.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import java.util.Map; + +public interface ICraftingProvider { + /** + * Access to the full list of recipes contained in the crafting provider. + * + * @return List of the given format where the first array represents inputs and the second outputs. Objects can be either ItemStack or LiquidStack. + */ + public Map getRecipes(); +} diff --git a/src/api/java/forestry/api/recipes/IFabricatorManager.java b/src/api/java/forestry/api/recipes/IFabricatorManager.java new file mode 100644 index 00000000..a01f0da4 --- /dev/null +++ b/src/api/java/forestry/api/recipes/IFabricatorManager.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import net.minecraft.item.ItemStack; + +import net.minecraftforge.fluids.FluidStack; + +public interface IFabricatorManager extends ICraftingProvider { + + void addRecipe(ItemStack plan, FluidStack molten, ItemStack result, Object[] pattern); + + void addSmelting(ItemStack resource, FluidStack molten, int meltingPoint); + +} diff --git a/src/api/java/forestry/api/recipes/IFermenterManager.java b/src/api/java/forestry/api/recipes/IFermenterManager.java new file mode 100644 index 00000000..92c903bb --- /dev/null +++ b/src/api/java/forestry/api/recipes/IFermenterManager.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import net.minecraft.item.ItemStack; + +import net.minecraftforge.fluids.FluidStack; + +/** + * Provides an interface to the recipe manager of the fermenter. + * + * The manager is initialized at the beginning of Forestry's BaseMod.load() + * cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be + * null even if your mod loads before Forestry. + * + * Accessible via {@link RecipeManagers} + * + * @author SirSengir + */ +public interface IFermenterManager extends ICraftingProvider { + + /** + * Add a recipe to the fermenter + * + * @param resource ItemStack representing the resource. + * @param fermentationValue Value of the given resource, i.e. how much needs + * to be fermented for the output to be deposited into the product tank. + * @param modifier Modifies the amount of liquid output per work cycle. + * (water = 1.0f, honey = 1.5f) + * @param output LiquidStack representing output liquid. Amount is + * determined by fermentationValue*modifier. + * @param liquid LiquidStack representing resource liquid and amount. + * @throws NullPointerException if resource, output or liquid is null + */ + public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output, FluidStack liquid); + + /** + * Add a recipe to the fermenter. Defaults to water as input liquid. + * + * @param resource ItemStack representing the resource. + * @param modifier Modifies the amount of liquid output per work cycle. + * (water = 1.0f, honey = 1.5f) + * @param fermentationValue Value of the given resource, i.e. how much needs + * to be fermented for the output to be deposited into the product tank. + * @param output LiquidStack representing output liquid. Amount is + * determined by fermentationValue*modifier. + * @throws NullPointerException if resource, output or liquid is null + */ + public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output); +} diff --git a/src/api/java/forestry/api/recipes/IMoistenerManager.java b/src/api/java/forestry/api/recipes/IMoistenerManager.java new file mode 100644 index 00000000..711264b4 --- /dev/null +++ b/src/api/java/forestry/api/recipes/IMoistenerManager.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import net.minecraft.item.ItemStack; + +/** + * Provides an interface to the recipe manager of the moistener. + * + * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even + * if your mod loads before Forestry. + * + * Accessible via {@link RecipeManagers} + * + * @author SirSengir + */ +public interface IMoistenerManager extends ICraftingProvider { + + /** + * Add a recipe to the moistener + * + * @param resource + * Item required in resource stack. Will be reduced by one per produced item. + * @param product + * Item to produce per resource processed. + * @param timePerItem + * Moistener runs at 1 - 4 time ticks per ingame tick depending on light level. For mycelium this value is currently 5000. + */ + public void addRecipe(ItemStack resource, ItemStack product, int timePerItem); +} diff --git a/src/api/java/forestry/api/recipes/ISqueezerManager.java b/src/api/java/forestry/api/recipes/ISqueezerManager.java new file mode 100644 index 00000000..0a63b731 --- /dev/null +++ b/src/api/java/forestry/api/recipes/ISqueezerManager.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import net.minecraft.item.ItemStack; + +import net.minecraftforge.fluids.FluidStack; + +/** + * Provides an interface to the recipe manager of the suqeezer. + * + * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even + * if your mod loads before Forestry. + * + * Accessible via {@link RecipeManagers} + * + * @author SirSengir + */ +public interface ISqueezerManager extends ICraftingProvider { + + /** + * Add a recipe to the squeezer. + * + * @param timePerItem + * Number of work cycles required to squeeze one set of resources. + * @param resources + * Array of item stacks representing the required resources for one process. Stack size will be taken into account. + * @param liquid + * {@link FluidStack} representing the output of this recipe. + * @param remnants + * Item stack representing the possible remnants from this recipe. + * @param chance + * Chance remnants will be produced by a single recipe cycle. + */ + public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid, ItemStack remnants, int chance); + + /** + * Add a recipe to the squeezer. + * + * @param timePerItem + * Number of work cycles required to squeeze one set of resources. + * @param resources + * Array of item stacks representing the required resources for one process. Stack size will be taken into account. + * @param liquid + * {@link FluidStack} representing the output of this recipe. + */ + public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid); +} diff --git a/src/api/java/forestry/api/recipes/IStillManager.java b/src/api/java/forestry/api/recipes/IStillManager.java new file mode 100644 index 00000000..47fd4215 --- /dev/null +++ b/src/api/java/forestry/api/recipes/IStillManager.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import net.minecraftforge.fluids.FluidStack; + +/** + * Provides an interface to the recipe manager of the still. + * + * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even + * if your mod loads before Forestry. + * + * Accessible via {@link RecipeManagers} + * + * Note that this is untested with anything other than biomass->biofuel conversion. + * + * @author SirSengir + */ +public interface IStillManager extends ICraftingProvider { + /** + * Add a recipe to the still + * + * @param cyclesPerUnit + * Amount of work cycles required to run through the conversion once. + * @param input + * ItemStack representing the input liquid. + * @param output + * ItemStack representing the output liquid + */ + public void addRecipe(int cyclesPerUnit, FluidStack input, FluidStack output); +} diff --git a/src/api/java/forestry/api/recipes/IVariableFermentable.java b/src/api/java/forestry/api/recipes/IVariableFermentable.java new file mode 100644 index 00000000..f0997f53 --- /dev/null +++ b/src/api/java/forestry/api/recipes/IVariableFermentable.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import net.minecraft.item.ItemStack; + +/** + * Fermenter checks any valid fermentation item for an implementation of this interface. + * This does not supersede adding a proper recipe to the fermenter! + */ +public interface IVariableFermentable { + + /** + * @param itemstack + * @return Float representing the modification to be applied to the matching recipe's biomass output. + */ + float getFermentationModifier(ItemStack itemstack); +} diff --git a/src/api/java/forestry/api/recipes/RecipeManagers.java b/src/api/java/forestry/api/recipes/RecipeManagers.java new file mode 100644 index 00000000..403bd5b5 --- /dev/null +++ b/src/api/java/forestry/api/recipes/RecipeManagers.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.recipes; + +import java.util.Collection; + +/** + * Contains all available recipe managers for Forestry machines and items. + * + * @author SirSengir + */ +public class RecipeManagers { + + public static Collection craftingProviders; + + /** + * Allows you to add recipes to the carpenter. See {@link ICarpenterManager} for details. + */ + public static ICarpenterManager carpenterManager; + /** + * Allows you to add recipes to the centrifuge. See {@link ICentrifugeManager} for details. + */ + public static ICentrifugeManager centrifugeManager; + /** + * Allows you to add recipes to the fermenter. See {@link IFermenterManager} for details. + */ + public static IFermenterManager fermenterManager; + /** + * Allows you to add recipes to the moistener. See {@link IMoistenerManager} for details. + */ + public static IMoistenerManager moistenerManager; + /** + * Allows you to add recipes to the squeezer. See {@link ISqueezerManager} for details. + */ + public static ISqueezerManager squeezerManager; + /** + * Allows you to add recipes to the still. See {@link IStillManager} for details. + */ + public static IStillManager stillManager; + + public static IFabricatorManager fabricatorManager; +} diff --git a/src/api/java/forestry/api/recipes/package-info.java b/src/api/java/forestry/api/recipes/package-info.java new file mode 100644 index 00000000..c76d83b9 --- /dev/null +++ b/src/api/java/forestry/api/recipes/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|recipes") +package forestry.api.recipes; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/storage/BackpackEvent.java b/src/api/java/forestry/api/storage/BackpackEvent.java new file mode 100644 index 00000000..37427788 --- /dev/null +++ b/src/api/java/forestry/api/storage/BackpackEvent.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; + +import cpw.mods.fml.common.eventhandler.Event; + + +public abstract class BackpackEvent extends Event { + + public final EntityPlayer player; + public final IBackpackDefinition backpackDefinition; + public final IInventory backpackInventory; + + public BackpackEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory) { + this.player = player; + this.backpackDefinition = backpackDefinition; + this.backpackInventory = backpackInventory; + } +} diff --git a/src/api/java/forestry/api/storage/BackpackManager.java b/src/api/java/forestry/api/storage/BackpackManager.java new file mode 100644 index 00000000..8805904d --- /dev/null +++ b/src/api/java/forestry/api/storage/BackpackManager.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +import java.util.ArrayList; +import java.util.HashMap; + +import net.minecraft.item.ItemStack; + +public class BackpackManager { + /** + * 0 - Miner's Backpack 1 - Digger's Backpack 2 - Forester's Backpack 3 - Hunter's Backpack 4 - Adventurer's Backpack + * + * Use IMC messages to achieve the same effect! + */ + public static ArrayList[] backpackItems; + + public static IBackpackInterface backpackInterface; + + /** + * Only use this if you know what you are doing. Prefer backpackInterface. + */ + public static HashMap definitions = new HashMap(); +} diff --git a/src/api/java/forestry/api/storage/BackpackResupplyEvent.java b/src/api/java/forestry/api/storage/BackpackResupplyEvent.java new file mode 100644 index 00000000..e6e5e119 --- /dev/null +++ b/src/api/java/forestry/api/storage/BackpackResupplyEvent.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; + +import cpw.mods.fml.common.eventhandler.Cancelable; + +/** + * Use @SubscribeEvent on a method taking this event as an argument. Will fire whenever a backpack tries to resupply to a player inventory. Processing will stop + * if the event is canceled. + */ +@Cancelable +public class BackpackResupplyEvent extends BackpackEvent { + + public BackpackResupplyEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory) { + super(player, backpackDefinition, backpackInventory); + } + +} diff --git a/src/api/java/forestry/api/storage/BackpackStowEvent.java b/src/api/java/forestry/api/storage/BackpackStowEvent.java new file mode 100644 index 00000000..3afbf7a1 --- /dev/null +++ b/src/api/java/forestry/api/storage/BackpackStowEvent.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +import cpw.mods.fml.common.eventhandler.Cancelable; + +/** + * Use @SubscribeEvent on a method taking this event as an argument. Will fire whenever a backpack tries to store an item. Processing will stop if the stacksize + * of stackToStow drops to 0 or less or the event is canceled. + */ +@Cancelable +public class BackpackStowEvent extends BackpackEvent { + + public final ItemStack stackToStow; + + public BackpackStowEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory, ItemStack stackToStow) { + super(player, backpackDefinition, backpackInventory); + this.stackToStow = stackToStow; + } +} diff --git a/src/api/java/forestry/api/storage/EnumBackpackType.java b/src/api/java/forestry/api/storage/EnumBackpackType.java new file mode 100644 index 00000000..48ad7ee0 --- /dev/null +++ b/src/api/java/forestry/api/storage/EnumBackpackType.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +public enum EnumBackpackType { + APIARIST, T1, T2 +} diff --git a/src/api/java/forestry/api/storage/IBackpackDefinition.java b/src/api/java/forestry/api/storage/IBackpackDefinition.java new file mode 100644 index 00000000..31c66631 --- /dev/null +++ b/src/api/java/forestry/api/storage/IBackpackDefinition.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +import java.util.List; + +import net.minecraft.item.ItemStack; + +public interface IBackpackDefinition { + + /** + * @return A unique string identifier + */ + String getKey(); + + /** + * @return Human-readable name of the backpack. + */ + String getName(ItemStack backpack); + + /** + * @return Primary colour for the backpack icon. + */ + int getPrimaryColour(); + + /** + * @return Secondary colour for backpack icon. + */ + int getSecondaryColour(); + + /** + * Adds an item as valid for this backpack. + * + * @param validItem + */ + void addValidItem(ItemStack validItem); + void addValidItems(List validItems); + + /** + * Returns true if the itemstack is a valid item for this backpack type. + */ + boolean isValidItem(ItemStack itemstack); + +} diff --git a/src/api/java/forestry/api/storage/IBackpackInterface.java b/src/api/java/forestry/api/storage/IBackpackInterface.java new file mode 100644 index 00000000..27a2eba5 --- /dev/null +++ b/src/api/java/forestry/api/storage/IBackpackInterface.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +import net.minecraft.item.Item; + +public interface IBackpackInterface { + + /** + * Adds a backpack with the given definition and type, returning the item. + * + * @param definition + * Definition of backpack behaviour. + * @param type + * Type of backpack. (T1 or T2 (= Woven) + * @return Created backpack item. + */ + Item addBackpack(IBackpackDefinition definition, EnumBackpackType type); +} diff --git a/src/api/java/forestry/api/storage/ICrateRegistry.java b/src/api/java/forestry/api/storage/ICrateRegistry.java new file mode 100644 index 00000000..868511e3 --- /dev/null +++ b/src/api/java/forestry/api/storage/ICrateRegistry.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public interface ICrateRegistry { + + /** + * Makes a new crate, registers it with the game registry with uid, + * and creates crating and uncrating recipes for the Carpenter. + * The icon is rendered automatically from the contained item. + * + * Can only be called during the Init stage. + */ + void registerCrate(Item item, String uid); + void registerCrate(Block block, String uid); + void registerCrate(ItemStack stack, String uid); + + /** + * Same as the above, but uses the ore dictionary for the Carpenter crating recipe. + */ + void registerCrateUsingOreDict(Item item, String uid); + void registerCrateUsingOreDict(Block block, String uid); + void registerCrateUsingOreDict(ItemStack stack, String uid); + +} diff --git a/src/api/java/forestry/api/storage/StorageManager.java b/src/api/java/forestry/api/storage/StorageManager.java new file mode 100644 index 00000000..ef4ec4cf --- /dev/null +++ b/src/api/java/forestry/api/storage/StorageManager.java @@ -0,0 +1,12 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.storage; + +public class StorageManager { + + public static ICrateRegistry crateRegistry; + +} diff --git a/src/api/java/forestry/api/storage/package-info.java b/src/api/java/forestry/api/storage/package-info.java new file mode 100644 index 00000000..3d0c1e9d --- /dev/null +++ b/src/api/java/forestry/api/storage/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|storage") +package forestry.api.storage; +import cpw.mods.fml.common.API; diff --git a/src/api/java/forestry/api/world/ITreeGenData.java b/src/api/java/forestry/api/world/ITreeGenData.java new file mode 100644 index 00000000..bf59c5e5 --- /dev/null +++ b/src/api/java/forestry/api/world/ITreeGenData.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.world; + +import net.minecraft.world.World; + +import com.mojang.authlib.GameProfile; + +import forestry.api.arboriculture.ITreeGenome; + +public interface ITreeGenData { + + int getGirth(World world, int x, int y, int z); + + float getHeightModifier(); + + boolean canGrow(World world, int x, int y, int z, int expectedGirth, int expectedHeight); + + void setLeaves(World world, GameProfile owner, int x, int y, int z); + void setLeavesDecorative(World world, GameProfile owner, int x, int y, int z); + + boolean allowsFruitBlocks(); + + boolean trySpawnFruitBlock(World world, int x, int y, int z); + + ITreeGenome getGenome(); +} diff --git a/src/api/java/forestry/api/world/IWorldGenInterface.java b/src/api/java/forestry/api/world/IWorldGenInterface.java new file mode 100644 index 00000000..b7b5555f --- /dev/null +++ b/src/api/java/forestry/api/world/IWorldGenInterface.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.world; + +import net.minecraft.world.gen.feature.WorldGenerator; + +public interface IWorldGenInterface { + + /** + * Retrieves generators for trees identified by a given string. + * + * Returned generator classes take an {@link ITreeGenData} in the constructor. + * + * @param ident + * Unique identifier for tree type. Forestry's convention is 'treeSpecies', i.e. 'treeBaobab', 'treeSequoia'. + * @return All generators matching the given ident. + */ + Class[] getTreeGenerators(String ident); +} diff --git a/src/api/java/forestry/api/world/WorldGenManager.java b/src/api/java/forestry/api/world/WorldGenManager.java new file mode 100644 index 00000000..a2a5b4f8 --- /dev/null +++ b/src/api/java/forestry/api/world/WorldGenManager.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +package forestry.api.world; + +public class WorldGenManager { + public static IWorldGenInterface worldgenInterface; +} diff --git a/src/api/java/forestry/api/world/package-info.java b/src/api/java/forestry/api/world/package-info.java new file mode 100644 index 00000000..c7e60f4e --- /dev/null +++ b/src/api/java/forestry/api/world/package-info.java @@ -0,0 +1,8 @@ +/******************************************************************************* + * Copyright 2011-2014 SirSengir + * + * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. + ******************************************************************************/ +@API(apiVersion="1.1.0", owner="ForestryAPI|core", provides="ForestryAPI|world") +package forestry.api.world; +import cpw.mods.fml.common.API; diff --git a/src/api/java/pneumaticCraft/api/IHeatExchangerLogic.java b/src/api/java/pneumaticCraft/api/IHeatExchangerLogic.java new file mode 100644 index 00000000..78f8dbec --- /dev/null +++ b/src/api/java/pneumaticCraft/api/IHeatExchangerLogic.java @@ -0,0 +1,77 @@ +package pneumaticCraft.api; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +/** + * DO NOT IMPLEMENT THIS CLASS YOURSELF! Use PneumaticRegistry.getInstance().getHeatExchangerLogic() ! + * @author MineMaarten + * www.minemaarten.com + */ +public interface IHeatExchangerLogic{ + + /** + * Call this to tick this logic, and make the heat disperse itself. + */ + public void update(); + + /** + * When called (preferably on tile entity load and neighbor block/tile entity change) this will add all IHeatExchanger neighbor TileEntities as connected heat exchangers. + * It will also take care of blocks like Lava. + * + * You don't _have_ to call this method, if this heat exchanger is not connected to the outside world (for example the heat of the liquid + * plastic in the Plastic Mixer). + * @param world + * @param x + * @param y + * @param z + * @param validSides Can be left out as vararg, meaning every side can be connected. When one or more sides are specified this will constrain + * this heat exchanger to only connect to other heat exchangers on these sides. + */ + public void initializeAsHull(World world, int x, int y, int z, ForgeDirection... validSides); + + /** + * When called, this will connect these two heat exchangers. You should only call this on one of the two heat exchangers. + * @param exchanger + */ + public void addConnectedExchanger(IHeatExchangerLogic exchanger); + + public void removeConnectedExchanger(IHeatExchangerLogic exchanger); + + /** + * A heat exchanger starts with 295 degrees Kelvin (20 degrees Celcius) by default. + * @param temperature in degrees Kelvin + */ + public void setTemperature(double temperature); + + public double getTemperature(); + + /** + * The higher the thermal resistance, the slower the heat disperses. + * @param thermalResistance By default it's 1. + */ + public void setThermalResistance(double thermalResistance); + + public double getThermalResistance(); + + /** + * The higher the capacity, the more heat can be 'stored'. This means that an object with a high capacity can heat up an object with a lower + * capacity without losing any significant amount of temperature. + * @param capacity + */ + public void setThermalCapacity(double capacity); + + public double getThermalCapacity(); + + public void writeToNBT(NBTTagCompound tag); + + public void readFromNBT(NBTTagCompound tag); + + /** + * Adds heat (= deltaT * Thermal Capacity) to this exchanger. negative values will remove heat. + * @param amount + */ + public void addHeat(double amount); + +} diff --git a/src/api/java/pneumaticCraft/api/PneumaticRegistry.java b/src/api/java/pneumaticCraft/api/PneumaticRegistry.java new file mode 100644 index 00000000..f3254829 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/PneumaticRegistry.java @@ -0,0 +1,158 @@ +package pneumaticCraft.api; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; +import pneumaticCraft.api.client.pneumaticHelmet.IBlockTrackEntry; +import pneumaticCraft.api.client.pneumaticHelmet.IEntityTrackEntry; +import pneumaticCraft.api.client.pneumaticHelmet.IHackableBlock; +import pneumaticCraft.api.client.pneumaticHelmet.IHackableEntity; +import pneumaticCraft.api.drone.ICustomBlockInteract; +import pneumaticCraft.api.drone.IPathfindHandler; +import pneumaticCraft.api.item.IInventoryItem; + +/** + * This class can be used to register and access various things to and from the mod. + */ +public class PneumaticRegistry{ + /** + * This field, which is initialized in PneumaticCraft's preInit, will give you access to various registration and access options. + * @deprecated This field isn't going to be removed, but it'll be marked private. use getInstance(). + */ + @Deprecated + public static IPneumaticCraftInterface instance; + + public static IPneumaticCraftInterface getInstance(){ + return instance; + } + + public static void init(IPneumaticCraftInterface inter){ + if(instance == null) instance = inter;//only allow initialization once; by PneumaticCraft + } + + public static interface IPneumaticCraftInterface{ + + /* + * ------------- Pneumatic Helmet -------------- + */ + + public void registerEntityTrackEntry(Class entry); + + public void registerBlockTrackEntry(IBlockTrackEntry entry); + + public void addHackable(Class entityClazz, Class iHackable); + + public void addHackable(Block block, Class iHackable); + + /** + * Returns a list of all current successful hacks of a given entity. This is used for example in Enderman hacking, so the user + * can only hack an enderman once (more times wouldn't have any effect). This is mostly used for display purposes. + * @param entity + * @return empty list if no hacks. + */ + public List getCurrentEntityHacks(Entity entity); + + /* + * ------------- Drones -------------- + */ + + /** + * Normally drones will pathfind through any block that doesn't have any collisions (Block#getBlocksMovement returns true). + * With this method you can register custom blocks to allow the drone to pathfind through them. If the block requires any special + * handling, like allow pathfinding on certain conditions, you can pass a IPathFindHandler with the registry. + * @param block + * @param handler can be null, to always allow pathfinding through this block. + */ + public void addPathfindableBlock(Block block, IPathfindHandler handler); + + /** + * This will add a puzzle piece that has only a Area white- and blacklist parameter (similar to a GoTo piece). + * It will do the specified behaviour. This can be used to create energy import/export widgets. + * @param interactor + */ + public void registerCustomBlockInteractor(ICustomBlockInteract interactor); + + /** + * Will spawn in a Drone a distance away from the given coordinate. The drone is programmed to travel to go to 5 blocks above the specified + * y level, and drop the deliveredStacks. When there isn't a clear path for the items to fall these 5 blocks the Drone will deliver at a + * y level above the specified y that _is_ clear. If no clear blocks can be found (when there are only solid blocks), the Drone will + * drop the items very high up in the air instead, and drop them there. + * + * When the Drone is tried to be catched by a player (by wrenching it), the drone will only the drop the items that it was delivering (or + * none if it dropped those items already). The Drone itself never will be dropped. + * + * @param x + * @param y + * @param z + * @param deliveredStacks stacks that are delivered by the drone. When no stacks, or more than 65 stacks are given, this will generate a IllegalArgumentException. + * @return the drone. You can use this to set a custom name for example (defaults to "Amazon Delivery Drone"). + */ + public EntityCreature deliverItemsAmazonStyle(World world, int x, int y, int z, ItemStack... deliveredStacks); + + /* + * --------------- Items ------------------- + */ + /** + * See {@link pneumaticCraft.api.item.IInventoryItem} + * @param handler + */ + public void registerInventoryItem(IInventoryItem handler); + + /* + * ----------------- Heat System -------------- + */ + public IHeatExchangerLogic getHeatExchangerLogic(); + + public void registerBlockExchanger(Block block, double temperature, double thermalResistance); + + /* + * ---------------- Power Generation ----------- + */ + + /** + * Adds a burnable liquid to the Liquid Compressor's available burnable fuels. + * @param fluid + * @param mLPerBucket the amount of mL generated for 1000mB of the fuel. As comparison, one piece of coal generates 16000mL in an Air Compressor. + */ + public void registerFuel(Fluid fluid, int mLPerBucket); + + /* + * --------------- Misc ------------------- + */ + + /** + * Returns the amount of Security Stations that disallow interaction with the given coordinate for the given player. + * Usually you'd disallow interaction when this returns > 0. + * @param world + * @param x + * @param y + * @param z + * @param player + * @param showRangeLines When true, any Security Station that prevents interaction will show the line grid (server --> client update is handled internally). + * @return The amount of Security Stations that disallow interaction for the given player. + * This method throws an IllegalArgumentException when tried to be called from the client side! + */ + public int getProtectingSecurityStations(World world, int x, int y, int z, EntityPlayer player, boolean showRangeLines); + + /** + * Use this to register ISimpleBlockRenderHandler render id's of full blocks, those of which should be able to be used for the Pneumatic Door Base camouflage. + * @param id + */ + public void registerConcealableRenderId(int id); + + /** + * Used to register a liquid that represents liquid XP (like MFR mob essence, OpenBlocks liquid XP). + * This is used in the Aerial Interface to pump XP in/out of the player. + * @param fluid + * @param liquidToPointRatio The amount of liquid (in mB) used to get one XP point. In OpenBlocks this is 20 (mB/point). + */ + public void registerXPLiquid(Fluid fluid, int liquidToPointRatio); + + } +} diff --git a/src/api/java/pneumaticCraft/api/actuator/IActuator.java b/src/api/java/pneumaticCraft/api/actuator/IActuator.java new file mode 100644 index 00000000..93ea61a2 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/actuator/IActuator.java @@ -0,0 +1,32 @@ +package pneumaticCraft.api.actuator; + +import java.util.List; + +import net.minecraft.tileentity.TileEntity; + +public interface IActuator{ + /** + * Same as {@link pneumaticCraft.api.universalSensor.ISensorSetting#getSensorPath()} + * @return + */ + public String getSensorPath(); + + /** + * When returned true, the GUI will enable the textbox writing, otherwise not. + * @return + */ + public boolean needsTextBox(); + + /** + * Should return the description of this sensor displayed in the GUI stat. Information should at least include + * when this sensor emits redstone and how (analog (1 through 15), or digital). + * @return + */ + public List getDescription(); + + /** + * + * @param universalActuator + */ + public void actuate(TileEntity universalActuator); +} diff --git a/src/api/java/pneumaticCraft/api/block/BlockSupplier.java b/src/api/java/pneumaticCraft/api/block/BlockSupplier.java new file mode 100644 index 00000000..0e35540d --- /dev/null +++ b/src/api/java/pneumaticCraft/api/block/BlockSupplier.java @@ -0,0 +1,77 @@ +package pneumaticCraft.api.block; + +import net.minecraft.block.Block; +import cpw.mods.fml.common.registry.GameRegistry; + +public class BlockSupplier{ + // private static Class blockClass; + + /** + * @param blockName + * @return + */ + public static Block getBlock(String blockName){ + return GameRegistry.findBlock("PneumaticCraft", blockName); + /*try { + if(blockClass == null) blockClass = Class.forName("pneumaticCraft.common.block.Blockss"); + return (Block)blockClass.getField(blockName).get(null); + } catch(Exception e) { + System.err.println("[PneumaticCraft API] Block supply failed for block: " + blockName); + return null; + }*/ + } + + /* + The following is a list of all the block names that can be passed as argument in getBlock(String) to get a PneumaticCraft block. + + + pressureTube meta = tube type + airCompressor + airCannon + pressureChamberWall meta < 6 ? wall : window + pressureChamberValve + pressureChamberInterface + squidPlant + fireFlower + creeperPlant + slimePlant + rainPlant + enderPlant + lightningPlant + adrenalinePlant + burstPlant + potionPlant + repulsionPlant + heliumPlant + flyingFlower + musicPlant + propulsionPlant + chopperPlant + chargingStation + elevatorBase + elevatorFrame + vacuumPump + pneumaticDoorBase + pneumaticDoor + assemblyPlatform + assemblyIOUnit + assemblyDrill + assemblyLaser + assemblyController + advancedPressureTube meta = tube type (like 'pressureTube') + compressedIron + uvLightBox + etchingAcid + securityStation + universalSensor + pneumaticGenerator + electricCompressor + pneumaticEngine + kineticCompressor + aerialInterface + electrostaticCompressor + aphorismTile + omnidirectionalHopper + + */ +} diff --git a/src/api/java/pneumaticCraft/api/block/IPneumaticWrenchable.java b/src/api/java/pneumaticCraft/api/block/IPneumaticWrenchable.java new file mode 100644 index 00000000..5b666d49 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/block/IPneumaticWrenchable.java @@ -0,0 +1,14 @@ +package pneumaticCraft.api.block; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +/** + * Should be implemented by any block that allows to be rotated by a Pneumatic Wrench. It uses almost the same + * rotate method as the Vanilla (Forge) method. However it uses energy to rotate (when rotateBlock() return true). + */ +public interface IPneumaticWrenchable{ + + public boolean rotateBlock(World world, EntityPlayer player, int x, int y, int z, ForgeDirection side); +} diff --git a/src/api/java/pneumaticCraft/api/client/GuiAnimatedStatSupplier.java b/src/api/java/pneumaticCraft/api/client/GuiAnimatedStatSupplier.java new file mode 100644 index 00000000..4f88f0f2 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/GuiAnimatedStatSupplier.java @@ -0,0 +1,49 @@ +package pneumaticCraft.api.client; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.item.ItemStack; + +/** + * With this class you can retrieve new instances of the PneumaticCraft's IGuiAnimatedStat implementation. You can use these in Gui's as + * well as anywhere you like. When you use these in Gui's you need to pass a valid GuiScreen instance, if you don't you can just pass + * null. + */ +public class GuiAnimatedStatSupplier{ + private static Class animatedStatClass; + + public static IGuiAnimatedStat getAnimatedStat(GuiScreen gui, int backgroundColor){ + return getAnimatedStat(new Class[]{GuiScreen.class, int.class}, gui, backgroundColor); + } + + /** + * Returns a GuiAnimatedStat which uses an itemstack as static icon. + * @param gui + * @param iconStack + * @param backgroundColor + * @return + */ + public static IGuiAnimatedStat getAnimatedStat(GuiScreen gui, ItemStack iconStack, int backgroundColor){ + return getAnimatedStat(new Class[]{GuiScreen.class, int.class, ItemStack.class}, gui, backgroundColor, iconStack); + } + + /** + * Returns a GuiAnimatedStat which uses a texture location as static icon. + * @param gui + * @param iconTexture / text + * @param backgroundColor + * @return + */ + public static IGuiAnimatedStat getAnimatedStat(GuiScreen gui, String iconTexture, int backgroundColor){ + return getAnimatedStat(new Class[]{GuiScreen.class, int.class, String.class}, gui, backgroundColor, iconTexture); + } + + private static IGuiAnimatedStat getAnimatedStat(Class[] constructorClasses, Object... constructorParameters){ + try { + if(animatedStatClass == null) animatedStatClass = Class.forName("pneumaticCraft.client.gui.widget.GuiAnimatedStat"); + return (IGuiAnimatedStat)animatedStatClass.getConstructor(constructorClasses).newInstance(constructorParameters); + } catch(Exception e) { + System.err.println("Failed to retrieve an GuiAnimatedStat instance from PneumaticCraft."); + } + return null; + } +} diff --git a/src/api/java/pneumaticCraft/api/client/GuiElementRenderer.java b/src/api/java/pneumaticCraft/api/client/GuiElementRenderer.java new file mode 100644 index 00000000..ff590de2 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/GuiElementRenderer.java @@ -0,0 +1,32 @@ +package pneumaticCraft.api.client; + +import java.lang.reflect.Method; + +import net.minecraft.client.gui.FontRenderer; + +public class GuiElementRenderer{ + private static Method drawGaugeMethod; + + /** + * Draws a Pressure Gauge, the same which is also used in many PneumaticCraft applications. + * @param fontRenderer fontrenderer used to draw the numbers of the pressure gauge. + * @param minPressure The minimal pressure that needs to be displayed (this is -1 in most applications). + * @param maxPressure The maximal pressure that needs to be rendererd (this is 7 for tier one machines, and 25 for tier two). + * @param dangerPressure The transition pressure from green to red (this is 5 for tier one, and 29 for tier two machines). + * @param minWorkingPressure The transition pressure from yellow to green (variates per machine). + * @param currentPressure The pressure that the needle should point to. + * @param xPos x position of the gauge. + * @param yPos y position of the gauge. + * @param zLevel z position of the gauge (Gui#zLevel, -90, for in normal GUI's). + */ + public static void drawPressureGauge(FontRenderer fontRenderer, float minPressure, float maxPressure, float dangerPressure, float minWorkingPressure, float currentPressure, int xPos, int yPos, float zLevel){ + try { + if(drawGaugeMethod == null) { + drawGaugeMethod = Class.forName("pneumaticCraft.client.gui.GuiUtils").getMethod("drawPressureGauge", FontRenderer.class, float.class, float.class, float.class, float.class, float.class, int.class, int.class, float.class); + } + drawGaugeMethod.invoke(null, fontRenderer, minPressure, maxPressure, dangerPressure, minWorkingPressure, currentPressure, xPos, yPos, zLevel); + } catch(Exception e) { + System.err.println("Failed to render a Pressure Gauge from PneumaticCraft."); + } + } +} diff --git a/src/api/java/pneumaticCraft/api/client/IGuiAnimatedStat.java b/src/api/java/pneumaticCraft/api/client/IGuiAnimatedStat.java new file mode 100644 index 00000000..15d55c71 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/IGuiAnimatedStat.java @@ -0,0 +1,179 @@ +package pneumaticCraft.api.client; + +import java.awt.Rectangle; +import java.util.List; + +/** + * This interface doesn't have to be implemented. In PneumaticCraft there already is one class which implements this interface + * which is used many times in PneumaticCraft (GUI stats, Pneumatic Helmet 2D and 3D stats). You can get an instance of this + * class as well. Information about this you can find in GuiAnimatedStatSupplier.java. Implementing your own version of + * animated stats can be implemented as well via this interface, and they will interact with the PneumaticCraft GuiAnimatedStats + * if you implement it correctly. + */ + +public interface IGuiAnimatedStat{ + + /** + * When you call this method with a set of coordinates representing the button location and dimensions, you'll get + * these parameters back scaled to the GuiAnimatedStat's scale. + * @param origX Button start X. + * @param origY Button start Y. + * @param width Button width. + * @param height Button height. + * @return rectangle containing the new location and dimensions. + */ + public Rectangle getButtonScaledRectangle(int origX, int origY, int width, int height); + + /** + * When passed 0.5F for example, the text of the stat will be half as big (so more text can fit into a certain area). + * @param scale + */ + public void scaleTextSize(float scale); + + /** + * Returns true if the statistic expands to the left. + * @return + */ + public boolean isLeftSided(); + + /** + * Returns true if the statistic is done with expanding (when text will be displayed). + * @return + */ + public boolean isDoneExpanding(); + + /** + * Pass true if the statistic should expand to the left, otherwise false. + * @param leftSided + */ + public void setLeftSided(boolean leftSided); + + /** + * Sets the main text of this stat. Every line should be stored in a seperate list element. Upon rendering, + * EnumChatFormattings will be respected. When you call this method, Too long lines will be divided into multiple shorter ones + * to fit in the GUI. + * @param text + * @return this, so you can chain calls. + */ + public IGuiAnimatedStat setText(List text); + + /** + * Sets the line to a single line. Upon rendering, + * EnumChatFormattings will be respected. When you call this method, Too long lines will be divided into multiple shorter ones + * to fit in the GUI. + * @param text + * @return this, so you can chain calls. + */ + public IGuiAnimatedStat setText(String text); + + /** + * Sets the main text of this stat. Every line should be stored in a seperate list element. Upon rendering, + * EnumChatFormattings will be respected. This version of the text setting doesn't handle too long lines. + * @param text + */ + public void setTextWithoutCuttingString(List text); + + /** + * Sets the title of this stat. It will automatically get the yellow color assigned. + * @param title + */ + public void setTitle(String title); + + /** + * Returns the title of this stat (obviously without color prefix). + * @return + */ + public String getTitle(); + + /** + * Defines what dimensions the stat should have when it is not expanded (default 17x17) and resets the stat to these dimensions. + * Used in PneumaticCraft by the block/entity tracker stats, they are 0x0 when not expanded so it looks like they expand + * (and appear) from nothing. + * @param minWidth + * @param minHeight + */ + public void setMinDimensionsAndReset(int minWidth, int minHeight); + + /** + * When this stat gets a parent stat assigned, the y of this stat will be the same as the parent's plus this stat's + * baseY. This will cause this stat to move up and down when the parent's stat expands/moves. + * @param stat + */ + public void setParentStat(IGuiAnimatedStat stat); + + /** + * Sets the x location of this stat. + * @param x + */ + public void setBaseX(int x); + + /** + * Sets the base Y of this stat. + * @param y + */ + public void setBaseY(int y); + + /** + * Returns the real Y of this stat. This is the same as getBaseY when there is no parent stat, but if there is this method + * returns the value described in setParentStat(IGuiAnimatedStat stat). + * @return + */ + public int getAffectedY(); + + public int getBaseX(); + + public int getBaseY(); + + /** + * Returns the Y size of this stat. + * @return + */ + public int getHeight(); + + /** + * Returns the X size of this stat. + * @return + */ + public int getWidth(); + + public Rectangle getBounds(); + + /** + * This method should be called every game tick to update the logic of the stat (expanding of the stat). + */ + public void update(); + + /** + * Should be called every render tick when and where you want to render the stat. + * @param mouseX + * @param mouseY + * @param partialTicks + */ + public void render(int mouseX, int mouseY, float partialTicks); + + /** + * This method will handle mouse clicks. This will handle open/closing of the stat when the mouse clicks it. + * @param x + * @param y + * @param button + * @return + */ + public void onMouseClicked(int x, int y, int button); + + /** + * Forces the stat to close. + */ + public void closeWindow(); + + /** + * Forces the stat to expand. + */ + public void openWindow(); + + /** + * Returns true if the stat is expanding. + * @return + */ + public boolean isClicked(); + +} diff --git a/src/api/java/pneumaticCraft/api/client/assemblymachine/AssemblyRenderOverriding.java b/src/api/java/pneumaticCraft/api/client/assemblymachine/AssemblyRenderOverriding.java new file mode 100644 index 00000000..1816dc5b --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/assemblymachine/AssemblyRenderOverriding.java @@ -0,0 +1,55 @@ +package pneumaticCraft.api.client.assemblymachine; + +import java.util.HashMap; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class AssemblyRenderOverriding{ + public static final HashMap renderOverrides = new HashMap(); + + public static void addRenderOverride(Block block, IAssemblyRenderOverriding renderOverride){ + renderOverrides.put(Block.getIdFromBlock(block), renderOverride); + } + + public static void addRenderOverride(Item item, IAssemblyRenderOverriding renderOverride){ + renderOverrides.put(Item.getIdFromItem(item), renderOverride); + } + + public static interface IAssemblyRenderOverriding{ + /** + * This method will be called just before the IO Unit's held stack is being rendered. You can insert GL11 calls here to + * rotate the model for example. push and pop matrices are not needed, this is done for you. + * You can also choose to do the whole rendering yourself, you'll need to return false then to indicate that + * PneumaticCraft shouldn't render the item. + * @param renderedStack itemStack that is being rendered + * @return true if PneumaticCraft should render the item (after your changes), or false to cancel rendering. + */ + public boolean applyRenderChangeIOUnit(ItemStack renderedStack); + + /** + * Same deal as with the applyRenderChangeIOUnit(), but now for the Assembly Platform. + * @param renderedStack itemStack that is being rendered + * @return true if PneumaticCraft should render the item (after your changes), or false to cancel rendering. + */ + public boolean applyRenderChangePlatform(ItemStack renderedStack); + + /** + * Should return the distance the claw travels before it is gripped to the stack. + * By default it's 0.0875F for items and 0.00625F for blocks, 0.09375 when the claw is completely closed. + * @param renderedStack + * @return + */ + public float getIOUnitClawShift(ItemStack renderedStack); + + /** + * Should return the distance the claw travels before it is gripped to the stack. + * By default it's 0.0875F for items and 0.00625F for blocks, 0.09375 when the claw is completely closed. + * @param renderedStack + * @return + */ + public float getPlatformClawShift(ItemStack renderedStack); + + } +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IBlockTrackEntry.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IBlockTrackEntry.java new file mode 100644 index 00000000..6d9e1fe0 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IBlockTrackEntry.java @@ -0,0 +1,80 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public interface IBlockTrackEntry{ + /** + * This method should return true if the coordinate checked is one that + * should be tracked. Most entries will just return true when the blockID is + * the one that they track. + * + * @param world + * The world that is examined. + * @param x + * The x coordinate of the block examined. + * @param y + * The y coordinate of the block examined. + * @param z + * The z coordinate of the block examined. + * @param block + * The block of the current coordinate. This will save you a + * call to World.getBlock(). + * @param te The TileEntity at this x,y,z. + * @return true if the coordinate should be tracked by this BlockTrackEntry. + */ + public boolean shouldTrackWithThisEntry(IBlockAccess world, int x, int y, int z, Block block, TileEntity te); + + /** + * This method defines if the block should be updated by the server (each 5 + * seconds). This is specifically aimed at Tile Entities, as the server will + * send an NBT packet. This method returns true at for instance Chests and + * Mob Spawners, to get the inventory at the client side and the time to the + * next spawn respectively. + * @param te The TileEntity at the currently checked location. + * + * @return true if the Tile Entity should be updated, or false when it + * doesn't have to. + */ + public boolean shouldBeUpdatedFromServer(TileEntity te); + + /** + * The return of this method defines at how many tracked blocks of this type + * the HUD should stop displaying text at the tracked blocks of this type. + * + * @return amount of blocks the HUD should stop displaying the block info. + */ + public int spamThreshold(); + + /** + * This method is called each render tick to retrieve the blocks additional + * information. The method behaves the same as the addInformation method in + * the Item class. This method only will be called if + * shouldTrackWithThisEntry() returned true and the player hovers over the + * coordinate. + * + * @param world + * The world the block is in. + * @param x + * The x coordinate the block is at. + * @param y + * The y coordinate the block is at. + * @param z + * The z coordinate the block is at. + * @param te The TileEntity at the x,y,z. + * @param infoList + * The list of lines to display. + */ + public void addInformation(World world, int x, int y, int z, TileEntity te, List infoList); + + /** + * This method is called when displaying the currently tracked blocks. + * Will be tried to be mapped to the localization file first. + * @return the name of the group of this entry. + */ + public String getEntryName(); +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IEntityTrackEntry.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IEntityTrackEntry.java new file mode 100644 index 00000000..65c2b79e --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IEntityTrackEntry.java @@ -0,0 +1,49 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import java.util.List; + +import net.minecraft.entity.Entity; + +/** + * Implement this class and register it by adding it to the entityTrackEntries class. + * There needs to be a parameterless constructor. For every entity that's applicable for this definition, an instance is created. + */ +public interface IEntityTrackEntry{ + /** + * Return true if you want to add a tooltip for the given entity. + * @param entity + * @return + */ + public boolean isApplicable(Entity entity); + + /** + * Add info to the tab. This is only called when isApplicable returned true. + * @param entity + * @param curInfo + */ + public void addInfo(Entity entity, List curInfo); + + /** + * Update is called every (client) tick, and can be used to update something like a timer (used for the Creeper countdown). + * @param entity + */ + public void update(Entity entity); + + /** + * Called every render tick, this method can be used to render additional info. Used for Drone AI visualisation. + * @param entity + * @param partialTicks TODO + */ + public void render(Entity entity, float partialTicks); + + /** + * Just a basic implementation class that can be used if an update and render method isn't needed. + */ + public static abstract class EntityTrackEntry implements IEntityTrackEntry{ + @Override + public void update(Entity entity){} + + @Override + public void render(Entity entity, float partialTicks){} + } +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IGuiScreen.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IGuiScreen.java new file mode 100644 index 00000000..8f98938d --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IGuiScreen.java @@ -0,0 +1,15 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import java.util.List; + +import net.minecraft.client.gui.FontRenderer; + +/** + * Just an interface to give access to GuiSreen#buttonList and GuiScreen#fontRenderer. An instance of this class can + * safely be casted to GuiSreen if needed. + */ +public interface IGuiScreen{ + public List getButtonList(); + + public FontRenderer getFontRenderer(); +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableBlock.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableBlock.java new file mode 100644 index 00000000..9dc7863d --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableBlock.java @@ -0,0 +1,69 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +/** +Use this interface to specify any hackable block. When it's your block, you can simply implement this interface in the +block's class. If you don't have access to the class (vanilla blocks), you can implement this interface in a separate class +and register it using PneumaticRegistry.registry.addHackable(blockClass, IHackableBlockClass). With the former way there will be one instance only per type. In the latter, there will +be an IHackableBlock instance for every block. +*/ +public interface IHackableBlock{ + /** + * Should return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime after a server restart. + * Null is a valid return: afterHackTick will not be triggered at all in that case. + * + * CURRENTLY THIS ISN'T IMPLEMENTED. + * @return + */ + public String getId(); + + /** + Returning true will allow the player to hack this block. This can be used to only allow hacking on certain conditions. + */ + public boolean canHack(IBlockAccess world, int x, int y, int z, EntityPlayer player); + + /** + Add info that is displayed on the tracker tooltip here. Text like "Hack to explode" can be added. + This method is only called when canHack(World, int, int, int) returned true. + The added lines automatically will be tried to get localized. + */ + public void addInfo(World world, int x, int y, int z, List curInfo, EntityPlayer player); + + /** + * Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true. + * Things like "Neutralized". + * The added lines automatically will be tried to get localized. + * @param entity + * @param curInfo + * @param player + */ + public void addPostHackInfo(World world, int x, int y, int z, List curInfo, EntityPlayer player); + + /** + Return the time it takes to hack this block in ticks. For more powerful hacks, a longer required hacking time is adviced. + */ + public int getHackTime(IBlockAccess world, int x, int y, int z, EntityPlayer player); + + /** + When the player hacked the block for getHackTime(World, int, int, int) ticks this will be called on both server and client side. + */ + public void onHackFinished(World world, int x, int y, int z, EntityPlayer player); + + /** + * Called every tick after the hacking finished (on both server and client side). Returning true will keep this going (for mob spawners, to keep them neutralized), + * or false to stop ticking (for door/lever hacking). + * + * CURRENTLY THIS METHOD WILL STOP GETTING INVOKED AFTER A SERVER RESTART! + * @param world + * @param x + * @param y + * @param z + * @return + */ + public boolean afterHackTick(World world, int x, int y, int z); +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableEntity.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableEntity.java new file mode 100644 index 00000000..e8aa236c --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IHackableEntity.java @@ -0,0 +1,59 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +/** +Use this interface to specify any hackable entity. When it's your entity, you can simply implement this interface in the +entity's class. If you don't have access to the class (vanilla entities), you can implement this interface in a separate class +and register it using PneumaticRegistry.registry.addHackable(entityClass, IHackableEntityClass). In both ways there will be an IHackableEntity instance for every entity. +*/ +public interface IHackableEntity{ + + /** + * Should return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime after a server restart. + * Null is a valid return: afterHackTick will not be triggered at all in that case. + * @return + */ + public String getId(); + + /** + Returning true will allow the player to hack this entity. This can be used to only allow hacking on certain conditions. + */ + public boolean canHack(Entity entity, EntityPlayer player); + + /** + Add info that is displayed on the tracker tooltip here. Text like "Hack to explode" can be added. + This method is only called when canHack(Entity) returned true. + The added lines automatically will be tried to get localized. + */ + public void addInfo(Entity entity, List curInfo, EntityPlayer player); + + /** + * Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true. + * Things like "Neutralized". + * The added lines automatically will be tried to get localized. + * @param entity + * @param curInfo + * @param player + */ + public void addPostHackInfo(Entity entity, List curInfo, EntityPlayer player); + + /** + Return the time it takes to hack this entity in ticks. For more powerful hacks, a longer required hacking time is adviced. + */ + public int getHackTime(Entity entity, EntityPlayer player); + + /** + When the player hacked the entity for getHackTime(Entity) ticks this will be called on both client and server side. + */ + public void onHackFinished(Entity entity, EntityPlayer player); + + /** + * Called every tick after the hacking finished. Returning true will keep this going (for mob spawners, to keep them neutralized), + * or false to stop ticking (for door/lever hacking). + */ + public boolean afterHackTick(Entity entity); +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IOptionPage.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IOptionPage.java new file mode 100644 index 00000000..2212749e --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IOptionPage.java @@ -0,0 +1,46 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +/** + * The Option Page is the page you see when you press 'F' (by default) with a Pneumatic Helmet equipped. You can register this class + * by returning a new instance of this class at {@link IUpgradeRenderHandler#getGuiOptionsPage()} + */ +public interface IOptionPage{ + + /** + * This string is used in the text of the button of this page. + * @return + */ + public String getPageName(); + + /** + * Here you can initialize your buttons and stuff like with a GuiScreen. For buttons, don't use button id 100 and up, as they + * will be used as selection buttons for other option pages in the main GuiScreen. + * @param gui + */ + public void initGui(IGuiScreen gui); + + /** + * Same as GuiScreen#actionPerformed(GuiButton). + * @param button + */ + public void actionPerformed(GuiButton button); + + /** + * Same as {@link GuiScreen#drawScreen(int, int, float)} + * Here you can render additional things like text. + * @param x + * @param y + * @param partialTicks + */ + public void drawScreen(int x, int y, float partialTicks); + + /** + * Same as GuiScreen#keyTyped(char, int). + * @param ch + * @param key + */ + public void keyTyped(char ch, int key); +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IUpgradeRenderHandler.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IUpgradeRenderHandler.java new file mode 100644 index 00000000..d273baf3 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/IUpgradeRenderHandler.java @@ -0,0 +1,92 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.config.Configuration; +import pneumaticCraft.api.client.IGuiAnimatedStat; + +/** + * To add upgrades for in the Pneumatic Helmet implement this interface. You can add members to this class, however these can only + * be client sided members as this class will be used as singleton. Therefore, only one of these instances exist at the server side + * so any member that is used server side will affect every player. + * + */ +public interface IUpgradeRenderHandler{ + + /** + * Return here the name of the upgrade. This is displayed in the formatting [upgradeName] + " " + "found"/"not found" on + * initialization of the helmet. + * @return + */ + public String getUpgradeName(); + + /** + * Being called from PneumaticCraft's config handler, you can use this method to read settings like stat positions + * @param config PneumaticCraft's config file. + */ + public void initConfig(Configuration config); + + /** + * When called this should save the settings to the config file. Called when changed a setting. When you want to use + * PneumaticCraft's config file, save a reference of it somewhere in this class when the config gets passed in the + * initConfig() method (this always will be called first). + */ + public void saveToConfig(); + + /** + * This method will be called every client tick, and should be used to update logic like the tracking and velocities of stuff. + * @param player + * @param rangeUpgrades amount of range upgrades installed in the helmet. + */ + public void update(EntityPlayer player, int rangeUpgrades); + + /** + * Called in the 3D render stage (renderWorldLastEvent) + * @param partialTicks + */ + public void render3D(float partialTicks); + + /** + * Called in the 2D render stage (Render Tick Handler) + * @param partialTicks + * @param helmetEnabled is true when isEnabled() returned true earlier. Can be used to close AnimatedStats for instance. + * However this is already handled if you return an AnimatedStat in getAnimatedStat(). + */ + public void render2D(float partialTicks, boolean helmetEnabled); + + /** + * You can return a GuiAnimatedStat here, that the HUDHandler will pick up and render. It also automatically opens and closes + * the stat when needed. The GuiMoveStat uses this method to retrieve the to be moved stat. + * @return null if no stat used. + */ + public IGuiAnimatedStat getAnimatedStat(); + + /** + * Should return true if this upgrade handler is enabled for the given stacks placed in the helmet. + * @param upgradeStacks + * @return + */ + public boolean isEnabled(ItemStack[] upgradeStacks); + + /** + * Returns the usage in mL/tick when this upgrade handler is enabled. + * @param rangeUpgrades amount of range upgrades installed in the helmet. + * @param player + * @return usage in mL/tick + */ + public float getEnergyUsage(int rangeUpgrades, EntityPlayer player); + + /** + * Called when (re-)equipped the helmet this method should be used to clear information like current tracked entities. + * So clearing lists and other references as this handler should re-acquire when reinstalled. + */ + public void reset(); + + /** + * When you have some options for your upgrade handler you could return a new instance of an IOptionsPage. + * When you do so, it will automatically get picked up by the options handler, and it will be added to the + * options GUI when this upgrade returns true when calling isEnabled(). Returning null is valid. + * @return + */ + public IOptionPage getGuiOptionsPage(); +} diff --git a/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/RenderHandlerRegistry.java b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/RenderHandlerRegistry.java new file mode 100644 index 00000000..acb1cdc5 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/client/pneumaticHelmet/RenderHandlerRegistry.java @@ -0,0 +1,10 @@ +package pneumaticCraft.api.client.pneumaticHelmet; + +import java.util.List; + +public class RenderHandlerRegistry{ + /** + * With this field you can register your render handlers. This field is initialized in the PreInit phase of PneumaticCraft's loading phase. + */ + public static List renderHandlers; +} diff --git a/src/api/java/pneumaticCraft/api/drone/DroneConstructingEvent.java b/src/api/java/pneumaticCraft/api/drone/DroneConstructingEvent.java new file mode 100644 index 00000000..801c55a4 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/drone/DroneConstructingEvent.java @@ -0,0 +1,11 @@ +package pneumaticCraft.api.drone; + +import cpw.mods.fml.common.eventhandler.Event; + +public class DroneConstructingEvent extends Event{ + public IDrone drone; + + public DroneConstructingEvent(IDrone drone){ + this.drone = drone; + } +} diff --git a/src/api/java/pneumaticCraft/api/drone/IBlockInteractHandler.java b/src/api/java/pneumaticCraft/api/drone/IBlockInteractHandler.java new file mode 100644 index 00000000..5e4eb245 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/drone/IBlockInteractHandler.java @@ -0,0 +1,26 @@ +package pneumaticCraft.api.drone; + +/** + * DON'T IMPLEMENT, just use + */ +public interface IBlockInteractHandler{ + + /** + * Returns a boolean[6] of all sides. when true, this side is accessible + * @return + */ + public boolean[] getSides(); + + public boolean useCount(); + + public void decreaseCount(int count); + + public int getRemainingCount(); + + /** + * When invoked, the drone will abort searching the area. Could be used to abort early when full of RF energy for example, when importing RF. + * (It's useless to search any further) + */ + public void abort(); + +} diff --git a/src/api/java/pneumaticCraft/api/drone/ICustomBlockInteract.java b/src/api/java/pneumaticCraft/api/drone/ICustomBlockInteract.java new file mode 100644 index 00000000..2960425e --- /dev/null +++ b/src/api/java/pneumaticCraft/api/drone/ICustomBlockInteract.java @@ -0,0 +1,45 @@ +package pneumaticCraft.api.drone; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ChunkPosition; + +/** + * Implement this and register it to PneumaticRegistry.registerCustomBlockInteractor(). + * This will add a puzzle piece that has only a Area white- and blacklist parameter (similar to a GoTo piece). + * It will do the specified behaviour. This can be used to create energy import/export widgets. + */ +public interface ICustomBlockInteract{ + + /** + * Should return a unique Id, used in NBT saving and localization. + */ + public String getName(); + + /** + * Should return the puzzle piece texture. Should be a multiple of 80x64 (width x height). I'd recommend starting out with copying the Go To widget texture. + * @return + */ + public ResourceLocation getTexture(); + + /** + * The actual interaction. + * + * For every position in the selected area the drone will visit every block (ordered from closest to furthest). It will call this method with 'simulate = true'. If this method returns true, the drone will navigate to this location, and call this method again with 'simulate = false' It will keep doing this until this method returns false. + * + * When interactHandler.useCount() returns true: + * In the interface of the puzzle piece users can specify a 'use count' and fill in the maximum count they want to use. When not simulating, you should only import/export up to interactHandler.getRemainingCount(), and you should notify the removed/added count by doing interactHandler.decreaseCount(int count). + * + * @param pos current visited location + * @param drone + * @param interactHandler object you can use to use to get accessible sides and give feedback about counts. + * @param simulate will be true when trying to figure out whether or not the drone should navigate to this block, false when next to this block. + * @return + */ + public boolean doInteract(ChunkPosition pos, IDrone drone, IBlockInteractHandler interactHandler, boolean simulate); + + /** + * Used for crafting, categorizes the puzzle piece. + * @return + */ + public int getCraftingColorIndex(); +} diff --git a/src/api/java/pneumaticCraft/api/drone/IDrone.java b/src/api/java/pneumaticCraft/api/drone/IDrone.java new file mode 100644 index 00000000..306bc6c0 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/drone/IDrone.java @@ -0,0 +1,61 @@ +package pneumaticCraft.api.drone; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.ai.EntityAITasks; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.IExtendedEntityProperties; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.IFluidTank; +import pneumaticCraft.api.item.IPressurizable; + +public interface IDrone extends IPressurizable{ + /** + * + * @param upgradeIndex metadata value of the upgrade item + * @return amount of inserted upgrades in the drone + */ + public int getUpgrades(int upgradeIndex); + + public World getWorld(); + + public IFluidTank getTank(); + + public IInventory getInventory(); + + public Vec3 getPosition(); + + public IPathNavigator getPathNavigator(); + + public void sendWireframeToClient(int x, int y, int z); + + public EntityPlayerMP getFakePlayer(); + + public boolean isBlockValidPathfindBlock(int x, int y, int z); + + public void dropItem(ItemStack stack); + + public void setDugBlock(int x, int y, int z); + + public EntityAITasks getTargetAI(); + + public IExtendedEntityProperties getProperty(String key); + + public void setProperty(String key, IExtendedEntityProperties property); + + public void setEmittingRedstone(ForgeDirection orientation, int emittingRedstone); + + public void setName(String string); + + public void setCarryingEntity(Entity entity); + + public Entity getCarryingEntity(); + + public boolean isAIOverriden(); + + public void onItemPickupEvent(EntityItem curPickingUpEntity, int stackSize); +} diff --git a/src/api/java/pneumaticCraft/api/drone/IPathNavigator.java b/src/api/java/pneumaticCraft/api/drone/IPathNavigator.java new file mode 100644 index 00000000..f089bae5 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/drone/IPathNavigator.java @@ -0,0 +1,11 @@ +package pneumaticCraft.api.drone; + +import net.minecraft.entity.Entity; + +public interface IPathNavigator{ + public boolean moveToXYZ(double x, double y, double z); + + public boolean moveToEntity(Entity entity); + + public boolean hasNoPath(); +} diff --git a/src/api/java/pneumaticCraft/api/drone/IPathfindHandler.java b/src/api/java/pneumaticCraft/api/drone/IPathfindHandler.java new file mode 100644 index 00000000..a5bcfabb --- /dev/null +++ b/src/api/java/pneumaticCraft/api/drone/IPathfindHandler.java @@ -0,0 +1,26 @@ +package pneumaticCraft.api.drone; + +import net.minecraft.world.World; + +public interface IPathfindHandler{ + /** + * When returned true, the drone can pathfind through this block. When false it can't. + * @param world + * @param x + * @param y + * @param z + * @return + */ + public boolean canPathfindThrough(World world, int x, int y, int z); + + /** + * CURRENTLY NOT IMPLEMENTED! + * Will be called every tick as long as the drone is < 1 block away from the given coordinate. + * can be used to open a door for a drone for example. + * @param world + * @param x + * @param y + * @param z + */ + public void onPathingThrough(World world, int x, int y, int z); +} diff --git a/src/api/java/pneumaticCraft/api/drone/SpecialVariableRetrievalEvent.java b/src/api/java/pneumaticCraft/api/drone/SpecialVariableRetrievalEvent.java new file mode 100644 index 00000000..83581c81 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/drone/SpecialVariableRetrievalEvent.java @@ -0,0 +1,60 @@ +package pneumaticCraft.api.drone; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.ChunkPosition; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * Fired when a Drone is trying to get a special coordinate, by accessing a variable with '$' prefix. + * These event are posted on the MinecraftForge.EVENT_BUS. + */ +public abstract class SpecialVariableRetrievalEvent extends Event{ + + /** + * The special variable name, with the '$' stripped away. + */ + public final String specialVarName; + + /** + * The returning coordinate + */ + + public SpecialVariableRetrievalEvent(String specialVarName){ + + this.specialVarName = specialVarName; + } + + public static abstract class CoordinateVariable extends SpecialVariableRetrievalEvent{ + public ChunkPosition coordinate; + + public CoordinateVariable(String specialVarName){ + super(specialVarName); + } + + public static class Drone extends CoordinateVariable{ + public final IDrone drone; + + public Drone(IDrone drone, String specialVarName){ + super(specialVarName); + this.drone = drone; + } + } + } + + public static abstract class ItemVariable extends SpecialVariableRetrievalEvent{ + public ItemStack item; + + public ItemVariable(String specialVarName){ + super(specialVarName); + } + + public static class Drone extends ItemVariable{ + public final IDrone drone; + + public Drone(IDrone drone, String specialVarName){ + super(specialVarName); + this.drone = drone; + } + } + } +} diff --git a/src/api/java/pneumaticCraft/api/item/IInventoryItem.java b/src/api/java/pneumaticCraft/api/item/IInventoryItem.java new file mode 100644 index 00000000..b153e022 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/item/IInventoryItem.java @@ -0,0 +1,20 @@ +package pneumaticCraft.api.item; + +import java.util.List; + +import net.minecraft.item.ItemStack; + +/** + * Implement this interface for your items that have an inventory. When you don't have access to the item, just create any old class + * that implements this interface and register an instance of it in PneumaticRegistry. + * This will then will be used in the Pneumatic Helmet's item search. + * + */ +public interface IInventoryItem{ + + /** + * @parm stack: Item that potentially has an inventory. + * @parm curStacks: List of all currently added stacks for this item. Add more stacks in here in your implementation when found the right item. + */ + public void getStacksInItem(ItemStack stack, List curStacks); +} diff --git a/src/api/java/pneumaticCraft/api/item/IPressurizable.java b/src/api/java/pneumaticCraft/api/item/IPressurizable.java new file mode 100644 index 00000000..027aaad1 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/item/IPressurizable.java @@ -0,0 +1,35 @@ +package pneumaticCraft.api.item; + +import net.minecraft.item.ItemStack; + +/** + * Any item implementing this interface will be able to (dis)charge in a Charging Station. + */ +public interface IPressurizable{ + /** + * This method should return the current pressure of the ItemStack given. + * + * @param iStack Stack the pressure is asked from. + * @return Pressure in bar. + */ + public float getPressure(ItemStack iStack); + + /** + * this method is used to charge or discharge a pneumatic item. when the + * value is negative the item should be discharging + * + * @param iStack the ItemStack which has to be (dis)charged. + * @param amount amount in mL that the item is (dis)charging. + */ + public void addAir(ItemStack iStack, int amount); + + /** + * This method should return the maximum pressure of a pneumatic item. If it + * has reached this maximum, it won't explode, but it wouldn't (try to) + * charge either. + * + * @param iStack the stack from which the maximum pressure is asked. + * @return maximum pressure in bar. + */ + public float maxPressure(ItemStack iStack); +} diff --git a/src/api/java/pneumaticCraft/api/item/IProgrammable.java b/src/api/java/pneumaticCraft/api/item/IProgrammable.java new file mode 100644 index 00000000..d00d94c3 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/item/IProgrammable.java @@ -0,0 +1,34 @@ +package pneumaticCraft.api.item; + +import net.minecraft.item.ItemStack; + +/** + * Implement this for items that can get programmed in a Programmer. + * For now the only thing you can do with this is make program storages, later more interaction with programming puzzles is planned. + * Puzzle pieces will be written onto the implementer's itemstack NBT, using the "progWidget" tag. + */ +public interface IProgrammable{ + + /** + * When returned true, this stack is allowed to be programmed. + * Used to allow certain damage values to be programmed while others can't. + * @param stack + * @return + */ + public boolean canProgram(ItemStack stack); + + /** + * When returned true, Programming Puzzles are needed to program this item. When returned false, it's free to program. + * Drones and Network API's return true in PneumaticCraft, Network Storages return false. + * @param stack + * @return + */ + public boolean usesPieces(ItemStack stack); + + /** + * When returned true, the implementing item will get a tooltip added of the summary of puzzles used in the stored program. + * @return + */ + public boolean showProgramTooltip(); + +} diff --git a/src/api/java/pneumaticCraft/api/item/ItemSupplier.java b/src/api/java/pneumaticCraft/api/item/ItemSupplier.java new file mode 100644 index 00000000..93c13fb5 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/item/ItemSupplier.java @@ -0,0 +1,47 @@ +package pneumaticCraft.api.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.registry.GameRegistry; + +public class ItemSupplier{ + public static Item getItem(String itemName){ + return GameRegistry.findItem("PneumaticCraft", itemName); + } + + /* + The following is a list of all the item names that can be passed as argument in getItem(String) to get a PneumaticCraft item. + + GPSTool Currently tracked coordinated is stored in NBT, with 'x', 'y', 'z' being the tag names for the x,y and z positions respectively. + machineUpgrade damage value = upgrade type. + ingotIronCompressed + pressureGauge + stoneBase + cannonBarrel + turbineBlade + plasticPlant damage value = plant type. Mapped the same as Vanilla dye in terms of color. + plastic damage value = plastic type. Mapped the same as Vanilla dye in terms of color. + airCanister implements IPressurizable + vortexCannon implements IPressurizable + pneumaticCylinder + pneumaticHelmet implements IPressurizable + manometer implements IPressurizable + turbineRotor + assemblyProgram damage value = program type. + emptyPCB + unassembledPCB + PCBBlueprint + bucketEtchingAcid + transistor + capacitor + printedCircuitBoard + failedPCB + networkComponent damage value = network component type. + stopWorm + nukeVirus + compressedIronGear + pneumaticWrench implements IPressurizable + + + + */ +} diff --git a/src/api/java/pneumaticCraft/api/package-info.java b/src/api/java/pneumaticCraft/api/package-info.java new file mode 100644 index 00000000..55919456 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/package-info.java @@ -0,0 +1,5 @@ +@API(apiVersion = "1.0", owner = "PneumaticCraft", provides = "PneumaticCraftApi") +package pneumaticCraft.api; + +import cpw.mods.fml.common.API; + diff --git a/src/api/java/pneumaticCraft/api/recipe/AssemblyRecipe.java b/src/api/java/pneumaticCraft/api/recipe/AssemblyRecipe.java new file mode 100644 index 00000000..8c74b4bb --- /dev/null +++ b/src/api/java/pneumaticCraft/api/recipe/AssemblyRecipe.java @@ -0,0 +1,49 @@ +package pneumaticCraft.api.recipe; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class AssemblyRecipe{ + public static List drillRecipes = new ArrayList(); + public static List laserRecipes = new ArrayList(); + public static List drillLaserRecipes = new ArrayList(); + + private final ItemStack input; + private final ItemStack output; + + public AssemblyRecipe(ItemStack input, ItemStack output){ + this.input = input; + this.output = output; + } + + public ItemStack getInput(){ + return input; + } + + public ItemStack getOutput(){ + return output; + } + + public static void addDrillRecipe(Object input, Object output){ + drillRecipes.add(new AssemblyRecipe(getStackFromObject(input), getStackFromObject(output))); + } + + public static void addLaserRecipe(Object input, Object output){ + laserRecipes.add(new AssemblyRecipe(getStackFromObject(input), getStackFromObject(output))); + } + + private static ItemStack getStackFromObject(Object object){ + if(object instanceof Block) { + return new ItemStack((Block)object); + } else if(object instanceof Item) { + return new ItemStack((Item)object); + } else { + return (ItemStack)object; + } + } + +} diff --git a/src/api/java/pneumaticCraft/api/recipe/IPressureChamberRecipe.java b/src/api/java/pneumaticCraft/api/recipe/IPressureChamberRecipe.java new file mode 100644 index 00000000..93eba67c --- /dev/null +++ b/src/api/java/pneumaticCraft/api/recipe/IPressureChamberRecipe.java @@ -0,0 +1,34 @@ +package pneumaticCraft.api.recipe; + +import net.minecraft.item.ItemStack; + +public interface IPressureChamberRecipe{ + + /** + * Returns the threshold which is minimal to craft the recipe. Negative pressures also work. + * @return threshold pressure + */ + public float getCraftingPressure(); + + /** + * This method should return the used items in the recipe when the right items are provided to craft this recipe. + * @param inputStacks + * @return usedStacks, return null when the inputStacks aren't valid for this recipe. + */ + public ItemStack[] isValidRecipe(ItemStack[] inputStacks); + + /** + * When returned true, only the exact same references of the stacks returned by isValidRecipe() will be removed. This is useful + * to remove stacks with a certain NBT value (like Enchanted Books). Return false for normal behaviour. + * @return true if exact stacks should be removed only. + */ + public boolean shouldRemoveExactStacks(); + + /** + * This method will be called when the recipe should output its items. the stacks the recipe output, may be dependent on the input stacks. + * @param removedStacks same reference to the stacks returned by isValidRecipe. + * @param inputStacks. These stacks can be modified (like adding/removing NBT data eg.) + * @return outputStacks. Stacks that will pop 'out of the chamber' + */ + public ItemStack[] craftRecipe(ItemStack[] inputStacks, ItemStack[] removedStacks); +} diff --git a/src/api/java/pneumaticCraft/api/recipe/PressureChamberRecipe.java b/src/api/java/pneumaticCraft/api/recipe/PressureChamberRecipe.java new file mode 100644 index 00000000..5d6b29e5 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/recipe/PressureChamberRecipe.java @@ -0,0 +1,24 @@ +package pneumaticCraft.api.recipe; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; + +public class PressureChamberRecipe{ + public static List chamberRecipes = new ArrayList(); + public static List specialRecipes = new ArrayList(); + + public final ItemStack[] input; + public final ItemStack[] output; + public final float pressure; + public final boolean outputAsBlock; + + public PressureChamberRecipe(ItemStack[] input, float pressureRequired, ItemStack[] output, boolean outputAsBlock){ + this.input = input; + this.output = output; + pressure = pressureRequired; + this.outputAsBlock = outputAsBlock; + } + +} diff --git a/src/api/java/pneumaticCraft/api/tileentity/AirHandlerSupplier.java b/src/api/java/pneumaticCraft/api/tileentity/AirHandlerSupplier.java new file mode 100644 index 00000000..1bf1be74 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/tileentity/AirHandlerSupplier.java @@ -0,0 +1,51 @@ +package pneumaticCraft.api.tileentity; + +import java.lang.reflect.Constructor; + +public class AirHandlerSupplier{ + private static Constructor airHandlerConstructor; + + public static IAirHandler getTierOneAirHandler(int volume){ + return getAirHandler(5F, 7F, volume); + } + + public static IAirHandler getTierTwoAirHandler(int volume){ + return getAirHandler(20F, 25F, volume); + } + + /** + * Returns a new instance of an IAirHandler. This handler handles everything pressurized air related: Air dispersion, + * blowing up when the pressure gets too high, providing a method for releasing air into the atmosphere... + * PROVIDED THAT THE FOLLOWING METHODS ARE FORWARDED TO THIS INSTANCE: + * {@link net.minecraft.tileentity.TileEntity#updateEntity()}, + * {@link net.minecraft.tileentity.TileEntity#writeToNBT(net.minecraft.nbt.NBTTagCompound)} + * {@link net.minecraft.tileentity.TileEntity#readFromNBT(net.minecraft.nbt.NBTTagCompound)} + * {@link net.minecraft.tileentity.TileEntity#validate()} + * @param dangerPressure minimal pressure on which this machine can explode (the yellow to red transition) + * @param criticalPressure the absolute maximum pressure the machine can take 7 bar in tier 1 machines. + * @param maxFlow maximum mL/tick that this machine can disperse. Tier one machines do 50mL/tick while Tier two have 200mL/tick. + * @param volume Volume of the machine's internal storage. These vary from 1000mL for small machines to 10,000mL for the big ones. + * The higher the volume the slower the machine will charge/discharge. + * @return + */ + public static IAirHandler getAirHandler(float dangerPressure, float criticalPressure, int volume){ + IAirHandler airHandler = null; + try { + if(airHandlerConstructor == null) airHandlerConstructor = Class.forName("pneumaticCraft.common.tileentity.TileEntityPneumaticBase").getConstructor(float.class, float.class, int.class); + airHandler = (IAirHandler)airHandlerConstructor.newInstance(dangerPressure, criticalPressure, volume); + } catch(Exception e) { + System.err.println("[PneumaticCraft API] An error has occured whilst trying to get an AirHandler. Here's a stacktrace:"); + e.printStackTrace(); + } + return airHandler; + } + + /** + * Use the version with integer parameters + */ + @Deprecated + public static IAirHandler getAirHandler(float dangerPressure, float criticalPressure, float maxFlow, float volume){ + return getAirHandler(dangerPressure, criticalPressure, (int)volume); + } + +} diff --git a/src/api/java/pneumaticCraft/api/tileentity/IAirHandler.java b/src/api/java/pneumaticCraft/api/tileentity/IAirHandler.java new file mode 100644 index 00000000..72929e90 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/tileentity/IAirHandler.java @@ -0,0 +1,114 @@ +package pneumaticCraft.api.tileentity; + +import java.util.List; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +import org.apache.commons.lang3.tuple.Pair; + +/** + * A way for you to access about everything you need from a pneumatic machine. + * DO NOT IMPLEMENT THIS YOURSELF! Use AirHandlerSupplier to get an instance for your TileEntity, and implement IPneumaticMachine instead. + */ + +public interface IAirHandler extends IManoMeasurable{ + + /** + * -----------Needs to be forwarded by the implementing TileEntity's updateEntity() method. + * Updates the pneumatic machine's logic like air dispersion and checking if it needs to explode. + */ + public void updateEntityI(); + + /** + * -----------Needs to be forwarded by the implementing TileEntity. + * @param nbt + */ + public void readFromNBTI(NBTTagCompound nbt); + + /** + * -----------Needs to be forwarded by the implementing TileEntity. + * @param nbt + */ + public void writeToNBTI(NBTTagCompound nbt); + + /** + * -----------Needs to be forwarded by the implementing TileEntity with itself as parameter. + * @param parent TileEntity that is referencing this air handler. + */ + public void validateI(TileEntity parent); + + /** + * Method to release air in the air. It takes air from a specific side, plays a sound effect, and spawns smoke particles. + * It automatically detects if it needs to release air (when under pressure), suck air (when in vacuum) or do nothing. + * @param side + */ + public void airLeak(ForgeDirection side); + + /** + * Returns a list of all the connecting pneumatics. It takes sides in account. + */ + public List> getConnectedPneumatics(); + + /** + * Adds air to the tank of the given side of this TE. It also updates clients where needed (when they have a GUI opened). + * Deprecated: use the version with the integer parameter now. + * @param amount + * @param side + */ + @Deprecated + public void addAir(float amount, ForgeDirection side); + + public void addAir(int amount, ForgeDirection side); + + /** + * Sets the volume of this TE's air tank. When the volume decreases the pressure will remain the same, meaning air will + * be lost. When the volume increases, the air remains the same, meaning the pressure will drop. + * Used in the Volume Upgrade calculations. + * Deprecated: use the version with the integer parameter now. + * @param newVolume + */ + @Deprecated + public void setVolume(float newVolume); + + public void setVolume(int newVolume); + + public int getVolume(); + + /** + * Returns the pressure at which this TE will explode. + * @return + */ + public float getMaxPressure(); + + public float getPressure(ForgeDirection sideRequested); + + /** + * Returns the amount of air (that has a relation to the pressure: air = pressure * volume) + * @param sideRequested + * @return + */ + public int getCurrentAir(ForgeDirection sideRequested); + + /** + * When your TileEntity is implementing IInventory and has slots that accept PneumaticCraft upgrades, register these slots + * to the air handler by calling this method once on initialization of the TileEntity. Then they'll automatically be used to get Volume/Security upgrades. + * @param upgradeSlots all upgrade slots stored in an array. + */ + public void setUpgradeSlots(int... upgradeSlots); + + public int[] getUpgradeSlots(); + + public int getXCoord(); + + public int getYCoord(); + + public int getZCoord(); + + /** + * Needs to be forwarded from the implementing _Block_! Forward the Block's "onNeighborChange" method to this handler. + */ + public void onNeighborChange(); + +} diff --git a/src/api/java/pneumaticCraft/api/tileentity/IHeatExchanger.java b/src/api/java/pneumaticCraft/api/tileentity/IHeatExchanger.java new file mode 100644 index 00000000..60df395c --- /dev/null +++ b/src/api/java/pneumaticCraft/api/tileentity/IHeatExchanger.java @@ -0,0 +1,24 @@ +package pneumaticCraft.api.tileentity; + +import net.minecraftforge.common.util.ForgeDirection; +import pneumaticCraft.api.IHeatExchangerLogic; + +/** + * Implemented by TileEntities or Blocks which transport heat. Keep in mind that when a Block is implementing it you only can give off a constant + * resistance/temperature (like Lava and Ice). + * @author MineMaarten + * www.minemaarten.com + */ +public interface IHeatExchanger{ + + /** + * Get an instance of IHeatExchangerLogic from PneumaticRegistry.getInstance().getHeatExchangerLogic() and keep a global reference. + * Then return it in this method. You can return different exchanger logics for different sides. Keep in mind that when you change + * a returned logic, you need to create a neighbor block change to notify the differences. You can return null to indicate no heat can + * be exchanged on that side. + * @param side + * @return + */ + public IHeatExchangerLogic getHeatExchangerLogic(ForgeDirection side); + +} diff --git a/src/api/java/pneumaticCraft/api/tileentity/IManoMeasurable.java b/src/api/java/pneumaticCraft/api/tileentity/IManoMeasurable.java new file mode 100644 index 00000000..c5178abe --- /dev/null +++ b/src/api/java/pneumaticCraft/api/tileentity/IManoMeasurable.java @@ -0,0 +1,14 @@ +package pneumaticCraft.api.tileentity; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; + +public interface IManoMeasurable{ + /** + * This method is invoked by the Manometer when a player right-clicks a TE or Entity with this interface implemented. + * @param player that rightclicks the measurable TE, and therefore needs to get the message + * @param curInfo list you can append info to. If you don't append any info no air will be used. + */ + public void printManometerMessage(EntityPlayer player, List curInfo); +} diff --git a/src/api/java/pneumaticCraft/api/tileentity/IPneumaticMachine.java b/src/api/java/pneumaticCraft/api/tileentity/IPneumaticMachine.java new file mode 100644 index 00000000..0e283115 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/tileentity/IPneumaticMachine.java @@ -0,0 +1,30 @@ +package pneumaticCraft.api.tileentity; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IPneumaticMachine{ + + /** + * In your TileEntity class which is implementing this interface you should keep a reference of an IAirHandler. + * You can retrieve one by calling {@link AirHandlerSupplier#getAirHandler(net.minecraft.tileentity.TileEntity, float, float, float, float)}. + * Do this when your TileEntity is initialized, i.e. xCoord,yCoord,zCoord and worldObj have a value. + * In this method you need to return this reference. + * + * IMPORTANT: You need to forward the {@link net.minecraft.tileentity.TileEntity#updateEntity()}, + * {@link net.minecraft.tileentity.TileEntity#writeToNBT(net.minecraft.nbt.NBTTagCompound)} , + * {@link net.minecraft.tileentity.TileEntity#readFromNBT(net.minecraft.nbt.NBTTagCompound)} and + * {@link net.minecraft.tileentity.TileEntity#validate()} (with the implementing TileEntity as additional parameter) + * to the IAirHandler. + * Apart from that you'll need to forward {@link net.minecraft.block.Block#onNeighborChange(net.minecraft.world.IBlockAccess, int, int, int, int, int, int)} + * from the implementing block to the IAirHandler. + * @return + */ + public IAirHandler getAirHandler(); + + /** + * Returns true if the pneumatic logic is connected to the given side. + * @param side + * @return + */ + public boolean isConnectedTo(ForgeDirection side); +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/EntityPollSensor.java b/src/api/java/pneumaticCraft/api/universalSensor/EntityPollSensor.java new file mode 100644 index 00000000..0419911f --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/EntityPollSensor.java @@ -0,0 +1,31 @@ +package pneumaticCraft.api.universalSensor; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public abstract class EntityPollSensor implements IPollSensorSetting{ + + @Override + public String getSensorPath(){ + return "entityTracker"; + } + + @Override + public int getPollFrequency(){ + return 1; + } + + @Override + public int getRedstoneValue(World world, int x, int y, int z, int sensorRange, String textBoxText){ + AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x - sensorRange, y - sensorRange, z - sensorRange, x + 1 + sensorRange, y + 1 + sensorRange, z + 1 + sensorRange); + return getRedstoneValue(world.getEntitiesWithinAABB(getEntityTracked(), aabb), textBoxText); + } + + public abstract Class getEntityTracked(); + + public abstract int getRedstoneValue(List entities, String textBoxText); + +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinateEventSensor.java b/src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinateEventSensor.java new file mode 100644 index 00000000..2f225c5a --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinateEventSensor.java @@ -0,0 +1,59 @@ +package pneumaticCraft.api.universalSensor; + +import java.util.List; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.tileentity.TileEntity; + +import org.lwjgl.util.Rectangle; + +import cpw.mods.fml.common.eventhandler.Event; + +public interface IBlockAndCoordinateEventSensor{ + /** + * See {@link ISensorSetting#getSensorPath()} + * @return + */ + public String getSensorPath(); + + /** + * Extended version of the normal emitRedstoneOnEvent. This method will only invoke with a valid GPS tool, and when the coordinate is within range. + * @param event + * @param sensor + * @param range + * @param toolX + * @param toolY + * @param toolZ + * @return + */ + public int emitRedstoneOnEvent(Event event, TileEntity sensor, int range, int toolX, int toolY, int toolZ); + + /** + * See {@link IEventSensorSetting#getRedstonePulseLength()} + * @return + */ + public int getRedstonePulseLength(); + + /** + * See {@link ISensorSetting#needsTextBox()} + * @return + */ + public boolean needsTextBox(); + + /** + * See {@link ISensorSetting#needsSlot()} + */ + public Rectangle needsSlot(); + + /** + * See {@link ISensorSetting#getDescription()} + * @return + */ + public List getDescription(); + + /** + * Called by GuiScreen#drawScreen this method can be used to render additional things like status/info text. + * @param fontRenderer + */ + public void drawAdditionalInfo(FontRenderer fontRenderer); +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinatePollSensor.java b/src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinatePollSensor.java new file mode 100644 index 00000000..e7bc329e --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/IBlockAndCoordinatePollSensor.java @@ -0,0 +1,63 @@ +package pneumaticCraft.api.universalSensor; + +import java.util.List; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.world.World; + +import org.lwjgl.util.Rectangle; + +public interface IBlockAndCoordinatePollSensor{ + /** + * See {@link ISensorSetting#getSensorPath()} + * @return + */ + public String getSensorPath(); + + /** + * See {@link ISensorSetting#needsTextBox()} + * @return + */ + public boolean needsTextBox(); + + /** + * See {@link ISensorSetting#needsSlot()} + * @return + */ + public Rectangle needsSlot(); + + /** + * See {@link ISensorSetting#getDescription()} + * @return + */ + public List getDescription(); + + /** + * See {@link IPollSensorSetting#getRedstoneValue(World, int, int, int, int, String)} , but this has the GPS tracked coordinates + * as extra parameters. This method will only be called when the coordinate is within the Universal Sensor's range. + * @param world + * @param x + * @param y + * @param z + * @param sensorRange + * @param textBoxText + * @param toolX + * @param toolY + * @param toolZ + * @return + */ + public int getRedstoneValue(World world, int x, int y, int z, int sensorRange, String textBoxText, int toolX, int toolY, int toolZ); + + /** + * See {@link IPollSensorSetting#getPollFrequency()} + * @return + */ + public int getPollFrequency(); + + /** + * Called by GuiScreen#drawScreen this method can be used to render additional things like status/info text. + * @param fontRenderer + */ + public void drawAdditionalInfo(FontRenderer fontRenderer); + +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/IEventSensorSetting.java b/src/api/java/pneumaticCraft/api/universalSensor/IEventSensorSetting.java new file mode 100644 index 00000000..bce3017a --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/IEventSensorSetting.java @@ -0,0 +1,23 @@ +package pneumaticCraft.api.universalSensor; + +import net.minecraft.tileentity.TileEntity; +import cpw.mods.fml.common.eventhandler.Event; + +public interface IEventSensorSetting extends ISensorSetting{ + + /** + * This method is only invoked when a subscribed event is triggered. + * @param event + * @param sensor + * @param range + * @param textboxText + * @return Redstone strength for the given event. + */ + public int emitRedstoneOnEvent(Event event, TileEntity sensor, int range, String textboxText); + + /** + * Should return how long a pulse should hold in ticks. By default this is 5 ticks (1/4 second). + * @return + */ + public int getRedstonePulseLength(); +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/IPollSensorSetting.java b/src/api/java/pneumaticCraft/api/universalSensor/IPollSensorSetting.java new file mode 100644 index 00000000..50cf8305 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/IPollSensorSetting.java @@ -0,0 +1,27 @@ +package pneumaticCraft.api.universalSensor; + +import net.minecraft.world.World; + +public interface IPollSensorSetting extends ISensorSetting{ + + /** + * The value returned here is the interval between every check in ticks (the interval of calling getRedstoneValue()). + * Consider increasing the interval when your sensor method is resource intensive. + * @return + */ + public int getPollFrequency(); + + /** + * The base method. This method should return the outputted redstone value 0-15 of this sensor. When this sensor is + * digital, just return 0 or 15. + * @param world + * @param x + * @param y + * @param z + * @param sensorRange Range of the sensor, based on the amount of Range Upgrades inserted in the Universal Sensor. + * @param textBoxText The text typed in the textbox of the Universal Sensor. + * @return + */ + public int getRedstoneValue(World world, int x, int y, int z, int sensorRange, String textBoxText); + +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/ISensorSetting.java b/src/api/java/pneumaticCraft/api/universalSensor/ISensorSetting.java new file mode 100644 index 00000000..bfbf3468 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/ISensorSetting.java @@ -0,0 +1,59 @@ +package pneumaticCraft.api.universalSensor; + +import java.util.List; + +import net.minecraft.client.gui.FontRenderer; + +import org.lwjgl.util.Rectangle; + +public interface ISensorSetting{ + /** + * Should return the button path the player has to follow in which this setting is stored. + * For instance, when the sensor should be located in player and is called speed, you should return "entityTracker/player/speed". + * "entityTracker" indicates that this sensor needs an Entity Tracker upgrade to run. You can choose from the following upgrades: + * + * -entityTracker + * -blockTracker + * -gpsTool (so you can use a certain coordinate (within range) to measure on) + * -volume + * -dispenser + * -speed + * -itemLife + * -itemSearch + * -coordinateTracker + * -range + * -security + * + * You can allow only sensors to work by more than one upgrade, by seperating the upgrades with a '_'. For example, + * "entityTracker_speed" will only let the sensor be chosen when both an Entity Tracker and a Speed Upgrade are inserted. + * @return + */ + public String getSensorPath(); + + /** + * When returned true, the GUI will enable the textbox writing, otherwise not. + * @return + */ + public boolean needsTextBox(); + + /** + * Called by GuiScreen#drawScreen this method can be used to render additional things like status/info text. + * @param fontRenderer + */ + public void drawAdditionalInfo(FontRenderer fontRenderer); + + /** + * Should return the description of this sensor displayed in the GUI stat. Information should at least include + * when this sensor emits redstone and how (analog (1 through 15), or digital). + * @return + */ + public List getDescription(); + + /** + * Not being used at the moment, I recommend returning null for now. It is going to be used to allow sensors to decide their + * status on a item which can be inserted in a slot in the GUI if this method returns a rectangle with the coordinates of + * the slot. + * @return + */ + public Rectangle needsSlot(); +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/PlayerEventSensor.java b/src/api/java/pneumaticCraft/api/universalSensor/PlayerEventSensor.java new file mode 100644 index 00000000..19bda915 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/PlayerEventSensor.java @@ -0,0 +1,33 @@ +package pneumaticCraft.api.universalSensor; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.event.entity.player.PlayerEvent; +import cpw.mods.fml.common.eventhandler.Event; + +public abstract class PlayerEventSensor implements IEventSensorSetting{ + + @Override + public String getSensorPath(){ + return "entityTracker/Player"; + } + + @Override + public int emitRedstoneOnEvent(Event event, TileEntity sensor, int range, String textboxText){ + if(event instanceof PlayerEvent) { + EntityPlayer player = ((PlayerEvent)event).entityPlayer; + if(Math.abs(player.posX - sensor.xCoord + 0.5D) < range + 0.5D && Math.abs(player.posY - sensor.yCoord + 0.5D) < range + 0.5D && Math.abs(player.posZ - sensor.zCoord + 0.5D) < range + 0.5D) { + return emitRedstoneOnEvent((PlayerEvent)event, sensor, range); + } + } + return 0; + } + + public abstract int emitRedstoneOnEvent(PlayerEvent event, TileEntity sensor, int range); + + @Override + public int getRedstonePulseLength(){ + return 5; + } + +} diff --git a/src/api/java/pneumaticCraft/api/universalSensor/SensorRegistrator.java b/src/api/java/pneumaticCraft/api/universalSensor/SensorRegistrator.java new file mode 100644 index 00000000..f76c0732 --- /dev/null +++ b/src/api/java/pneumaticCraft/api/universalSensor/SensorRegistrator.java @@ -0,0 +1,33 @@ +package pneumaticCraft.api.universalSensor; + +/** + * With this class you can register your own sensors. + */ +public class SensorRegistrator{ + /** + * This field will be initialized in the PreInit phase of PneumaticCraft's loading phase. + * With this field you can register every Universal Sensor sensor you want. Just pass a new instance + * to one of the registerSensor methods. Sensors are singletons. + */ + public static ISensorRegistrator sensorRegistrator; + + public static interface ISensorRegistrator{ + /** + * Registry for IPollSensorSetting, EntityPollSensor and IEventSensorSetting, and any other instance of ISensorSetting. + * @param sensor + */ + public void registerSensor(ISensorSetting sensor); + + /** + * Registry for IBlockAndCoordinateEventSensor + * @param sensor + */ + public void registerSensor(IBlockAndCoordinateEventSensor sensor); + + /** + * Registry for IBlockAndCoordinatePollSensor + * @param sensor + */ + public void registerSensor(IBlockAndCoordinatePollSensor sensor); + } +} diff --git a/src/api/java/thaumcraft/api/IGoggles.java b/src/api/java/thaumcraft/api/IGoggles.java new file mode 100644 index 00000000..2f53d816 --- /dev/null +++ b/src/api/java/thaumcraft/api/IGoggles.java @@ -0,0 +1,22 @@ +package thaumcraft.api; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +/** + * + * @author Azanor + * + * Equipped head slot items that extend this class will be able to perform most functions that + * goggles of revealing can apart from view nodes which is handled by IRevealer. + * + */ + +public interface IGoggles { + + /* + * If this method returns true things like block essentia contents will be shown. + */ + public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player); + +} diff --git a/src/api/java/thaumcraft/api/IRepairable.java b/src/api/java/thaumcraft/api/IRepairable.java new file mode 100644 index 00000000..48c6dff9 --- /dev/null +++ b/src/api/java/thaumcraft/api/IRepairable.java @@ -0,0 +1,13 @@ +package thaumcraft.api; + + + +/** + * @author Azanor + * Items, armor and tools with this interface can receive the Repair enchantment. + * Repairs 1 point of durability every 10 seconds (2 for repair II) + */ +public interface IRepairable { + + +} diff --git a/src/api/java/thaumcraft/api/IRepairableExtended.java b/src/api/java/thaumcraft/api/IRepairableExtended.java new file mode 100644 index 00000000..33827124 --- /dev/null +++ b/src/api/java/thaumcraft/api/IRepairableExtended.java @@ -0,0 +1,17 @@ +package thaumcraft.api; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + + + +/** + * @author Azanor + * Items, armor and tools with this interface can receive the Repair enchantment. + * Repairs 1 point of durability every 10 seconds (2 for repair II) + */ +public interface IRepairableExtended extends IRepairable { + + public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantlevel); + +} diff --git a/src/api/java/thaumcraft/api/IRunicArmor.java b/src/api/java/thaumcraft/api/IRunicArmor.java new file mode 100644 index 00000000..5dd31100 --- /dev/null +++ b/src/api/java/thaumcraft/api/IRunicArmor.java @@ -0,0 +1,22 @@ +package thaumcraft.api; + +import net.minecraft.item.ItemStack; + +/** + * + * @author Azanor + * + * Armor or bauble slot items that implement this interface can provide runic shielding. + * Recharging, hardening, etc. is handled internally by thaumcraft. + * + */ + +public interface IRunicArmor { + + /** + * returns how much charge this item can provide. This is the base shielding value - any hardening is stored and calculated internally. + */ + public int getRunicCharge(ItemStack itemstack); + + +} diff --git a/src/api/java/thaumcraft/api/IScribeTools.java b/src/api/java/thaumcraft/api/IScribeTools.java new file mode 100644 index 00000000..8800fa57 --- /dev/null +++ b/src/api/java/thaumcraft/api/IScribeTools.java @@ -0,0 +1,14 @@ +package thaumcraft.api; + + +/** + * + * @author Azanor + * + * Interface used to identify scribing tool items used in research table + * + */ + +public interface IScribeTools { + +} diff --git a/src/api/java/thaumcraft/api/IVisDiscountGear.java b/src/api/java/thaumcraft/api/IVisDiscountGear.java new file mode 100644 index 00000000..3793ea3e --- /dev/null +++ b/src/api/java/thaumcraft/api/IVisDiscountGear.java @@ -0,0 +1,20 @@ +package thaumcraft.api; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import thaumcraft.api.aspects.Aspect; + + + + +/** + * @author Azanor + * ItemArmor with this interface will grant a discount to the vis cost of actions the wearer performs with casting wands. + * The amount returned is the percentage by which the cost is discounted. There is a built-int max discount of 50%, but + * individual items really shouldn't have a discount more than 5% + */ +public interface IVisDiscountGear { + + int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect); + +} diff --git a/src/api/java/thaumcraft/api/ItemApi.java b/src/api/java/thaumcraft/api/ItemApi.java new file mode 100644 index 00000000..25dda282 --- /dev/null +++ b/src/api/java/thaumcraft/api/ItemApi.java @@ -0,0 +1,70 @@ +package thaumcraft.api; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.FMLLog; + +/** + * @author Azanor + * + * This is used to gain access to the items in my mod. + * I only give some examples and it will probably still + * require a bit of work for you to get hold of everything you need. + * + */ +public class ItemApi { + + public static ItemStack getItem(String itemString, int meta) { + ItemStack item = null; + + try { + String itemClass = "thaumcraft.common.config.ConfigItems"; + Object obj = Class.forName(itemClass).getField(itemString).get(null); + if (obj instanceof Item) { + item = new ItemStack((Item) obj,1,meta); + } else if (obj instanceof ItemStack) { + item = (ItemStack) obj; + } + } catch (Exception ex) { + FMLLog.warning("[Thaumcraft] Could not retrieve item identified by: " + itemString); + } + + return item; + } + + public static ItemStack getBlock(String itemString, int meta) { + ItemStack item = null; + + try { + String itemClass = "thaumcraft.common.config.ConfigBlocks"; + Object obj = Class.forName(itemClass).getField(itemString).get(null); + if (obj instanceof Block) { + item = new ItemStack((Block) obj,1,meta); + } else if (obj instanceof ItemStack) { + item = (ItemStack) obj; + } + } catch (Exception ex) { + FMLLog.warning("[Thaumcraft] Could not retrieve block identified by: " + itemString); + } + + return item; + } + + /** + * + * Some examples + * + * Casting Wands: + * itemWandCasting + * + * Resources: + * itemEssence, itemWispEssence, itemResource, itemShard, itemNugget, + * itemNuggetChicken, itemNuggetBeef, itemNuggetPork, itemTripleMeatTreat + * + * Research: + * itemResearchNotes, itemInkwell, itemThaumonomicon + * + */ + +} diff --git a/src/api/java/thaumcraft/api/ItemRunic.java b/src/api/java/thaumcraft/api/ItemRunic.java new file mode 100644 index 00000000..80251f59 --- /dev/null +++ b/src/api/java/thaumcraft/api/ItemRunic.java @@ -0,0 +1,21 @@ +package thaumcraft.api; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class ItemRunic extends Item implements IRunicArmor { + + int charge; + + public ItemRunic (int charge) + { + super(); + this.charge = charge; + } + + @Override + public int getRunicCharge(ItemStack itemstack) { + return charge; + } + +} diff --git a/src/api/java/thaumcraft/api/ThaumcraftApi.java b/src/api/java/thaumcraft/api/ThaumcraftApi.java new file mode 100644 index 00000000..0b135d31 --- /dev/null +++ b/src/api/java/thaumcraft/api/ThaumcraftApi.java @@ -0,0 +1,507 @@ +package thaumcraft.api; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.crafting.CrucibleRecipe; +import thaumcraft.api.crafting.InfusionEnchantmentRecipe; +import thaumcraft.api.crafting.InfusionRecipe; +import thaumcraft.api.crafting.ShapedArcaneRecipe; +import thaumcraft.api.crafting.ShapelessArcaneRecipe; +import thaumcraft.api.research.IScanEventHandler; +import thaumcraft.api.research.ResearchCategories; +import thaumcraft.api.research.ResearchCategoryList; +import thaumcraft.api.research.ResearchItem; +import thaumcraft.api.research.ResearchPage; + + +/** + * @author Azanor + * + * + * IMPORTANT: If you are adding your own aspects to items it is a good idea to do it AFTER Thaumcraft adds its aspects, otherwise odd things may happen. + * + */ +public class ThaumcraftApi { + + //Materials + public static ToolMaterial toolMatThaumium = EnumHelper.addToolMaterial("THAUMIUM", 3, 400, 7F, 2, 22); + public static ToolMaterial toolMatElemental = EnumHelper.addToolMaterial("THAUMIUM_ELEMENTAL", 3, 1500, 10F, 3, 18); + public static ArmorMaterial armorMatThaumium = EnumHelper.addArmorMaterial("THAUMIUM", 25, new int[] { 2, 6, 5, 2 }, 25); + public static ArmorMaterial armorMatSpecial = EnumHelper.addArmorMaterial("SPECIAL", 25, new int[] { 1, 3, 2, 1 }, 25); + + //Enchantment references + public static int enchantFrugal; + public static int enchantPotency; + public static int enchantWandFortune; + public static int enchantHaste; + public static int enchantRepair; + + //Miscellaneous + /** + * Portable Hole Block-id Blacklist. + * Simply add the block-id's of blocks you don't want the portable hole to go through. + */ + public static ArrayList portableHoleBlackList = new ArrayList(); + + + //RESEARCH///////////////////////////////////////// + public static ArrayList scanEventhandlers = new ArrayList(); + public static ArrayList scanEntities = new ArrayList(); + public static class EntityTagsNBT { + public EntityTagsNBT(String name, Object value) { + this.name = name; + this.value = value; + } + public String name; + public Object value; + } + public static class EntityTags { + public EntityTags(String entityName, AspectList aspects, EntityTagsNBT... nbts) { + this.entityName = entityName; + this.nbts = nbts; + this.aspects = aspects; + } + public String entityName; + public EntityTagsNBT[] nbts; + public AspectList aspects; + } + + /** + * not really working atm, so ignore it for now + * @param scanEventHandler + */ + public static void registerScanEventhandler(IScanEventHandler scanEventHandler) { + scanEventhandlers.add(scanEventHandler); + } + + /** + * This is used to add aspects to entities which you can then scan using a thaumometer. + * Also used to calculate vis drops from mobs. + * @param entityName + * @param aspects + * @param nbt you can specify certain nbt keys and their values + * to differentiate between mobs.
For example the normal and wither skeleton: + *
ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 5)); + *
ThaumcraftApi.registerEntityTag("Skeleton", (new AspectList()).add(Aspect.DEATH, 8), new NBTTagByte("SkeletonType",(byte) 1)); + */ + public static void registerEntityTag(String entityName, AspectList aspects, EntityTagsNBT... nbt ) { + scanEntities.add(new EntityTags(entityName,aspects,nbt)); + } + + //RECIPES///////////////////////////////////////// + private static ArrayList craftingRecipes = new ArrayList(); + private static HashMap smeltingBonus = new HashMap(); + + /** + * This method is used to determine what bonus items are generated when the infernal furnace smelts items + * @param in The input of the smelting operation. e.g. new ItemStack(Block.oreGold) + * @param out The bonus item that can be produced from the smelting operation e.g. new ItemStack(nuggetGold,0,0). + * Stacksize should be 0 unless you want to guarantee that at least 1 item is always produced. + */ + public static void addSmeltingBonus(ItemStack in, ItemStack out) { + smeltingBonus.put( + Arrays.asList(in.getItem(),in.getItemDamage()), + new ItemStack(out.getItem(),0,out.getItemDamage())); + } + + /** + * This method is used to determine what bonus items are generated when the infernal furnace smelts items + * @param in The ore dictionary input of the smelting operation. e.g. "oreGold" + * @param out The bonus item that can be produced from the smelting operation e.g. new ItemStack(nuggetGold,0,0). + * Stacksize should be 0 unless you want to guarantee that at least 1 item is always produced. + */ + public static void addSmeltingBonus(String in, ItemStack out) { + smeltingBonus.put( in, new ItemStack(out.getItem(),0,out.getItemDamage())); + } + + /** + * Returns the bonus item produced from a smelting operation in the infernal furnace + * @param in The input of the smelting operation. e.g. new ItemStack(oreGold) + * @return the The bonus item that can be produced + */ + public static ItemStack getSmeltingBonus(ItemStack in) { + ItemStack out = smeltingBonus.get(Arrays.asList(in.getItem(),in.getItemDamage())); + if (out==null) { + out = smeltingBonus.get(Arrays.asList(in.getItem(),OreDictionary.WILDCARD_VALUE)); + } + if (out==null) { + String od = OreDictionary.getOreName( OreDictionary.getOreID(in)); + out = smeltingBonus.get(od); + } + return out; + } + + public static List getCraftingRecipes() { + return craftingRecipes; + } + + /** + * @param research the research key required for this recipe to work. Leave blank if it will work without research + * @param result the recipe output + * @param aspects the vis cost per aspect. + * @param recipe The recipe. Format is exactly the same as vanilla recipes. Input itemstacks are NBT sensitive. + */ + public static ShapedArcaneRecipe addArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object ... recipe) + { + ShapedArcaneRecipe r= new ShapedArcaneRecipe(research, result, aspects, recipe); + craftingRecipes.add(r); + return r; + } + + /** + * @param research the research key required for this recipe to work. Leave blank if it will work without research + * @param result the recipe output + * @param aspects the vis cost per aspect + * @param recipe The recipe. Format is exactly the same as vanilla shapeless recipes. Input itemstacks are NBT sensitive. + */ + public static ShapelessArcaneRecipe addShapelessArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object ... recipe) + { + ShapelessArcaneRecipe r = new ShapelessArcaneRecipe(research, result, aspects, recipe); + craftingRecipes.add(r); + return r; + } + + /** + * @param research the research key required for this recipe to work. Leave blank if it will work without research + * @param result the recipe output. It can either be an itemstack or an nbt compound tag that will be added to the central item + * @param instability a number that represents the N in 1000 chance for the infusion altar to spawn an + * instability effect each second while the crafting is in progress + * @param aspects the essentia cost per aspect. + * @param aspects input the central item to be infused + * @param recipe An array of items required to craft this. Input itemstacks are NBT sensitive. + * Infusion crafting components are automatically "fuzzy" and the oredict will be checked for possible matches. + * + */ + public static InfusionRecipe addInfusionCraftingRecipe(String research, Object result, int instability, AspectList aspects, ItemStack input,ItemStack[] recipe) + { + if (!(result instanceof ItemStack || result instanceof Object[])) return null; + InfusionRecipe r= new InfusionRecipe(research, result, instability, aspects, input, recipe); + craftingRecipes.add(r); + return r; + } + + /** + * @param research the research key required for this recipe to work. Leave blank if it will work without research + * @param enchantment the enchantment that will be applied to the item + * @param instability a number that represents the N in 1000 chance for the infusion altar to spawn an + * instability effect each second while the crafting is in progress + * @param aspects the essentia cost per aspect. + * @param recipe An array of items required to craft this. Input itemstacks are NBT sensitive. + * Infusion crafting components are automatically "fuzzy" and the oredict will be checked for possible matches. + * + */ + public static InfusionEnchantmentRecipe addInfusionEnchantmentRecipe(String research, Enchantment enchantment, int instability, AspectList aspects, ItemStack[] recipe) + { + InfusionEnchantmentRecipe r= new InfusionEnchantmentRecipe(research, enchantment, instability, aspects, recipe); + craftingRecipes.add(r); + return r; + } + + /** + * @param stack the recipe result + * @return the recipe + */ + public static InfusionRecipe getInfusionRecipe(ItemStack res) { + for (Object r:getCraftingRecipes()) { + if (r instanceof InfusionRecipe) { + if (((InfusionRecipe)r).getRecipeOutput() instanceof ItemStack) { + if (((ItemStack) ((InfusionRecipe)r).getRecipeOutput()).isItemEqual(res)) + return (InfusionRecipe)r; + } + } + } + return null; + } + + + /** + * @param key the research key required for this recipe to work. + * @param result the output result + * @param catalyst an itemstack of the catalyst or a string if it is an ore dictionary item + * @param cost the vis cost + * @param tags the aspects required to craft this + */ + public static CrucibleRecipe addCrucibleRecipe(String key, ItemStack result, Object catalyst, AspectList tags) { + CrucibleRecipe rc = new CrucibleRecipe(key, result, catalyst, tags); + getCraftingRecipes().add(rc); + return rc; + } + + + /** + * @param stack the recipe result + * @return the recipe + */ + public static CrucibleRecipe getCrucibleRecipe(ItemStack stack) { + for (Object r:getCraftingRecipes()) { + if (r instanceof CrucibleRecipe) { + if (((CrucibleRecipe)r).getRecipeOutput().isItemEqual(stack)) + return (CrucibleRecipe)r; + } + } + return null; + } + + /** + * Used by the thaumonomicon drilldown feature. + * @param stack the item + * @return the thaumcraft recipe key that produces that item. + */ + private static HashMap keyCache = new HashMap(); + + public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) { + int[] key = new int[] {Item.getIdFromItem(stack.getItem()),stack.getItemDamage()}; + if (keyCache.containsKey(key)) { + if (keyCache.get(key)==null) return null; + if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String)(keyCache.get(key))[0])) + return keyCache.get(key); + else + return null; + } + for (ResearchCategoryList rcl:ResearchCategories.researchCategories.values()) { + for (ResearchItem ri:rcl.research.values()) { + if (ri.getPages()==null) continue; + for (int a=0;a objectTags = new ConcurrentHashMap(); + + /** + * Checks to see if the passed item/block already has aspects associated with it. + * @param id + * @param meta + * @return + */ + public static boolean exists(Item item, int meta) { + AspectList tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,meta)); + if (tmp==null) { + tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,OreDictionary.WILDCARD_VALUE)); + if (meta==OreDictionary.WILDCARD_VALUE && tmp==null) { + int index=0; + do { + tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item,index)); + index++; + } while (index<16 && tmp==null); + } + if (tmp==null) return false; + } + + return true; + } + + /** + * Used to assign apsects to the given item/block. Here is an example of the declaration for cobblestone:

+ * ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.cobblestone), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); + * @param item the item passed. Pass OreDictionary.WILDCARD_VALUE if all damage values of this item/block should have the same aspects + * @param aspects A ObjectTags object of the associated aspects + */ + public static void registerObjectTag(ItemStack item, AspectList aspects) { + if (aspects==null) aspects=new AspectList(); + try { + objectTags.put(Arrays.asList(item.getItem(),item.getItemDamage()), aspects); + } catch (Exception e) {} + } + + + /** + * Used to assign apsects to the given item/block. Here is an example of the declaration for cobblestone:

+ * ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.cobblestone), new int[]{0,1}, (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); + * @param item + * @param meta A range of meta values if you wish to lump several item meta's together as being the "same" item (i.e. stair orientations) + * @param aspects A ObjectTags object of the associated aspects + */ + public static void registerObjectTag(ItemStack item, int[] meta, AspectList aspects) { + if (aspects==null) aspects=new AspectList(); + try { + objectTags.put(Arrays.asList(item.getItem(),meta), aspects); + } catch (Exception e) {} + } + + /** + * Used to assign apsects to the given ore dictionary item. + * @param oreDict the ore dictionary name + * @param aspects A ObjectTags object of the associated aspects + */ + public static void registerObjectTag(String oreDict, AspectList aspects) { + if (aspects==null) aspects=new AspectList(); + ArrayList ores = OreDictionary.getOres(oreDict); + if (ores!=null && ores.size()>0) { + for (ItemStack ore:ores) { + try { + objectTags.put(Arrays.asList(ore.getItem(), ore.getItemDamage()), aspects); + } catch (Exception e) {} + } + } + } + + /** + * Used to assign aspects to the given item/block. + * Attempts to automatically generate aspect tags by checking registered recipes. + * Here is an example of the declaration for pistons:

+ * ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.cobblestone), (new AspectList()).add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 4)); + * @param item, pass OreDictionary.WILDCARD_VALUE to meta if all damage values of this item/block should have the same aspects + * @param aspects A ObjectTags object of the associated aspects + */ + public static void registerComplexObjectTag(ItemStack item, AspectList aspects ) { + if (!exists(item.getItem(),item.getItemDamage())) { + AspectList tmp = ThaumcraftApiHelper.generateTags(item.getItem(), item.getItemDamage()); + if (tmp != null && tmp.size()>0) { + for(Aspect tag:tmp.getAspects()) { + aspects.add(tag, tmp.getAmount(tag)); + } + } + registerObjectTag(item,aspects); + } else { + AspectList tmp = ThaumcraftApiHelper.getObjectAspects(item); + for(Aspect tag:aspects.getAspects()) { + tmp.merge(tag, tmp.getAmount(tag)); + } + registerObjectTag(item,tmp); + } + } + + //WARP /////////////////////////////////////////////////////////////////////////////////////// + private static HashMap warpMap = new HashMap(); + + /** + * This method is used to determine how much warp is gained if the item is crafted + * @param craftresult The item crafted + * @param amount how much warp is gained + */ + public static void addWarpToItem(ItemStack craftresult, int amount) { + warpMap.put(Arrays.asList(craftresult.getItem(),craftresult.getItemDamage()),amount); + } + + /** + * This method is used to determine how much warp is gained if the sent item is crafted + * @param in The item crafted + * @param amount how much warp is gained + */ + public static void addWarpToResearch(String research, int amount) { + warpMap.put(research, amount); + } + + /** + * Returns how much warp is gained from the item or research passed in + * @param in itemstack or string + * @return how much warp it will give + */ + public static int getWarp(Object in) { + if (in==null) return 0; + if (in instanceof ItemStack && warpMap.containsKey(Arrays.asList(((ItemStack)in).getItem(),((ItemStack)in).getItemDamage()))) { + return warpMap.get(Arrays.asList(((ItemStack)in).getItem(),((ItemStack)in).getItemDamage())); + } else + if (in instanceof String && warpMap.containsKey((String)in)) { + return warpMap.get((String)in); + } + return 0; + } + + //CROPS ////////////////////////////////////////////////////////////////////////////////////////// + + /** + * To define mod crops you need to use FMLInterModComms in your @Mod.Init method. + * There are two 'types' of crops you can add. Standard crops and clickable crops. + * + * Standard crops work like normal vanilla crops - they grow until a certain metadata + * value is reached and you harvest them by destroying the block and collecting the blocks. + * You need to create and ItemStack that tells the golem what block id and metadata represents + * the crop when fully grown. Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the metadata won't get + * checked. + * Example for vanilla wheat: + * FMLInterModComms.sendMessage("Thaumcraft", "harvestStandardCrop", new ItemStack(Block.crops,1,7)); + * + * Clickable crops are crops that you right click to gather their bounty instead of destroying them. + * As for standard crops, you need to create and ItemStack that tells the golem what block id + * and metadata represents the crop when fully grown. The golem will trigger the blocks onBlockActivated method. + * Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the metadata won't get checked. + * Example (this will technically do nothing since clicking wheat does nothing, but you get the idea): + * FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(Block.crops,1,7)); + * + * Stacked crops (like reeds) are crops that you wish the bottom block should remain after harvesting. + * As for standard crops, you need to create and ItemStack that tells the golem what block id + * and metadata represents the crop when fully grown. Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the actualy md won't get + * checked. If it has the order upgrade it will only harvest if the crop is more than one block high. + * Example: + * FMLInterModComms.sendMessage("Thaumcraft", "harvestStackedCrop", new ItemStack(Block.reed,1,7)); + */ + + //NATIVE CLUSTERS ////////////////////////////////////////////////////////////////////////////////// + + /** + * You can define certain ores that will have a chance to produce native clusters via FMLInterModComms + * in your @Mod.Init method using the "nativeCluster" string message. + * The format should be: + * "[ore item/block id],[ore item/block metadata],[cluster item/block id],[cluster item/block metadata],[chance modifier float]" + * + * NOTE: The chance modifier is a multiplier applied to the default chance for that cluster to be produced (default 27.5% for a pickaxe of the core) + * + * Example for vanilla iron ore to produce one of my own native iron clusters (assuming default id's) at double the default chance: + * FMLInterModComms.sendMessage("Thaumcraft", "nativeCluster","15,0,25016,16,2.0"); + */ + + //LAMP OF GROWTH BLACKLIST /////////////////////////////////////////////////////////////////////////// + /** + * You can blacklist crops that should not be effected by the Lamp of Growth via FMLInterModComms + * in your @Mod.Init method using the "lampBlacklist" itemstack message. + * Sending a metadata of [OreDictionary.WILDCARD_VALUE] will mean the metadata won't get checked. + * Example for vanilla wheat: + * FMLInterModComms.sendMessage("Thaumcraft", "lampBlacklist", new ItemStack(Block.crops,1,OreDictionary.WILDCARD_VALUE)); + */ + + //DIMENSION BLACKLIST /////////////////////////////////////////////////////////////////////////// + /** + * You can blacklist a dimension to not spawn certain thaumcraft features + * in your @Mod.Init method using the "dimensionBlacklist" string message in the format "[dimension]:[level]" + * The level values are as follows: + * [0] stop all tc spawning and generation + * [1] allow ore and node generation + * [2] allow mob spawning + * [3] allow ore and node gen + mob spawning + * Example: + * FMLInterModComms.sendMessage("Thaumcraft", "dimensionBlacklist", "15:1"); + */ + + //BIOME BLACKLIST /////////////////////////////////////////////////////////////////////////// + /** + * You can blacklist a biome to not spawn certain thaumcraft features + * in your @Mod.Init method using the "biomeBlacklist" string message in the format "[biome id]:[level]" + * The level values are as follows: + * [0] stop all tc spawning and generation + * [1] allow ore and node generation + * [2] allow mob spawning + * [3] allow ore and node gen + mob spawning + * Example: + * FMLInterModComms.sendMessage("Thaumcraft", "biomeBlacklist", "180:2"); + */ +} diff --git a/src/api/java/thaumcraft/api/ThaumcraftApiHelper.java b/src/api/java/thaumcraft/api/ThaumcraftApiHelper.java new file mode 100644 index 00000000..a4b6d42a --- /dev/null +++ b/src/api/java/thaumcraft/api/ThaumcraftApiHelper.java @@ -0,0 +1,269 @@ +package thaumcraft.api; + +import java.lang.reflect.Method; +import java.util.HashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IEssentiaTransport; +import cpw.mods.fml.common.FMLLog; + +public class ThaumcraftApiHelper { + + public static AspectList cullTags(AspectList temp) { + AspectList temp2 = new AspectList(); + for (Aspect tag:temp.getAspects()) { + if (tag!=null) + temp2.add(tag, temp.getAmount(tag)); + } + while (temp2!=null && temp2.size()>10) { + Aspect lowest = null; + int low = Integer.MAX_VALUE; + for (Aspect tag:temp2.getAspects()) { + if (tag==null) continue; + if (temp2.getAmount(tag) allAspects= new HashMap(); + private static HashMap allCompoundAspects= new HashMap(); + + public static AspectList getAllAspects(int amount) { + if (allAspects.get(amount)==null) { + AspectList al = new AspectList(); + for (Aspect aspect:Aspect.aspects.values()) { + al.add(aspect, amount); + } + allAspects.put(amount, al); + } + return allAspects.get(amount); + } + + public static AspectList getAllCompoundAspects(int amount) { + if (allCompoundAspects.get(amount)==null) { + AspectList al = new AspectList(); + for (Aspect aspect:Aspect.getCompoundAspects()) { + al.add(aspect, amount); + } + allCompoundAspects.put(amount, al); + } + return allCompoundAspects.get(amount); + } + + static Method consumeVisFromWand; + /** + * Use to subtract vis from a wand for most operations + * Wands store vis differently so "real" vis costs need to be multiplied by 100 before calling this method + * @param wand the wand itemstack + * @param player the player using the wand + * @param cost the cost of the operation. + * @param doit actually subtract the vis from the wand if true - if false just simulate the result + * @param crafting is this a crafting operation or not - if + * false then things like frugal and potency will apply to the costs + * @return was the vis successfully subtracted + */ + public static boolean consumeVisFromWand(ItemStack wand, EntityPlayer player, + AspectList cost, boolean doit, boolean crafting) { + boolean ot = false; + try { + if(consumeVisFromWand == null) { + Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting"); + consumeVisFromWand = fake.getMethod("consumeAllVis", + ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class, boolean.class); + } + ot = (Boolean) consumeVisFromWand.invoke( + consumeVisFromWand.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit, crafting); + } catch(Exception ex) { + FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVis"); + } + return ot; + } + + static Method consumeVisFromWandCrafting; + /** + * Subtract vis for use by a crafting mechanic. Costs are calculated slightly + * differently and things like the frugal enchant is ignored + * Must NOT be multiplied by 100 - send the actual vis cost + * @param wand the wand itemstack + * @param player the player using the wand + * @param cost the cost of the operation. + * @param doit actually subtract the vis from the wand if true - if false just simulate the result + * @return was the vis successfully subtracted + */ + public static boolean consumeVisFromWandCrafting(ItemStack wand, EntityPlayer player, + AspectList cost, boolean doit) { + boolean ot = false; + try { + if(consumeVisFromWandCrafting == null) { + Class fake = Class.forName("thaumcraft.common.items.wands.ItemWandCasting"); + consumeVisFromWandCrafting = fake.getMethod("consumeAllVisCrafting", + ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class); + } + ot = (Boolean) consumeVisFromWandCrafting.invoke( + consumeVisFromWandCrafting.getDeclaringClass().cast(wand.getItem()), wand, player, cost, doit); + } catch(Exception ex) { + FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.ItemWandCasting method consumeAllVisCrafting"); + } + return ot; + } + + static Method consumeVisFromInventory; + /** + * Subtract vis from a wand the player is carrying. Works like consumeVisFromWand in that actual vis + * costs should be multiplied by 100. The costs are handled like crafting however and things like + * frugal don't effect them + * @param player the player using the wand + * @param cost the cost of the operation. + * @return was the vis successfully subtracted + */ + public static boolean consumeVisFromInventory(EntityPlayer player, AspectList cost) { + boolean ot = false; + try { + if(consumeVisFromInventory == null) { + Class fake = Class.forName("thaumcraft.common.items.wands.WandManager"); + consumeVisFromInventory = fake.getMethod("consumeVisFromInventory", + EntityPlayer.class, AspectList.class); + } + ot = (Boolean) consumeVisFromInventory.invoke(null, player, cost); + } catch(Exception ex) { + FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.items.wands.WandManager method consumeVisFromInventory"); + } + return ot; + } +} diff --git a/src/api/java/thaumcraft/api/TileThaumcraft.java b/src/api/java/thaumcraft/api/TileThaumcraft.java new file mode 100644 index 00000000..56ccae87 --- /dev/null +++ b/src/api/java/thaumcraft/api/TileThaumcraft.java @@ -0,0 +1,63 @@ +package thaumcraft.api; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +/** + * + * @author azanor + * + * Custom tile entity class I use for most of my tile entities. Setup in such a way that only + * the nbt data within readCustomNBT / writeCustomNBT will be sent to the client when the tile + * updates. Apart from all the normal TE data that gets sent that is. + * + */ +public class TileThaumcraft extends TileEntity { + + //NBT stuff + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + readCustomNBT(nbttagcompound); + } + + public void readCustomNBT(NBTTagCompound nbttagcompound) + { + //TODO + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + writeCustomNBT(nbttagcompound); + } + + public void writeCustomNBT(NBTTagCompound nbttagcompound) + { + //TODO + } + + //Client Packet stuff + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeCustomNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, nbttagcompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + super.onDataPacket(net, pkt); + this.readCustomNBT(pkt.func_148857_g()); + } + + + + +} diff --git a/src/api/java/thaumcraft/api/WorldCoordinates.java b/src/api/java/thaumcraft/api/WorldCoordinates.java new file mode 100644 index 00000000..6c620af5 --- /dev/null +++ b/src/api/java/thaumcraft/api/WorldCoordinates.java @@ -0,0 +1,117 @@ +package thaumcraft.api; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class WorldCoordinates implements Comparable +{ + public int x; + + /** the y coordinate */ + public int y; + + /** the z coordinate */ + public int z; + + public int dim; + + public WorldCoordinates() {} + + public WorldCoordinates(int par1, int par2, int par3, int d) + { + this.x = par1; + this.y = par2; + this.z = par3; + this.dim = d; + } + + public WorldCoordinates(TileEntity tile) + { + this.x = tile.xCoord; + this.y = tile.yCoord; + this.z = tile.zCoord; + this.dim = tile.getWorldObj().provider.dimensionId; + } + + public WorldCoordinates(WorldCoordinates par1ChunkCoordinates) + { + this.x = par1ChunkCoordinates.x; + this.y = par1ChunkCoordinates.y; + this.z = par1ChunkCoordinates.z; + this.dim = par1ChunkCoordinates.dim; + } + + public boolean equals(Object par1Obj) + { + if (!(par1Obj instanceof WorldCoordinates)) + { + return false; + } + else + { + WorldCoordinates coordinates = (WorldCoordinates)par1Obj; + return this.x == coordinates.x && this.y == coordinates.y && this.z == coordinates.z && this.dim == coordinates.dim ; + } + } + + public int hashCode() + { + return this.x + this.y << 8 + this.z << 16 + this.dim << 24; + } + + /** + * Compare the coordinate with another coordinate + */ + public int compareWorldCoordinate(WorldCoordinates par1) + { + return this.dim == par1.dim ? ( + this.y == par1.y ? (this.z == par1.z ? this.x - par1.x : this.z - par1.z) : this.y - par1.y) : -1; + } + + public void set(int par1, int par2, int par3, int d) + { + this.x = par1; + this.y = par2; + this.z = par3; + this.dim = d; + } + + /** + * Returns the squared distance between this coordinates and the coordinates given as argument. + */ + public float getDistanceSquared(int par1, int par2, int par3) + { + float f = (float)(this.x - par1); + float f1 = (float)(this.y - par2); + float f2 = (float)(this.z - par3); + return f * f + f1 * f1 + f2 * f2; + } + + /** + * Return the squared distance between this coordinates and the ChunkCoordinates given as argument. + */ + public float getDistanceSquaredToWorldCoordinates(WorldCoordinates par1ChunkCoordinates) + { + return this.getDistanceSquared(par1ChunkCoordinates.x, par1ChunkCoordinates.y, par1ChunkCoordinates.z); + } + + public int compareTo(Object par1Obj) + { + return this.compareWorldCoordinate((WorldCoordinates)par1Obj); + } + + public void readNBT(NBTTagCompound nbt) { + this.x = nbt.getInteger("w_x"); + this.y = nbt.getInteger("w_y"); + this.z = nbt.getInteger("w_z"); + this.dim = nbt.getInteger("w_d"); + } + + public void writeNBT(NBTTagCompound nbt) { + nbt.setInteger("w_x",x); + nbt.setInteger("w_y",y); + nbt.setInteger("w_z",z); + nbt.setInteger("w_d",dim); + } + +} diff --git a/src/api/java/thaumcraft/api/aspects/Aspect.java b/src/api/java/thaumcraft/api/aspects/Aspect.java new file mode 100644 index 00000000..3c33a4a7 --- /dev/null +++ b/src/api/java/thaumcraft/api/aspects/Aspect.java @@ -0,0 +1,201 @@ +package thaumcraft.api.aspects; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import org.apache.commons.lang3.text.WordUtils; + +public class Aspect { + + String tag; + Aspect[] components; + int color; + private String chatcolor; + ResourceLocation image; + int blend; + + /** + * Use this constructor to register your own aspects. + * @param tag the key that will be used to reference this aspect, as well as its latin display name + * @param color color to display the tag in + * @param components the aspects this one is formed from + * @param image ResourceLocation pointing to a 32x32 icon of the aspect + * @param blend GL11 blendmode (1 or 771). Used for rendering nodes. Default is 1 + */ + public Aspect(String tag, int color, Aspect[] components, ResourceLocation image, int blend) { + if (aspects.containsKey(tag)) throw new IllegalArgumentException(tag+" already registered!"); + this.tag = tag; + this.components = components; + this.color = color; + this.image = image; + this.blend = blend; + aspects.put(tag, this); + } + + /** + * Shortcut constructor I use for the default aspects - you shouldn't be using this. + */ + public Aspect(String tag, int color, Aspect[] components) { + this(tag,color,components,new ResourceLocation("thaumcraft","textures/aspects/"+tag.toLowerCase()+".png"),1); + } + + /** + * Shortcut constructor I use for the default aspects - you shouldn't be using this. + */ + public Aspect(String tag, int color, Aspect[] components, int blend) { + this(tag,color,components,new ResourceLocation("thaumcraft","textures/aspects/"+tag.toLowerCase()+".png"),blend); + } + + /** + * Shortcut constructor I use for the primal aspects - + * you shouldn't use this as making your own primal aspects will break all the things. + */ + public Aspect(String tag, int color, String chatcolor, int blend) { + this(tag,color,(Aspect[])null, blend); + this.setChatcolor(chatcolor); + } + + public int getColor() { + return color; + } + + public String getName() { + return WordUtils.capitalizeFully(tag); + } + + public String getLocalizedDescription() { + return StatCollector.translateToLocal("tc.aspect."+tag); + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public Aspect[] getComponents() { + return components; + } + + public void setComponents(Aspect[] components) { + this.components = components; + } + + public ResourceLocation getImage() { + return image; + } + + public static Aspect getAspect(String tag) { + return aspects.get(tag); + } + + public int getBlend() { + return blend; + } + + public void setBlend(int blend) { + this.blend = blend; + } + + public boolean isPrimal() { + return getComponents()==null || getComponents().length!=2; + } + + /////////////////////////////// + public static ArrayList getPrimalAspects() { + ArrayList primals = new ArrayList(); + Collection pa = aspects.values(); + for (Aspect aspect:pa) { + if (aspect.isPrimal()) primals.add(aspect); + } + return primals; + } + + public static ArrayList getCompoundAspects() { + ArrayList compounds = new ArrayList(); + Collection pa = aspects.values(); + for (Aspect aspect:pa) { + if (!aspect.isPrimal()) compounds.add(aspect); + } + return compounds; + } + + public String getChatcolor() { + return chatcolor; + } + + public void setChatcolor(String chatcolor) { + this.chatcolor = chatcolor; + } + + + /////////////////////////////// + public static LinkedHashMap aspects = new LinkedHashMap(); + + //PRIMAL + public static final Aspect AIR = new Aspect("aer",0xffff7e,"e",1); + public static final Aspect EARTH = new Aspect("terra",0x56c000,"2",1); + public static final Aspect FIRE = new Aspect("ignis",0xff5a01,"c",1); + public static final Aspect WATER = new Aspect("aqua",0x3cd4fc,"3",1); + public static final Aspect ORDER = new Aspect("ordo",0xd5d4ec,"7",1); + public static final Aspect ENTROPY = new Aspect("perditio",0x404040,"8",771); + + //SECONDARY + public static final Aspect VOID = new Aspect("vacuos",0x888888, new Aspect[] {AIR, ENTROPY},771); + public static final Aspect LIGHT = new Aspect("lux",0xfff663, new Aspect[] {AIR, FIRE}); + public static final Aspect WEATHER = new Aspect("tempestas",0xFFFFFF, new Aspect[] {AIR, WATER}); + public static final Aspect MOTION = new Aspect("motus",0xcdccf4, new Aspect[] {AIR, ORDER}); + public static final Aspect COLD = new Aspect("gelum",0xe1ffff, new Aspect[] {FIRE, ENTROPY}); + public static final Aspect CRYSTAL = new Aspect("vitreus",0x80ffff, new Aspect[] {EARTH, ORDER}); + public static final Aspect LIFE = new Aspect("victus",0xde0005, new Aspect[] {WATER, EARTH}); + public static final Aspect POISON = new Aspect("venenum",0x89f000, new Aspect[] {WATER, ENTROPY}); + public static final Aspect ENERGY = new Aspect("potentia",0xc0ffff, new Aspect[] {ORDER, FIRE}); + public static final Aspect EXCHANGE = new Aspect("permutatio",0x578357, new Aspect[] {ENTROPY, ORDER}); +// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {AIR, EARTH}); +// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {FIRE, EARTH}); +// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {FIRE, WATER}); +// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {ORDER, WATER}); +// public static final Aspect ?? = new Aspect("??",0xcdccf4, new Aspect[] {EARTH, ENTROPY}); + + //TERTIARY + public static final Aspect METAL = new Aspect("metallum",0xb5b5cd, new Aspect[] {EARTH, CRYSTAL}); + public static final Aspect DEATH = new Aspect("mortuus",0x887788, new Aspect[] {LIFE, ENTROPY}); + public static final Aspect FLIGHT = new Aspect("volatus",0xe7e7d7, new Aspect[] {AIR, MOTION}); + public static final Aspect DARKNESS = new Aspect("tenebrae",0x222222, new Aspect[] {VOID, LIGHT}); + public static final Aspect SOUL = new Aspect("spiritus",0xebebfb, new Aspect[] {LIFE, DEATH}); + public static final Aspect HEAL = new Aspect("sano",0xff2f34, new Aspect[] {LIFE, ORDER}); + public static final Aspect TRAVEL = new Aspect("iter",0xe0585b, new Aspect[] {MOTION, EARTH}); + public static final Aspect ELDRITCH = new Aspect("alienis",0x805080, new Aspect[] {VOID, DARKNESS}); + public static final Aspect MAGIC = new Aspect("praecantatio",0x9700c0, new Aspect[] {VOID, ENERGY}); + public static final Aspect AURA = new Aspect("auram",0xffc0ff, new Aspect[] {MAGIC, AIR}); + public static final Aspect TAINT = new Aspect("vitium",0x800080, new Aspect[] {MAGIC, ENTROPY}); + public static final Aspect SLIME = new Aspect("limus",0x01f800, new Aspect[] {LIFE, WATER}); + public static final Aspect PLANT = new Aspect("herba",0x01ac00, new Aspect[] {LIFE, EARTH}); + public static final Aspect TREE = new Aspect("arbor",0x876531, new Aspect[] {AIR, PLANT}); + public static final Aspect BEAST = new Aspect("bestia",0x9f6409, new Aspect[] {MOTION, LIFE}); + public static final Aspect FLESH = new Aspect("corpus",0xee478d, new Aspect[] {DEATH, BEAST}); + public static final Aspect UNDEAD = new Aspect("exanimis",0x3a4000, new Aspect[] {MOTION, DEATH}); + public static final Aspect MIND = new Aspect("cognitio",0xffc2b3, new Aspect[] {EARTH, SOUL}); + public static final Aspect SENSES = new Aspect("sensus",0x0fd9ff, new Aspect[] {AIR, SOUL}); + public static final Aspect MAN = new Aspect("humanus",0xffd7c0, new Aspect[] {BEAST, MIND}); + public static final Aspect CROP = new Aspect("messis",0xe1b371, new Aspect[] {PLANT, MAN}); + public static final Aspect MINE = new Aspect("perfodio",0xdcd2d8, new Aspect[] {MAN, EARTH}); + public static final Aspect TOOL = new Aspect("instrumentum",0x4040ee, new Aspect[] {MAN, ORDER}); + public static final Aspect HARVEST = new Aspect("meto",0xeead82, new Aspect[] {CROP, TOOL}); + public static final Aspect WEAPON = new Aspect("telum",0xc05050, new Aspect[] {TOOL, ENTROPY}); + public static final Aspect ARMOR = new Aspect("tutamen",0x00c0c0, new Aspect[] {TOOL, EARTH}); + public static final Aspect HUNGER = new Aspect("fames",0x9a0305, new Aspect[] {LIFE, VOID}); + public static final Aspect GREED = new Aspect("lucrum",0xe6be44, new Aspect[] {MAN, HUNGER}); + public static final Aspect CRAFT = new Aspect("fabrico",0x809d80, new Aspect[] {MAN, TOOL}); + public static final Aspect CLOTH = new Aspect("pannus",0xeaeac2, new Aspect[] {TOOL, BEAST}); + public static final Aspect MECHANISM = new Aspect("machina",0x8080a0, new Aspect[] {MOTION, TOOL}); + public static final Aspect TRAP = new Aspect("vinculum",0x9a8080, new Aspect[] {MOTION, ENTROPY}); + + +} diff --git a/src/api/java/thaumcraft/api/aspects/AspectList.java b/src/api/java/thaumcraft/api/aspects/AspectList.java new file mode 100644 index 00000000..6b9dfcef --- /dev/null +++ b/src/api/java/thaumcraft/api/aspects/AspectList.java @@ -0,0 +1,256 @@ +package thaumcraft.api.aspects; + +import java.io.Serializable; +import java.util.LinkedHashMap; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import thaumcraft.api.ThaumcraftApiHelper; + +public class AspectList implements Serializable { + + public LinkedHashMap aspects = new LinkedHashMap();//aspects associated with this object + + + /** + * this creates a new aspect list with preloaded values based off the aspects of the given item. + * @param the itemstack of the given item + */ + public AspectList(ItemStack stack) { + try { + AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack); + if (temp!=null) + for (Aspect tag:temp.getAspects()) { + add(tag,temp.getAmount(tag)); + } + } catch (Exception e) {} + } + + public AspectList() { + } + + public AspectList copy() { + AspectList out = new AspectList(); + for (Aspect a:this.getAspects()) + out.add(a, this.getAmount(a)); + return out; + } + + /** + * @return the amount of different aspects in this collection + */ + public int size() { + return aspects.size(); + } + + /** + * @return the amount of total vis in this collection + */ + public int visSize() { + int q = 0; + + for (Aspect as:aspects.keySet()) { + q+=this.getAmount(as); + } + + return q; + } + + /** + * @return an array of all the aspects in this collection + */ + public Aspect[] getAspects() { + Aspect[] q = new Aspect[1]; + return aspects.keySet().toArray(q); + } + + /** + * @return an array of all the aspects in this collection + */ + public Aspect[] getPrimalAspects() { + AspectList t = new AspectList(); + for (Aspect as:aspects.keySet()) { + if (as.isPrimal()) { + t.add(as,1); + } + } + Aspect[] q = new Aspect[1]; + return t.aspects.keySet().toArray(q); + } + + /** + * @return an array of all the aspects in this collection sorted by name + */ + public Aspect[] getAspectsSorted() { + try { + Aspect[] out = aspects.keySet().toArray(new Aspect[1]); + boolean change=false; + do { + change=false; + for(int a=0;a0) { + out[a] = e2; + out[a+1] = e1; + change = true; + break; + } + } + } while (change==true); + return out; + } catch (Exception e) { + return this.getAspects(); + } + } + + /** + * @return an array of all the aspects in this collection sorted by amount + */ + public Aspect[] getAspectsSortedAmount() { + try { + Aspect[] out = aspects.keySet().toArray(new Aspect[1]); + boolean change=false; + do { + change=false; + for(int a=0;a0 && e2>0 && e2>e1) { + Aspect ea = out[a]; + Aspect eb = out[a+1]; + out[a] = eb; + out[a+1] = ea; + change = true; + break; + } + } + } while (change==true); + return out; + } catch (Exception e) { + return this.getAspects(); + } + } + + /** + * @param key + * @return the amount associated with the given aspect in this collection + */ + public int getAmount(Aspect key) { + return aspects.get(key)==null?0:aspects.get(key); + } + + /** + * Reduces the amount of an aspect in this collection by the given amount. + * @param key + * @param amount + * @return + */ + public boolean reduce(Aspect key, int amount) { + if (getAmount(key)>=amount) { + int am = getAmount(key)-amount; + aspects.put(key, am); + return true; + } + return false; + } + + /** + * Reduces the amount of an aspect in this collection by the given amount. + * If reduced to 0 or less the aspect will be removed completely. + * @param key + * @param amount + * @return + */ + public AspectList remove(Aspect key, int amount) { + int am = getAmount(key)-amount; + if (am<=0) aspects.remove(key); else + this.aspects.put(key, am); + return this; + } + + /** + * Simply removes the aspect from the list + * @param key + * @param amount + * @return + */ + public AspectList remove(Aspect key) { + aspects.remove(key); + return this; + } + + /** + * Adds this aspect and amount to the collection. + * If the aspect exists then its value will be increased by the given amount. + * @param aspect + * @param amount + * @return + */ + public AspectList add(Aspect aspect, int amount) { + if (this.aspects.containsKey(aspect)) { + int oldamount = this.aspects.get(aspect); + amount+=oldamount; + } + this.aspects.put( aspect, amount ); + return this; + } + + + /** + * Adds this aspect and amount to the collection. + * If the aspect exists then only the highest of the old or new amount will be used. + * @param aspect + * @param amount + * @return + */ + public AspectList merge(Aspect aspect, int amount) { + if (this.aspects.containsKey(aspect)) { + int oldamount = this.aspects.get(aspect); + if (amount0?aspects:null; + } + return null; + } + + @Override + public void setAspects(ItemStack itemstack, AspectList aspects) { + if (!itemstack.hasTagCompound()) itemstack.setTagCompound(new NBTTagCompound()); + aspects.writeToNBT(itemstack.getTagCompound()); + } +*/ \ No newline at end of file diff --git a/src/api/java/thaumcraft/api/aspects/IEssentiaTransport.java b/src/api/java/thaumcraft/api/aspects/IEssentiaTransport.java new file mode 100644 index 00000000..fecbc160 --- /dev/null +++ b/src/api/java/thaumcraft/api/aspects/IEssentiaTransport.java @@ -0,0 +1,100 @@ +package thaumcraft.api.aspects; + +import net.minecraftforge.common.util.ForgeDirection; + + +/** + * @author Azanor + * This interface is used by tiles that use or transport vis. + * Only tiles that implement this interface will be able to connect to vis conduits or other thaumic devices + */ +public interface IEssentiaTransport { + /** + * Is this tile able to connect to other vis users/sources on the specified side? + * @param face + * @return + */ + public boolean isConnectable(ForgeDirection face); + + /** + * Is this side used to input essentia? + * @param face + * @return + */ + boolean canInputFrom(ForgeDirection face); + + /** + * Is this side used to output essentia? + * @param face + * @return + */ + boolean canOutputTo(ForgeDirection face); + + /** + * Sets the amount of suction this block will apply + * @param suction + */ + public void setSuction(Aspect aspect, int amount); + + /** + * Returns the type of suction this block is applying. + * @param loc + * the location from where the suction is being checked + * @return + * a return type of null indicates the suction is untyped and the first thing available will be drawn + */ + public Aspect getSuctionType(ForgeDirection face); + + /** + * Returns the strength of suction this block is applying. + * @param loc + * the location from where the suction is being checked + * @return + */ + public int getSuctionAmount(ForgeDirection face); + + /** + * remove the specified amount of essentia from this transport tile + * @return how much was actually taken + */ + public int takeEssentia(Aspect aspect, int amount, ForgeDirection face); + + /** + * add the specified amount of essentia to this transport tile + * @return how much was actually added + */ + public int addEssentia(Aspect aspect, int amount, ForgeDirection face); + + /** + * What type of essentia this contains + * @param face + * @return + */ + public Aspect getEssentiaType(ForgeDirection face); + + /** + * How much essentia this block contains + * @param face + * @return + */ + public int getEssentiaAmount(ForgeDirection face); + + + + /** + * Essentia will not be drawn from this container unless the suction exceeds this amount. + * @return the amount + */ + public int getMinimumSuction(); + + /** + * Return true if you want the conduit to extend a little further into the block. + * Used by jars and alembics that have smaller than normal hitboxes + * @return + */ + boolean renderExtendedTube(); + + + +} + diff --git a/src/api/java/thaumcraft/api/crafting/CrucibleRecipe.java b/src/api/java/thaumcraft/api/crafting/CrucibleRecipe.java new file mode 100644 index 00000000..9c1e8a62 --- /dev/null +++ b/src/api/java/thaumcraft/api/crafting/CrucibleRecipe.java @@ -0,0 +1,95 @@ +package thaumcraft.api.crafting; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; + +public class CrucibleRecipe { + + private ItemStack recipeOutput; + + + public Object catalyst; + public AspectList aspects; + public String key; + + public CrucibleRecipe(String researchKey, ItemStack result, Object cat, AspectList tags) { + recipeOutput = result; + this.aspects = tags; + this.key = researchKey; + this.catalyst = cat; + if (cat instanceof String) { + this.catalyst = OreDictionary.getOres((String) cat); + } + } + + + public boolean matches(AspectList itags, ItemStack cat) { + if (catalyst instanceof ItemStack && + !ThaumcraftApiHelper.itemMatches((ItemStack) catalyst,cat,false)) { + return false; + } else + if (catalyst instanceof ArrayList && ((ArrayList)catalyst).size()>0) { + ItemStack[] ores = ((ArrayList)catalyst).toArray(new ItemStack[]{}); + if (!ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{cat},ores)) return false; + } + if (itags==null) return false; + for (Aspect tag:aspects.getAspects()) { + if (itags.getAmount(tag))catalyst).size()>0) { + ItemStack[] ores = ((ArrayList)catalyst).toArray(new ItemStack[]{}); + if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{cat},ores)) return true; + } + return false; + } + + public AspectList removeMatching(AspectList itags) { + AspectList temptags = new AspectList(); + temptags.aspects.putAll(itags.aspects); + + for (Aspect tag:aspects.getAspects()) { + temptags.remove(tag, aspects.getAmount(tag)); +// if (!temptags.remove(tag, aspects.getAmount(tag))) return null; + } + + itags = temptags; + return itags; + } + + public ItemStack getRecipeOutput() { + return recipeOutput; + } + + +// @Override +// public int hashCode() { +// String hash = ""; +// if (catalyst instanceof ItemStack) { +// hash += ((ItemStack)catalyst).toString(); +// } else if (catalyst instanceof ArrayList && ((ArrayList)catalyst).size()>0) { +// for (ItemStack s:(ArrayList)catalyst) { +// hash += s.toString(); +// } +// } else { +// hash += catalyst.hashCode(); +// } +// hash += getRecipeOutput().toString(); +// for (Aspect a:aspects.getAspectsSorted()) { +// hash += a.getTag() + aspects.getAmount(a); +// } +// return hash.hashCode(); +// } + +} diff --git a/src/api/java/thaumcraft/api/crafting/IArcaneRecipe.java b/src/api/java/thaumcraft/api/crafting/IArcaneRecipe.java new file mode 100644 index 00000000..bb5036d2 --- /dev/null +++ b/src/api/java/thaumcraft/api/crafting/IArcaneRecipe.java @@ -0,0 +1,35 @@ +package thaumcraft.api.crafting; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import thaumcraft.api.aspects.AspectList; + +public interface IArcaneRecipe +{ + + + /** + * Used to check if a recipe matches current crafting inventory + * @param player + */ + boolean matches(IInventory var1, World world, EntityPlayer player); + + /** + * Returns an Item that is the result of this recipe + */ + ItemStack getCraftingResult(IInventory var1); + + /** + * Returns the size of the recipe area + */ + int getRecipeSize(); + + ItemStack getRecipeOutput(); + AspectList getAspects(); + AspectList getAspects(IInventory var1); + String getResearch(); + + +} diff --git a/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java b/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java new file mode 100644 index 00000000..d137ff24 --- /dev/null +++ b/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java @@ -0,0 +1,19 @@ +package thaumcraft.api.crafting; + +import net.minecraft.world.World; + +/** + * + * @author Azanor + * + * Blocks that implement this interface act as infusion crafting stabilisers like candles and skulls + * + */ +public interface IInfusionStabiliser { + + /** + * returns true if the block can stabilise things + */ + public boolean canStabaliseInfusion(World world, int x, int y, int z); + +} diff --git a/src/api/java/thaumcraft/api/crafting/InfusionEnchantmentRecipe.java b/src/api/java/thaumcraft/api/crafting/InfusionEnchantmentRecipe.java new file mode 100644 index 00000000..6fb4d63d --- /dev/null +++ b/src/api/java/thaumcraft/api/crafting/InfusionEnchantmentRecipe.java @@ -0,0 +1,156 @@ +package thaumcraft.api.crafting; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Map; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.aspects.AspectList; + +public class InfusionEnchantmentRecipe +{ + + public AspectList aspects; + public String research; + public ItemStack[] components; + public Enchantment enchantment; + public int recipeXP; + public int instability; + + public InfusionEnchantmentRecipe(String research, Enchantment input, int inst, + AspectList aspects2, ItemStack[] recipe) { + this.research = research; + this.enchantment = input; + this.aspects = aspects2; + this.components = recipe; + this.instability = inst; + this.recipeXP = Math.max(1, input.getMinEnchantability(1)/3); + } + + /** + * Used to check if a recipe matches current crafting inventory + * @param player + */ + public boolean matches(ArrayList input, ItemStack central, World world, EntityPlayer player) { + if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { + return false; + } + + if (!enchantment.canApply(central) || !central.getItem().isItemTool(central)) { + return false; + } + + Map map1 = EnchantmentHelper.getEnchantments(central); + Iterator iterator = map1.keySet().iterator(); + while (iterator.hasNext()) + { + int j1 = ((Integer)iterator.next()).intValue(); + Enchantment ench = Enchantment.enchantmentsList[j1]; + if (j1 == enchantment.effectId && + EnchantmentHelper.getEnchantmentLevel(j1, central)>=ench.getMaxLevel()) + return false; + if (enchantment.effectId != ench.effectId && + (!enchantment.canApplyTogether(ench) || + !ench.canApplyTogether(enchantment))) { + return false; + } + } + + ItemStack i2 = null; + + ArrayList ii = new ArrayList(); + for (ItemStack is:input) { + ii.add(is.copy()); + } + + for (ItemStack comp:components) { + boolean b=false; + for (int a=0;a stack0.getMaxStackSize() ? false : t1)); + } + + + public Enchantment getEnchantment() { + return enchantment; + + } + + public AspectList getAspects() { + return aspects; + + } + + public String getResearch() { + return research; + + } + + public int calcInstability(ItemStack recipeInput) { + int i = 0; + Map map1 = EnchantmentHelper.getEnchantments(recipeInput); + Iterator iterator = map1.keySet().iterator(); + while (iterator.hasNext()) + { + int j1 = ((Integer)iterator.next()).intValue(); + i += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput); + } + return (i/2) + instability; + } + + public int calcXP(ItemStack recipeInput) { + return recipeXP * (1+EnchantmentHelper.getEnchantmentLevel(enchantment.effectId, recipeInput)); + } + + public float getEssentiaMod(ItemStack recipeInput) { + float mod = EnchantmentHelper.getEnchantmentLevel(enchantment.effectId, recipeInput); + Map map1 = EnchantmentHelper.getEnchantments(recipeInput); + Iterator iterator = map1.keySet().iterator(); + while (iterator.hasNext()) + { + int j1 = ((Integer)iterator.next()).intValue(); + if (j1 != enchantment.effectId) + mod += EnchantmentHelper.getEnchantmentLevel(j1, recipeInput) * .1f; + } + return mod; + } + +} diff --git a/src/api/java/thaumcraft/api/crafting/InfusionRecipe.java b/src/api/java/thaumcraft/api/crafting/InfusionRecipe.java new file mode 100644 index 00000000..fef0a347 --- /dev/null +++ b/src/api/java/thaumcraft/api/crafting/InfusionRecipe.java @@ -0,0 +1,128 @@ +package thaumcraft.api.crafting; + +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.aspects.AspectList; + +public class InfusionRecipe +{ + protected AspectList aspects; + protected String research; + private ItemStack[] components; + private ItemStack recipeInput; + protected Object recipeOutput; + protected int instability; + + public InfusionRecipe(String research, Object output, int inst, + AspectList aspects2, ItemStack input, ItemStack[] recipe) { + this.research = research; + this.recipeOutput = output; + this.recipeInput = input; + this.aspects = aspects2; + this.components = recipe; + this.instability = inst; + } + + /** + * Used to check if a recipe matches current crafting inventory + * @param player + */ + public boolean matches(ArrayList input, ItemStack central, World world, EntityPlayer player) { + if (getRecipeInput()==null) return false; + + if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { + return false; + } + + ItemStack i2 = central.copy(); + if (getRecipeInput().getItemDamage()==OreDictionary.WILDCARD_VALUE) { + i2.setItemDamage(OreDictionary.WILDCARD_VALUE); + } + + if (!areItemStacksEqual(i2, getRecipeInput(), true)) return false; + + ArrayList ii = new ArrayList(); + for (ItemStack is:input) { + ii.add(is.copy()); + } + + for (ItemStack comp:getComponents()) { + boolean b=false; + for (int a=0;a stack0.getMaxStackSize() ? false : t1)); + } + + + public Object getRecipeOutput() { + return getRecipeOutput(this.getRecipeInput()); + } + + public AspectList getAspects() { + return getAspects(this.getRecipeInput()); + } + + public int getInstability() { + return getInstability(this.getRecipeInput()); + } + + public String getResearch() { + return research; + } + + public ItemStack getRecipeInput() { + return recipeInput; + } + + public ItemStack[] getComponents() { + return components; + } + + public Object getRecipeOutput(ItemStack input) { + return recipeOutput; + } + + public AspectList getAspects(ItemStack input) { + return aspects; + } + + public int getInstability(ItemStack input) { + return instability; + } +} diff --git a/src/api/java/thaumcraft/api/crafting/ShapedArcaneRecipe.java b/src/api/java/thaumcraft/api/crafting/ShapedArcaneRecipe.java new file mode 100644 index 00000000..40c7bc27 --- /dev/null +++ b/src/api/java/thaumcraft/api/crafting/ShapedArcaneRecipe.java @@ -0,0 +1,261 @@ +package thaumcraft.api.crafting; + +import java.util.ArrayList; +import java.util.HashMap; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.aspects.AspectList; + +public class ShapedArcaneRecipe implements IArcaneRecipe +{ + //Added in for future ease of change, but hard coded for now. + private static final int MAX_CRAFT_GRID_WIDTH = 3; + private static final int MAX_CRAFT_GRID_HEIGHT = 3; + + public ItemStack output = null; + public Object[] input = null; + public AspectList aspects = null; + public String research; + public int width = 0; + public int height = 0; + private boolean mirrored = true; + + public ShapedArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); } + public ShapedArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research, new ItemStack(result), aspects, recipe); } + public ShapedArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe) + { + output = result.copy(); + this.research = research; + this.aspects = aspects; + String shape = ""; + + int idx = 0; + + if (recipe[idx] instanceof Boolean) + { + mirrored = (Boolean)recipe[idx]; + if (recipe[idx+1] instanceof Object[]) + { + recipe = (Object[])recipe[idx+1]; + } + else + { + idx = 1; + } + } + + if (recipe[idx] instanceof String[]) + { + String[] parts = ((String[])recipe[idx++]); + + for (String s : parts) + { + width = s.length(); + shape += s; + } + + height = parts.length; + } + else + { + while (recipe[idx] instanceof String) + { + String s = (String)recipe[idx++]; + shape += s; + width = s.length(); + height++; + } + } + + if (width * height != shape.length()) + { + String ret = "Invalid shaped ore recipe: "; + for (Object tmp : recipe) + { + ret += tmp + ", "; + } + ret += output; + throw new RuntimeException(ret); + } + + HashMap itemMap = new HashMap(); + + for (; idx < recipe.length; idx += 2) + { + Character chr = (Character)recipe[idx]; + Object in = recipe[idx + 1]; + + 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); + } + } + + input = new Object[width * height]; + int x = 0; + for (char chr : shape.toCharArray()) + { + input[x++] = itemMap.get(chr); + } + } + + @Override + public ItemStack getCraftingResult(IInventory var1){ return output.copy(); } + + @Override + public int getRecipeSize(){ return input.length; } + + @Override + public ItemStack getRecipeOutput(){ return output; } + + @Override + public boolean matches(IInventory inv, World world, EntityPlayer player) + { + if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { + return false; + } + 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; + } + + if (mirrored && checkMatch(inv, x, y, true)) + { + return true; + } + } + } + + return false; + } + + private boolean checkMatch(IInventory 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; + + 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 = ThaumcraftApiHelper.getStackInRowAndColumn(inv, x, y); + + if (target instanceof ItemStack) + { + if (!checkItemEquals((ItemStack)target, slot)) + { + return false; + } + } + else if (target instanceof ArrayList) + { + boolean matched = false; + + for (ItemStack item : (ArrayList)target) + { + matched = matched || checkItemEquals(item, slot); + } + + if (!matched) + { + return false; + } + } + else if (target == null && slot != null) + { + return false; + } + } + } + + return true; + } + + private boolean checkItemEquals(ItemStack target, ItemStack input) + { + if (input == null && target != null || input != null && target == null) + { + return false; + } + return (target.getItem() == input.getItem() && + (!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) && + (target.getItemDamage() == OreDictionary.WILDCARD_VALUE|| target.getItemDamage() == input.getItemDamage())); + } + + public ShapedArcaneRecipe setMirrored(boolean mirror) + { + mirrored = mirror; + return this; + } + + /** + * Returns the input for this recipe, any mod accessing this value should never + * manipulate the values in this array as it will effect the recipe itself. + * @return The recipes input vales. + */ + public Object[] getInput() + { + return this.input; + } + + @Override + public AspectList getAspects() { + return aspects; + } + + @Override + public AspectList getAspects(IInventory inv) { + return aspects; + } + + @Override + public String getResearch() { + return research; + } +} diff --git a/src/api/java/thaumcraft/api/crafting/ShapelessArcaneRecipe.java b/src/api/java/thaumcraft/api/crafting/ShapelessArcaneRecipe.java new file mode 100644 index 00000000..3d4ed508 --- /dev/null +++ b/src/api/java/thaumcraft/api/crafting/ShapelessArcaneRecipe.java @@ -0,0 +1,157 @@ +package thaumcraft.api.crafting; + +import java.util.ArrayList; +import java.util.Iterator; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.api.aspects.AspectList; + +public class ShapelessArcaneRecipe implements IArcaneRecipe +{ + private ItemStack output = null; + private ArrayList input = new ArrayList(); + + public AspectList aspects = null; + public String research; + + public ShapelessArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); } + public ShapelessArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe){ this(research,new ItemStack(result),aspects, recipe); } + + public ShapelessArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe) + { + output = result.copy(); + this.research = research; + this.aspects = aspects; + for (Object in : recipe) + { + if (in instanceof ItemStack) + { + input.add(((ItemStack)in).copy()); + } + 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); + } + } + } + + @Override + public int getRecipeSize(){ return input.size(); } + + @Override + public ItemStack getRecipeOutput(){ return output; } + + @Override + public ItemStack getCraftingResult(IInventory var1){ return output.copy(); } + + @Override + public boolean matches(IInventory var1, World world, EntityPlayer player) + { + if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) { + return false; + } + + ArrayList required = new ArrayList(input); + + for (int x = 0; x < 9; x++) + { + ItemStack slot = var1.getStackInSlot(x); + + if (slot != null) + { + boolean inRecipe = false; + Iterator req = required.iterator(); + + while (req.hasNext()) + { + boolean match = false; + + Object next = req.next(); + + if (next instanceof ItemStack) + { + match = checkItemEquals((ItemStack)next, slot); + } + else if (next instanceof ArrayList) + { + for (ItemStack item : (ArrayList)next) + { + match = match || checkItemEquals(item, slot); + } + } + + if (match) + { + inRecipe = true; + required.remove(next); + break; + } + } + + if (!inRecipe) + { + return false; + } + } + } + + return required.isEmpty(); + } + + private boolean checkItemEquals(ItemStack target, ItemStack input) + { + return (target.getItem() == input.getItem() && + (!target.hasTagCompound() || ItemStack.areItemStackTagsEqual(target, input)) && + (target.getItemDamage() == OreDictionary.WILDCARD_VALUE || target.getItemDamage() == input.getItemDamage())); + } + + /** + * Returns the input for this recipe, any mod accessing this value should never + * manipulate the values in this array as it will effect the recipe itself. + * @return The recipes input vales. + */ + public ArrayList getInput() + { + return this.input; + } + + @Override + public AspectList getAspects() { + return aspects; + } + + @Override + public AspectList getAspects(IInventory inv) { + return aspects; + } + + @Override + public String getResearch() { + return research; + } +} diff --git a/src/api/java/thaumcraft/api/damagesource/DamageSourceIndirectThaumcraftEntity.java b/src/api/java/thaumcraft/api/damagesource/DamageSourceIndirectThaumcraftEntity.java new file mode 100644 index 00000000..1562d052 --- /dev/null +++ b/src/api/java/thaumcraft/api/damagesource/DamageSourceIndirectThaumcraftEntity.java @@ -0,0 +1,32 @@ +package thaumcraft.api.damagesource; + +import net.minecraft.entity.Entity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; + +public class DamageSourceIndirectThaumcraftEntity extends EntityDamageSourceIndirect { + + private boolean fireDamage; + private float hungerDamage; + private boolean isUnblockable; + + + public DamageSourceIndirectThaumcraftEntity(String par1Str, + Entity par2Entity, Entity par3Entity) { + super(par1Str, par2Entity, par3Entity); + } + + + public DamageSource setFireDamage() + { + this.fireDamage = true; + return this; + } + + public DamageSource setDamageBypassesArmor() + { + this.isUnblockable = true; + this.hungerDamage = 0.0F; + return this; + } +} diff --git a/src/api/java/thaumcraft/api/damagesource/DamageSourceThaumcraft.java b/src/api/java/thaumcraft/api/damagesource/DamageSourceThaumcraft.java new file mode 100644 index 00000000..7c277f28 --- /dev/null +++ b/src/api/java/thaumcraft/api/damagesource/DamageSourceThaumcraft.java @@ -0,0 +1,46 @@ +package thaumcraft.api.damagesource; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; + +public class DamageSourceThaumcraft extends DamageSource +{ + + public static DamageSource taint = new DamageSourceThaumcraft("taint").setDamageBypassesArmor().setMagicDamage(); + public static DamageSource tentacle = new DamageSourceThaumcraft("tentacle"); + public static DamageSource swarm = new DamageSourceThaumcraft("swarm"); + + protected DamageSourceThaumcraft(String par1Str) { + super(par1Str); + } + + /** This kind of damage can be blocked or not. */ + private boolean isUnblockable = false; + private boolean isDamageAllowedInCreativeMode = false; + private float hungerDamage = 0.3F; + + /** This kind of damage is based on fire or not. */ + private boolean fireDamage; + + /** This kind of damage is based on a projectile or not. */ + private boolean projectile; + + /** + * Whether this damage source will have its damage amount scaled based on the current difficulty. + */ + private boolean difficultyScaled; + private boolean magicDamage = false; + private boolean explosion = false; + + public static DamageSource causeSwarmDamage(EntityLivingBase par0EntityLiving) + { + return new EntityDamageSource("swarm", par0EntityLiving); + } + + public static DamageSource causeTentacleDamage(EntityLivingBase par0EntityLiving) + { + return new EntityDamageSource("tentacle", par0EntityLiving); + } + +} diff --git a/src/api/java/thaumcraft/api/entities/ITaintedMob.java b/src/api/java/thaumcraft/api/entities/ITaintedMob.java new file mode 100644 index 00000000..83fb1fcb --- /dev/null +++ b/src/api/java/thaumcraft/api/entities/ITaintedMob.java @@ -0,0 +1,5 @@ +package thaumcraft.api.entities; + +public interface ITaintedMob { + +} diff --git a/src/api/java/thaumcraft/api/nodes/INode.java b/src/api/java/thaumcraft/api/nodes/INode.java new file mode 100644 index 00000000..8c71414d --- /dev/null +++ b/src/api/java/thaumcraft/api/nodes/INode.java @@ -0,0 +1,53 @@ +package thaumcraft.api.nodes; + +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IAspectContainer; + +public interface INode extends IAspectContainer { + + /** + * Unique identifier to distinguish nodes. Normal node id's are based on world id and coordinates + * @return + */ + public String getId(); + + public AspectList getAspectsBase(); + + /** + * Return the type of node + * @return + */ + public NodeType getNodeType(); + + /** + * Set the type of node + * @return + */ + public void setNodeType(NodeType nodeType); + + /** + * Return the node modifier + * @return + */ + public void setNodeModifier(NodeModifier nodeModifier); + + /** + * Set the node modifier + * @return + */ + public NodeModifier getNodeModifier(); + + /** + * Return the maximum capacity of each aspect the node can hold + * @return + */ + public int getNodeVisBase(Aspect aspect); + + /** + * Set the maximum capacity of each aspect the node can hold + * @return + */ + public void setNodeVisBase(Aspect aspect, short nodeVisBase); + +} diff --git a/src/api/java/thaumcraft/api/nodes/IRevealer.java b/src/api/java/thaumcraft/api/nodes/IRevealer.java new file mode 100644 index 00000000..14a19b54 --- /dev/null +++ b/src/api/java/thaumcraft/api/nodes/IRevealer.java @@ -0,0 +1,22 @@ +package thaumcraft.api.nodes; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +/** + * + * @author Azanor + * + * Equipped head slot items that extend this class will make nodes visible in world. + * + */ + +public interface IRevealer { + + /* + * If this method returns true the nodes will be visible. + */ + public boolean showNodes(ItemStack itemstack, EntityLivingBase player); + + +} diff --git a/src/api/java/thaumcraft/api/nodes/NodeModifier.java b/src/api/java/thaumcraft/api/nodes/NodeModifier.java new file mode 100644 index 00000000..885b8678 --- /dev/null +++ b/src/api/java/thaumcraft/api/nodes/NodeModifier.java @@ -0,0 +1,6 @@ +package thaumcraft.api.nodes; + +public enum NodeModifier +{ + BRIGHT, PALE, FADING +} \ No newline at end of file diff --git a/src/api/java/thaumcraft/api/nodes/NodeType.java b/src/api/java/thaumcraft/api/nodes/NodeType.java new file mode 100644 index 00000000..355324b5 --- /dev/null +++ b/src/api/java/thaumcraft/api/nodes/NodeType.java @@ -0,0 +1,6 @@ +package thaumcraft.api.nodes; + +public enum NodeType +{ + NORMAL, UNSTABLE, DARK, TAINTED, HUNGRY, PURE +} \ No newline at end of file diff --git a/src/api/java/thaumcraft/api/package-info.java b/src/api/java/thaumcraft/api/package-info.java new file mode 100644 index 00000000..0de39267 --- /dev/null +++ b/src/api/java/thaumcraft/api/package-info.java @@ -0,0 +1,4 @@ +@API(owner = "Thaumcraft", apiVersion = "4.2.0.0", provides = "Thaumcraft|API") +package thaumcraft.api; + +import cpw.mods.fml.common.API; diff --git a/src/api/java/thaumcraft/api/potions/PotionFluxTaint.java b/src/api/java/thaumcraft/api/potions/PotionFluxTaint.java new file mode 100644 index 00000000..b718de4b --- /dev/null +++ b/src/api/java/thaumcraft/api/potions/PotionFluxTaint.java @@ -0,0 +1,67 @@ +package thaumcraft.api.potions; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.util.ResourceLocation; +import thaumcraft.api.damagesource.DamageSourceThaumcraft; +import thaumcraft.api.entities.ITaintedMob; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PotionFluxTaint extends Potion +{ + public static PotionFluxTaint instance = null; // will be instantiated at runtime + private int statusIconIndex = -1; + + public PotionFluxTaint(int par1, boolean par2, int par3) + { + super(par1,par2,par3); + setIconIndex(0, 0); + } + + public static void init() + { + instance.setPotionName("potion.fluxtaint"); + instance.setIconIndex(3, 1); + instance.setEffectiveness(0.25D); + } + + @Override + public boolean isBadEffect() { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public int getStatusIconIndex() { + Minecraft.getMinecraft().renderEngine.bindTexture(rl); + return super.getStatusIconIndex(); + } + + ResourceLocation rl = new ResourceLocation("thaumcraft","textures/misc/potions.png"); + + @Override + public void performEffect(EntityLivingBase target, int par2) { + if (target instanceof ITaintedMob) { + target.heal(1); + } else + if (!target.isEntityUndead() && !(target instanceof EntityPlayer)) + { + target.attackEntityFrom(DamageSourceThaumcraft.taint, 1); + } + else + if (!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer))) + { + target.attackEntityFrom(DamageSourceThaumcraft.taint, 1); + } + } + + public boolean isReady(int par1, int par2) + { + int k = 40 >> par2; + return k > 0 ? par1 % k == 0 : true; + } + +} diff --git a/src/api/java/thaumcraft/api/research/IScanEventHandler.java b/src/api/java/thaumcraft/api/research/IScanEventHandler.java new file mode 100644 index 00000000..d0efac5f --- /dev/null +++ b/src/api/java/thaumcraft/api/research/IScanEventHandler.java @@ -0,0 +1,9 @@ +package thaumcraft.api.research; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IScanEventHandler { + ScanResult scanPhenomena(ItemStack stack, World world, EntityPlayer player); +} diff --git a/src/api/java/thaumcraft/api/research/ResearchCategories.java b/src/api/java/thaumcraft/api/research/ResearchCategories.java new file mode 100644 index 00000000..82309b36 --- /dev/null +++ b/src/api/java/thaumcraft/api/research/ResearchCategories.java @@ -0,0 +1,101 @@ +package thaumcraft.api.research; + +import java.util.Collection; +import java.util.LinkedHashMap; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import org.apache.logging.log4j.Level; + +import cpw.mods.fml.common.FMLLog; + +public class ResearchCategories { + + //Research + public static LinkedHashMap researchCategories = new LinkedHashMap (); + + /** + * @param key + * @return the research item linked to this key + */ + public static ResearchCategoryList getResearchList(String key) { + return researchCategories.get(key); + } + + /** + * @param key + * @return the name of the research category linked to this key. + * Must be stored as localization information in the LanguageRegistry. + */ + public static String getCategoryName(String key) { + return StatCollector.translateToLocal("tc.research_category."+key); + } + + /** + * @param key the research key + * @return the ResearchItem object. + */ + public static ResearchItem getResearch(String key) { + Collection rc = researchCategories.values(); + for (Object cat:rc) { + Collection rl = ((ResearchCategoryList)cat).research.values(); + for (Object ri:rl) { + if ((((ResearchItem)ri).key).equals(key)) return (ResearchItem)ri; + } + } + return null; + } + + /** + * This should only be done at the PostInit stage + * @param key the key used for this category + * @param icon the icon to be used for the research category tab + * @param background the resource location of the background image to use for this category + * @return the name of the research linked to this key + */ + public static void registerCategory(String key, ResourceLocation icon, ResourceLocation background) { + if (getResearchList(key)==null) { + ResearchCategoryList rl = new ResearchCategoryList(icon, background); + researchCategories.put(key, rl); + } + } + + public static void addResearch(ResearchItem ri) { + ResearchCategoryList rl = getResearchList(ri.category); + if (rl!=null && !rl.research.containsKey(ri.key)) { + + if (!ri.isVirtual()) { + for (ResearchItem rr:rl.research.values()) { + if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) { + FMLLog.log(Level.FATAL, "[Thaumcraft] Research ["+ri.getName()+"] not added as it overlaps with existing research ["+rr.getName()+"]"); + return; + } + } + } + + + rl.research.put(ri.key, ri); + + if (ri.displayColumn < rl.minDisplayColumn) + { + rl.minDisplayColumn = ri.displayColumn; + } + + if (ri.displayRow < rl.minDisplayRow) + { + rl.minDisplayRow = ri.displayRow; + } + + if (ri.displayColumn > rl.maxDisplayColumn) + { + rl.maxDisplayColumn = ri.displayColumn; + } + + if (ri.displayRow > rl.maxDisplayRow) + { + rl.maxDisplayRow = ri.displayRow; + } + } + } +} diff --git a/src/api/java/thaumcraft/api/research/ResearchCategoryList.java b/src/api/java/thaumcraft/api/research/ResearchCategoryList.java new file mode 100644 index 00000000..7eed0101 --- /dev/null +++ b/src/api/java/thaumcraft/api/research/ResearchCategoryList.java @@ -0,0 +1,37 @@ +package thaumcraft.api.research; + +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.util.ResourceLocation; + +public class ResearchCategoryList { + + /** Is the smallest column used on the GUI. */ + public int minDisplayColumn; + + /** Is the smallest row used on the GUI. */ + public int minDisplayRow; + + /** Is the biggest column used on the GUI. */ + public int maxDisplayColumn; + + /** Is the biggest row used on the GUI. */ + public int maxDisplayRow; + + /** display variables **/ + public ResourceLocation icon; + public ResourceLocation background; + + public ResearchCategoryList(ResourceLocation icon, ResourceLocation background) { + this.icon = icon; + this.background = background; + } + + //Research + public Map research = new HashMap(); + + + + +} diff --git a/src/api/java/thaumcraft/api/research/ResearchItem.java b/src/api/java/thaumcraft/api/research/ResearchItem.java new file mode 100644 index 00000000..55b3820c --- /dev/null +++ b/src/api/java/thaumcraft/api/research/ResearchItem.java @@ -0,0 +1,367 @@ +package thaumcraft.api.research; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; + +public class ResearchItem +{ + /** + * A short string used as a key for this research. Must be unique + */ + public final String key; + + /** + * A short string used as a reference to the research category to which this must be added. + */ + public final String category; + + /** + * The aspect tags and their values required to complete this research + */ + public final AspectList tags; + + /** + * This links to any research that needs to be completed before this research can be discovered or learnt. + */ + public String[] parents = null; + + /** + * Like parent above, but a line will not be displayed in the thaumonomicon linking them. Just used to prevent clutter. + */ + public String[] parentsHidden = null; + /** + * any research linked to this that will be unlocked automatically when this research is complete + */ + public String[] siblings = null; + + /** + * the horizontal position of the research icon + */ + public final int displayColumn; + + /** + * the vertical position of the research icon + */ + public final int displayRow; + + /** + * the icon to be used for this research + */ + public final ItemStack icon_item; + + /** + * the icon to be used for this research + */ + public final ResourceLocation icon_resource; + + /** + * How large the research grid is. Valid values are 1 to 3. + */ + private int complexity; + + /** + * Special research has a spiky border. Used for important research milestones. + */ + private boolean isSpecial; + + /** + * Research that can be directly purchased with RP in normal research difficulty. + */ + private boolean isSecondary; + + /** + * This indicates if the research should use a circular icon border. Usually used for "passive" research + * that doesn't have recipes and grants passive effects, or that unlock automatically. + */ + private boolean isRound; + + /** + * Stub research cannot be discovered by normal means, but can be unlocked via the sibling system. + */ + private boolean isStub; + + /** + * This indicated that the research is completely hidden and cannot be discovered by any + * player-controlled means. The recipes will never show up in the thaumonomicon. + * Usually used to unlock "hidden" recipes via sibling unlocking, like + * the various cap and rod combos for wands. + */ + private boolean isVirtual; + + @Deprecated + private boolean isLost; + + /** + * Concealed research does not display in the thaumonomicon until parent researches are discovered. + */ + private boolean isConcealed; + + /** + * Hidden research can only be discovered via scanning or knowledge fragments + */ + private boolean isHidden; + + /** + * These research items will automatically unlock for all players on game start + */ + private boolean isAutoUnlock; + + /** + * Scanning these items will have a chance of revealing hidden knowledge in the thaumonomicon + */ + private ItemStack[] itemTriggers; + + /** + * Scanning these entities will have a chance of revealing hidden knowledge in the thaumonomicon + */ + private String[] entityTriggers; + + /** + * Scanning things with these aspects will have a chance of revealing hidden knowledge in the thaumonomicon + */ + private Aspect[] aspectTriggers; + + private ResearchPage[] pages = null; + + public ResearchItem(String key, String category) + { + this.key = key; + this.category = category; + this.tags = new AspectList(); + this.icon_resource = null; + this.icon_item = null; + this.displayColumn = 0; + this.displayRow = 0; + this.setVirtual(); + + } + + public ResearchItem(String key, String category, AspectList tags, int col, int row, int complex, ResourceLocation icon) + { + this.key = key; + this.category = category; + this.tags = tags; + this.icon_resource = icon; + this.icon_item = null; + this.displayColumn = col; + this.displayRow = row; + this.complexity = complex; + if (complexity < 1) this.complexity = 1; + if (complexity > 3) this.complexity = 3; + } + + public ResearchItem(String key, String category, AspectList tags, int col, int row, int complex, ItemStack icon) + { + this.key = key; + this.category = category; + this.tags = tags; + this.icon_item = icon; + this.icon_resource = null; + this.displayColumn = col; + this.displayRow = row; + this.complexity = complex; + if (complexity < 1) this.complexity = 1; + if (complexity > 3) this.complexity = 3; + } + + public ResearchItem setSpecial() + { + this.isSpecial = true; + return this; + } + + public ResearchItem setStub() + { + this.isStub = true; + return this; + } + + @Deprecated + public ResearchItem setLost() + { + this.isLost = true; + return this; + } + + public ResearchItem setConcealed() + { + this.isConcealed = true; + return this; + } + + public ResearchItem setHidden() + { + this.isHidden = true; + return this; + } + + public ResearchItem setVirtual() + { + this.isVirtual = true; + return this; + } + + public ResearchItem setParents(String... par) + { + this.parents = par; + return this; + } + + + + public ResearchItem setParentsHidden(String... par) + { + this.parentsHidden = par; + return this; + } + + public ResearchItem setSiblings(String... sib) + { + this.siblings = sib; + return this; + } + + public ResearchItem setPages(ResearchPage... par) + { + this.pages = par; + return this; + } + + public ResearchPage[] getPages() { + return pages; + } + + public ResearchItem setItemTriggers(ItemStack... par) + { + this.itemTriggers = par; + return this; + } + + public ResearchItem setEntityTriggers(String... par) + { + this.entityTriggers = par; + return this; + } + + public ResearchItem setAspectTriggers(Aspect... par) + { + this.aspectTriggers = par; + return this; + } + + public ItemStack[] getItemTriggers() { + return itemTriggers; + } + + public String[] getEntityTriggers() { + return entityTriggers; + } + + public Aspect[] getAspectTriggers() { + return aspectTriggers; + } + + public ResearchItem registerResearchItem() + { + ResearchCategories.addResearch(this); + return this; + } + + public String getName() + { + return StatCollector.translateToLocal("tc.research_name."+key); + } + + public String getText() + { + return StatCollector.translateToLocal("tc.research_text."+key); + } + + public boolean isSpecial() + { + return this.isSpecial; + } + + public boolean isStub() + { + return this.isStub; + } + + @Deprecated + public boolean isLost() + { + return this.isLost; + } + + public boolean isConcealed() + { + return this.isConcealed; + } + + public boolean isHidden() + { + return this.isHidden; + } + + public boolean isVirtual() + { + return this.isVirtual; + } + + public boolean isAutoUnlock() { + return isAutoUnlock; + } + + public ResearchItem setAutoUnlock() + { + this.isAutoUnlock = true; + return this; + } + + public boolean isRound() { + return isRound; + } + + public ResearchItem setRound() { + this.isRound = true; + return this; + } + + public boolean isSecondary() { + return isSecondary; + } + + public ResearchItem setSecondary() { + this.isSecondary = true; + return this; + } + + public int getComplexity() { + return complexity; + } + + public ResearchItem setComplexity(int complexity) { + this.complexity = complexity; + return this; + } + + /** + * @return the aspect aspects ordinal with the highest value. Used to determine scroll color and similar things + */ + public Aspect getResearchPrimaryTag() { + Aspect aspect=null; + int highest=0; + if (tags!=null) + for (Aspect tag:tags.getAspects()) { + if (tags.getAmount(tag)>highest) { + aspect=tag; + highest=tags.getAmount(tag); + }; + } + return aspect; + } + +} diff --git a/src/api/java/thaumcraft/api/research/ResearchPage.java b/src/api/java/thaumcraft/api/research/ResearchPage.java new file mode 100644 index 00000000..fdada843 --- /dev/null +++ b/src/api/java/thaumcraft/api/research/ResearchPage.java @@ -0,0 +1,193 @@ +package thaumcraft.api.research; + +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.crafting.CrucibleRecipe; +import thaumcraft.api.crafting.IArcaneRecipe; +import thaumcraft.api.crafting.InfusionEnchantmentRecipe; +import thaumcraft.api.crafting.InfusionRecipe; + +public class ResearchPage { + public static enum PageType + { + TEXT, + TEXT_CONCEALED, + IMAGE, + CRUCIBLE_CRAFTING, + ARCANE_CRAFTING, + ASPECTS, + NORMAL_CRAFTING, + INFUSION_CRAFTING, + COMPOUND_CRAFTING, + INFUSION_ENCHANTMENT, + SMELTING + } + + public PageType type = PageType.TEXT; + + public String text=null; + public String research=null; + public ResourceLocation image=null; + public AspectList aspects=null; + public Object recipe=null; + public ItemStack recipeOutput=null; + + /** + * @param text this can (but does not have to) be a reference to a localization variable, not the actual text. + */ + public ResearchPage(String text) { + this.type = PageType.TEXT; + this.text = text; + } + + /** + * @param research this page will only be displayed if the player has discovered this research + * @param text this can (but does not have to) be a reference to a localization variable, not the actual text. + */ + public ResearchPage(String research, String text) { + this.type = PageType.TEXT_CONCEALED; + this.research = research; + this.text = text; + } + + /** + * @param recipe a vanilla crafting recipe. + */ + public ResearchPage(IRecipe recipe) { + this.type = PageType.NORMAL_CRAFTING; + this.recipe = recipe; + this.recipeOutput = recipe.getRecipeOutput(); + } + + /** + * @param recipe a collection of vanilla crafting recipes. + */ + public ResearchPage(IRecipe[] recipe) { + this.type = PageType.NORMAL_CRAFTING; + this.recipe = recipe; + } + + /** + * @param recipe a collection of arcane crafting recipes. + */ + public ResearchPage(IArcaneRecipe[] recipe) { + this.type = PageType.ARCANE_CRAFTING; + this.recipe = recipe; + } + + /** + * @param recipe a collection of arcane crafting recipes. + */ + public ResearchPage(CrucibleRecipe[] recipe) { + this.type = PageType.CRUCIBLE_CRAFTING; + this.recipe = recipe; + } + + /** + * @param recipe a collection of infusion crafting recipes. + */ + public ResearchPage(InfusionRecipe[] recipe) { + this.type = PageType.INFUSION_CRAFTING; + this.recipe = recipe; + } + + /** + * @param recipe a compound crafting recipe. + */ + public ResearchPage(List recipe) { + this.type = PageType.COMPOUND_CRAFTING; + this.recipe = recipe; + } + + /** + * @param recipe an arcane worktable crafting recipe. + */ + public ResearchPage(IArcaneRecipe recipe) { + this.type = PageType.ARCANE_CRAFTING; + this.recipe = recipe; + this.recipeOutput = recipe.getRecipeOutput(); + } + + /** + * @param recipe an alchemy crafting recipe. + */ + public ResearchPage(CrucibleRecipe recipe) { + this.type = PageType.CRUCIBLE_CRAFTING; + this.recipe = recipe; + this.recipeOutput = recipe.getRecipeOutput(); + } + + /** + * @param recipe a furnace smelting crafting recipe. + */ + public ResearchPage(ItemStack input) { + this.type = PageType.SMELTING; + this.recipe = input; + this.recipeOutput = FurnaceRecipes.smelting().getSmeltingResult(input); + } + + /** + * @param recipe an infusion crafting recipe. + */ + public ResearchPage(InfusionRecipe recipe) { + this.type = PageType.INFUSION_CRAFTING; + this.recipe = recipe; + if (recipe.getRecipeOutput() instanceof ItemStack) { + this.recipeOutput = (ItemStack) recipe.getRecipeOutput(); + } else { + this.recipeOutput = recipe.getRecipeInput(); + } + } + + /** + * @param recipe an infusion crafting recipe. + */ + public ResearchPage(InfusionEnchantmentRecipe recipe) { + this.type = PageType.INFUSION_ENCHANTMENT; + this.recipe = recipe; +// if (recipe.recipeOutput instanceof ItemStack) { +// this.recipeOutput = (ItemStack) recipe.recipeOutput; +// } else { +// this.recipeOutput = recipe.recipeInput; +// } + } + + /** + * @param image + * @param caption this can (but does not have to) be a reference to a localization variable, not the actual text. + */ + public ResearchPage(ResourceLocation image, String caption) { + this.type = PageType.IMAGE; + this.image = image; + this.text = caption; + } + + /** + * This function should really not be called directly - used internally + */ + public ResearchPage(AspectList as) { + this.type = PageType.ASPECTS; + this.aspects = as; + } + + /** + * returns a localized text of the text field (if one exists). Returns the text field itself otherwise. + * @return + */ + public String getTranslatedText() { + String ret=""; + if (text != null) { + ret = StatCollector.translateToLocal(text); + if (ret.isEmpty()) ret = text; + } + return ret; + } + + +} diff --git a/src/api/java/thaumcraft/api/research/ScanResult.java b/src/api/java/thaumcraft/api/research/ScanResult.java new file mode 100644 index 00000000..e1498f31 --- /dev/null +++ b/src/api/java/thaumcraft/api/research/ScanResult.java @@ -0,0 +1,39 @@ +package thaumcraft.api.research; + +import net.minecraft.entity.Entity; + +public class ScanResult { + public byte type = 0; //1=blocks,2=entities,3=phenomena + public int id; + public int meta; + public Entity entity; + public String phenomena; + + public ScanResult(byte type, int blockId, int blockMeta, Entity entity, + String phenomena) { + super(); + this.type = type; + this.id = blockId; + this.meta = blockMeta; + this.entity = entity; + this.phenomena = phenomena; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ScanResult) { + ScanResult sr = (ScanResult) obj; + if (type != sr.type) + return false; + if (type == 1 + && (id != sr.id || meta != sr.meta)) + return false; + if (type == 2 && entity.getEntityId() != sr.entity.getEntityId()) + return false; + if (type == 3 && !phenomena.equals(sr.phenomena)) + return false; + } + return true; + } + +} diff --git a/src/api/java/thaumcraft/api/visnet/TileVisNode.java b/src/api/java/thaumcraft/api/visnet/TileVisNode.java new file mode 100644 index 00000000..84b1400d --- /dev/null +++ b/src/api/java/thaumcraft/api/visnet/TileVisNode.java @@ -0,0 +1,188 @@ +package thaumcraft.api.visnet; + +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.HashMap; + +import thaumcraft.api.TileThaumcraft; +import thaumcraft.api.WorldCoordinates; +import thaumcraft.api.aspects.Aspect; + +/** + * @author Azanor + * + * The tile entity used by nodes in the vis energy network. A node is either a source (like an aura node), + * a transport relay or vis receiver (like the infernal furnace). + * + */ +public abstract class TileVisNode extends TileThaumcraft { + + WeakReference parent = null; + ArrayList> children = new ArrayList>(); + + /** + * @return the WorldCoordinates location of where this node is located + */ + public WorldCoordinates getLocation() { + return new WorldCoordinates(this); + } + + /** + * @return the number of blocks away this node will check for parent nodes to connect to. + */ + public abstract int getRange(); + + /** + * @return true if this is the source or root node of the vis network. + */ + public abstract boolean isSource(); + + /** + * This method should never be called directly. Use VisNetHandler.drainVis() instead + * @param aspect what aspect to drain + * @param vis how much to drain + * @return how much was actually drained + */ + public int consumeVis(Aspect aspect, int vis) { + if (VisNetHandler.isNodeValid(getParent())) { + int out = getParent().get().consumeVis(aspect, vis); + if (out>0) { + triggerConsumeEffect(aspect); + } + return out; + } + return 0; + } + + public void removeThisNode() { + for (WeakReference n:getChildren()) { + if (n!=null && n.get()!=null) { + n.get().removeThisNode(); + } + } + + children = new ArrayList>(); + if (VisNetHandler.isNodeValid(this.getParent())) { + this.getParent().get().nodeRefresh=true; + } + this.setParent(null); + this.parentChanged(); + + if (this.isSource()) { + HashMap> sourcelist = VisNetHandler.sources.get(worldObj.provider.dimensionId); + if (sourcelist==null) { + sourcelist = new HashMap>(); + } + sourcelist.remove(getLocation()); + VisNetHandler.sources.put( worldObj.provider.dimensionId, sourcelist ); + } + + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + + + @Override + public void invalidate() { + removeThisNode(); + super.invalidate(); + } + + public void triggerConsumeEffect(Aspect aspect) { } + + /** + * @return + */ + public WeakReference getParent() { + return parent; + } + + /** + * @return + */ + public WeakReference getRootSource() { + return VisNetHandler.isNodeValid(getParent()) ? + getParent().get().getRootSource() : this.isSource() ? + new WeakReference(this) : null; + } + + /** + * @param parent + */ + public void setParent(WeakReference parent) { + this.parent = parent; + } + + /** + * @return + */ + public ArrayList> getChildren() { + return children; + } + + @Override + public boolean canUpdate() { + return true; + } + + protected int nodeCounter = 0; + private boolean nodeRegged = false; + public boolean nodeRefresh = false; + + @Override + public void updateEntity() { + + if (!worldObj.isRemote && ((nodeCounter++) % 40==0 || nodeRefresh)) { + //check for changes + if (!nodeRefresh && children.size()>0) { + for (WeakReference n:children) { + if (n==null || n.get()==null) { + nodeRefresh=true; + break; + } + } + } + + //refresh linked nodes + if (nodeRefresh) { + for (WeakReference n:children) { + if (n.get()!=null) { + n.get().nodeRefresh=true; + } + } + children.clear(); + parent=null; + } + + //redo stuff + if (isSource() && !nodeRegged) { + VisNetHandler.addSource(getWorldObj(), this); + nodeRegged = true; + } else + if (!isSource() && !VisNetHandler.isNodeValid(getParent())) { + setParent(VisNetHandler.addNode(getWorldObj(), this)); + nodeRefresh=true; + } + + if (nodeRefresh) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + parentChanged(); + } + nodeRefresh=false; + } + + } + + public void parentChanged() { } + + /** + * @return the type of shard this is attuned to: + * none -1, air 0, fire 1, water 2, earth 3, order 4, entropy 5 + * Should return -1 for most implementations + */ + public byte getAttunement() { + return -1; + } + + +} diff --git a/src/api/java/thaumcraft/api/visnet/VisNetHandler.java b/src/api/java/thaumcraft/api/visnet/VisNetHandler.java new file mode 100644 index 00000000..23e01ccf --- /dev/null +++ b/src/api/java/thaumcraft/api/visnet/VisNetHandler.java @@ -0,0 +1,284 @@ +package thaumcraft.api.visnet; + +import java.lang.ref.WeakReference; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; + +import net.minecraft.world.World; +import thaumcraft.api.WorldCoordinates; +import thaumcraft.api.aspects.Aspect; +import cpw.mods.fml.common.FMLLog; + +public class VisNetHandler { + + // / NODE DRAINING + /** + * This method drains vis from a relay or source near the passed in + * location. The amount received can be less than the amount requested so + * take that into account. + * + * @param world + * @param x the x position of the draining block or entity + * @param y the y position of the draining block or entity + * @param z the z position of the draining block or entity + * @param aspect what aspect to drain + * @param vis how much to drain + * @return how much was actually drained + */ + public static int drainVis(World world, int x, int y, int z, Aspect aspect, int amount) { + + int drainedAmount = 0; + + WorldCoordinates drainer = new WorldCoordinates(x, y, z, + world.provider.dimensionId); + if (!nearbyNodes.containsKey(drainer)) { + calculateNearbyNodes(world, x, y, z); + } + + ArrayList> nodes = nearbyNodes.get(drainer); + if (nodes!=null && nodes.size()>0) + for (WeakReference noderef : nodes) { + + TileVisNode node = noderef.get(); + + if (node == null) continue; + + int a = node.consumeVis(aspect, amount); + drainedAmount += a; + amount -= a; + if (a>0) { + int color = Aspect.getPrimalAspects().indexOf(aspect); + generateVisEffect(world.provider.dimensionId, x, y, z, node.xCoord, node.yCoord, node.zCoord, color); + } + if (amount <= 0) { + break; + } + } + + return drainedAmount; + } + + static Method generateVisEffect; + public static void generateVisEffect(int dim, int x, int y, int z, int x2, int y2, int z2, int color) { + try { + if(generateVisEffect == null) { + Class fake = Class.forName("thaumcraft.common.lib.Utils"); + generateVisEffect = fake.getMethod("generateVisEffect", int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class); + } + generateVisEffect.invoke(null, dim, x,y,z,x2,y2,z2,color); + } catch(Exception ex) { + FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.Utils method generateVisEffect"); + } + } + + public static HashMap>> sources = new HashMap>>(); + + public static void addSource(World world, TileVisNode vs) { + HashMap> sourcelist = sources + .get(world.provider.dimensionId); + if (sourcelist == null) { + sourcelist = new HashMap>(); + } + sourcelist.put(vs.getLocation(), new WeakReference(vs)); + sources.put(world.provider.dimensionId, sourcelist); + nearbyNodes.clear(); + } + + public static boolean isNodeValid(WeakReference node) { + if (node == null || node.get() == null || node.get().isInvalid()) + return false; + return true; + } + + public static WeakReference addNode(World world, TileVisNode vn) { + WeakReference ref = new WeakReference(vn); + + HashMap> sourcelist = sources + .get(world.provider.dimensionId); + if (sourcelist == null) { + sourcelist = new HashMap>(); + return null; + } + + ArrayList nearby = new ArrayList(); + + for (WeakReference root : sourcelist.values()) { + if (!isNodeValid(root)) + continue; + + TileVisNode source = root.get(); + + float r = inRange(world, vn.getLocation(), source.getLocation(), + vn.getRange()); + if (r > 0) { + nearby.add(new Object[] { source, r - vn.getRange() * 2 }); + } + nearby = findClosestNodes(vn, source, nearby); + } + + float dist = Float.MAX_VALUE; + TileVisNode closest = null; + if (nearby.size() > 0) { + for (Object[] o : nearby) { + if ((Float) o[1] < dist) {// && canNodeBeSeen(vn,(TileVisNode) + // o[0])) { + dist = (Float) o[1]; + closest = (TileVisNode) o[0]; + } + } + } + if (closest != null) { + closest.getChildren().add(ref); + nearbyNodes.clear(); + return new WeakReference(closest); + } + + return null; + } + + public static ArrayList findClosestNodes(TileVisNode target, + TileVisNode root, ArrayList in) { + TileVisNode closestChild = null; + + for (WeakReference child : root.getChildren()) { + TileVisNode n = child.get(); + + if (n != null + && !n.equals(target) + && !n.equals(root) + && (target.getAttunement() == -1 || n.getAttunement() == -1 || n + .getAttunement() == target.getAttunement())) { + + float r2 = inRange(n.getWorldObj(), n.getLocation(), + target.getLocation(), target.getRange()); + if (r2 > 0) { + in.add(new Object[] { n, r2 }); + } + + in = findClosestNodes(target, n, in); + } + } + return in; + } + + private static float inRange(World world, WorldCoordinates cc1, + WorldCoordinates cc2, int range) { + float distance = cc1.getDistanceSquaredToWorldCoordinates(cc2); + return distance > range * range ? -1 : distance; + } + + private static HashMap>> nearbyNodes = new HashMap>>(); + + private static void calculateNearbyNodes(World world, int x, int y, int z) { + + HashMap> sourcelist = sources + .get(world.provider.dimensionId); + if (sourcelist == null) { + sourcelist = new HashMap>(); + return; + } + + ArrayList> cn = new ArrayList>(); + WorldCoordinates drainer = new WorldCoordinates(x, y, z, + world.provider.dimensionId); + + ArrayList nearby = new ArrayList(); + + for (WeakReference root : sourcelist.values()) { + + if (!isNodeValid(root)) + continue; + + TileVisNode source = root.get(); + + TileVisNode closest = null; + float range = Float.MAX_VALUE; + + float r = inRange(world, drainer, source.getLocation(), + source.getRange()); + if (r > 0) { + range = r; + closest = source; + } + + ArrayList> children = new ArrayList>(); + children = getAllChildren(source,children); + + for (WeakReference child : children) { + TileVisNode n = child.get(); + if (n != null && !n.equals(root)) { + + float r2 = inRange(n.getWorldObj(), n.getLocation(), + drainer, n.getRange()); + if (r2 > 0 && r2 < range) { + range = r2; + closest = n; + } + } + } + + if (closest != null) { + + cn.add(new WeakReference(closest)); + } + } + + nearbyNodes.put(drainer, cn); + } + + private static ArrayList> getAllChildren(TileVisNode source, ArrayList> list) { + for (WeakReference child : source.getChildren()) { + TileVisNode n = child.get(); + if (n != null) { + list.add(child); + list = getAllChildren(n,list); + } + } + return list; + } + + // public static boolean canNodeBeSeen(TileVisNode source,TileVisNode + // target) + // { + // double d = Math.sqrt(source.getDistanceFrom(target.xCoord, target.yCoord, + // target.zCoord)); + // double xd = (source.xCoord-target.xCoord) / d; + // double yd = (source.yCoord-target.yCoord) / d; + // double zd = (source.zCoord-target.zCoord) / d; + // return source.getWorldObj().rayTraceBlocks( + // SpellHelper.createVec3(source.xCoord-xd+.5+.5, source.yCoord-yd, + // source.zCoord-zd), + // SpellHelper.createVec3(target.xCoord+.5, target.yCoord+.5, + // target.zCoord+.5)) == null; + // } + + // public static HashMap> + // noderef = new HashMap>(); + // + // public static TileVisNode getClosestNodeWithinRadius(World world, int x, + // int y, int z, int radius) { + // TileVisNode out = null; + // WorldCoordinates wc = null; + // float cd = Float.MAX_VALUE; + // for (int sx = x - radius; sx <= x + radius; sx++) { + // for (int sy = y - radius; sy <= y + radius; sy++) { + // for (int sz = z - radius; sz <= z + radius; sz++) { + // wc = new WorldCoordinates(sx,sy,sz,world.provider.dimensionId); + // if (noderef.containsKey(wc)) { + // float d = wc.getDistanceSquared(x, y, z); + // if (dAs a guide build the sort string from two alphanumeric characters followed by + * two numeric characters based on... whatever. + */ + public String getSortingHelper(ItemStack itemstack); + + boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player); + + public boolean acceptsEnchant(int id); + + + + + +} diff --git a/src/api/java/thaumcraft/api/wands/IWandRodOnUpdate.java b/src/api/java/thaumcraft/api/wands/IWandRodOnUpdate.java new file mode 100644 index 00000000..4ef8c849 --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/IWandRodOnUpdate.java @@ -0,0 +1,16 @@ +package thaumcraft.api.wands; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +/** + * + * @author azanor + * + * Implemented by a class that you wish to be called whenever a wand with this rod performs its + * update tick. + * + */ +public interface IWandRodOnUpdate { + void onUpdate(ItemStack itemstack, EntityPlayer player); +} diff --git a/src/api/java/thaumcraft/api/wands/IWandTriggerManager.java b/src/api/java/thaumcraft/api/wands/IWandTriggerManager.java new file mode 100644 index 00000000..47465552 --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/IWandTriggerManager.java @@ -0,0 +1,12 @@ +package thaumcraft.api.wands; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IWandTriggerManager { + + public boolean performTrigger(World world, ItemStack wand, EntityPlayer player, + int x, int y, int z, int side, int event); + +} diff --git a/src/api/java/thaumcraft/api/wands/IWandable.java b/src/api/java/thaumcraft/api/wands/IWandable.java new file mode 100644 index 00000000..aeb9bac7 --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/IWandable.java @@ -0,0 +1,25 @@ +package thaumcraft.api.wands; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * + * @author azanor + * + * Add this to a tile entity that you wish wands to interact with in some way. + * + */ + +public interface IWandable { + + public int onWandRightClick(World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side, int md); + + public ItemStack onWandRightClick(World world, ItemStack wandstack, EntityPlayer player); + + public void onUsingWandTick(ItemStack wandstack, EntityPlayer player, int count); + + public void onWandStoppedUsing(ItemStack wandstack, World world, EntityPlayer player, int count); + +} diff --git a/src/api/java/thaumcraft/api/wands/ItemFocusBasic.java b/src/api/java/thaumcraft/api/wands/ItemFocusBasic.java new file mode 100644 index 00000000..35900520 --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/ItemFocusBasic.java @@ -0,0 +1,166 @@ +package thaumcraft.api.wands; + +import java.text.DecimalFormat; +import java.util.List; +import java.util.Map; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemFocusBasic extends Item implements IWandFocus { + + public ItemFocusBasic () + { + super(); + maxStackSize = 1; + canRepair=false; + this.setMaxDamage(0); + } + + public IIcon icon; + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIconFromDamage(int par1) { + return icon; + } + + @Override + public boolean isItemTool(ItemStack par1ItemStack) + { + return true; + } + + @Override + public boolean isDamageable() { + return true; + } + + @Override + public void addInformation(ItemStack stack,EntityPlayer player, List list, boolean par4) { + AspectList al = this.getVisCost(); + if (al!=null && al.size()>0) { + list.add(StatCollector.translateToLocal(isVisCostPerTick()?"item.Focus.cost2":"item.Focus.cost1")); + for (Aspect aspect:al.getAspectsSorted()) { + DecimalFormat myFormatter = new DecimalFormat("#####.##"); + String amount = myFormatter.format(al.getAmount(aspect)/100f); + list.add(" \u00A7"+aspect.getChatcolor()+aspect.getName()+"\u00A7r x "+ amount); + + } + } + } + + @Override + public int getItemEnchantability() { + return 5; + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.rare; + } + + + @Override + public int getFocusColor() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public AspectList getVisCost() { + // TODO Auto-generated method stub + return null; + } + + @Override + public ItemStack onFocusRightClick(ItemStack itemstack, World world, + EntityPlayer player, MovingObjectPosition movingobjectposition) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, + int count) { + // TODO Auto-generated method stub + } + + @Override + public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, + EntityPlayer player, int count) { + // TODO Auto-generated method stub + + } + + /** + * Just insert two alphanumeric characters before this string in your focus item class + */ + @Override + public String getSortingHelper(ItemStack itemstack) { + Map ench = EnchantmentHelper.getEnchantments(itemstack); + String out=""; + for (Integer lvl:ench.values()) { + out = out + lvl + ""; + } + return out; + } + + @Override + public boolean isVisCostPerTick() { + return false; + } + + @Override + public IIcon getOrnament() { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, + int z, EntityPlayer player) { + // TODO Auto-generated method stub + return false; + } + + @Override + public WandFocusAnimation getAnimation() { + return WandFocusAnimation.WAVE; + } + + @Override + public IIcon getFocusDepthLayerIcon() { + // TODO Auto-generated method stub + return null; + } + + /** + * @see thaumcraft.api.wands.IWandFocus#acceptsEnchant(int) + * By default fortune is off for all wands + **/ + @Override + public boolean acceptsEnchant(int id) { + if (id==ThaumcraftApi.enchantFrugal|| + id==ThaumcraftApi.enchantPotency) return true; + return false; + } + + + + + +} diff --git a/src/api/java/thaumcraft/api/wands/StaffRod.java b/src/api/java/thaumcraft/api/wands/StaffRod.java new file mode 100644 index 00000000..e7ae90f0 --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/StaffRod.java @@ -0,0 +1,48 @@ +package thaumcraft.api.wands; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +/** + * + * @author Azanor + * + * This class is used to keep the material information for the various rods. + * It is also used to generate the wand recipes ingame. + * + */ +public class StaffRod extends WandRod { + + boolean runes=false; + + public StaffRod(String tag, int capacity, ItemStack item, int craftCost) { + super(tag+"_staff", capacity, item, craftCost); + this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+tag+".png"); + } + + public StaffRod(String tag, int capacity, ItemStack item, int craftCost, + IWandRodOnUpdate onUpdate, ResourceLocation texture) { + super(tag+"_staff", capacity, item, craftCost, onUpdate, texture); + } + + public StaffRod(String tag, int capacity, ItemStack item, int craftCost, + IWandRodOnUpdate onUpdate) { + super(tag+"_staff", capacity, item, craftCost, onUpdate); + this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+tag+".png"); + } + + public StaffRod(String tag, int capacity, ItemStack item, int craftCost, + ResourceLocation texture) { + super(tag+"_staff", capacity, item, craftCost, texture); + } + + public boolean hasRunes() { + return runes; + } + + public void setRunes(boolean hasRunes) { + this.runes = hasRunes; + } + + +} diff --git a/src/api/java/thaumcraft/api/wands/WandCap.java b/src/api/java/thaumcraft/api/wands/WandCap.java new file mode 100644 index 00000000..17b4581c --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/WandCap.java @@ -0,0 +1,129 @@ +package thaumcraft.api.wands; + +import java.util.LinkedHashMap; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import thaumcraft.api.aspects.Aspect; + +/** + * This class is used to keep the material information for the various caps. + * It is also used to generate the wand recipes ingame. + * @author Azanor + * + */ +public class WandCap { + + private String tag; + + /** + * Cost to craft this wand. Combined with the rod cost. + */ + private int craftCost; + + /** + * the amount by which all aspect costs are multiplied + */ + float baseCostModifier; + + /** + * specifies a list of primal aspects that use the special discount figure instead of the normal discount. + */ + List specialCostModifierAspects; + + /** + * the amount by which the specified aspect costs are multiplied + */ + float specialCostModifier; + + /** + * The texture that will be used for the ingame wand cap + */ + ResourceLocation texture; + + /** + * the actual item that makes up this cap and will be used to generate the wand recipes + */ + ItemStack item; + + public static LinkedHashMap caps = new LinkedHashMap(); + + public WandCap (String tag, float discount, ItemStack item, int craftCost) { + this.setTag(tag); + this.baseCostModifier = discount; + this.specialCostModifierAspects = null; + texture = new ResourceLocation("thaumcraft","textures/models/wand_cap_"+getTag()+".png"); + this.item=item; + this.setCraftCost(craftCost); + caps.put(tag, this); + } + + public WandCap (String tag, float discount, List specialAspects, float discountSpecial, ItemStack item, int craftCost) { + this.setTag(tag); + this.baseCostModifier = discount; + this.specialCostModifierAspects = specialAspects; + this.specialCostModifier = discountSpecial; + texture = new ResourceLocation("thaumcraft","textures/models/wand_cap_"+getTag()+".png"); + this.item=item; + this.setCraftCost(craftCost); + caps.put(tag, this); + } + + public float getBaseCostModifier() { + return baseCostModifier; + } + + public List getSpecialCostModifierAspects() { + return specialCostModifierAspects; + } + + public float getSpecialCostModifier() { + return specialCostModifier; + } + + public ResourceLocation getTexture() { + return texture; + } + + public void setTexture(ResourceLocation texture) { + this.texture = texture; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + + public ItemStack getItem() { + return item; + } + + public void setItem(ItemStack item) { + this.item = item; + } + + public int getCraftCost() { + return craftCost; + } + + public void setCraftCost(int craftCost) { + this.craftCost = craftCost; + } + + /** + * The research a player needs to have finished to be able to craft a wand with this cap. + */ + public String getResearch() { + return "CAP_"+getTag(); + } + + // Some examples: + // WandCap WAND_CAP_IRON = new WandCap("iron", 1.1f, Arrays.asList(Aspect.ORDER),1, new ItemStack(ConfigItems.itemWandCap,1,0),1); + // WandCap WAND_CAP_GOLD = new WandCap("gold", 1f, new ItemStack(ConfigItems.itemWandCap,1,1),3); + +} diff --git a/src/api/java/thaumcraft/api/wands/WandRod.java b/src/api/java/thaumcraft/api/wands/WandRod.java new file mode 100644 index 00000000..85954e46 --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/WandRod.java @@ -0,0 +1,158 @@ +package thaumcraft.api.wands; + +import java.util.LinkedHashMap; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +/** + * + * @author Azanor + * + * This class is used to keep the material information for the various rods. + * It is also used to generate the wand recipes ingame. + * + */ +public class WandRod { + + + private String tag; + + /** + * Cost to craft this wand. Combined with the rod cost. + */ + private int craftCost; + + /** + * The amount of vis that can be stored - this number is actually multiplied + * by 100 for use by the wands internals + */ + int capacity; + + /** + * The texture that will be used for the ingame wand rod + */ + protected ResourceLocation texture; + + /** + * the actual item that makes up this rod and will be used to generate the wand recipes + */ + ItemStack item; + + /** + * A class that will be called whenever the wand onUpdate tick is run + */ + IWandRodOnUpdate onUpdate; + + /** + * Does the rod glow in the dark? + */ + boolean glow; + + public static LinkedHashMap rods = new LinkedHashMap(); + + public WandRod (String tag, int capacity, ItemStack item, int craftCost, ResourceLocation texture) { + this.setTag(tag); + this.capacity = capacity; + this.texture = texture; + this.item=item; + this.setCraftCost(craftCost); + rods.put(tag, this); + } + + public WandRod (String tag, int capacity, ItemStack item, int craftCost, IWandRodOnUpdate onUpdate, ResourceLocation texture) { + this.setTag(tag); + this.capacity = capacity; + this.texture = texture; + this.item=item; + this.setCraftCost(craftCost); + rods.put(tag, this); + this.onUpdate = onUpdate; + } + + public WandRod (String tag, int capacity, ItemStack item, int craftCost) { + this.setTag(tag); + this.capacity = capacity; + this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+getTag()+".png"); + this.item=item; + this.setCraftCost(craftCost); + rods.put(tag, this); + } + + public WandRod (String tag, int capacity, ItemStack item, int craftCost, IWandRodOnUpdate onUpdate) { + this.setTag(tag); + this.capacity = capacity; + this.texture = new ResourceLocation("thaumcraft","textures/models/wand_rod_"+getTag()+".png"); + this.item=item; + this.setCraftCost(craftCost); + rods.put(tag, this); + this.onUpdate = onUpdate; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public int getCapacity() { + return capacity; + } + + public void setCapacity(int capacity) { + this.capacity = capacity; + } + + public ResourceLocation getTexture() { + return texture; + } + + public void setTexture(ResourceLocation texture) { + this.texture = texture; + } + + public ItemStack getItem() { + return item; + } + + public void setItem(ItemStack item) { + this.item = item; + } + + public int getCraftCost() { + return craftCost; + } + + public void setCraftCost(int craftCost) { + this.craftCost = craftCost; + } + + public IWandRodOnUpdate getOnUpdate() { + return onUpdate; + } + + public void setOnUpdate(IWandRodOnUpdate onUpdate) { + this.onUpdate = onUpdate; + } + + public boolean isGlowing() { + return glow; + } + + public void setGlowing(boolean hasGlow) { + this.glow = hasGlow; + } + + /** + * The research a player needs to have finished to be able to craft a wand with this rod. + */ + public String getResearch() { + return "ROD_"+getTag(); + } + + // Some examples: + // WandRod WAND_ROD_WOOD = new WandRod("wood",25,new ItemStack(Item.stick),1); + // WandRod WAND_ROD_BLAZE = new WandRod("blaze",100,new ItemStack(Item.blazeRod),7,new WandRodBlazeOnUpdate()); +} diff --git a/src/api/java/thaumcraft/api/wands/WandTriggerRegistry.java b/src/api/java/thaumcraft/api/wands/WandTriggerRegistry.java new file mode 100644 index 00000000..68655cb7 --- /dev/null +++ b/src/api/java/thaumcraft/api/wands/WandTriggerRegistry.java @@ -0,0 +1,72 @@ +package thaumcraft.api.wands; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * This class serves a similar function to IWandable in that it allows wands to interact + * with object in the world. In this case it is most useful for adding interaction with non-mod + * blocks where you can't control what happens in their code. + * Example where it is used is in crafting the thaumonomicon from a bookshelf and the + * crucible from a cauldron + * + * @author azanor + * + */ +public class WandTriggerRegistry { + + /** + * Registers an action to perform when a casting wand right clicks on a specific block. + * A manager class needs to be created that implements IWandTriggerManager. + * @param manager + * @param event a logical number that you can use to differentiate different events or actions + * @param block + * @param meta send -1 as a wildcard value for all possible meta values + */ + public static void registerWandBlockTrigger(IWandTriggerManager manager, int event, Block block, int meta) { + triggers.put(Arrays.asList(block,meta), + Arrays.asList(manager,event)); + + } + + private static HashMap triggers = new HashMap(); + + public static boolean hasTrigger(Block block, int meta) { + if (triggers.containsKey(Arrays.asList(block,meta)) || + triggers.containsKey(Arrays.asList(block,-1))) return true; + return false; + } + + /** + * This is called by the onItemUseFirst function in wands. + * Parameters and return value functions like you would expect for that function. + * @param world + * @param wand + * @param player + * @param x + * @param y + * @param z + * @param side + * @param block + * @param meta + * @return + */ + public static boolean performTrigger(World world, ItemStack wand, EntityPlayer player, + int x, int y, int z, int side, Block block, int meta) { + + List l = triggers.get(Arrays.asList(block,meta)); + if (l==null) l = triggers.get(Arrays.asList(block,-1)); + if (l==null) return false; + + IWandTriggerManager manager = (IWandTriggerManager) l.get(0); + int event = (Integer) l.get(1); + return manager.performTrigger(world, wand, player, x, y, z, side, event); + } + +} diff --git a/src/api/java/vazkii/botania/api/BotaniaAPI.java b/src/api/java/vazkii/botania/api/BotaniaAPI.java new file mode 100644 index 00000000..36f5aa5a --- /dev/null +++ b/src/api/java/vazkii/botania/api/BotaniaAPI.java @@ -0,0 +1,363 @@ +/** + * 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 @ [Jan 14, 2014, 6:15:28 PM (GMT)] + */ +package vazkii.botania.api; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.EnumHelper; +import vazkii.botania.api.internal.DummyMethodHandler; +import vazkii.botania.api.internal.DummySubTile; +import vazkii.botania.api.internal.IInternalMethodHandler; +import vazkii.botania.api.lexicon.KnowledgeType; +import vazkii.botania.api.lexicon.LexiconCategory; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.recipe.RecipeElvenTrade; +import vazkii.botania.api.recipe.RecipeManaInfusion; +import vazkii.botania.api.recipe.RecipePetals; +import vazkii.botania.api.recipe.RecipeRuneAltar; +import vazkii.botania.api.subtile.SubTileEntity; +import vazkii.botania.api.wiki.IWikiProvider; +import vazkii.botania.api.wiki.SimpleWikiProvider; +import vazkii.botania.api.wiki.WikiHooks; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; + +public final class BotaniaAPI { + + private static List categories = new ArrayList(); + private static List allEntries = new ArrayList(); + + public static Map knowledgeTypes = new HashMap(); + + public static List petalRecipes = new ArrayList(); + public static List runeAltarRecipes = new ArrayList(); + public static List manaInfusionRecipes = new ArrayList(); + public static List elvenTradeRecipes = new ArrayList(); + + private static BiMap> subTiles = HashBiMap.> create(); + public static Set subtilesForCreativeMenu = new LinkedHashSet(); + + public static Map oreWeights = new HashMap(); + + public static Map seeds = new HashMap(); + + public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18); + public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20); + + public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", 18, new int[] { 2, 6, 5, 2 }, 18); + public static ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20); + + public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26); + public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 3, 2300, 9F, 3F, 26); + + public static KnowledgeType basicKnowledge, elvenKnowledge; + + static { + registerSubTile("", DummySubTile.class); + + basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true); + elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false); + + addOreWeight("oreAluminum", 3940); // Tinkers' Construct + addOreWeight("oreAmber", 2075); // Thaumcraft + addOreWeight("oreApatite", 1595); // Forestry + addOreWeight("oreBlueTopaz", 3195); // Ars Magica + addOreWeight("oreCassiterite", 1634); // GregTech + addOreWeight("oreCertusQuartz", 3975); // Applied Energistics + addOreWeight("oreChimerite", 3970); // Ars Magica + addOreWeight("oreCinnabar", 2585); // Thaumcraft + addOreWeight("oreCoal", 46525); // Vanilla + addOreWeight("oreCooperite", 5); // GregTech + addOreWeight("oreCopper", 8325); // IC2, Thermal Expansion, Tinkers' Construct, etc. + addOreWeight("oreDarkIron", 1700); // Factorization + addOreWeight("oreDiamond", 1265); // Vanilla + addOreWeight("oreEmerald", 780); // Vanilla + addOreWeight("oreEmery", 415); // GregTech + addOreWeight("oreGalena", 1000); // Factorization + addOreWeight("oreGold", 2970); // Vanilla + addOreWeight("oreInfusedAir", 925); // Thaumcraft + addOreWeight("oreInfusedEarth", 925); // Thaumcraft + addOreWeight("oreInfusedEntropy", 925); // Thaumcraft + addOreWeight("oreInfusedFire", 925); // Thaumcraft + addOreWeight("oreInfusedOrder", 925); // Thaumcraft + addOreWeight("oreInfusedWater", 925); // Thaumcraft + addOreWeight("oreIridium", 30); // GregTech + addOreWeight("oreIron", 20665); // Vanilla + addOreWeight("oreLapis", 1285); // Vanilla + addOreWeight("oreLead", 7985); // IC2, Thermal Expansion, Factorization, etc. + addOreWeight("oreMCropsEssence", 3085); // Magical Crops + addOreWeight("oreNickel", 2275); // Thermal Expansion + addOreWeight("oreOlivine", 1100); // Project RED + addOreWeight("oreRedstone", 6885); // Vanilla + addOreWeight("oreRuby", 1100); // Project RED + addOreWeight("oreSapphire", 1100); // Project RED + addOreWeight("oreSilver", 6300); // Thermal Expansion, Factorization, etc. + addOreWeight("oreSphalerite", 25); // GregTech + addOreWeight("oreSulfur", 1105); // Railcraft + addOreWeight("oreTetrahedrite", 4040); // GregTech + addOreWeight("oreTin", 9450); // IC2, Thermal Expansion, etc. + addOreWeight("oreTungstate", 20); // GregTech + addOreWeight("oreUranium", 1337); // IC2 + addOreWeight("oreVinteum", 5925); // Ars Magica + addOreWeight("oreYellorite", 3520); // Big Reactors + addOreWeight("oreZinc", 6485); // Flaxbeard's Steam Power + + addSeed(Items.wheat_seeds, Blocks.wheat); + addSeed(Items.potato, Blocks.potatoes); + addSeed(Items.carrot, Blocks.carrots); + addSeed(Items.nether_wart, Blocks.nether_wart); + addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem); + addSeed(Items.melon_seeds, Blocks.melon_stem); + + registerModWiki("Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s")); + + IWikiProvider technicWiki = new SimpleWikiProvider("Technic Wiki", "http://wiki.technicpack.net/%s"); + IWikiProvider mekanismWiki = new SimpleWikiProvider("Mekanism Wiki", "http://wiki.aidancbrady.com/wiki/%s"); + IWikiProvider buildcraftWiki = new SimpleWikiProvider("BuildCraft Wiki", "http://www.mod-buildcraft.com/wiki/doku.php?id=%s"); + + registerModWiki("Mekanism", mekanismWiki); + registerModWiki("MekanismGenerators", mekanismWiki); + registerModWiki("MekanismTools", mekanismWiki); + registerModWiki("EnderIO", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s")); + registerModWiki("TropiCraft", new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s")); + registerModWiki("RandomThings", new SimpleWikiProvider("Random Things Wiki", "http://randomthingsminecraftmod.wikispaces.com/%s")); + registerModWiki("Witchery", new SimpleWikiProvider("Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-")); + registerModWiki("AppliedEnergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s")); + registerModWiki("BigReactors", technicWiki); + registerModWiki("BuildCraft|Core", buildcraftWiki); + registerModWiki("BuildCraft|Builders", buildcraftWiki); + registerModWiki("BuildCraft|Energy", buildcraftWiki); + registerModWiki("BuildCraft|Factory", buildcraftWiki); + registerModWiki("BuildCraft|Silicon", buildcraftWiki); + registerModWiki("BuildCraft|Transport", buildcraftWiki); + registerModWiki("ArsMagica2", new SimpleWikiProvider("ArsMagica2 Wiki", "http://wiki.arsmagicamod.com/wiki/%s")); + registerModWiki("PneumaticCraft", new SimpleWikiProvider("PneumaticCraft Wiki", "http://www.minemaarten.com/wikis/pneumaticcraft-wiki/pneumaticcraft-wiki-%s")); + registerModWiki("StevesCarts2", new SimpleWikiProvider("Steve's Carts Wiki", "http://stevescarts2.wikispaces.com/%s")); + registerModWiki("GanysSurface", new SimpleWikiProvider("Gany's Surface Wiki", "http://ganys-surface.wikia.com/wiki/%s")); + registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s")); + registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s")); + } + + /** + * The internal method handler in use. Do not overwrite. + * @see IInternalMethodHandler + */ + public static IInternalMethodHandler internalHandler = new DummyMethodHandler(); + + + /** + * Registers a new Knowledge Type. + * @param id The ID for this knowledge type. + * @param color The color to display this knowledge type as. + */ + public static KnowledgeType registerKnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { + KnowledgeType type = new KnowledgeType(id, color, autoUnlock); + knowledgeTypes.put(id, type); + return type; + } + + /** + * Registers a Petal Recipe. + * @param output The ItemStack to craft. + * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper + * or String (case for Ore Dictionary). The array can't be larger than 16. + * @return The recipe created. + */ + public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) { + RecipePetals recipe = new RecipePetals(output, inputs); + petalRecipes.add(recipe); + return recipe; + } + + /** + * Registers a Rune Altar + * @param output The ItemStack to craft. + * @param mana The amount of mana required. Don't go over 100000! + * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper + * or String (case for Ore Dictionary). The array can't be larger than 16. + * @return The recipe created. + */ + public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) { + RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs); + runeAltarRecipes.add(recipe); + return recipe; + } + + /** + * Registers a Mana Infusion Recipe (throw an item in a mana pool) + * @param output The ItemStack to craft + * @param input The input item, be it an ItemStack or an ore dictionary entry String. + * @param mana The amount of mana required. Don't go over 100000! + * @return The recipe created. + */ + public static RecipeManaInfusion registerManaInfusionRecipe(ItemStack output, Object input, int mana) { + RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana); + manaInfusionRecipes.add(recipe); + return recipe; + } + + /** + * Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an + * Alchemy Catalyst below the pool). + * @see BotaniaAPI#registerManaInfusionRecipe + */ + public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) { + RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); + recipe.setAlchemy(true); + return recipe; + } + + /** + * Register a Mana Infusion Recipe and flags it as an Conjuration recipe (requires a + * Conjuration Catalyst below the pool). + * @see BotaniaAPI#registerManaInfusionRecipe + */ + public static RecipeManaInfusion registerManaConjurationRecipe(ItemStack output, Object input, int mana) { + RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); + recipe.setConjuration(true); + return recipe; + } + + /** + * Registers a Elven Trade recipe (throw an item in an Alfheim Portal). + * @param output The ItemStack to return. + * @param inputs The items required, can be ItemStack or ore dictionary entry string. + * @return The recipe created. + */ + public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) { + RecipeElvenTrade recipe = new RecipeElvenTrade(output, inputs); + elvenTradeRecipes.add(recipe); + return recipe; + } + + /** + * Registers a SubTileEntity, a new special flower. Look in the subtile package of the API. + */ + public static void registerSubTile(String key, Class subtileClass) { + subTiles.put(key, subtileClass); + } + + /** + * Adds the key for a SubTileEntity into the creative menu. This goes into the + * subtilesForCreativeMenu Set. + */ + public static void addSubTileToCreativeMenu(String key) { + subtilesForCreativeMenu.add(key); + } + + /** + * Adds a category to the list of registered categories to appear in the Lexicon. + */ + public static void addCategory(LexiconCategory category) { + categories.add(category); + } + + /** + * Gets all registered categories. + */ + public static List getAllCategories() { + return categories; + } + + /** + * Gets all registered entries. + */ + public static List getAllEntries() { + return allEntries; + } + + /** + * Registers a Lexicon Entry and adds it to the category passed in. + */ + public static void addEntry(LexiconEntry entry, LexiconCategory category) { + allEntries.add(entry); + category.entries.add(entry); + } + + /** + * Maps an ore (ore dictionary key) to it's weight on the world generation. This + * is used for the Orechid flower. Check the static block in the BotaniaAPI class + * to get the weights for the vanilla blocks.
+ * Alternatively get the values with the OreDetector mod:
+ * https://gist.github.com/Vazkii/9493322 + */ + public static void addOreWeight(String ore, int weight) { + oreWeights.put(ore, weight); + } + + public static int getOreWeight(String ore) { + return oreWeights.get(ore); + } + + /** + * Allows an item to be counted as a seed. Any item in this list can be + * dispensed by a dispenser, the block is the block to be placed. + */ + public static void addSeed(Item item, Block block) { + seeds.put(item, block); + } + + /** + * Gets the last recipe to have been added to the recipe list. + */ + public static IRecipe getLatestAddedRecipe() { + List list = CraftingManager.getInstance().getRecipeList(); + return list.get(list.size() - 1); + } + + /** + * Gets the last x recipes added to the recipe list. + */ + public static List getLatestAddedRecipes(int x) { + List list = CraftingManager.getInstance().getRecipeList(); + List newList = new ArrayList(); + for(int i = x - 1; i >= 0; i--) + newList.add(list.get(list.size() - 1 - i)); + + return newList; + } + + /** + * Registers a Wiki provider for a mod so it uses that instead of the fallback + * FTB wiki. Make sure to call this on PostInit only! + */ + public static void registerModWiki(String mod, IWikiProvider provider) { + WikiHooks.registerModWiki(mod, provider); + } + + public static Class getSubTileMapping(String key) { + if(!subTiles.containsKey(key)) + key = ""; + + return subTiles.get(key); + } + + public static String getSubTileStringMapping(Class clazz) { + return subTiles.inverse().get(clazz); + } +} diff --git a/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java b/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java new file mode 100644 index 00000000..53a8e421 --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java @@ -0,0 +1,51 @@ +/** + * 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 @ [Mar 7, 2014, 3:47:43 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import vazkii.botania.api.mana.TileSignature; + +public class DummyManaNetwork implements IManaNetwork { + + public static final DummyManaNetwork instance = new DummyManaNetwork(); + + @Override + public void clear() { + // NO-OP + } + + @Override + public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit) { + return null; + } + + @Override + public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit) { + return null; + } + + @Override + public List getAllCollectorsInWorld(World world) { + return new ArrayList(); + } + + @Override + public List getAllPoolsInWorld(World world) { + return new ArrayList(); + } + +} diff --git a/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java b/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java new file mode 100644 index 00000000..549bd197 --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java @@ -0,0 +1,135 @@ +/** + * 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 @ [Jan 14, 2014, 6:43:03 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import java.util.List; + +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import vazkii.botania.api.lexicon.LexiconPage; +import vazkii.botania.api.recipe.RecipeElvenTrade; +import vazkii.botania.api.recipe.RecipeManaInfusion; +import vazkii.botania.api.recipe.RecipePetals; +import vazkii.botania.api.recipe.RecipeRuneAltar; + +public class DummyMethodHandler implements IInternalMethodHandler { + + @Override + public LexiconPage textPage(String key) { + return dummyPage(key); + } + + @Override + public LexiconPage imagePage(String key, String resource) { + return dummyPage(key); + } + + @Override + public LexiconPage craftingRecipesPage(String key, List recipes) { + return dummyPage(key); + } + + @Override + public LexiconPage craftingRecipePage(String key, IRecipe recipe) { + return dummyPage(key); + } + + @Override + public LexiconPage petalRecipesPage(String key, List recipes) { + return dummyPage(key); + } + + @Override + public LexiconPage petalRecipePage(String key, RecipePetals recipe) { + return dummyPage(key); + } + + @Override + public LexiconPage runeRecipesPage(String key, List recipes) { + return dummyPage(key); + } + + @Override + public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe) { + return dummyPage(key); + } + + @Override + public LexiconPage manaInfusionRecipesPage(String key, List recipes) { + return dummyPage(key); + } + + @Override + public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe) { + return dummyPage(key); + } + + @Override + public LexiconPage elvenTradePage(String key, List recipes) { + return dummyPage(key); + } + + @Override + public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe) { + return dummyPage(key); + } + + private LexiconPage dummyPage(String key) { + return new DummyPage(key); + } + + @Override + public ItemStack getSubTileAsStack(String subTile) { + return new ItemStack(Blocks.stone, 0, 0); + } + + @Override + public IIcon getSubTileIconForName(String name) { + return Blocks.red_flower.getIcon(0, 0); + } + + @Override + public IManaNetwork getManaNetworkInstance() { + return DummyManaNetwork.instance; + } + + @Override + public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) { + // NO-OP + } + + @Override + public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) { + // NO-OP + } + + @Override + public IInventory getBaublesInventory(EntityPlayer player) { + return null; + } + + @Override + public boolean shouldForceCheck() { + return true; + } + + @Override + public int getPassiveFlowerDecay() { + return 0; + } +} diff --git a/src/api/java/vazkii/botania/api/internal/DummyPage.java b/src/api/java/vazkii/botania/api/internal/DummyPage.java new file mode 100644 index 00000000..33cbcf84 --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/DummyPage.java @@ -0,0 +1,35 @@ +/** + * 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 @ [Jan 14, 2014, 6:41:23 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import vazkii.botania.api.lexicon.LexiconPage; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * A dummy page. It does absolutely nothing and is only + * existant to make sure everything goes right even if + * Botania isn't loaded. + */ +public class DummyPage extends LexiconPage { + + public DummyPage(String unlocalizedName) { + super(unlocalizedName); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderScreen(IGuiLexiconEntry gui, int x, int y) { + // NO-OP + } + +} diff --git a/src/api/java/vazkii/botania/api/internal/DummySubTile.java b/src/api/java/vazkii/botania/api/internal/DummySubTile.java new file mode 100644 index 00000000..d23adced --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/DummySubTile.java @@ -0,0 +1,18 @@ +/** + * 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 @ [Jan 24, 2014, 4:17:33 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import vazkii.botania.api.subtile.SubTileEntity; + +public class DummySubTile extends SubTileEntity { + +} diff --git a/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java b/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java new file mode 100644 index 00000000..c8bf6da1 --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java @@ -0,0 +1,57 @@ +/** + * 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 @ [Jan 14, 2014, 6:48:41 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import vazkii.botania.api.lexicon.LexiconEntry; + +/** + * Internal interface for the Lexicon Entry GUI. This contains + * everything that can be accessed from it. It's safe to cast + * this type to GuiScreen. + */ +public interface IGuiLexiconEntry { + + /** + * Gets the entry currently portrayed in this gui. + */ + public LexiconEntry getEntry(); + + /** + * Gets the current page the lexicon GUI is browsing. + */ + public int getPageOn(); + + /** + * Gets the leftmost part of the GUI. + */ + public int getLeft(); + + /** + * Gets the topmost part of the GUI. + */ + public int getTop(); + + /** + * Gets the GUI's width. + */ + public int getWidth(); + + /** + * Gets the GUI's height + */ + public int getHeight(); + + /** + * Gets the GUI's Z level for rendering. + */ + public float getZLevel(); +} diff --git a/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java b/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java new file mode 100644 index 00000000..00a16a29 --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java @@ -0,0 +1,81 @@ +/** + * 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 @ [Jan 14, 2014, 6:34:34 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import java.util.List; + +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import vazkii.botania.api.lexicon.LexiconPage; +import vazkii.botania.api.recipe.RecipeElvenTrade; +import vazkii.botania.api.recipe.RecipeManaInfusion; +import vazkii.botania.api.recipe.RecipePetals; +import vazkii.botania.api.recipe.RecipeRuneAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Any methods that refer to internal methods in Botania are here. + * This is defaulted to a dummy handler, whose methods do nothing. + * This handler is set to a proper one on PreInit. Make sure to + * make your mod load after Botania if you have any intention of + * doing anythign with this on PreInit. + */ +public interface IInternalMethodHandler { + + public LexiconPage textPage(String key); + + public LexiconPage imagePage(String key, String resource); + + public LexiconPage craftingRecipesPage(String key, List recipes); + + public LexiconPage craftingRecipePage(String key, IRecipe recipe); + + public LexiconPage petalRecipesPage(String key, List recipes); + + public LexiconPage petalRecipePage(String key, RecipePetals recipe); + + public LexiconPage runeRecipesPage(String key, List recipes); + + public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe); + + public LexiconPage manaInfusionRecipesPage(String key, List recipes); + + public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe); + + public LexiconPage elvenTradePage(String key, List recipes); + + public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe); + + public IManaNetwork getManaNetworkInstance(); + + public ItemStack getSubTileAsStack(String subTile); + + public IIcon getSubTileIconForName(String name); + + public boolean shouldForceCheck(); + + public int getPassiveFlowerDecay(); + + public IInventory getBaublesInventory(EntityPlayer player); + + @SideOnly(Side.CLIENT) + public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res); + + public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m); + +} diff --git a/src/api/java/vazkii/botania/api/internal/IManaBurst.java b/src/api/java/vazkii/botania/api/internal/IManaBurst.java new file mode 100644 index 00000000..38c5fd8c --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/IManaBurst.java @@ -0,0 +1,62 @@ +/** + * 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 @ [Jan 31, 2014, 4:36:13 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; + +/** + * Interface for the Mana Burst entity. This can safely be casted to EntityThrowable. + */ +public interface IManaBurst { + + public boolean isFake(); + + public void setMotion(double x, double y, double z); + + public int getColor(); + + public void setColor(int color); + + public int getMana(); + + public void setMana(int mana); + + public int getStartingMana(); + + public void setStartingMana(int mana); + + public int getMinManaLoss(); + + public void setMinManaLoss(int minManaLoss); + + public float getManaLossPerTick(); + + public void setManaLossPerTick(float mana); + + public float getGravity(); + + public void setGravity(float gravity); + + public ChunkCoordinates getBurstSourceChunkCoordinates(); + + public void setBurstSourceCoords(int x, int y, int z); + + public ItemStack getSourceLens(); + + public void setSourceLens(ItemStack lens); + + public boolean hasAlreadyCollidedAt(int x, int y, int z); + + public int getTicksExisted(); + +} diff --git a/src/api/java/vazkii/botania/api/internal/IManaNetwork.java b/src/api/java/vazkii/botania/api/internal/IManaNetwork.java new file mode 100644 index 00000000..38e94197 --- /dev/null +++ b/src/api/java/vazkii/botania/api/internal/IManaNetwork.java @@ -0,0 +1,68 @@ +/** + * 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 @ [Mar 7, 2014, 3:39:48 PM (GMT)] + */ +package vazkii.botania.api.internal; + +import java.util.List; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import vazkii.botania.api.mana.TileSignature; + +/** + * A basic interface for a world's Mana Network. + * @see IInternalMethodHandler#getManaNetworkInstance() + */ +public interface IManaNetwork { + + /** + * Clears the entire Mana Network of all it's contents, you probably + * don't want to call this unless you have a very good reason. + */ + public void clear(); + + /** + * Gets the closest Mana Collector (eg. Mana Spreader) in the network to the Chunk + * Coordinates passed in, in the given dimension.
+ * A way of getting the dimension is via worldObj.provider.dimensionId
+ * Note that this function *can* get performance intensive, it's reccomended you + * call it sparingly and take cache of the value returned. + * @param limit The maximum distance the closest block can be, if the closest block + * is farther away than that, null will be returned instead. + */ + public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit); + + /** + * Gets the closest Mana Pool in the network to the Chunk Coordinates passed in, + * in the given dimension.
+ * A way of getting the dimension is via worldObj.provider.dimensionId
+ * Note that this function *can* get performance intensive, it's reccomended you + * call it sparingly and take cache of the value returned. + * @param limit The maximum distance the closest block can be, if the closest block + * is farther away than that, null will be returned instead. + */ + public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit); + + /** + * Gets the list of all Mana Collectors (eg. Mana Spreader) in the dimension + * passed in. Note that this is the actual list and not a copy, make sure to + * clone the list if you intend to change it in any way. + */ + public List getAllCollectorsInWorld(World world); + + /** + * Gets the list of all Mana Pools in the dimension passed in. Note that this + * is the actual list and not a copy, make sure to clone the list if you intend + * to change it in any way. + */ + public List getAllPoolsInWorld(World world); +} diff --git a/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java b/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java new file mode 100644 index 00000000..eb4815c6 --- /dev/null +++ b/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java @@ -0,0 +1,44 @@ +/** + * 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 @ [Aug 30, 2014, 4:28:29 PM (GMT)] + */ +package vazkii.botania.api.item; + +/** + * A TileEntity that implements this can be heated by an Exoflame flower. + */ +public interface IExoflameHeatable { + + /** + * Can this TileEntity smelt its contents. If true, the Exoflame is allowed + * to fuel it. + */ + public boolean canSmelt(); + + /** + * Gets the amount of ticks left for the fuel. If below 2, the exoflame + * will call boostBurnTime. + */ + public int getBurnTime(); + + /** + * Called to increase the amount of time this furnace should be burning + * the fuel for. Even if it doesn't have any fuel. + */ + public void boostBurnTime(); + + /** + * Called once every two ticks to increase the speed of the furnace. Feel + * free to not do anything if all you want is to allow the exoflame to feed + * it, not make it faster. + */ + public void boostCookTime(); + +} diff --git a/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java b/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java new file mode 100644 index 00000000..67db3e64 --- /dev/null +++ b/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java @@ -0,0 +1,29 @@ +/** + * 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 @ [Aug 6, 2014, 6:02:29 PM (GMT)] + */ +package vazkii.botania.api.item; + +/** + * An interface that defines an instance of PlayerControllerMP with + * the ability to modify reach. See vazkii.botania.client.core.handler.BotaniaPlayerController + */ +public interface IExtendedPlayerController { + + /** + * Sets the extra reach the player should have. + */ + public void setReachDistanceExtension(float f); + + /** + * Gets the current reach extension. + */ + public float getReachDistanceExtension(); +} diff --git a/src/api/java/vazkii/botania/api/item/IPetalApothecary.java b/src/api/java/vazkii/botania/api/item/IPetalApothecary.java new file mode 100644 index 00000000..d96f73f1 --- /dev/null +++ b/src/api/java/vazkii/botania/api/item/IPetalApothecary.java @@ -0,0 +1,30 @@ +/** + * 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 @ [Aug 30, 2014, 4:22:15 PM (GMT)] + */ +package vazkii.botania.api.item; + +/** + * Base Interface for the Petal Apothecary block. Can + * be safely casted to TileEntity. + */ +public interface IPetalApothecary { + + /** + * Sets if the the apothecary has water or not. + */ + public void setWater(boolean water); + + /** + * Does the apothecary have water in it? + */ + public boolean hasWater(); + +} diff --git a/src/api/java/vazkii/botania/api/item/IPixieSpawner.java b/src/api/java/vazkii/botania/api/item/IPixieSpawner.java new file mode 100644 index 00000000..c0d47f87 --- /dev/null +++ b/src/api/java/vazkii/botania/api/item/IPixieSpawner.java @@ -0,0 +1,30 @@ +/** + * 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 @ [Aug 6, 2014, 6:06:27 PM (GMT)] + */ +package vazkii.botania.api.item; + +import net.minecraft.item.ItemStack; + +/** + * Any item that implements this allows for pixies to be spawned when the player takes damage when...
+ * - Case the item is armor, having it equipped.
+ * - Case the item is a bauble, having it worn.
+ * - On any other case, having the item being the current held item. + */ +public interface IPixieSpawner { + + /** + * The chance this item adds for pixies to be spawned. From 0.0 to 1.0. All values + * are put together when calculating. + */ + public float getPixieChance(ItemStack stack); + +} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java b/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java new file mode 100644 index 00000000..fe2167b1 --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java @@ -0,0 +1,29 @@ +/** + * 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 @ [Jun 8, 2014, 7:02:48 PM (GMT)] + */ +package vazkii.botania.api.lexicon; + +/** + * Have a LexiconEntry implement this to signify it's an "Addon entry", as + * in, one provided by an Addon. This allows it to draw a subtitle of + * sorts, to prevent the [Mod tag here] nonsense that happened with thaumcraft + * addons. It can also be used for other purposes, such as stating an + * entry is WIP. + */ +public interface IAddonEntry { + + /** + * Returns the unlocalized subtitle to show below the title. Here you'd + * return something like "(This Entry is provided by the Botanic Tinkerer addon)". + */ + public String getSubtitle(); + +} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexicon.java b/src/api/java/vazkii/botania/api/lexicon/ILexicon.java new file mode 100644 index 00000000..ee07e17f --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/ILexicon.java @@ -0,0 +1,21 @@ +package vazkii.botania.api.lexicon; + +import net.minecraft.item.ItemStack; + +/** + * Basic interface for the Lexica Botania. + */ +public interface ILexicon { + + /** + * Gets if a specific knowledge is unlocked. Check the knowledge types in + * BotaniaAPI. + */ + public boolean isKnowledgeUnlocked(ItemStack stack, KnowledgeType knowledge); + + /** + * Unlocks a specfic type of knowledge. + */ + public void unlockKnowledge(ItemStack stack, KnowledgeType knowledge); + +} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java b/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java new file mode 100644 index 00000000..e8777db2 --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java @@ -0,0 +1,29 @@ +/** + * 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 @ [Jan 20, 2014, 7:05:44 PM (GMT)] + */ +package vazkii.botania.api.lexicon; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * Any block that implements this can be right clicked with + * a Lexica Botania to open a entry page. + */ +public interface ILexiconable { + + /** + * Gets the lexicon entry to open at this location. null works too. + */ + public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon); + +} diff --git a/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java b/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java new file mode 100644 index 00000000..d07c0325 --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java @@ -0,0 +1,24 @@ +/** + * 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 @ [Mar 20, 2014, 6:08:48 PM (GMT)] + */ +package vazkii.botania.api.lexicon; + +import net.minecraft.item.ItemStack; + +/** + * Have an Item implement this so that the method used for mapping it into + * the lexicon recipe mappings isn't the typical id:meta key. + */ +public interface IRecipeKeyProvider { + + public String getKey(ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java b/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java new file mode 100644 index 00000000..5a08c9ce --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java @@ -0,0 +1,20 @@ +package vazkii.botania.api.lexicon; + +import net.minecraft.util.EnumChatFormatting; + +public class KnowledgeType { + + public final String id; + public final EnumChatFormatting color; + public final boolean autoUnlock; + + public KnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { + this.id = id; + this.color = color; + this.autoUnlock = autoUnlock; + } + + public String getUnlocalizedName() { + return "botania.knowledge." + id; + } +} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java b/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java new file mode 100644 index 00000000..76273419 --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java @@ -0,0 +1,32 @@ +/** + * 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 @ [Jan 14, 2014, 6:23:47 PM (GMT)] + */ +package vazkii.botania.api.lexicon; + +import java.util.ArrayList; +import java.util.List; + +public final class LexiconCategory { + + public final String unlocalizedName; + public final List entries = new ArrayList(); + + /** + * @param unlocalizedName The unlocalized name of this category. This will be localized by the client display. + */ + public LexiconCategory(String unlocalizedName) { + this.unlocalizedName = unlocalizedName; + } + + public String getUnlocalizedName() { + return unlocalizedName; + } +} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java b/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java new file mode 100644 index 00000000..bbc475c4 --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java @@ -0,0 +1,97 @@ +/** + * 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 @ [Jan 14, 2014, 6:17:06 PM (GMT)] + */ +package vazkii.botania.api.lexicon; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.util.StatCollector; +import vazkii.botania.api.BotaniaAPI; + +public class LexiconEntry implements Comparable { + + public final String unlocalizedName; + public final LexiconCategory category; + + private KnowledgeType type = BotaniaAPI.basicKnowledge; + + public List pages = new ArrayList(); + private boolean priority = false; + + /** + * @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display. + */ + public LexiconEntry(String unlocalizedName, LexiconCategory category) { + this.unlocalizedName = unlocalizedName; + this.category = category; + } + + /** + * Sets this page as prioritized, as in, will appear before others in the lexicon. + */ + public LexiconEntry setPriority() { + priority = true; + return this; + } + + /** + * Sets the Knowledge type of this entry. + */ + public LexiconEntry setKnowledgeType(KnowledgeType type) { + this.type = type; + return this; + } + + public KnowledgeType getKnowledgeType() { + return type; + } + + public boolean isPriority() { + return priority; + } + + public String getUnlocalizedName() { + return unlocalizedName; + } + + /** + * Sets what pages you want this entry to have. + */ + public LexiconEntry setLexiconPages(LexiconPage... pages) { + this.pages.addAll(Arrays.asList(pages)); + + for(int i = 0; i < this.pages.size(); i++) { + LexiconPage page = this.pages.get(i); + if(!page.skipRegistry) + page.onPageAdded(this, i); + } + + return this; + } + + /** + * Adds a page to the list of pages. + */ + public void addPage(LexiconPage page) { + pages.add(page); + } + + public final String getNameForSorting() { + return (priority ? 0 : 1) + StatCollector.translateToLocal(getUnlocalizedName()); + } + + @Override + public int compareTo(LexiconEntry o) { + return getNameForSorting().compareTo(o.getNameForSorting()); + } +} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java b/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java new file mode 100644 index 00000000..f17f0c5e --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java @@ -0,0 +1,67 @@ +/** + * 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 @ [Jan 14, 2014, 6:17:24 PM (GMT)] + */ +package vazkii.botania.api.lexicon; + +import vazkii.botania.api.internal.IGuiLexiconEntry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class LexiconPage { + + public String unlocalizedName; + public boolean skipRegistry; + + public LexiconPage(String unlocalizedName) { + this.unlocalizedName = unlocalizedName; + } + + /** + * Does the rendering for this page. + * @param gui The active GuiScreen + * @param mx The mouse's relative X position. + * @param my The mouse's relative Y position. + */ + @SideOnly(Side.CLIENT) + public abstract void renderScreen(IGuiLexiconEntry gui, int mx, int my); + + /** + * Called per update tick. + */ + @SideOnly(Side.CLIENT) + public void updateScreen() { + // NO-OP + } + + /** + * Called when a key is pressed. + */ + @SideOnly(Side.CLIENT) + public void onKeyPressed(char c, int key) { + // NO-OP + } + + /** + * Called when {@link LexiconEntry#setLexiconPages(LexiconPage...)} is called. + */ + public void onPageAdded(LexiconEntry entry, int index) { + // NO-OP + } + + public String getUnlocalizedName() { + return unlocalizedName; + } + + public LexiconPage setSkipRegistry() { + skipRegistry = true; + return this; + } +} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java b/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java new file mode 100644 index 00000000..49b2a133 --- /dev/null +++ b/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java @@ -0,0 +1,66 @@ +/** + * 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 @ [Mar 6, 2014, 3:54:12 PM (GMT)] + */ +package vazkii.botania.api.lexicon; + +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.item.ItemStack; + +/** + * This class contains mappings for which entry and page correspond to each + * craftable ItemStack. Use the map method to map an ItemStack to a page in + * an entry in the lexicon. + */ +public final class LexiconRecipeMappings { + + private static Map mappings = new HashMap(); + + /** + * Maps the given stack to the given page of the entry. + */ + public static void map(ItemStack stack, LexiconEntry entry, int page, boolean force) { + EntryData data = new EntryData(entry, page); + String str = stackToString(stack); + + if(force || !mappings.containsKey(str)) + mappings.put(str, data); + } + + public static void map(ItemStack stack, LexiconEntry entry, int page) { + map(stack, entry, page, false); + } + + + public static EntryData getDataForStack(ItemStack stack) { + return mappings.get(stackToString(stack)); + } + + public static String stackToString(ItemStack stack) { + if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) + return ((IRecipeKeyProvider) stack.getItem()).getKey(stack); + + return stack.getUnlocalizedName() + "~" + stack.getItemDamage(); + } + + public static class EntryData { + + public final LexiconEntry entry; + public final int page; + + public EntryData(LexiconEntry entry, int page) { + this.entry = entry; + this.page = page; + } + + } +} diff --git a/src/api/java/vazkii/botania/api/mana/BurstProperties.java b/src/api/java/vazkii/botania/api/mana/BurstProperties.java new file mode 100644 index 00000000..eed74809 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/BurstProperties.java @@ -0,0 +1,37 @@ +/** + * 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 @ [Jan 31, 2014, 3:49:30 PM (GMT)] + */ +package vazkii.botania.api.mana; + +/** + * The properties of a mana burst, when shot. This is passed to the lens + * currently on the mana spreader to apply changes. + */ +public final class BurstProperties { + + public int maxMana; + public int ticksBeforeManaLoss; + public float manaLossPerTick; + public float gravity; + public float motionModifier; + + public int color; + + public BurstProperties(int maxMana, int ticksBeforeManaLoss, float manaLossPerTick, float gravity, float motionModifier, int color) { + this.maxMana = maxMana; + this.ticksBeforeManaLoss = ticksBeforeManaLoss; + this.manaLossPerTick = manaLossPerTick; + this.gravity = gravity; + this.motionModifier = motionModifier; + this.color = color; + } + +} diff --git a/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java b/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java new file mode 100644 index 00000000..889cfb51 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java @@ -0,0 +1,21 @@ +/** + * 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 @ [Jul 2, 2014, 5:26:02 PM (GMT)] + */ +package vazkii.botania.api.mana; + +/** + * A TileEntity that implements this will get it's recieveMana call + * called on both client and server. If this is not implemented + * the call will only occur on the server. + */ +public interface IClientManaHandler extends IManaReceiver { + +} diff --git a/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java b/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java new file mode 100644 index 00000000..51f3cce9 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java @@ -0,0 +1,26 @@ +/** + * 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 @ [May 25, 2014, 7:34:00 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.item.ItemStack; + +/** + * Have an item implement this to flag it as an infinite + * mana source for the purposes of the HUD rendered when + * an IManaUserItem implementing item is present. + */ +public interface ICreativeManaProvider { + + public boolean isCreative(ItemStack stack); + +} + diff --git a/src/api/java/vazkii/botania/api/mana/IKeyLocked.java b/src/api/java/vazkii/botania/api/mana/IKeyLocked.java new file mode 100644 index 00000000..a7870e6b --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IKeyLocked.java @@ -0,0 +1,30 @@ +/** + * 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 @ [Jul 11, 2014, 4:29:32 PM (GMT)] + */ +package vazkii.botania.api.mana; + +/** + * A TileEntity that implements this interface has an IO key lock. This + * interface defines an input and output key.

+ * + * A Spreader can only shoot mana into a IKeyLocked interfaced TE if the Input + * key of the TE is equal to the Output key of the Spreader.

+ * + * A Spreader can only pull mana from a IKeyLocked interfaced IManaPool TE if the + * Output key of the IManaPool is equal to the Input key of the Spreader. + */ +public interface IKeyLocked { + + public String getInputKey(); + + public String getOutputKey(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java b/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java new file mode 100644 index 00000000..91cb0b93 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java @@ -0,0 +1,23 @@ +/** + * 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 @ [Jul 26, 2014, 9:51:58 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.world.World; + +/** + * A block that implements this has a flag for whether it can be moved by the Shard of Laputa. + */ +public interface ILaputaImmobile { + + public boolean canMove(World world, int x, int y, int z); + +} diff --git a/src/api/java/vazkii/botania/api/mana/ILens.java b/src/api/java/vazkii/botania/api/mana/ILens.java new file mode 100644 index 00000000..628d102b --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/ILens.java @@ -0,0 +1,43 @@ +/** + * 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 @ [Jan 31, 2014, 3:03:04 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.item.ItemStack; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Have an Item implement this to be counted as a lens for the mana spreader. + */ +public interface ILens extends ILensEffect { + + @SideOnly(Side.CLIENT) + public int getLensColor(ItemStack stack); + + /** + * Can the source lens be combined with the composite lens? This is called + * for both the ILens instance of ItemStack.getItem() of sourceLens and compositeLens. + */ + public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens); + + /** + * Gets the composite lens in the stack passed in, return null for none. + */ + public ItemStack getCompositeLens(ItemStack stack); + + /** + * Sets the composite lens for the sourceLens as the compositeLens, returns + * the ItemStack with the combination. + */ + public ItemStack setCompositeLens(ItemStack sourceLens, ItemStack compositeLens); + +} diff --git a/src/api/java/vazkii/botania/api/mana/ILensEffect.java b/src/api/java/vazkii/botania/api/mana/ILensEffect.java new file mode 100644 index 00000000..d97095b2 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/ILensEffect.java @@ -0,0 +1,49 @@ +/** + * 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 14, 2014, 7:30:00 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import vazkii.botania.api.internal.IManaBurst; + +/** + * Have an item implement this for it to count as a lens effect and + * be able to change the properties of Mana Bursts. + */ +public interface ILensEffect { + + /** + * Called when a mana spreader that has this focus shoots a burst. This is where + * you change the properties of the burst. + */ + public void apply(ItemStack stack, BurstProperties props); + + /** + * Called when a mana burst fired from a mana spreader with this focus collides against + * any block. This is called after the collision is handled. + * @return True to kill the burst. False to keep it alive. + */ + public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack); + + /** + * Called when a mana burst fired from a mana spreader with this focus is updated. + * This is called before the update is handled. + */ + public void updateBurst(IManaBurst burst, ItemStack stack); + + /** + * Called when the mana burst should do it's particles. Return false to not + * do any particles. + */ + public boolean doParticles(IManaBurst burst, ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaBlock.java b/src/api/java/vazkii/botania/api/mana/IManaBlock.java new file mode 100644 index 00000000..6896f059 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaBlock.java @@ -0,0 +1,26 @@ +/** + * 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 @ [Jan 22, 2014, 4:59:05 PM (GMT)] + */ +package vazkii.botania.api.mana; + +/** + * A TileEntity that implements this is considered a Mana Block. + * Just being a Mana Block doesn't mean much, look at the other IMana + * interfaces. + */ +public interface IManaBlock { + + /** + * Gets the amount of mana currently in this block. + */ + public int getCurrentMana(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollector.java b/src/api/java/vazkii/botania/api/mana/IManaCollector.java new file mode 100644 index 00000000..a54d8c93 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaCollector.java @@ -0,0 +1,43 @@ +/** + * 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 @ [Jan 22, 2014, 5:01:19 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import vazkii.botania.api.internal.IManaBurst; + +/** + * Any TileEntity that implements this is considered a mana collector, by + * which nearby generating flowers will pump mana into it.

+ * + * Implementation Instructions:
+ * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removeCollector(this); on both.
+ * - On the first tick of onUpdate(), call ManaNetworkEvent.addCollector(this); + */ +public interface IManaCollector extends IManaReceiver { + + /** + * Called every tick on the client case the player is holding a Wand of the Forest. + */ + public void onClientDisplayTick(); + + /** + * Get the multiplier of mana to input into the block, 1.0 is the original amount of mana + * in the burst. 0.9, for example, is 90%, so 10% of the mana in the burst will get + * dissipated. + */ + public float getManaYieldMultiplier(IManaBurst burst); + + /** + * Gets the maximum amount of mana this collector can have. + */ + public int getMaxMana(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java b/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java new file mode 100644 index 00000000..420f683c --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java @@ -0,0 +1,22 @@ +/** + * 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 @ [Mar 10, 2014, 7:49:19 PM (GMT)] + */ +package vazkii.botania.api.mana; + +/** + * Any TileEntity that implements this can be counted as a "ghost" block of + * sorts, that won't call the collision code for the mana bursts. + */ +public interface IManaCollisionGhost { + + public boolean isGhost(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaItem.java b/src/api/java/vazkii/botania/api/mana/IManaItem.java new file mode 100644 index 00000000..42dfef15 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaItem.java @@ -0,0 +1,69 @@ +/** + * 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 @ [Mar 6, 2014, 9:07:40 AM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +/** + * An item that implements this can be counted as an item that can + * contain mana. + */ +public interface IManaItem { + + /** + * Gets the amount of mana this item contains + */ + public int getMana(ItemStack stack); + + /** + * Gets the max amount of mana this item can hold. + */ + public int getMaxMana(ItemStack stack); + + /** + * Adds mana to this item. + */ + public void addMana(ItemStack stack, int mana); + + /** + * Can this item receive mana from a mana Pool? + * @param pool The pool it's receiving mana from, can be casted to IManaPool. + * @see IManaPool#isOutputtingPower() + */ + public boolean canReceiveManaFromPool(ItemStack stack, TileEntity pool); + + /** + * Can this item recieve mana from another item? + */ + public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack); + + /** + * Can this item export mana to a mana Pool? + * @param pool The pool it's exporting mana to, can be casted to IManaPool. + * @see IManaPool#isOutputtingPower() + */ + public boolean canExportManaToPool(ItemStack stack,TileEntity pool); + + /** + * Can this item export mana to another item? + */ + public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack); + + /** + * If this item simply does not export mana at all, set this to true. This is + * used to skip items that contain mana but can't export it when drawing the + * mana bar above the XP bar. + */ + public boolean isNoExport(ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaPool.java b/src/api/java/vazkii/botania/api/mana/IManaPool.java new file mode 100644 index 00000000..b93bf6e8 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaPool.java @@ -0,0 +1,31 @@ +/** + * 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 @ [Jan 22, 2014, 5:03:09 PM (GMT)] + */ +package vazkii.botania.api.mana; + +/** + * Any TileEntity that implements this is considered a Mana Pool, + * by which nearby functional flowers will pull mana from it.
+ * Mana Distributors will also accept it as valid output.

+ * + * Implementation Instructions:
+ * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removePool(this); on both.
+ * - On the first tick of onUpdate(), call ManaNetworkEvent.addPool(this); + */ +public interface IManaPool extends IManaReceiver { + + /** + * Returns false if the mana pool is accepting power from other power items, + * true if it's sending power into them. + */ + public boolean isOutputtingPower(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaReceiver.java b/src/api/java/vazkii/botania/api/mana/IManaReceiver.java new file mode 100644 index 00000000..2838c7b7 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaReceiver.java @@ -0,0 +1,35 @@ +/** + * 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 @ [Jan 22, 2014, 4:55:00 PM (GMT)] + */ +package vazkii.botania.api.mana; + +/** + * Any TileEntity that implements this can receive mana from mana bursts. + */ +public interface IManaReceiver extends IManaBlock { + + /** + * Is this Mana Receiver is full? Being full means no mana bursts will be sent. + */ + public boolean isFull(); + + /** + * Called when this receiver receives mana. + */ + public void recieveMana(int mana); + + /** + * Can this tile receive mana from bursts? Generally set to false for + * implementations of IManaCollector. + */ + public boolean canRecieveManaFromBursts(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaTrigger.java b/src/api/java/vazkii/botania/api/mana/IManaTrigger.java new file mode 100644 index 00000000..684a2c1d --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaTrigger.java @@ -0,0 +1,24 @@ +/** + * 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 @ [May 16, 2014, 7:52:53 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.world.World; +import vazkii.botania.api.internal.IManaBurst; + +/** + * Have a block implement this class to make it do something when a mana burst collides with it. + */ +public interface IManaTrigger { + + public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java b/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java new file mode 100644 index 00000000..d06cf744 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java @@ -0,0 +1,26 @@ +/** + * 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 @ [May 25, 2014, 7:32:10 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.item.ItemStack; + +/** + * Any item that implements this interface is an item that would use mana + * from the player's inventory. If there's any items in the inventory or + * equipped in either the baubles or armor inventories that implement + * this interface, a mana bar will be rendered. + */ +public interface IManaUsingItem { + + public boolean usesMana(ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java b/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java new file mode 100644 index 00000000..f677c3ee --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java @@ -0,0 +1,26 @@ +/** + * 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 @ [Jul 2, 2014, 6:36:54 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +/** + * A block that implements this can provide an IIcon (block icons only) + * to be used as an overlay for the mana pool, similarly to the mana void + * and catalysts. + */ +public interface IPoolOverlayProvider { + + public IIcon getIcon(World world, int x, int y, int z); + +} diff --git a/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java b/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java new file mode 100644 index 00000000..004c52ed --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java @@ -0,0 +1,24 @@ +/** + * 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 @ [Jul 22, 2014, 2:26:14 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.item.ItemStack; + +/** + * Any Item that implements ILensEffect and this will have + * a check before being pulled by the Tiny Planet. + */ +public interface ITinyPlanetExcempt { + + public boolean shouldPull(ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java b/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java new file mode 100644 index 00000000..74fb0053 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java @@ -0,0 +1,201 @@ +/** + * 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 @ [Mar 13, 2014, 5:32:24 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import vazkii.botania.api.BotaniaAPI; + +public final class ManaItemHandler { + + /** + * Requests mana from items in a given player's inventory. + * @param manaToGet How much mana is to be requested, if less mana exists than this amount, + * the amount of mana existent will be returned instead, if you want exact values use requestManaExact. + * @param remove If true, the mana will be removed from the target item. Set to false to just check. + * @return The amount of mana received from the request. + */ + public static int requestMana(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { + if(stack == null) + return 0; + + IInventory mainInv = player.inventory; + IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); + + int invSize = mainInv.getSizeInventory(); + int size = invSize; + if(baublesInv != null) + size += baublesInv.getSizeInventory(); + + for(int i = 0; i < size; i++) { + boolean useBaubles = i >= invSize; + IInventory inv = useBaubles ? baublesInv : mainInv; + ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); + if(stackInSlot == stack) + continue; + + if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { + IManaItem manaItem = (IManaItem) stackInSlot.getItem(); + if(manaItem.canExportManaToItem(stackInSlot, stack) && manaItem.getMana(stackInSlot) > 0) { + if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) + continue; + + int mana = Math.min(manaToGet, manaItem.getMana(stackInSlot)); + + if(remove) + manaItem.addMana(stackInSlot, -mana); + + return mana; + } + } + } + + return 0; + } + + /** + * Requests an exact amount of mana from items in a given player's inventory. + * @param manaToGet How much mana is to be requested, if less mana exists than this amount, + * false will be returned instead, and nothing will happen. + * @param remove If true, the mana will be removed from the target item. Set to false to just check. + * @return If the request was succesful. + */ + public static boolean requestManaExact(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { + if(stack == null) + return false; + + IInventory mainInv = player.inventory; + IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); + + int invSize = mainInv.getSizeInventory(); + int size = invSize; + if(baublesInv != null) + size += baublesInv.getSizeInventory(); + + for(int i = 0; i < size; i++) { + boolean useBaubles = i >= invSize; + IInventory inv = useBaubles ? baublesInv : mainInv; + ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); + if(stackInSlot == stack) + continue; + + if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { + IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); + if(manaItemSlot.canExportManaToItem(stackInSlot, stack) && manaItemSlot.getMana(stackInSlot) > manaToGet) { + if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) + continue; + + if(remove) + manaItemSlot.addMana(stackInSlot, -manaToGet); + + return true; + } + } + } + + return false; + } + + /** + * Dispatches mana to items in a given player's inventory. Note that this method + * does not automatically remove mana from the item which is exporting. + * @param manaToSend How much mana is to be sent. + * @param remove If true, the mana will be added from the target item. Set to false to just check. + * @return The amount of mana actually sent. + */ + public static int dispatchMana(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { + if(stack == null) + return 0; + + IInventory mainInv = player.inventory; + IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); + + int invSize = mainInv.getSizeInventory(); + int size = invSize; + if(baublesInv != null) + size += baublesInv.getSizeInventory(); + + for(int i = 0; i < size; i++) { + boolean useBaubles = i >= invSize; + IInventory inv = useBaubles ? baublesInv : mainInv; + ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); + if(stackInSlot == stack) + continue; + + if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { + IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); + + if(manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { + if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) + continue; + + int received = 0; + if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot)) + received = manaToSend; + else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot)); + + + if(add) + manaItemSlot.addMana(stackInSlot, manaToSend); + + return received; + } + } + } + + return 0; + } + + /** + * Dispatches an exact amount of mana to items in a given player's inventory. Note that this method + * does not automatically remove mana from the item which is exporting. + * @param manaToSend How much mana is to be sent. + * @param remove If true, the mana will be added from the target item. Set to false to just check. + * @return If an item received the mana sent. + */ + public static boolean dispatchManaExact(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { + if(stack == null) + return false; + + IInventory mainInv = player.inventory; + IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); + + int invSize = mainInv.getSizeInventory(); + int size = invSize; + if(baublesInv != null) + size += baublesInv.getSizeInventory(); + + for(int i = 0; i < size; i++) { + boolean useBaubles = i >= invSize; + IInventory inv = useBaubles ? baublesInv : mainInv; + ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); + if(stackInSlot == stack) + continue; + + if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { + IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); + if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot) && manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { + if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) + continue; + + if(add) + manaItemSlot.addMana(stackInSlot, manaToSend); + + return true; + } + } + } + + return false; + } +} diff --git a/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java b/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java new file mode 100644 index 00000000..e04253a7 --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java @@ -0,0 +1,57 @@ +/** + * 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 @ [Jan 22, 2014, 5:04:30 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.eventhandler.Event; + +public class ManaNetworkEvent extends Event { + + public final TileEntity tile; + public final ManaBlockType type; + public final Action action; + + public ManaNetworkEvent(TileEntity tile, ManaBlockType type, Action action) { + this.tile = tile; + this.type = type; + this.action = action; + } + + public static void addCollector(TileEntity tile) { + ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.ADD); + MinecraftForge.EVENT_BUS.post(event); + } + + public static void removeCollector(TileEntity tile) { + ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.REMOVE); + MinecraftForge.EVENT_BUS.post(event); + } + + public static void addPool(TileEntity tile) { + ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.ADD); + MinecraftForge.EVENT_BUS.post(event); + } + + public static void removePool(TileEntity tile) { + ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.REMOVE); + MinecraftForge.EVENT_BUS.post(event); + } + + public enum ManaBlockType { + POOL, COLLECTOR + } + + public enum Action { + REMOVE, ADD + } +} diff --git a/src/api/java/vazkii/botania/api/mana/TileSignature.java b/src/api/java/vazkii/botania/api/mana/TileSignature.java new file mode 100644 index 00000000..5573670d --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/TileSignature.java @@ -0,0 +1,15 @@ +package vazkii.botania.api.mana; + +import net.minecraft.tileentity.TileEntity; + +public class TileSignature { + + public final TileEntity tile; + public final boolean remoteWorld; + + public TileSignature(TileEntity tile, boolean remoteWorld) { + this.tile = tile; + this.remoteWorld = remoteWorld; + } + +} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java new file mode 100644 index 00000000..4353f01c --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java @@ -0,0 +1,54 @@ +/** + * 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 @ [Aug 21, 2014, 5:44:13 PM (GMT)] + */ +package vazkii.botania.api.mana.spark; + +import net.minecraft.item.ItemStack; +import vazkii.botania.api.mana.IManaReceiver; + +/** + * A TileEntity that implements this can have a Spark attached to it. + * For the Spark to be allowed to have upgrades, it needs to be an IManaPool. + */ +public interface ISparkAttachable extends IManaReceiver { + + /** + * Can this block have a Spark attached to it. Note that this will not + * unattach the Spark if it's changed later. + */ + public boolean canAttachSpark(ItemStack stack); + + /** + * Called when the Spark is attached. + */ + public void attachSpark(ISparkEntity entity); + + /** + * Gets the Spark that is attached to this block. A common implementation is + * to check for Spark entities above: + * + List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); + if(sparks.size() == 1) { + Entity e = (Entity) sparks.get(0); + return (ISparkEntity) e; + } + + return null; + */ + public ISparkEntity getAttachedSpark(); + + /** + * Return true if this Tile no longer requires mana and all Sparks + * transferring mana to it should cancel their transfer. + */ + public boolean areIncomingTranfersDone(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java new file mode 100644 index 00000000..084b827c --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java @@ -0,0 +1,65 @@ +/** + * 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 @ [Aug 21, 2014, 5:44:07 PM (GMT)] + */ +package vazkii.botania.api.mana.spark; + +import java.util.Collection; + +/** + * An Entity that implements this is considered a Spark. + */ +public interface ISparkEntity { + + /** + * Which TileEntity is this Spark attached to? A common implementation is checking the block below. + * + int x = MathHelper.floor_double(posX); + int y = MathHelper.floor_double(posY) - 1; + int z = MathHelper.floor_double(posZ); + TileEntity tile = worldObj.getTileEntity(x, y, z); + if(tile != null && tile instanceof ISparkAttachable) + return (ISparkAttachable) tile; + + return null; + */ + public ISparkAttachable getAttachedTile(); + + /** + * Gets a collection of all Sparks this is tranfering to. + */ + public Collection getTransfers(); + + /** + * Registers the Spark passed in as a Spark meant for mana to be transfered towards. + */ + public void registerTransfer(ISparkEntity entity); + + /** + * Gets which upgrade is in this Spark.
+ * 0: None
+ * 1: Dispersive
+ * 2: Dominant
+ * 3: Recessive
+ * 4: Isolated + */ + public int getUpgrade(); + + /** + * Sets the upgrade on this Spark. See {@link ISparkEntity#getUpgrade} + */ + public void setUpgrade(int upgrade); + + /** + * See {@link ISparkAttachable#areIncomingTranfersDone()} + */ + public boolean areIncomingTransfersDone(); + +} diff --git a/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java b/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java new file mode 100644 index 00000000..6bb3196a --- /dev/null +++ b/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java @@ -0,0 +1,33 @@ +/** + * 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 @ [Aug 21, 2014, 7:16:11 PM (GMT)] + */ +package vazkii.botania.api.mana.spark; + +import java.util.List; + +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public final class SparkHelper { + + public static final int SPARK_SCAN_RANGE = 12; + + public static List getSparksAround(World world, double x, double y, double z) { + return SparkHelper.getEntitiesAround(ISparkEntity.class, world, x, y, z); + } + + public static List getEntitiesAround(Class clazz, World world, double x, double y, double z) { + int r = SPARK_SCAN_RANGE; + List entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r)); + return entities; + } + +} diff --git a/src/api/java/vazkii/botania/api/package-info.java b/src/api/java/vazkii/botania/api/package-info.java new file mode 100644 index 00000000..82da263c --- /dev/null +++ b/src/api/java/vazkii/botania/api/package-info.java @@ -0,0 +1,4 @@ +@API(owner = "Botania", apiVersion = "18", provides = "BotaniaAPI") +package vazkii.botania.api; +import cpw.mods.fml.common.API; + diff --git a/src/api/java/vazkii/botania/api/recipe/IElvenItem.java b/src/api/java/vazkii/botania/api/recipe/IElvenItem.java new file mode 100644 index 00000000..e614014d --- /dev/null +++ b/src/api/java/vazkii/botania/api/recipe/IElvenItem.java @@ -0,0 +1,14 @@ +package vazkii.botania.api.recipe; + +import net.minecraft.item.ItemStack; + +/** + * Any Item that implements this is classified as an "Elven Item", by which, + * it'll not go through the alfheim portal. Any item that comes out of it + * must implement this or it'll just go back in. + */ +public interface IElvenItem { + + public boolean isElvenItem(ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java b/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java new file mode 100644 index 00000000..fe5bf3cd --- /dev/null +++ b/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java @@ -0,0 +1,26 @@ +/** + * 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 @ [Feb 15, 2014, 2:36:35 PM (GMT)] + */ +package vazkii.botania.api.recipe; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +/** + * Have an Item implement this to allow it to be used in the Petal Apothecary. + */ +public interface IFlowerComponent { + + public boolean canFit(ItemStack stack, IInventory apothecary); + + public int getParticleColor(ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java b/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java new file mode 100644 index 00000000..dbea13e8 --- /dev/null +++ b/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java @@ -0,0 +1,94 @@ +package vazkii.botania.api.recipe; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class RecipeElvenTrade { + + ItemStack output; + List inputs; + + public RecipeElvenTrade(ItemStack output, Object... inputs) { + this.output = output; + + List inputsToSet = new ArrayList(); + for(Object obj : inputs) { + if(obj instanceof String || obj instanceof ItemStack) + inputsToSet.add(obj); + else throw new IllegalArgumentException("Invalid input"); + } + + this.inputs = inputsToSet; + } + + public boolean matches(List stacks, boolean remove) { + List inputsMissing = new ArrayList(inputs); + List stacksToRemove = new ArrayList(); + + for(ItemStack stack : stacks) { + if(stack == null) { + continue; + } + if(inputsMissing.isEmpty()) + break; + + int stackIndex = -1, oredictIndex = -1; + + for(int j = 0; j < inputsMissing.size(); j++) { + Object input = inputsMissing.get(j); + if(input instanceof String) { + List validStacks = OreDictionary.getOres((String) input); + boolean found = false; + for(ItemStack ostack : validStacks) { + ItemStack cstack = ostack.copy(); + if(cstack.getItemDamage() == Short.MAX_VALUE) + cstack.setItemDamage(stack.getItemDamage()); + + if(stack.isItemEqual(cstack)) { + if(!stacksToRemove.contains(stack)) + stacksToRemove.add(stack); + oredictIndex = j; + found = true; + break; + } + } + + if(found) + break; + } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { + if(!stacksToRemove.contains(stack)) + stacksToRemove.add(stack); + stackIndex = j; + break; + } + } + + if(stackIndex != -1) + inputsMissing.remove(stackIndex); + else if(oredictIndex != -1) + inputsMissing.remove(oredictIndex); + } + + if(remove) + for(ItemStack r : stacksToRemove) + stacks.remove(r); + + return inputsMissing.isEmpty(); + } + + boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { + return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); + } + + public List getInputs() { + return new ArrayList(inputs); + } + + public ItemStack getOutput() { + return output; + } + +} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java b/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java new file mode 100644 index 00000000..e87b002d --- /dev/null +++ b/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java @@ -0,0 +1,81 @@ +/** + * 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 @ [Jan 30, 2014, 5:57:07 PM (GMT)] + */ +package vazkii.botania.api.recipe; + +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class RecipeManaInfusion { + + ItemStack output; + Object input; + int mana; + boolean isAlchemy = false; + boolean isConjuration = false; + + public RecipeManaInfusion(ItemStack output, Object input, int mana) { + this.output = output; + this.input = input; + this.mana = mana; + } + + public boolean matches(ItemStack stack) { + if(input instanceof ItemStack) + return stack.isItemEqual((ItemStack) input); + + if(input instanceof String) { + List validStacks = OreDictionary.getOres((String) input); + + for(ItemStack ostack : validStacks) { + ItemStack cstack = ostack.copy(); + if(cstack.getItemDamage() == Short.MAX_VALUE) + cstack.setItemDamage(stack.getItemDamage()); + + if(stack.isItemEqual(cstack)) + return true; + } + } + + return false; + } + + public void setAlchemy(boolean alchemy) { + isAlchemy = alchemy; + } + + public boolean isAlchemy() { + return isAlchemy; + } + + public void setConjuration(boolean conjuration) { + isConjuration = conjuration; + } + + public boolean isConjuration() { + return isConjuration; + } + + public Object getInput() { + return input; + } + + public ItemStack getOutput() { + return output; + } + + public int getManaToConsume() { + return mana; + } +} + diff --git a/src/api/java/vazkii/botania/api/recipe/RecipePetals.java b/src/api/java/vazkii/botania/api/recipe/RecipePetals.java new file mode 100644 index 00000000..0dba51ac --- /dev/null +++ b/src/api/java/vazkii/botania/api/recipe/RecipePetals.java @@ -0,0 +1,97 @@ +/** + * 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 @ [Jan 22, 2014, 2:02:44 PM (GMT)] + */ +package vazkii.botania.api.recipe; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class RecipePetals { + + ItemStack output; + List inputs; + + public RecipePetals(ItemStack output, Object... inputs) { + this.output = output; + + List inputsToSet = new ArrayList(); + for(Object obj : inputs) { + if(obj instanceof String || obj instanceof ItemStack) + inputsToSet.add(obj); + else throw new IllegalArgumentException("Invalid input"); + } + + this.inputs = inputsToSet; + } + + public boolean matches(IInventory inv) { + List inputsMissing = new ArrayList(inputs); + + for(int i = 0; i < inv.getSizeInventory(); i++) { + ItemStack stack = inv.getStackInSlot(i); + if(stack == null) + break; + + int stackIndex = -1, oredictIndex = -1; + + for(int j = 0; j < inputsMissing.size(); j++) { + Object input = inputsMissing.get(j); + if(input instanceof String) { + List validStacks = OreDictionary.getOres((String) input); + boolean found = false; + for(ItemStack ostack : validStacks) { + ItemStack cstack = ostack.copy(); + if(cstack.getItemDamage() == Short.MAX_VALUE) + cstack.setItemDamage(stack.getItemDamage()); + + if(stack.isItemEqual(cstack)) { + oredictIndex = j; + found = true; + break; + } + } + + + if(found) + break; + } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { + stackIndex = j; + break; + } + } + + if(stackIndex != -1) + inputsMissing.remove(stackIndex); + else if(oredictIndex != -1) + inputsMissing.remove(oredictIndex); + else return false; + } + + return inputsMissing.isEmpty(); + } + + boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { + return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); + } + + public List getInputs() { + return new ArrayList(inputs); + } + + public ItemStack getOutput() { + return output; + } + +} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java b/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java new file mode 100644 index 00000000..745c9573 --- /dev/null +++ b/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java @@ -0,0 +1,31 @@ +/** + * 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 @ [Feb 5, 2014, 1:41:14 PM (GMT)] + */ +package vazkii.botania.api.recipe; + +import net.minecraft.item.ItemStack; + +public class RecipeRuneAltar extends RecipePetals { + + ItemStack output; + int mana; + + public RecipeRuneAltar(ItemStack output, int mana, Object... inputs) { + super(output, inputs); + this.output = output; + this.mana = mana; + } + + public int getManaUsage() { + return mana; + } + +} diff --git a/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java b/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java new file mode 100644 index 00000000..0ef31493 --- /dev/null +++ b/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java @@ -0,0 +1,21 @@ +/** + * 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 @ [Jan 22, 2014, 7:12:28 PM (GMT)] + */ +package vazkii.botania.api.subtile; + +/** + * The special flowers in botania implement this. Used for cases where + * BlockFlower would be checked against, but isn't convenient for + * the special flowers with effects. For Azanor and Lycaon. + */ +public interface ISpecialFlower { + +} diff --git a/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java b/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java new file mode 100644 index 00000000..ddfaee7f --- /dev/null +++ b/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java @@ -0,0 +1,30 @@ +/** + * 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 @ [Aug 26, 2014, 5:42:16 PM (GMT)] + */ +package vazkii.botania.api.subtile; + +/** + * A TileEntity that implements this contains a SubTileEntity. + */ +public interface ISubTileContainer { + + /** + * Gets the SubTile in this block. Generally shouldn't return null, but in that + * case use the fallback DummySubTile. + */ + public SubTileEntity getSubTile(); + + /** + * Sets the SubTile on this block from it's name. + */ + public void setSubTile(String name); + +} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java b/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java new file mode 100644 index 00000000..619d00f3 --- /dev/null +++ b/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java @@ -0,0 +1,126 @@ +/** + * 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 @ [Jan 24, 2014, 3:59:06 PM (GMT)] + */ +package vazkii.botania.api.subtile; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IIcon; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.wand.IWandBindable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * A Sub-TileEntity, this is used for the flower system. Make sure to map subclasses + * of this using BotaniaAPI.mapSubTile(String, Class). Any subclass of this must have + * a no parameter constructor. + */ +public class SubTileEntity { + + protected TileEntity supertile; + + /** The Tag items should use to store which sub tile they are. **/ + public static final String TAG_TYPE = "type"; + + public void setSupertile(TileEntity tile) { + supertile = tile; + } + + public boolean canUpdate() { + return false; + } + + public void onUpdate() { } + + /** + * Writes some extra data to a network packet. This data is read + * by readFromPacketNBT on the client that receives the packet. + * Note: This method is also used to write to the world NBT. + */ + public void writeToPacketNBT(NBTTagCompound cmp) { } + + /** + * Reads data from a network packet. This data is written by + * writeToPacketNBT in the server. Note: This method is also used + * to read from the world NBT. + */ + public void readFromPacketNBT(NBTTagCompound cmp) { } + + public void sync() { + supertile.getWorldObj().markBlockForUpdate(supertile.xCoord, supertile.yCoord, supertile.zCoord); + } + + public String getUnlocalizedName() { + return BotaniaAPI.getSubTileStringMapping(getClass()); + } + + /** + * Gets the icon for this SubTileEntity, this is a block icon. + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName()); + } + + /** + * Called when a Wand of the Forest is used on this sub tile. Note that the + * player parameter can be null if this is called from a dispenser. + */ + public boolean onWanded(EntityPlayer player, ItemStack wand) { + return false; + } + + /** + * Gets which Lexicon Entry to open when this sub tile is right clicked with a lexicon. + */ + public LexiconEntry getEntry() { + return null; + } + + /** + * Gets the block coordinates this is bound to, for use with the wireframe render + * when the sub tile is being hovered with a wand of the forest. + */ + @SideOnly(Side.CLIENT) + public ChunkCoordinates getBinding() { + return null; + } + + /** + * @see IWandBindable#canSelect(EntityPlayer, ItemStack, int, int, int, int) + */ + public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + return false; + } + + /** + * @see IWandBindable#bindTo(EntityPlayer, ItemStack, int, int, int, int) + */ + public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + return false; + } + + /** + * Called on the client when the block being pointed at is the one with this sub tile. + * Used to render a HUD portraying some data from this sub tile. + */ + @SideOnly(Side.CLIENT) + public void renderHUD(Minecraft mc, ScaledResolution res) { + // NO-OP + } +} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java new file mode 100644 index 00000000..7d95afe7 --- /dev/null +++ b/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java @@ -0,0 +1,212 @@ +/** + * 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 @ [Jan 24, 2014, 8:03:44 PM (GMT)] + */ +package vazkii.botania.api.subtile; + +import java.awt.Color; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.internal.IManaNetwork; +import vazkii.botania.api.mana.IManaPool; + +/** + * The basic class for a Functional Flower. + */ +public class SubTileFunctional extends SubTileEntity { + + private static final String TAG_MANA = "mana"; + + private static final String TAG_POOL_X = "poolX"; + private static final String TAG_POOL_Y = "poolY"; + private static final String TAG_POOL_Z = "poolZ"; + + public int mana; + + public int redstoneSignal = 0; + + int sizeLastCheck = -1; + TileEntity linkedPool = null; + public int knownMana = -1; + + ChunkCoordinates cachedPoolCoordinates = null; + + @Override + public boolean canUpdate() { + return true; + } + + /** + * If set to true, redstoneSignal will be updated every tick. + */ + public boolean acceptsRedstone() { + return false; + } + + @Override + public void onUpdate() { + super.onUpdate(); + + linkPool(); + + if(linkedPool != null) { + IManaPool pool = (IManaPool) linkedPool; + int manaInPool = pool.getCurrentMana(); + int manaMissing = getMaxMana() - mana; + int manaToRemove = Math.min(manaMissing, manaInPool); + pool.recieveMana(-manaToRemove); + addMana(manaToRemove); + } + + if(acceptsRedstone()) { + redstoneSignal = 0; + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); + redstoneSignal = Math.max(redstoneSignal, redstoneSide); + } + } + + if(supertile.getWorldObj().isRemote) { + double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; + Color color = new Color(getColor()); + if(Math.random() > particleChance) + BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); + } + } + + public void linkPool() { + final int range = 10; + + boolean needsNew = false; + if(linkedPool == null) { + needsNew = true; + + if(cachedPoolCoordinates != null && supertile.getWorldObj().blockExists(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ)) { + TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); + if(tileAt != null && tileAt instanceof IManaPool) { + linkedPool = tileAt; + needsNew = false; + } + cachedPoolCoordinates = null; + } + } + + if(!needsNew) { + TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); + if(!(tileAt instanceof IManaPool)) { + linkedPool = null; + needsNew = true; + } else linkedPool = tileAt; + } + + if(needsNew) { + IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); + int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); + if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { + ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); + linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), range); + sizeLastCheck = size; + } + } + } + + public void addMana(int mana) { + this.mana = Math.min(getMaxMana(), this.mana + mana); + } + + @Override + public boolean onWanded(EntityPlayer player, ItemStack wand) { + if(player == null) + return false; + + knownMana = mana; + player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); + + return super.onWanded(player, wand); + } + + public int getMaxMana() { + return 20; + } + + public int getColor() { + return 0xFFFFFF; + } + + @Override + public void readFromPacketNBT(NBTTagCompound cmp) { + mana = cmp.getInteger(TAG_MANA); + + int x = cmp.getInteger(TAG_POOL_X); + int y = cmp.getInteger(TAG_POOL_Y); + int z = cmp.getInteger(TAG_POOL_Z); + + cachedPoolCoordinates = new ChunkCoordinates(x, y, z); + } + + @Override + public void writeToPacketNBT(NBTTagCompound cmp) { + cmp.setInteger(TAG_MANA, mana); + + int x = linkedPool == null ? 0 : linkedPool.xCoord; + int y = linkedPool == null ? -1 : linkedPool.yCoord; + int z = linkedPool == null ? 0 : linkedPool.zCoord; + + cmp.setInteger(TAG_POOL_X, x); + cmp.setInteger(TAG_POOL_Y, y); + cmp.setInteger(TAG_POOL_Z, z); + } + + @Override + public ChunkCoordinates getBinding() { + if(linkedPool == null) + return null; + return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); + } + + @Override + public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + return true; + } + + @Override + public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + int range = 10; + range *= range; + + double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); + if(range >= dist) { + TileEntity tile = player.worldObj.getTileEntity(x, y, z); + if(tile instanceof IManaPool) { + linkedPool = tile; + return true; + } + } + + return false; + } + + @Override + public void renderHUD(Minecraft mc, ScaledResolution res) { + String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); + int color = 0x66000000 | getColor(); + BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); + } + +} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java new file mode 100644 index 00000000..9c44868d --- /dev/null +++ b/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java @@ -0,0 +1,245 @@ +/** + * 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 @ [Jan 24, 2014, 8:03:36 PM (GMT)] + */ +package vazkii.botania.api.subtile; + +import java.awt.Color; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.StatCollector; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.internal.IManaNetwork; +import vazkii.botania.api.mana.IManaCollector; + +/** + * The basic class for a Generating Flower. + */ +public class SubTileGenerating extends SubTileEntity { + + private static final String TAG_MANA = "mana"; + private static final String TAG_TICKS_EXISTED = "ticksExisted"; + + private static final String TAG_COLLECTOR_X = "collectorX"; + private static final String TAG_COLLECTOR_Y = "collectorY"; + private static final String TAG_COLLECTOR_Z = "collectorZ"; + + protected int mana; + + int ticksExisted = 0; + int sizeLastCheck = -1; + protected TileEntity linkedCollector = null; + public int knownMana = -1; + + ChunkCoordinates cachedCollectorCoordinates = null; + + @Override + public boolean canUpdate() { + return true; + } + + @Override + public void onUpdate() { + super.onUpdate(); + + linkCollector(); + + if(canGeneratePassively()) { + int delay = getDelayBetweenPassiveGeneration(); + if(delay > 0 && supertile.getWorldObj().getWorldTime() % delay == 0) { + if(shouldSyncPassiveGeneration()) + sync(); + addMana(getValueForPassiveGeneration()); + } + } + emptyManaIntoCollector(); + + if(supertile.getWorldObj().isRemote) { + double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; + Color color = new Color(getColor()); + if(Math.random() > particleChance) + BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); + } + + if(!supertile.getWorldObj().isRemote) { + ++ticksExisted; + int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay(); + + if(isPassiveFlower() && muhBalance > 0 && ticksExisted > muhBalance) { + supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType())); + supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); + } + } + } + + public void linkCollector() { + final int range = 6; + + boolean needsNew = false; + if(linkedCollector == null) { + needsNew = true; + + if(cachedCollectorCoordinates != null && supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) { + TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); + if(tileAt != null && tileAt instanceof IManaCollector) { + linkedCollector = tileAt; + needsNew = false; + } + cachedCollectorCoordinates = null; + } + } + + if(!needsNew) { + TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); + if(!(tileAt instanceof IManaCollector)) { + linkedCollector = null; + needsNew = true; + } else linkedCollector = tileAt; + } + + if(needsNew) { + IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); + int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size(); + if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { + ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); + linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), range); + sizeLastCheck = size; + } + } + } + + public void addMana(int mana) { + this.mana = Math.min(getMaxMana(), this.mana + mana); + } + + public void emptyManaIntoCollector() { + if(linkedCollector != null) { + IManaCollector collector = (IManaCollector) linkedCollector; + if(!collector.isFull() && mana > 0) { + int manaval = Math.min(mana, collector.getMaxMana() - collector.getCurrentMana()); + mana -= manaval; + collector.recieveMana(manaval); + } + } + } + + public boolean isPassiveFlower() { + return false; + } + + public boolean shouldSyncPassiveGeneration() { + return false; + } + + public boolean canGeneratePassively() { + return false; + } + + public int getDelayBetweenPassiveGeneration() { + return 20; + } + + public int getValueForPassiveGeneration() { + return 1; + } + + @Override + public boolean onWanded(EntityPlayer player, ItemStack wand) { + if(player == null) + return false; + + if(!player.worldObj.isRemote) + sync(); + + knownMana = mana; + player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); + + return super.onWanded(player, wand); + } + + public int getMaxMana() { + return 20; + } + + public int getColor() { + return 0xFFFFFF; + } + + @Override + public void readFromPacketNBT(NBTTagCompound cmp) { + mana = cmp.getInteger(TAG_MANA); + if(!cmp.hasKey(TAG_TICKS_EXISTED)) + ticksExisted = cmp.getInteger(TAG_TICKS_EXISTED); + + int x = cmp.getInteger(TAG_COLLECTOR_X); + int y = cmp.getInteger(TAG_COLLECTOR_Y); + int z = cmp.getInteger(TAG_COLLECTOR_Z); + + cachedCollectorCoordinates = new ChunkCoordinates(x, y, z); + } + + @Override + public void writeToPacketNBT(NBTTagCompound cmp) { + cmp.setInteger(TAG_MANA, mana); + cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted); + + int x = linkedCollector == null ? 0 : linkedCollector.xCoord; + int y = linkedCollector == null ? -1 : linkedCollector.yCoord; + int z = linkedCollector == null ? 0 : linkedCollector.zCoord; + + cmp.setInteger(TAG_COLLECTOR_X, x); + cmp.setInteger(TAG_COLLECTOR_Y, y); + cmp.setInteger(TAG_COLLECTOR_Z, z); + } + + @Override + public ChunkCoordinates getBinding() { + if(linkedCollector == null) + return null; + return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); + } + + @Override + public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + return true; + } + + @Override + public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + int range = 6; + range *= range; + + double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); + if(range >= dist) { + TileEntity tile = player.worldObj.getTileEntity(x, y, z); + if(tile instanceof IManaCollector) { + linkedCollector = tile; + return true; + } + } + + return false; + } + + @Override + public void renderHUD(Minecraft mc, ScaledResolution res) { + String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); + int color = 0x66000000 | getColor(); + BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); + } + +} diff --git a/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java b/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java new file mode 100644 index 00000000..f7c8036d --- /dev/null +++ b/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java @@ -0,0 +1,18 @@ +package vazkii.botania.api.wand; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * The item equivalent of ITileBound, renders when the + * item is in hand. + * @see ITileBound + */ +public interface ICoordBoundItem { + + @SideOnly(Side.CLIENT) + public ChunkCoordinates getBinding(ItemStack stack); + +} diff --git a/src/api/java/vazkii/botania/api/wand/ITileBound.java b/src/api/java/vazkii/botania/api/wand/ITileBound.java new file mode 100644 index 00000000..25a8683c --- /dev/null +++ b/src/api/java/vazkii/botania/api/wand/ITileBound.java @@ -0,0 +1,31 @@ +/** + * 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 @ [Mar 24, 2014, 6:47:53 PM (GMT)] + */ +package vazkii.botania.api.wand; + +import net.minecraft.util.ChunkCoordinates; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Any TileEntity that implements this is technically bound + * to something, and the binding will be shown when hovering + * over with a Wand of the Forest. + */ +public interface ITileBound { + + /** + * Gets where this block is bound to, can return null. + */ + @SideOnly(Side.CLIENT) + public ChunkCoordinates getBinding(); + +} diff --git a/src/api/java/vazkii/botania/api/wand/IWandBindable.java b/src/api/java/vazkii/botania/api/wand/IWandBindable.java new file mode 100644 index 00000000..02d0771c --- /dev/null +++ b/src/api/java/vazkii/botania/api/wand/IWandBindable.java @@ -0,0 +1,36 @@ +/** + * 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 @ [Oct 9, 2014, 3:01:58 PM (GMT)] + */ +package vazkii.botania.api.wand; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; + +/** + * A TileEntity that implements this can be bound to another block + * via the Wand of the Forest. Also see IWireframeAABBProvider to change + * the displayed bounding box. + */ +public interface IWandBindable extends ITileBound { + + /** + * Return true if the Wand can select this tile. + */ + public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); + + /** + * Call to bind the TileEntity to where the player clicked. Return true to deselect + * the TileEntity for another bind or false case the TileEntity should stay selected. + */ + public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); + +} diff --git a/src/api/java/vazkii/botania/api/wand/IWandHUD.java b/src/api/java/vazkii/botania/api/wand/IWandHUD.java new file mode 100644 index 00000000..57c7e313 --- /dev/null +++ b/src/api/java/vazkii/botania/api/wand/IWandHUD.java @@ -0,0 +1,26 @@ +/** + * 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 @ [Feb 5, 2014, 1:34:44 PM (GMT)] + */ +package vazkii.botania.api.wand; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.world.World; + +/** + * Any block that implements this has a HUD rendered when being hovered + * with a Wand of the Forest. + */ +public interface IWandHUD { + + public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z); + +} diff --git a/src/api/java/vazkii/botania/api/wand/IWandable.java b/src/api/java/vazkii/botania/api/wand/IWandable.java new file mode 100644 index 00000000..0cdcf1f1 --- /dev/null +++ b/src/api/java/vazkii/botania/api/wand/IWandable.java @@ -0,0 +1,29 @@ +/** + * 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 @ [Jan 22, 2014, 5:12:53 PM (GMT)] + */ +package vazkii.botania.api.wand; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * Any block that implements this can be used with the Wand for the Forest for some purpose. + */ +public interface IWandable { + + /** + * Called when the block is used by a wand. Note that the player parameter can be null + * if this function is called from a dispenser. + */ + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side); + +} diff --git a/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java b/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java new file mode 100644 index 00000000..d20b6660 --- /dev/null +++ b/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java @@ -0,0 +1,25 @@ +/** + * 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 19, 2014, 7:23:59 PM (GMT)] + */ +package vazkii.botania.api.wand; + +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +/** + * A block that implements this can provide a custom AABB + * for rendering the wireframe with ITileBound. + */ +public interface IWireframeAABBProvider { + + public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z); + +} diff --git a/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java new file mode 100644 index 00000000..42e61147 --- /dev/null +++ b/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java @@ -0,0 +1,39 @@ +/** + * 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 @ [Sep 2, 2014, 5:57:35 PM (GMT)] + */ +package vazkii.botania.api.wiki; + +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +/** + * An interface for a Wiki Provider, these are registered to allow a mod to provide a wiki + * for all the blocks in them, used for the world interaction with the Lexica Botania. + * A simple, mostly all-inclusive implementation can be found on SimpleWikiProvider. + */ +public interface IWikiProvider { + + /** + * Gets the name of the block being looked at for display. + */ + public String getBlockName(World world, MovingObjectPosition pos); + + /** + * Gets the URL to open when the block is clicked. + */ + public String getWikiURL(World world, MovingObjectPosition pos); + + /** + * Gets the name of the wiki for display. + */ + public String getWikiName(World world, MovingObjectPosition pos); + +} diff --git a/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java new file mode 100644 index 00000000..6105c718 --- /dev/null +++ b/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java @@ -0,0 +1,73 @@ +/** + * 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 @ [Sep 2, 2014, 5:58:39 PM (GMT)] + */ +package vazkii.botania.api.wiki; + +import org.apache.commons.lang3.text.WordUtils; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class SimpleWikiProvider implements IWikiProvider { + + final String name, urlBase, replacement; + + public SimpleWikiProvider(String name, String urlBase) { + this(name, urlBase, "%20"); + } + + public SimpleWikiProvider(String name, String urlBase, String replacement) { + this.name = name; + this.urlBase = urlBase; + this.replacement = replacement; + } + + @Override + public String getBlockName(World world, MovingObjectPosition pos) { + int x = pos.blockX; + int y = pos.blockY; + int z = pos.blockZ; + + Block block = world.getBlock(x, y, z); + if(block == null) + return null; + + ItemStack stack = block.getPickBlock(pos, world, x, y, z); + + if(stack == null || stack.getItem() == null) + stack = new ItemStack(block, 1, world.getBlockMetadata(x, y, z)); + + if(stack.getItem() == null) + return null; + + String name = stack.getDisplayName(); + if(name == null || name.isEmpty()) + return null; + + return name; + } + + @Override + public String getWikiURL(World world, MovingObjectPosition pos) { + String name = getBlockName(world, pos); + if(name == null) + return null; + return String.format(urlBase, WordUtils.capitalizeFully(name).replaceAll(" ", replacement)); + } + + @Override + public String getWikiName(World world, MovingObjectPosition pos) { + return name; + } + +} diff --git a/src/api/java/vazkii/botania/api/wiki/WikiHooks.java b/src/api/java/vazkii/botania/api/wiki/WikiHooks.java new file mode 100644 index 00000000..40f586e6 --- /dev/null +++ b/src/api/java/vazkii/botania/api/wiki/WikiHooks.java @@ -0,0 +1,43 @@ +/** + * 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 @ [Sep 2, 2014, 6:05:03 PM (GMT)] + */ +package vazkii.botania.api.wiki; + +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.block.Block; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; + +public class WikiHooks { + + private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://wiki.feed-the-beast.com/%s"); + + private static final Map modWikis = new HashMap(); + + public static IWikiProvider getWikiFor(Block block) { + UniqueIdentifier mod = GameRegistry.findUniqueIdentifierFor(block); + return getWikiFor(mod.modId.toLowerCase()); + } + + public static IWikiProvider getWikiFor(String mod) { + if(!modWikis.containsKey(mod)) + modWikis.put(mod, FALLBACK_PROVIDER); + + return modWikis.get(mod); + } + + public static void registerModWiki(String mod, IWikiProvider provider) { + modWikis.put(mod.toLowerCase(), provider); + } + +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index a76b1bad..f43059b2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -11,7 +11,7 @@ import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import WayofTime.alchemicalWizardry.common.potion.*; +import WayofTime.alchemicalWizardry.common.thread.CommandDownloadGAPI; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -28,20 +28,6 @@ import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.Mod.Instance; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLInterModComms; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.registry.EntityRegistry; -import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; @@ -50,10 +36,10 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -//import thaumcraft.api.ItemApi; -//import thaumcraft.api.ThaumcraftApi; -//import thaumcraft.api.aspects.Aspect; -//import thaumcraft.api.aspects.AspectList; +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; @@ -66,6 +52,7 @@ import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; import WayofTime.alchemicalWizardry.api.rituals.Rituals; +import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler; import WayofTime.alchemicalWizardry.api.soulNetwork.ComplexNetworkHandler; import WayofTime.alchemicalWizardry.api.spell.SpellEffectRegistry; import WayofTime.alchemicalWizardry.api.spell.SpellParadigmMelee; @@ -83,8 +70,12 @@ import WayofTime.alchemicalWizardry.common.ModLivingDropsEvent; import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.achievements.ModAchievements; import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry; -import WayofTime.alchemicalWizardry.common.block.BlockArmourForge; +import WayofTime.alchemicalWizardry.common.block.ArmourForge; import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; +import WayofTime.alchemicalWizardry.common.book.BloodMagicGuide; +import WayofTime.alchemicalWizardry.common.commands.CommandBind; +import WayofTime.alchemicalWizardry.common.commands.CommandSN; +import WayofTime.alchemicalWizardry.common.commands.CommandUnbind; import WayofTime.alchemicalWizardry.common.compress.AdvancedCompressionHandler; import WayofTime.alchemicalWizardry.common.compress.BaseCompressionHandler; import WayofTime.alchemicalWizardry.common.compress.StorageBlockCraftingManager; @@ -117,19 +108,41 @@ 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.guide.RecipeHolder; +import WayofTime.alchemicalWizardry.common.harvest.AgriCraftCropHarvestHandler; 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.ItemIncense; +import WayofTime.alchemicalWizardry.common.items.ItemMailOrderCatalogue; import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; -//import WayofTime.alchemicalWizardry.common.items.forestry.ItemBloodFrame; +import WayofTime.alchemicalWizardry.common.items.forestry.ItemBloodFrame; import WayofTime.alchemicalWizardry.common.items.sigil.holding.HoldingPacketHandler; +import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmEarth; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmFire; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWater; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWind; import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry; +import WayofTime.alchemicalWizardry.common.potion.PotionAmphibian; +import WayofTime.alchemicalWizardry.common.potion.PotionBoost; +import WayofTime.alchemicalWizardry.common.potion.PotionDeaf; +import WayofTime.alchemicalWizardry.common.potion.PotionDemonCloak; +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; @@ -243,12 +256,12 @@ 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.TEAlchemicalCalcinator; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; import WayofTime.alchemicalWizardry.common.tileEntity.TECrucible; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellTable; +import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import WayofTime.alchemicalWizardry.common.tileEntity.TEMimicBlock; import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; @@ -264,16 +277,29 @@ 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.TEChemistrySet; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler; -//import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration; - +import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration; +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.ModContainer; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.3", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") public class AlchemicalWizardry { - public static String MODID = "AWWayofTime"; //Temporary - public static boolean parseTextFiles = false; public static boolean doMeteorsDestroyBlocks = true; @@ -361,6 +387,8 @@ public class AlchemicalWizardry public static boolean ritualDisabledPhantomHands; public static boolean ritualDisabledSphereIsland; + public static boolean displayRitualAnimation; + public static boolean potionDisableRegen; public static boolean potionDisableNightVision; public static boolean potionDisableFireResistance; @@ -399,6 +427,7 @@ public class AlchemicalWizardry public static boolean lockdownAltar; public static boolean causeHungerWithRegen; public static boolean causeHungerChatMessage = true; + public static boolean disableBoundToolsRightClick; public static List wellBlacklist; @@ -419,7 +448,7 @@ public class AlchemicalWizardry }; public static ToolMaterial bloodBoundToolMaterial = EnumHelper.addToolMaterial("BoundBlood", 4, 1000, 12.0f, 8.0f, 50); - public static ArmorMaterial sanguineArmourArmourMaterial = EnumHelper.addArmorMaterial("SanguineArmour", "test", 33, new int[]{3, 8, 6, 3}, 30); + public static ArmorMaterial sanguineArmourArmourMaterial = EnumHelper.addArmorMaterial("SanguineArmour", 33, new int[]{3, 8, 6, 3}, 30); //Dungeon loot chances public static int standardBindingAgentDungeonChance; @@ -546,7 +575,9 @@ public class AlchemicalWizardry FluidRegistry.registerFluid(lifeEssenceFluid); ModBlocks.init(); + ModBlocks.registerBlocksInPre(); ModItems.init(); + ModItems.registerItems(); RecipeSorter.register("AWWayofTime:shapedorb", ShapedBloodOrbRecipe.class, Category.SHAPED, "before:minecraft:shapeless"); RecipeSorter.register("AWWayofTime:shapelessorb", ShapelessBloodOrbRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless"); @@ -565,7 +596,7 @@ public class AlchemicalWizardry { int craftingConstant = OreDictionary.WILDCARD_VALUE; - ModBlocks.init(); + ModBlocks.registerBlocksInInit(); //blocks proxy.registerRenderers(); @@ -640,7 +671,7 @@ public class AlchemicalWizardry ItemStack largeBloodStoneBrickStack = new ItemStack(ModBlocks.largeBloodStoneBrick); ItemStack bloodStoneBrickStackCrafted = new ItemStack(ModBlocks.bloodStoneBrick, 4); ItemStack growthSigilStack = new ItemStack(ModItems.growthSigil); - ItemStack blockHomHeartStack = new ItemStack(ModBlocks.blockSpellTable); + ItemStack blockHomHeartStack = new ItemStack(ModBlocks.blockHomHeart); ItemStack redWoolStack = new ItemStack(Blocks.wool, 1, 14); ItemStack simpleCatalystStack = new ItemStack(ModItems.simpleCatalyst); ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner); @@ -715,23 +746,24 @@ public class AlchemicalWizardry GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemBloodLightSigil), "btb", "sss", "bob", 'o', magicianBloodOrbStack, 'b', glowstoneBlockStack, 't', new ItemStack(Blocks.torch), 's', imbuedSlateStack)); GameRegistry.addRecipe(new ItemStack(ModItems.itemKeyOfDiablo), " gw", "gdg", "wg ", 'w', weakBloodShardStack, 'g', goldIngotStack, 'd', diamondStack); GameRegistry.addRecipe(new ItemStack(ModItems.itemBloodPack), "gbg","flf","gsg",'s', blankSlateStack,'g', glassStack,'f',new ItemStack(Items.flint,1,craftingConstant),'b', emptyBucketStack, 'l', new ItemStack(Items.leather_chestplate)); - customPotionDrowning = (new PotionBloodMagic(customPotionDrowningID, true, 0)).setIconIndex(0, 0).setPotionName("Drowning"); - customPotionBoost = (new PotionBloodMagic(customPotionBoostID, false, 0)).setIconIndex(0, 0).setPotionName("Boost"); - customPotionProjProt = (new PotionBloodMagic(customPotionProjProtID, false, 0)).setIconIndex(0, 0).setPotionName("Whirlwind"); - customPotionInhibit = (new PotionBloodMagic(customPotionInhibitID, false, 0)).setIconIndex(0, 0).setPotionName("Inhibit"); - customPotionFlight = (new PotionBloodMagic(customPotionFlightID, false, 0)).setIconIndex(0, 0).setPotionName("Flight"); - customPotionReciprocation = (new PotionBloodMagic(customPotionReciprocationID, false, 0xFFFFFF)).setIconIndex(0, 0).setPotionName("Reciprocation"); - customPotionFlameCloak = (new PotionBloodMagic(customPotionFlameCloakID, false, 0).setIconIndex(0, 0).setPotionName("Flame Cloak")); - customPotionIceCloak = (new PotionBloodMagic(customPotionIceCloakID, false, 0).setIconIndex(0, 0).setPotionName("Ice Cloak")); - customPotionHeavyHeart = (new PotionBloodMagic(customPotionHeavyHeartID, true, 0).setIconIndex(0, 0).setPotionName("Heavy Heart")); - customPotionFireFuse = (new PotionBloodMagic(customPotionFireFuseID, true, 0).setIconIndex(0, 0).setPotionName("Fire Fuse")); - customPotionPlanarBinding = (new PotionBloodMagic(customPotionPlanarBindingID, true, 0).setIconIndex(0, 0).setPotionName("Planar Binding")); - customPotionSoulFray = (new PotionBloodMagic(customPotionSoulFrayID, true, 0).setIconIndex(0, 0).setPotionName("Soul Fray")); - customPotionSoulHarden = (new PotionBloodMagic(customPotionSoulHardenID, false, 0).setIconIndex(0, 0).setPotionName("Soul Harden")); - customPotionDeaf = (new PotionBloodMagic(customPotionDeafID, true, 0).setIconIndex(0, 0).setPotionName("Deafness")); - customPotionFeatherFall = (new PotionBloodMagic(customPotionFeatherFallID, false, 0).setIconIndex(0, 0).setPotionName("Feather Fall")); - customPotionDemonCloak = (new PotionBloodMagic(customPotionDemonCloakID, false, 0).setIconIndex(0, 0).setPotionName("Demon Cloaking")); - customPotionAmphibian = (new PotionBloodMagic(customPotionAmphibianID, false, 0).setIconIndex(0, 0).setPotionName("Amphibian")); + customPotionDrowning = (new PotionDrowning(customPotionDrowningID, true, 0)).setIconIndex(0, 0).setPotionName("Drowning"); + customPotionBoost = (new PotionBoost(customPotionBoostID, false, 0)).setIconIndex(0, 0).setPotionName("Boost"); + customPotionProjProt = (new PotionProjectileProtect(customPotionProjProtID, false, 0)).setIconIndex(0, 0).setPotionName("Whirlwind"); + 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")); + PlayerSacrificeHandler.soulFrayId = customPotionSoulFray; + 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")); + customPotionDemonCloak = (new PotionDemonCloak(customPotionDemonCloakID, false, 0).setIconIndex(0, 0).setPotionName("Demon Cloaking")); + customPotionAmphibian = (new PotionAmphibian(customPotionAmphibianID, false, 0).setIconIndex(0, 0).setPotionName("Amphibian")); ItemStack masterBloodOrbStack = new ItemStack(ModItems.masterBloodOrb); ItemStack transcendentBloodOrbStack = new ItemStack(ModItems.transcendentBloodOrb); @@ -744,8 +776,8 @@ public class AlchemicalWizardry GameRegistry.registerTileEntity(TEAltar.class, "containerAltar"); GameRegistry.registerTileEntity(TEMasterStone.class, "containerMasterStone"); GameRegistry.registerTileEntity(TESocket.class, "containerSocket"); - GameRegistry.registerTileEntity(TEChemistrySet.class, "containerWritingTable"); - GameRegistry.registerTileEntity(TESpellTable.class, "containerHomHeart"); + GameRegistry.registerTileEntity(TEWritingTable.class, "containerWritingTable"); + GameRegistry.registerTileEntity(TEHomHeart.class, "containerHomHeart"); GameRegistry.registerTileEntity(TEPedestal.class, "containerPedestal"); GameRegistry.registerTileEntity(TEPlinth.class, "containerPlinth"); GameRegistry.registerTileEntity(TETeleposer.class, "containerTeleposer"); @@ -760,8 +792,8 @@ public class AlchemicalWizardry GameRegistry.registerTileEntity(TESchematicSaver.class, "containerSchematicSaver"); GameRegistry.registerTileEntity(TESpectralBlock.class, "containerSpectralBlock"); GameRegistry.registerTileEntity(TEReagentConduit.class, "containerReagentConduit"); - GameRegistry.registerTileEntity(TEBelljar.class, "containerBellJar"); - GameRegistry.registerTileEntity(TEAlchemicalCalcinator.class, "containerAlchemicCalcinator"); + GameRegistry.registerTileEntity(TEBellJar.class, "containerBellJar"); + GameRegistry.registerTileEntity(TEAlchemicCalcinator.class, "containerAlchemicCalcinator"); GameRegistry.registerTileEntity(TEDemonChest.class, "containerDemonChest"); GameRegistry.registerTileEntity(TEMimicBlock.class, "containerMimic"); GameRegistry.registerTileEntity(TECrucible.class, "containerCrucible"); @@ -779,7 +811,7 @@ public class AlchemicalWizardry ModBlocks.bloodStoneBrick.setHarvestLevel("pickaxe", 0); ModBlocks.largeBloodStoneBrick.setHarvestLevel("pickaxe", 0); ModBlocks.blockWritingTable.setHarvestLevel("pickaxe", 1); - ModBlocks.blockSpellTable.setHarvestLevel("pickaxe", 1); + ModBlocks.blockHomHeart.setHarvestLevel("pickaxe", 1); ModBlocks.blockPedestal.setHarvestLevel("pickaxe", 2); ModBlocks.blockPlinth.setHarvestLevel("pickaxe", 2); ModBlocks.blockTeleposer.setHarvestLevel("pickaxe", 2); @@ -789,7 +821,7 @@ public class AlchemicalWizardry //Gui registration UpgradedAltars.loadAltars(); - BlockArmourForge.initializeRecipes(); + ArmourForge.initializeRecipes(); TEPlinth.initialize(); initAlchemyPotionRecipes(); @@ -811,7 +843,7 @@ public class AlchemicalWizardry blacklistAccelerators(); MinecraftForge.EVENT_BUS.register(new ModLivingDropsEvent()); - proxy.initRendering(); + proxy.InitRendering(); NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); ItemStack gunpowderStack = new ItemStack(Items.gunpowder); @@ -827,6 +859,7 @@ public class AlchemicalWizardry 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); @@ -865,6 +898,7 @@ public class AlchemicalWizardry 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()); @@ -916,6 +950,8 @@ public class AlchemicalWizardry EntityRegistry.registerModEntity(EntityMinorDemonGruntGuardianIce.class, "MinorDemonGruntGuardianIce", 42, this, 80, 3, true); EntityRegistry.registerModEntity(EntityMinorDemonGruntGuardianEarth.class, "MinorDemonGruntGuardianEarth", 43, this, 80, 3, true); + + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.standardBindingAgent), 1, 3, this.standardBindingAgentDungeonChance / 5)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.mundanePowerCatalyst), 1, 1, this.mundanePowerCatalystDungeonChance / 5)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.mundaneLengtheningCatalyst), 1, 1, this.mundaneLengtheningCatalystDungeonChance / 5)); @@ -1052,7 +1088,7 @@ public class AlchemicalWizardry 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.blockAlchemicalCalcinator), "pgp", "gsg", "ccc", 'p', crackedRunicPlateStack, 'g', glassStack, 's', strengthenedCatalystStack, 'c', cobblestoneStack); + 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.blockReagentConduit), "isi", "scs", "isi", 'c', concentratedCatalystStack, 's', stringStack, 'i', ironIngotStack); @@ -1108,7 +1144,7 @@ public class AlchemicalWizardry { proxy.registerPostSideObjects(); //TODO Thaumcraft Integration -/* if (Loader.isModLoaded("Thaumcraft")) + if (Loader.isModLoaded("Thaumcraft")) { isThaumcraftLoaded = true; @@ -1137,6 +1173,7 @@ public class AlchemicalWizardry ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.sanguinePants), aspectList); ThaumcraftApi.registerObjectTag(new ItemStack(ModItems.sanguineBoots), aspectList); + if (itemGoggles != null) { BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineHelmet), itemGoggles); @@ -1188,11 +1225,11 @@ public class AlchemicalWizardry ModItems.itemBloodFrame = new ItemBloodFrame().setUnlocalizedName("bloodFrame"); - Item provenFrame = GameRegistry.findItem("Forestry", "frameImpregnated"); + ItemStack provenFrame = GameRegistry.findItemStack("Forestry", "frameImpregnated", 1); if(provenFrame !=null) { - AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.itemBloodFrame), new ItemStack(provenFrame, 1), 3, 30000, 20, 20, false); + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.itemBloodFrame), provenFrame, 3, 30000, 20, 20, false); } } else { @@ -1211,13 +1248,12 @@ public class AlchemicalWizardry AlchemicalWizardry.logger.info("Loaded MineTweaker 3 Integration"); } -// if(Loader.isModLoaded("AgriCraft")) -// { -// HarvestRegistry.registerHarvestHandler(new AgriCraftCropHarvestHandler()); -// AlchemicalWizardry.logger.info("Loaded AgriCraft Handlers!"); -// } -*/ - isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); //this is temp. + if(Loader.isModLoaded("AgriCraft")) + { + HarvestRegistry.registerHarvestHandler(new AgriCraftCropHarvestHandler()); + AlchemicalWizardry.logger.info("Loaded AgriCraft Handlers!"); + } + isBotaniaLoaded = Loader.isModLoaded("Botania"); isPneumaticCraftLoaded = Loader.isModLoaded("PneumaticCraft"); isFMPLoaded = Loader.isModLoaded("ForgeMultipart"); @@ -1236,12 +1272,12 @@ public class AlchemicalWizardry // this.createItemTextureFiles(); } -/* @Optional.Method(modid = "guideapi") + @Optional.Method(modid = "guideapi") public static void registerBMBook() { BloodMagicGuide.registerGuide(); } -*/ + public static void blacklistAccelerators() { if (Loader.isModLoaded("Torcherino")) @@ -1365,13 +1401,13 @@ public class AlchemicalWizardry AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.diamond), Potion.resistance.id, 2 * 60 * 20); if(!AlchemicalWizardry.potionDisableSaturation) - AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.poisonous_potato), Potion.saturation.id, 2); //saturation + AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.poisonous_potato), Potion.field_76443_y.id, 2); //saturation if(!AlchemicalWizardry.potionDisableHealthBoost) - AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.demonBloodShard), Potion.field_180152_w.id, 4 * 60 * 20); //health boost + AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.demonBloodShard), Potion.field_76434_w.id, 4 * 60 * 20); //health boost if(!AlchemicalWizardry.potionDisableAbsorption) - AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.weakBloodShard), Potion.absorption.id, 4 * 60 * 20); //Absorption + AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.weakBloodShard), Potion.field_76444_x.id, 4 * 60 * 20); //Absorption if(!AlchemicalWizardry.potionDisableBoost) AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.terrae), AlchemicalWizardry.customPotionBoost.id, 60 * 20); @@ -1518,10 +1554,10 @@ public class AlchemicalWizardry ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 7), new ReagentStack(ReagentRegistry.reductusReagent, 1000)); ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 8), new ReagentStack(ReagentRegistry.potentiaReagent, 1000)); - OmegaRegistry.registerParadigm(ReagentRegistry.aquasalusReagent, new OmegaParadigmWater((OmegaArmour)ModItems.boundHelmetWater, (OmegaArmour)ModItems.boundChestplateWater, (OmegaArmour)ModItems.boundLeggingsWater, (OmegaArmour)ModItems.boundBootsWater)); - OmegaRegistry.registerParadigm(ReagentRegistry.terraeReagent, new OmegaParadigmEarth((OmegaArmour)ModItems.boundHelmetEarth, (OmegaArmour)ModItems.boundChestplateEarth, (OmegaArmour)ModItems.boundLeggingsEarth, (OmegaArmour)ModItems.boundBootsEarth)); - OmegaRegistry.registerParadigm(ReagentRegistry.aetherReagent, new OmegaParadigmWind((OmegaArmour)ModItems.boundHelmetWind, (OmegaArmour)ModItems.boundChestplateWind, (OmegaArmour)ModItems.boundLeggingsWind, (OmegaArmour)ModItems.boundBootsWind)); - OmegaRegistry.registerParadigm(ReagentRegistry.incendiumReagent, new OmegaParadigmFire((OmegaArmour)ModItems.boundHelmetFire, (OmegaArmour)ModItems.boundChestplateFire, (OmegaArmour)ModItems.boundLeggingsFire, (OmegaArmour)ModItems.boundBootsFire)); + OmegaRegistry.registerParadigm(ReagentRegistry.aquasalusReagent, new OmegaParadigmWater((OmegaArmour)ModItems.boundHelmetWater, (OmegaArmour)ModItems.boundPlateWater, (OmegaArmour)ModItems.boundLeggingsWater, (OmegaArmour)ModItems.boundBootsWater)); + OmegaRegistry.registerParadigm(ReagentRegistry.terraeReagent, new OmegaParadigmEarth((OmegaArmour)ModItems.boundHelmetEarth, (OmegaArmour)ModItems.boundPlateEarth, (OmegaArmour)ModItems.boundLeggingsEarth, (OmegaArmour)ModItems.boundBootsEarth)); + OmegaRegistry.registerParadigm(ReagentRegistry.aetherReagent, new OmegaParadigmWind((OmegaArmour)ModItems.boundHelmetWind, (OmegaArmour)ModItems.boundPlateWind, (OmegaArmour)ModItems.boundLeggingsWind, (OmegaArmour)ModItems.boundBootsWind)); + OmegaRegistry.registerParadigm(ReagentRegistry.incendiumReagent, new OmegaParadigmFire((OmegaArmour)ModItems.boundHelmetFire, (OmegaArmour)ModItems.boundPlateFire, (OmegaArmour)ModItems.boundLeggingsFire, (OmegaArmour)ModItems.boundBootsFire)); } @@ -1694,7 +1730,7 @@ public class AlchemicalWizardry // // InputStream input = AlchemicalWizardry.class.getResourceAsStream("/assets/alchemicalwizardryBooks/books/book.txt"); // -// Minecraft.getMinecraft().fontRendererObj.setUnicodeFlag(true); +// Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true); // // if(input != null) // { @@ -1770,9 +1806,9 @@ public class AlchemicalWizardry // // strLine = strLine.replace('”', '"').replace('“','"').replace("…", "...").replace('’', '\'').replace('–', '-'); // -// if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRendererObj != null) +// if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null) // { -// List list = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(strLine, 110); +// List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strLine, 110); // if(list != null) // { // System.out.println("Number of lines: " + list.size()); @@ -1786,7 +1822,7 @@ public class AlchemicalWizardry // boolean changePage = false; // int length = word.length(); // word = word.replace('\t', ' '); -// List list = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(strings[currentPage] + " " + word, 110); +// List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110); // // if(list.size() > maxLines) // { @@ -1817,8 +1853,8 @@ public class AlchemicalWizardry // } // } // -// int currentLines = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(strings[currentPage], 110).size(); -// while(Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(strings[currentPage] + " ", 110).size() <= currentLines) +// int currentLines = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage], 110).size(); +// while(Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " ", 110).size() <= currentLines) // { // { // strings[currentPage] = strings[currentPage] + " "; @@ -1853,7 +1889,7 @@ public class AlchemicalWizardry //// // } // -// Minecraft.getMinecraft().fontRendererObj.setUnicodeFlag(false); +// Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false); // // } catch (FileNotFoundException e) { // // TODO Auto-generated catch block @@ -1865,12 +1901,12 @@ public class AlchemicalWizardry // } // } -// @Mod.EventHandler -// public void initCommands(FMLServerStartingEvent event) -// { -// event.registerServerCommand(new CommandBind()); -// event.registerServerCommand(new CommandUnbind()); -// event.registerServerCommand(new CommandSN()); -// event.registerServerCommand(new CommandDownloadGAPI()); -// } + @Mod.EventHandler + public void initCommands(FMLServerStartingEvent event) + { + event.registerServerCommand(new CommandBind()); + event.registerServerCommand(new CommandUnbind()); + event.registerServerCommand(new CommandSN()); + event.registerServerCommand(new CommandDownloadGAPI()); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java b/src/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java index 3eed0062..b76359ff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java +++ b/src/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java @@ -9,8 +9,6 @@ import java.util.Map.Entry; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLivingBase; import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.relauncher.Side; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold; import WayofTime.alchemicalWizardry.client.renderer.RenderHelper; @@ -18,6 +16,8 @@ import WayofTime.alchemicalWizardry.common.demonVillage.DemonVillagePath; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; /** * Created with IntelliJ IDEA. @@ -32,8 +32,6 @@ public class BloodMagicConfiguration public static Configuration config; - public static String[] blocksToBeDisabled; - public static String[] itemsToBeDisabled; public static String[] teleposerBlacklist; public static String[] blacklist = {}; @@ -108,6 +106,7 @@ public class BloodMagicConfiguration AlchemicalWizardry.causeHungerChatMessage = config.get("WimpySettings", "causeHungerChatMessage", true).getBoolean(); // AlchemicalWizardry.lockdownAltar = config.get("WimpySettings", "LockdownAltarWithRegen", true).getBoolean(); AlchemicalWizardry.lockdownAltar = false; + AlchemicalWizardry.disableBoundToolsRightClick = config.get("WimpySettings", "disableBoundToolsRightClick", false).getBoolean(false); AlchemicalWizardry.ritualDisabledWater = config.get("Ritual Blacklist", "Ritual of the Full Spring", false).getBoolean(false); AlchemicalWizardry.ritualDisabledLava = config.get("Ritual Blacklist", "Serenade of the Nether", false).getBoolean(false); @@ -145,7 +144,7 @@ public class BloodMagicConfiguration AlchemicalWizardry.ritualDisabledCrafting = config.get("Ritual Blacklist", "Rhythm of the Beating Anvil", false).getBoolean(false); AlchemicalWizardry.ritualDisabledPhantomHands = config.get("Ritual Blacklist", "Orchestra of the Phantom Hands", false).getBoolean(false); AlchemicalWizardry.ritualDisabledSphereIsland = config.get("Ritual Blacklist", "Birth of the Bastion", false).getBoolean(false); - + AlchemicalWizardry.potionDisableRegen = config.get("Alchemy Potion Blacklist", "Regeneration", false).getBoolean(false); AlchemicalWizardry.potionDisableNightVision = config.get("Alchemy Potion Blacklist", "Night Vision", false).getBoolean(false); AlchemicalWizardry.potionDisableFireResistance = config.get("Alchemy Potion Blacklist", "Fire Resistance", false).getBoolean(false); @@ -195,9 +194,6 @@ public class BloodMagicConfiguration AlchemicalWizardry.isDemonRitualCreativeOnly = config.get(tempDemonConfigs, "IsDemonRitualCreativeOnly", false).getBoolean(); BoundArmour.tryComplexRendering = config.get("WimpySettings", "UseFancyBoundArmour", true).getBoolean(true); - - blocksToBeDisabled = config.getStringList("Disable blocks here", "WimpySettings", new String[]{""}, "Type in the unlocalized name of the block you want disabled here (separate them using ENTER)"); - itemsToBeDisabled = config.getStringList("Disable items here", "WimpySettings", new String[]{""}, "Type in the unlocalized name of the item you want disabled (separate them using ENTER)"); // ItemIncense.itemDuration = config.get("TestIncenseSettings", "ItemDuration", 100).getInt(); // ItemIncense.minValue = config.get("TestIncenseSettings", "MinValue", 0).getInt(); @@ -205,7 +201,6 @@ public class BloodMagicConfiguration // PlayerSacrificeHandler.scalingOfSacrifice = (float) config.get("TestIncenseSettings", "ScalingFactor", 0.0025f).getDouble(); // PlayerSacrificeHandler.soulFrayDuration = config.get("TestIncenseSettings", "SoulFrayDuration", 400).getInt(); - Side side = FMLCommonHandler.instance().getSide(); if (side == Side.CLIENT) { @@ -213,6 +208,7 @@ public class BloodMagicConfiguration RenderHelper.yOffset = config.get("ClientSettings", "AlchemyHUDyOffset", 2).getInt(); RenderHelper.lpBarX = config.get("ClientSettings", "LPHUDxOffset", 12).getInt(); RenderHelper.lpBarY = config.get("ClientSettings", "LPHUDyOffset", 75).getInt(); + AlchemicalWizardry.displayRitualAnimation = config.get("ClientSettings", "Display Ritual Animation", true).getBoolean(true); } config.save(); @@ -220,7 +216,6 @@ public class BloodMagicConfiguration public static void set(String categoryName, String propertyName, String newValue) { - config.load(); if (config.getCategoryNames().contains(categoryName)) { @@ -230,8 +225,6 @@ public class BloodMagicConfiguration } } config.save(); - - } public static void loadBlacklist() @@ -253,49 +246,49 @@ public class BloodMagicConfiguration config.save(); } - public static void blacklistRituals() - { - if (AlchemicalWizardry.ritualDisabledWater) r("AW001Water"); - if (AlchemicalWizardry.ritualDisabledLava) r("AW002Lava"); - if (AlchemicalWizardry.ritualDisabledGreenGrove) r("AW003GreenGrove"); - if (AlchemicalWizardry.ritualDisabledInterdiction) r("AW004Interdiction"); - if (AlchemicalWizardry.ritualDisabledContainment) r("AW005Containment"); - if (AlchemicalWizardry.ritualDisabledBinding) r("AW006Binding"); - if (AlchemicalWizardry.ritualDisabledUnbinding) r("AW007Unbinding"); // "A medium dry martini, lemon peel. Shaken, not stirred." - if (AlchemicalWizardry.ritualDisabledHighJump) r("AW008HighJump"); - if (AlchemicalWizardry.ritualDisabledMagnetism) r("AW009Magnetism"); - if (AlchemicalWizardry.ritualDisabledCrusher) r("AW010Crusher"); - if (AlchemicalWizardry.ritualDisabledSpeed) r("AW011Speed"); - if (AlchemicalWizardry.ritualDisabledAnimalGrowth) r("AW012AnimalGrowth"); - if (AlchemicalWizardry.ritualDisabledSuffering) r("AW013Suffering"); - if (AlchemicalWizardry.ritualDisabledRegen) r("AW014Regen"); - if (AlchemicalWizardry.ritualDisabledFeatheredKnife) r("AW015FeatheredKnife"); - if (AlchemicalWizardry.ritualDisabledFeatheredEarth) r("AW016FeatheredEarth"); - if (AlchemicalWizardry.ritualDisabledGaia) r("AW017Gaia"); - if (AlchemicalWizardry.ritualDisabledCondor) r("AW018Condor"); - if (AlchemicalWizardry.ritualDisabledFallingTower) r("AW019FallingTower"); - if (AlchemicalWizardry.ritualDisabledBalladOfAlchemy) r("AW020BalladOfAlchemy"); - if (AlchemicalWizardry.ritualDisabledExpulsion) r("AW021Expulsion"); - if (AlchemicalWizardry.ritualDisabledSuppression) r("AW022Suppression"); - if (AlchemicalWizardry.ritualDisabledZephyr) r("AW023Zephyr"); - if (AlchemicalWizardry.ritualDisabledHarvest) r("AW024Harvest"); - if (AlchemicalWizardry.ritualDisabledConduit) r("AW025Conduit"); - if (AlchemicalWizardry.ritualDisabledEllipsoid) r("AW026Ellipsoid"); - if (AlchemicalWizardry.ritualDisabledEvaporation) r("AW027Evaporation"); - if (AlchemicalWizardry.ritualDisabledSpawnWard) r("AW028SpawnWard"); - if (AlchemicalWizardry.ritualDisabledVeilOfEvil) r("AW029VeilOfEvil"); - if (AlchemicalWizardry.ritualDisabledFullStomach) r("AW030FullStomach"); - if (AlchemicalWizardry.ritualDisabledConvocation) r("AW031Convocation"); - if (AlchemicalWizardry.ritualDisabledSymmetry) r("AW032Symmetry"); - if (AlchemicalWizardry.ritualDisabledStalling) r("AW033Stalling"); - if (AlchemicalWizardry.ritualDisabledCrafting) r("AW034Crafting"); - if (AlchemicalWizardry.ritualDisabledPhantomHands) r("AW035PhantomHands"); - if (AlchemicalWizardry.ritualDisabledSphereIsland) r("AW036SphereIsland"); - } + public static void blacklistRituals() + { + if (AlchemicalWizardry.ritualDisabledWater) r("AW001Water"); + if (AlchemicalWizardry.ritualDisabledLava) r("AW002Lava"); + if (AlchemicalWizardry.ritualDisabledGreenGrove) r("AW003GreenGrove"); + if (AlchemicalWizardry.ritualDisabledInterdiction) r("AW004Interdiction"); + if (AlchemicalWizardry.ritualDisabledContainment) r("AW005Containment"); + if (AlchemicalWizardry.ritualDisabledBinding) r("AW006Binding"); + if (AlchemicalWizardry.ritualDisabledUnbinding) r("AW007Unbinding"); // "A medium dry martini, lemon peel. Shaken, not stirred." + if (AlchemicalWizardry.ritualDisabledHighJump) r("AW008HighJump"); + if (AlchemicalWizardry.ritualDisabledMagnetism) r("AW009Magnetism"); + if (AlchemicalWizardry.ritualDisabledCrusher) r("AW010Crusher"); + if (AlchemicalWizardry.ritualDisabledSpeed) r("AW011Speed"); + if (AlchemicalWizardry.ritualDisabledAnimalGrowth) r("AW012AnimalGrowth"); + if (AlchemicalWizardry.ritualDisabledSuffering) r("AW013Suffering"); + if (AlchemicalWizardry.ritualDisabledRegen) r("AW014Regen"); + if (AlchemicalWizardry.ritualDisabledFeatheredKnife) r("AW015FeatheredKnife"); + if (AlchemicalWizardry.ritualDisabledFeatheredEarth) r("AW016FeatheredEarth"); + if (AlchemicalWizardry.ritualDisabledGaia) r("AW017Gaia"); + if (AlchemicalWizardry.ritualDisabledCondor) r("AW018Condor"); + if (AlchemicalWizardry.ritualDisabledFallingTower) r("AW019FallingTower"); + if (AlchemicalWizardry.ritualDisabledBalladOfAlchemy) r("AW020BalladOfAlchemy"); + if (AlchemicalWizardry.ritualDisabledExpulsion) r("AW021Expulsion"); + if (AlchemicalWizardry.ritualDisabledSuppression) r("AW022Suppression"); + if (AlchemicalWizardry.ritualDisabledZephyr) r("AW023Zephyr"); + if (AlchemicalWizardry.ritualDisabledHarvest) r("AW024Harvest"); + if (AlchemicalWizardry.ritualDisabledConduit) r("AW025Conduit"); + if (AlchemicalWizardry.ritualDisabledEllipsoid) r("AW026Ellipsoid"); + if (AlchemicalWizardry.ritualDisabledEvaporation) r("AW027Evaporation"); + if (AlchemicalWizardry.ritualDisabledSpawnWard) r("AW028SpawnWard"); + if (AlchemicalWizardry.ritualDisabledVeilOfEvil) r("AW029VeilOfEvil"); + if (AlchemicalWizardry.ritualDisabledFullStomach) r("AW030FullStomach"); + if (AlchemicalWizardry.ritualDisabledConvocation) r("AW031Convocation"); + if (AlchemicalWizardry.ritualDisabledSymmetry) r("AW032Symmetry"); + if (AlchemicalWizardry.ritualDisabledStalling) r("AW033Stalling"); + if (AlchemicalWizardry.ritualDisabledCrafting) r("AW034Crafting"); + if (AlchemicalWizardry.ritualDisabledPhantomHands) r("AW035PhantomHands"); + if (AlchemicalWizardry.ritualDisabledSphereIsland) r("AW036SphereIsland"); + } - private static void r(String ritualID) - { - Rituals.ritualMap.remove(ritualID); - Rituals.keyList.remove(ritualID); - } + private static void r(String ritualID) + { + Rituals.ritualMap.remove(ritualID); + Rituals.keyList.remove(ritualID); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java b/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java index a3f6e5c6..7cf58421 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java @@ -1,26 +1,23 @@ package WayofTime.alchemicalWizardry; -import WayofTime.alchemicalWizardry.client.BlockRenderer; import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraftforge.fml.common.registry.GameRegistry; -import WayofTime.alchemicalWizardry.common.block.BlockArmourForge; -import WayofTime.alchemicalWizardry.common.block.BlockAlchemicalCalcinator; +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.BlockIncenseCrucible; +import WayofTime.alchemicalWizardry.common.block.BlockCrucible; import WayofTime.alchemicalWizardry.common.block.BlockCrystal; import WayofTime.alchemicalWizardry.common.block.BlockDemonPortal; import WayofTime.alchemicalWizardry.common.block.BlockEnchantmentGlyph; -import WayofTime.alchemicalWizardry.common.block.BlockSpellTable; +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.BlockFilledSocket; +import WayofTime.alchemicalWizardry.common.block.BlockSocket; import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer; import WayofTime.alchemicalWizardry.common.block.BlockSpellEffect; import WayofTime.alchemicalWizardry.common.block.BlockSpellEnhancement; @@ -28,20 +25,20 @@ import WayofTime.alchemicalWizardry.common.block.BlockSpellModifier; import WayofTime.alchemicalWizardry.common.block.BlockSpellParadigm; import WayofTime.alchemicalWizardry.common.block.BlockStabilityGlyph; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; -import WayofTime.alchemicalWizardry.common.block.BlockChemistrySet; -import WayofTime.alchemicalWizardry.common.block.BlockBloodRune; -import WayofTime.alchemicalWizardry.common.block.BlockBloodStoneBrick; -import WayofTime.alchemicalWizardry.common.block.BlockEfficiencyRune; -import WayofTime.alchemicalWizardry.common.block.BlockEmptySocket; -import WayofTime.alchemicalWizardry.common.block.BlockImperfectRitualStone; -import WayofTime.alchemicalWizardry.common.block.BlockLargeBloodStoneBrick; -import WayofTime.alchemicalWizardry.common.block.BlockLifeEssence; -import WayofTime.alchemicalWizardry.common.block.BlockMimic; -import WayofTime.alchemicalWizardry.common.block.BlockRitualStone; -import WayofTime.alchemicalWizardry.common.block.BlockRuneOfSacrifice; -import WayofTime.alchemicalWizardry.common.block.BlockRuneOfSelfSacrifice; -import WayofTime.alchemicalWizardry.common.block.BlockSpectral; -import WayofTime.alchemicalWizardry.common.block.BlockSpeedRune; +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.MimicBlock; +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.demonVillage.tileEntity.BlockDemonChest; import WayofTime.alchemicalWizardry.common.items.ItemBlockCrystalBelljar; import WayofTime.alchemicalWizardry.common.items.ItemBloodRuneBlock; @@ -52,8 +49,7 @@ import WayofTime.alchemicalWizardry.common.items.ItemSpellEnhancementBlock; import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock; import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock; import WayofTime.alchemicalWizardry.common.items.ItemStabilityGlyphBlock; - -import java.util.ArrayList; +import cpw.mods.fml.common.registry.GameRegistry; /** * Created with IntelliJ IDEA. @@ -66,11 +62,11 @@ public class ModBlocks public static Block bloodStoneBrick; public static Block largeBloodStoneBrick; public static BlockAltar blockAltar; - public static BlockBloodRune bloodRune; - public static BlockSpeedRune speedRune; - public static BlockEfficiencyRune efficiencyRune; - public static BlockRuneOfSacrifice runeOfSacrifice; - public static BlockRuneOfSelfSacrifice runeOfSelfSacrifice; + public static BloodRune bloodRune; + public static SpeedRune speedRune; + public static EfficiencyRune efficiencyRune; + public static RuneOfSacrifice runeOfSacrifice; + public static RuneOfSelfSacrifice runeOfSelfSacrifice; public static Block blockMasterStone; public static Block ritualStone; public static Block imperfectRitualStone; @@ -78,7 +74,7 @@ public class ModBlocks public static Block emptySocket; public static Block armourForge; public static Block blockWritingTable; - public static Block blockSpellTable; + public static Block blockHomHeart; public static Block blockPedestal; public static Block blockPlinth; public static Block blockLifeEssence; @@ -94,7 +90,7 @@ public class ModBlocks public static Block blockBuildingSchematicSaver; public static Block blockDemonPortal; public static Block blockReagentConduit; - public static Block blockAlchemicalCalcinator; + public static Block blockAlchemicCalcinator; public static Block blockCrystalBelljar; public static Block blockDemonChest; public static Block blockCrystal; @@ -103,99 +99,98 @@ public class ModBlocks public static Block blockStabilityGlyph; public static Block blockCrucible; - public static ArrayList blocksNotToBeRegistered = new ArrayList(); - public static void init() { -/* blockAltar = (BlockAltar) registerBlock(new BlockAltar(), "altar"); - bloodRune = (BlockBloodRune) registerBlock(new BlockBloodRune(), ItemBloodRuneBlock.class, "base_rune"); - speedRune = (BlockSpeedRune) registerBlock(new BlockSpeedRune(), "speed_rune"); - efficiencyRune = (BlockEfficiencyRune) registerBlock(new BlockEfficiencyRune(), "efficiency_rune"); - runeOfSacrifice = (BlockRuneOfSacrifice) registerBlock(new BlockRuneOfSacrifice(), "sacrifice_rune"); - runeOfSelfSacrifice = (BlockRuneOfSelfSacrifice) registerBlock(new BlockRuneOfSelfSacrifice(), "self_sacrifice_rune"); - */ blockTeleposer = registerBlock(new BlockTeleposer(), "teleposer"); - spectralBlock = registerBlock(new BlockSpectral(), "spectral_block"); - ritualStone = registerBlock(new BlockRitualStone(), "ritual_stone"); - blockMasterStone = registerBlock(new BlockMasterStone(), "master_ritual_stone"); - imperfectRitualStone = registerBlock(new BlockImperfectRitualStone(), "imperfect_ritual_stone"); - emptySocket = registerBlock(new BlockEmptySocket(), "empty_socket"); - bloodSocket = registerBlock(new BlockFilledSocket(), "filled_socket"); - armourForge = registerBlock(new BlockArmourForge(), "soul_armour_forge"); - largeBloodStoneBrick = registerBlock(new BlockLargeBloodStoneBrick(), "large_bloodstone_brick"); - bloodStoneBrick = registerBlock(new BlockBloodStoneBrick(), "bloodstone_brick"); - blockWritingTable = registerBlock(new BlockChemistrySet(), "chemistry_set"); - blockSpellTable = registerBlock(new BlockSpellTable(), "spell_table"); - blockPedestal = registerBlock(new BlockPedestal(), "pedestal"); - blockPlinth = registerBlock(new BlockPlinth(), "plinth"); - blockConduit = registerBlock(new BlockConduit(), "spell_conduit"); - blockBloodLight = registerBlock(new BlockBloodLightSource(), "blood_light"); - blockSpellEffect = registerBlock(new BlockSpellEffect(), "spell_effect"); - blockSpellParadigm = registerBlock(new BlockSpellParadigm(), ItemSpellParadigmBlock.class, "spell_paradigm"); - blockSpellModifier = registerBlock(new BlockSpellModifier(), ItemSpellEnhancementBlock.class, "spell_modifier"); - blockSpellEnhancement = registerBlock(new BlockSpellEnhancement(), ItemSpellModifierBlock.class, "spell_enhancement"); - blockSpectralContainer = registerBlock(new BlockSpectralContainer(), ItemSpellEffectBlock.class, "spectral_container"); - blockDemonPortal = registerBlock(new BlockDemonPortal(), "demon_portal"); - blockBuildingSchematicSaver = registerBlock(new BlockSchematicSaver(), "schematic_saver"); - blockReagentConduit = registerBlock(new BlockReagentConduit(), "reagent_conduit"); - blockAlchemicalCalcinator = registerBlock(new BlockAlchemicalCalcinator(), "alchemical_calcinator"); - blockCrystalBelljar = registerBlock(new BlockBelljar(), ItemBlockCrystalBelljar.class, "belljar"); - blockDemonChest = registerBlock(new BlockDemonChest(), "demon_chest"); - blockCrystal = registerBlock(new BlockCrystal(), ItemCrystalBlock.class, "crystal_block"); - blockMimic = registerBlock(new BlockMimic(), "mimic_block"); + blockAltar = new BlockAltar(); + bloodRune = new BloodRune(); + speedRune = new SpeedRune(); + efficiencyRune = new EfficiencyRune(); + runeOfSacrifice = new RuneOfSacrifice(); + runeOfSelfSacrifice = new RuneOfSelfSacrifice(); + blockTeleposer = new BlockTeleposer(); + spectralBlock = new SpectralBlock(); + ritualStone = new RitualStone(); + blockMasterStone = new BlockMasterStone(); + imperfectRitualStone = new ImperfectRitualStone(); + bloodSocket = new BlockSocket(); + armourForge = new ArmourForge(); + emptySocket = new EmptySocket(); + largeBloodStoneBrick = new LargeBloodStoneBrick(); + bloodStoneBrick = new BloodStoneBrick(); + blockWritingTable = new BlockWritingTable(); + blockHomHeart = new BlockHomHeart(); + blockPedestal = new BlockPedestal(); + blockPlinth = new BlockPlinth(); + blockConduit = new BlockConduit(); + blockBloodLight = new BlockBloodLightSource(); + blockSpellEffect = new BlockSpellEffect(); + blockSpellParadigm = new BlockSpellParadigm(); + blockSpellModifier = new BlockSpellModifier(); + blockSpellEnhancement = new BlockSpellEnhancement(); + blockSpectralContainer = new BlockSpectralContainer(); + blockDemonPortal = new BlockDemonPortal(); + blockBuildingSchematicSaver = new BlockSchematicSaver(); + blockReagentConduit = new BlockReagentConduit(); + blockAlchemicCalcinator = new BlockAlchemicCalcinator(); + blockCrystalBelljar = new BlockBelljar(); + blockDemonChest = new BlockDemonChest(); + blockCrystal = new BlockCrystal(); + blockMimic = new MimicBlock(); - blockLifeEssence = registerBlock(new BlockLifeEssence(), "life_essence"); - blockEnchantmentGlyph = registerBlock(new BlockEnchantmentGlyph(), ItemEnchantmentGlyphBlock.class, "enchantment_glyph"); - blockStabilityGlyph = registerBlock(new BlockStabilityGlyph(), ItemStabilityGlyphBlock.class, "stability_glyph"); - blockCrucible = registerBlock(new BlockIncenseCrucible(), "incense_crucible"); + blockLifeEssence = new LifeEssenceBlock(); + blockEnchantmentGlyph = new BlockEnchantmentGlyph(); + blockStabilityGlyph = new BlockStabilityGlyph(); + blockCrucible = new BlockCrucible(); } - public static Block registerBlock(Block block, String unlocalizedName) + public static void registerBlocksInPre() { - //TODO Insert Model Code here - block.setUnlocalizedName(unlocalizedName); + 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"); + GameRegistry.registerBlock(ModBlocks.runeOfSacrifice, "runeOfSacrifice"); + GameRegistry.registerBlock(ModBlocks.runeOfSelfSacrifice, "runeOfSelfSacrifice"); + GameRegistry.registerBlock(ModBlocks.ritualStone, "ritualStone"); + GameRegistry.registerBlock(ModBlocks.blockMasterStone, "masterStone"); + GameRegistry.registerBlock(ModBlocks.bloodSocket, "bloodSocket"); + GameRegistry.registerBlock(ModBlocks.imperfectRitualStone, "imperfectRitualStone"); -// if (!) //creative tab blacklist - { - block.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - } + GameRegistry.registerBlock(ModBlocks.armourForge, "armourForge"); + GameRegistry.registerBlock(ModBlocks.emptySocket, "emptySocket"); + GameRegistry.registerBlock(ModBlocks.bloodStoneBrick, "bloodStoneBrick"); + GameRegistry.registerBlock(ModBlocks.largeBloodStoneBrick, "largeBloodStoneBrick"); + GameRegistry.registerBlock(ModBlocks.blockWritingTable, "blockWritingTable"); + GameRegistry.registerBlock(ModBlocks.blockHomHeart, "blockHomHeart"); + GameRegistry.registerBlock(ModBlocks.blockPedestal, "blockPedestal"); + GameRegistry.registerBlock(ModBlocks.blockPlinth, "blockPlinth"); + GameRegistry.registerBlock(ModBlocks.blockTeleposer, "blockTeleposer"); + GameRegistry.registerBlock(ModBlocks.spectralBlock, "spectralBlock"); + GameRegistry.registerBlock(ModBlocks.blockBloodLight, "bloodLight"); -// blocksNotToBeRegistered.clear(); -// for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled) - { -// if (unlocName.equals(unlocalizedName)) - { -// blocksNotToBeRegistered.add(unlocName); - } - } - // if (!blocksNotToBeRegistered.contains(unlocalizedName)) - { -// GameRegistry.registerBlock(block, unlocalizedName); - } + 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())); -// BlockRenderer.registerBlock(block); - - GameRegistry.registerBlock(block, unlocalizedName); - return block; + GameRegistry.registerBlock(ModBlocks.blockSpectralContainer, "spectralContainer"); + GameRegistry.registerBlock(ModBlocks.blockDemonPortal, "demonPortalMain"); + GameRegistry.registerBlock(ModBlocks.blockBuildingSchematicSaver, "blockSchemSaver"); + GameRegistry.registerBlock(ModBlocks.blockReagentConduit, "blockReagentConduit"); + GameRegistry.registerBlock(ModBlocks.blockAlchemicCalcinator, "blockAlchemicCalcinator"); + GameRegistry.registerBlock(ModBlocks.blockCrystalBelljar, ItemBlockCrystalBelljar.class, "blockCrystalBelljar"); + GameRegistry.registerBlock(ModBlocks.blockDemonChest, "blockDemonChest"); + GameRegistry.registerBlock(ModBlocks.blockCrystal, ItemCrystalBlock.class, "blockCrystal"); + GameRegistry.registerBlock(ModBlocks.blockMimic, "blockMimic"); + GameRegistry.registerBlock(ModBlocks.blockEnchantmentGlyph, ItemEnchantmentGlyphBlock.class, "blockEnchantmentGlyph"); + GameRegistry.registerBlock(ModBlocks.blockStabilityGlyph, ItemStabilityGlyphBlock.class, "blockStabilityGlyph"); + + GameRegistry.registerBlock(ModBlocks.blockCrucible, "blockCrucible"); } - public static Block registerBlock(Block block, Class itemBlockClass, String unlocalizedName) + public static void registerBlocksInInit() { - block.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - -// for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled) - { -// if (unlocName.equals(unlocalizedName)) - { -// blocksNotToBeRegistered.add(unlocName); - } - } -// if (!blocksNotToBeRegistered.contains(unlocalizedName)) - { - GameRegistry.registerBlock(block, itemBlockClass, unlocalizedName); - } - -// BlockRenderer.registerBlock(block); - - return block; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/ModItems.java b/src/main/java/WayofTime/alchemicalWizardry/ModItems.java index edfcf081..8e504b33 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/ModItems.java +++ b/src/main/java/WayofTime/alchemicalWizardry/ModItems.java @@ -1,61 +1,19 @@ package WayofTime.alchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.*; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; -import net.minecraftforge.fml.common.registry.GameRegistry; import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool; import WayofTime.alchemicalWizardry.api.spell.SpellParadigmTool; -import WayofTime.alchemicalWizardry.common.items.BaseItems; -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.BoundAxe; -import WayofTime.alchemicalWizardry.common.items.BoundPickaxe; -import WayofTime.alchemicalWizardry.common.items.BoundShovel; -import WayofTime.alchemicalWizardry.common.items.CreativeOrb; -import WayofTime.alchemicalWizardry.common.items.CreativeDagger; -import WayofTime.alchemicalWizardry.common.items.DaggerOfSacrifice; -import WayofTime.alchemicalWizardry.common.items.DawnScribeTool; -import WayofTime.alchemicalWizardry.common.items.DemonCrystal; -import WayofTime.alchemicalWizardry.common.items.DemonicTelepositionFocus; -import WayofTime.alchemicalWizardry.common.items.DuskScribeTool; -import WayofTime.alchemicalWizardry.common.items.EarthScribeTool; -import WayofTime.alchemicalWizardry.common.items.Orb; -import WayofTime.alchemicalWizardry.common.items.EnergyBazooka; -import WayofTime.alchemicalWizardry.common.items.EnergyBlaster; -import WayofTime.alchemicalWizardry.common.items.BoundBlade; -import WayofTime.alchemicalWizardry.common.items.EnhancedTelepositionFocus; -import WayofTime.alchemicalWizardry.common.items.FireScribeTool; -import WayofTime.alchemicalWizardry.common.items.ItemAlchemyBase; -import WayofTime.alchemicalWizardry.common.items.ItemBloodLetterPack; -import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal; -import WayofTime.alchemicalWizardry.common.items.ItemComponents; -import WayofTime.alchemicalWizardry.common.items.KeyOfBinding; -import WayofTime.alchemicalWizardry.common.items.ItemIncense; -import WayofTime.alchemicalWizardry.common.items.ItemRitualDismantler; -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.TranscendentBloodOrb; -import WayofTime.alchemicalWizardry.common.items.WaterScribeTool; import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourEarth; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourFire; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourWater; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmourWind; -import WayofTime.alchemicalWizardry.common.items.energy.AlchemicalRouter; -import WayofTime.alchemicalWizardry.common.items.energy.AlchemicalCleanser; -import WayofTime.alchemicalWizardry.common.items.energy.AlchemicalSegmenter; +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; @@ -88,13 +46,12 @@ import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheAssassin; 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.SigilCompress; +import WayofTime.alchemicalWizardry.common.items.sigil.SigilPackRat; import WayofTime.alchemicalWizardry.common.items.sigil.SigilSeer; import WayofTime.alchemicalWizardry.common.items.sigil.SigilVoid; import WayofTime.alchemicalWizardry.common.items.sigil.SigilWater; import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding; - -import java.util.ArrayList; +import cpw.mods.fml.common.registry.GameRegistry; /** * Created with IntelliJ IDEA. @@ -133,7 +90,7 @@ public class ModItems public static Item boundAxe; public static Item boundShovel; public static Item boundHelmet; - public static Item boundChestplate; + public static Item boundPlate; public static Item boundLeggings; public static Item boundBoots; public static Item weakBloodShard; @@ -201,7 +158,7 @@ public class ModItems public static Item itemSeerSigil; public static Item itemCombinationalCatalyst; - public static ItemSpellMultiTool customTool; + public static Item customTool; public static Item itemAttunedCrystal; public static Item itemTankSegmenter; @@ -218,22 +175,22 @@ public class ModItems public static Item itemAssassinSigil; public static Item boundHelmetWater; - public static Item boundChestplateWater; + public static Item boundPlateWater; public static Item boundLeggingsWater; public static Item boundBootsWater; public static Item boundHelmetEarth; - public static Item boundChestplateEarth; + public static Item boundPlateEarth; public static Item boundLeggingsEarth; public static Item boundBootsEarth; public static Item boundHelmetWind; - public static Item boundChestplateWind; + public static Item boundPlateWind; public static Item boundLeggingsWind; public static Item boundBootsWind; public static Item boundHelmetFire; - public static Item boundChestplateFire; + public static Item boundPlateFire; public static Item boundLeggingsFire; public static Item boundBootsFire; @@ -246,159 +203,269 @@ public class ModItems public static Item ritualDismantler; - public static ArrayList itemsNotToBeRegistered = new ArrayList(); - public static void init() { - weakBloodOrb = registerItem(new Orb(5000), "weak_blood_orb"); - apprenticeBloodOrb = registerItem(new ApprenticeBloodOrb(25000), "apprentice_blood_orb"); - magicianBloodOrb = registerItem(new MagicianBloodOrb(150000), "magician_blood_orb"); - masterBloodOrb = registerItem(new MasterBloodOrb(1000000), "master_blood_orb"); - archmageBloodOrb = registerItem(new ArchmageBloodOrb(10000000), "archmage_blood_orb"); - transcendentBloodOrb = registerItem(new TranscendentBloodOrb(30000000), "transcendent_blood_orb"); - energyBlaster = registerItem(new EnergyBlaster(), "energy_blaster"); - energySword = registerItem(new BoundBlade(), "bound_blade"); - lavaCrystal = registerItem(new LavaCrystal(), "lava_crystal"); - waterSigil = registerItem(new SigilWater(), "water_sigil"); - lavaSigil = registerItem(new SigilLava(), "lava_sigil"); - voidSigil = registerItem(new SigilVoid(), "void_sigil"); - blankSlate = registerItem(new BaseItems(), "blank_slate"); - reinforcedSlate = registerItem(new BaseItems(), "reinforced_slate"); - sacrificialDagger = registerItem(new SacrificialDagger(), "sacrificial_agger"); - daggerOfSacrifice = registerItem(new DaggerOfSacrifice(), "dagger_of_sacrifice"); - airSigil = registerItem(new SigilAir(), "air_sigil"); - sigilOfTheFastMiner = registerItem(new SigilOfTheFastMiner(), "sigil_of_the_fast_miner"); - sigilOfElementalAffinity = registerItem(new SigilOfElementalAffinity(), "sigil_of_elemental_affinity"); - sigilOfHaste = registerItem(new SigilOfHaste(), "sigil_of_haste"); - sigilOfHolding = registerItem(new SigilOfHolding(), "sigil_of_holding"); - divinationSigil = registerItem(new SigilDivination(), "divination_sigil"); - waterScribeTool = registerItem(new WaterScribeTool(), "water_scribe_tool"); - fireScribeTool = registerItem(new FireScribeTool(), "fire_scribe_tool"); - earthScribeTool = registerItem(new EarthScribeTool(), "earth_scribe_tool"); - airScribeTool = registerItem(new AirScribeTool(), "air_scribe_tool"); - activationCrystal = registerItem(new ActivationCrystal(), "activation_crystal"); - boundPickaxe = registerItem(new BoundPickaxe(), "bound_pickaxe"); - boundAxe = registerItem(new BoundAxe(), "bound_axe"); - boundShovel = registerItem(new BoundShovel(), "bound_shovel"); - boundHelmet = registerItem(new BoundArmour(0), "bound_helmet"); - boundChestplate = registerItem(new BoundArmour(1), "bound_chestplate"); - boundLeggings = registerItem(new BoundArmour(2), "bound_leggings"); - boundBoots = registerItem(new BoundArmour(3), "bound_boots"); - weakBloodShard = registerItem(new BloodShard(), "weak_blood_shard"); - growthSigil = registerItem(new SigilOfGrowth(), "growth_sigil"); - blankSpell = registerItem(new BlankSpell(), "blank_spell"); - alchemyFlask = registerItem(new AlchemyFlask(), "alchemy_flask"); - standardBindingAgent = registerItem(new StandardBindingAgent(), "standard_binding_agent"); - mundanePowerCatalyst = registerItem(new MundanePowerCatalyst(), "mundane_power_catalyst"); - averagePowerCatalyst = registerItem(new AveragePowerCatalyst(), "average_power_catalyst"); - greaterPowerCatalyst = registerItem(new GreaterPowerCatalyst(), "greater_power_catalyst"); - mundaneLengtheningCatalyst = registerItem(new MundaneLengtheningCatalyst(), "mundane_lengthening_catalyst"); - averageLengtheningCatalyst = registerItem(new AverageLengtheningCatalyst(), "average_lengthening_catalyst"); - greaterLengtheningCatalyst = registerItem(new GreaterLengtheningCatalyst(), "greater_lengthening_catalyst"); - incendium = registerItem(new AlchemyReagent(), "incendium"); - magicales = registerItem(new AlchemyReagent(), "magicales"); - sanctus = registerItem(new AlchemyReagent(), "sanctus"); - aether = registerItem(new AlchemyReagent(), "aether"); - simpleCatalyst = registerItem(new AlchemyReagent(), "simple_catalyst"); - crepitous = registerItem(new AlchemyReagent(), "crepitous"); - crystallos = registerItem(new AlchemyReagent(), "crystallos"); - terrae = registerItem(new AlchemyReagent(), "terrae"); - aquasalus = registerItem(new AlchemyReagent(), "aquasalus"); - tennebrae = registerItem(new AlchemyReagent(), "tennebrae"); - demonBloodShard = registerItem(new BloodShard(), "demon_blood_shard"); - sigilOfWind = registerItem(new SigilOfWind(), "sigil_of_wind"); - telepositionFocus = registerItem(new TelepositionFocus(1), "teleposition_focus"); - enhancedTelepositionFocus = registerItem(new EnhancedTelepositionFocus(), "enhanced_teleposition_focus"); - reinforcedTelepositionFocus = registerItem(new ReinforcedTelepositionFocus(), "reinforced_teleposition_focus"); - demonicTelepositionFocus = registerItem(new DemonicTelepositionFocus(), "demonic_teleposition_focus"); - imbuedSlate = registerItem(new BaseItems(), "imbued_slate"); - demonicSlate = registerItem(new BaseItems(), "demonic_slate"); - duskScribeTool = registerItem(new DuskScribeTool(), "dusk_scribe_tool"); - sigilOfTheBridge = registerItem(new SigilOfTheBridge(), "sigil_of_the_bridge"); - armourInhibitor = registerItem(new ArmourInhibitor(), "armour_inhibitor"); - creativeFiller = registerItem(new CreativeOrb(), "creative_orb"); - demonPlacer = registerItem(new DemonCrystal(), "demon_crystal"); - creativeDagger = registerItem(new CreativeDagger(), "creative_dagger"); - weakFillingAgent = registerItem(new WeakFillingAgent(), "weak_filling_agent"); - standardFillingAgent = registerItem(new StandardFillingAgent(), "standard_filling_agent"); - enhancedFillingAgent = registerItem(new EnhancedFillingAgent(), "enhanced_filling_agent"); - weakBindingAgent = registerItem(new WeakBindingAgent(), "weak_binding_agent"); - itemRitualDiviner = registerItem(new ItemRitualDiviner(), "ritual_diviner"); - sigilOfMagnetism = registerItem(new SigilOfMagnetism(), "sigil_of_magnetism"); - itemKeyOfDiablo = registerItem(new KeyOfBinding(), "key_of_binding"); - energyBazooka = registerItem(new EnergyBazooka(), "energy_bazooka"); - itemBloodLightSigil = registerItem(new SigilBloodLight(), "blood_light_sigil"); - itemComplexSpellCrystal = registerItem(new ItemComplexSpellCrystal(), "complex_spell_crystal"); - bucketLife = registerItem(new LifeBucket(ModBlocks.blockLifeEssence), "bucket_life").setContainerItem(Items.bucket).setCreativeTab(CreativeTabs.tabMisc); - itemSigilOfEnderSeverance = registerItem(new SigilOfEnderSeverance(), "sigil_of_ender_severance"); - baseItems = registerItem(new ItemComponents(), "base_items"); - baseAlchemyItems = registerItem(new ItemAlchemyBase(), "base_alchemy_items"); - itemSigilOfSupression = registerItem(new SigilOfSupression(), "sigil_of_suppression"); - itemFluidSigil = registerItem(new SigilFluid(), "fluid_sigil"); - itemSeerSigil = registerItem(new SigilSeer(), "sigil_of_sight"); - customTool = (ItemSpellMultiTool) registerItem(new ItemSpellMultiTool(), "multi_tool"); + weakBloodOrb = new EnergyBattery(5000).setUnlocalizedName("weakBloodOrb"); + apprenticeBloodOrb = new ApprenticeBloodOrb(25000).setUnlocalizedName("apprenticeBloodOrb"); + magicianBloodOrb = new MagicianBloodOrb(150000).setUnlocalizedName("magicianBloodOrb"); + masterBloodOrb = new MasterBloodOrb(1000000).setUnlocalizedName("masterBloodOrb"); + archmageBloodOrb = new ArchmageBloodOrb(10000000).setUnlocalizedName("archmageBloodOrb"); + transcendentBloodOrb = new TranscendentBloodOrb(30000000).setUnlocalizedName("transcendentBloodOrb"); + energyBlaster = new EnergyBlast().setUnlocalizedName("energyBlast"); + energySword = new EnergySword().setUnlocalizedName("energySword"); + lavaCrystal = new LavaCrystal().setUnlocalizedName("lavaCrystal"); + waterSigil = new SigilWater().setUnlocalizedName("waterSigil"); + lavaSigil = new SigilLava().setUnlocalizedName("lavaSigil"); + voidSigil = new SigilVoid().setUnlocalizedName("voidSigil"); + blankSlate = new AWBaseItems().setUnlocalizedName("blankSlate"); + reinforcedSlate = new AWBaseItems().setUnlocalizedName("reinforcedSlate"); + sacrificialDagger = new SacrificialDagger().setUnlocalizedName("sacrificialDagger"); + daggerOfSacrifice = new DaggerOfSacrifice().setUnlocalizedName("daggerOfSacrifice"); + airSigil = new SigilAir().setUnlocalizedName("airSigil"); + sigilOfTheFastMiner = new SigilOfTheFastMiner().setUnlocalizedName("sigilOfTheFastMiner"); + sigilOfElementalAffinity = new SigilOfElementalAffinity().setUnlocalizedName("sigilOfElementalAffinity"); + sigilOfHaste = new SigilOfHaste().setUnlocalizedName("sigilOfHaste"); + sigilOfHolding = new SigilOfHolding().setUnlocalizedName("sigilOfHolding"); + divinationSigil = new SigilDivination().setUnlocalizedName("divinationSigil"); + waterScribeTool = new WaterScribeTool().setUnlocalizedName("waterScribeTool"); + fireScribeTool = new FireScribeTool().setUnlocalizedName("fireScribeTool"); + earthScribeTool = new EarthScribeTool().setUnlocalizedName("earthScribeTool"); + airScribeTool = new AirScribeTool().setUnlocalizedName("airScribeTool"); + activationCrystal = new ActivationCrystal(); + boundPickaxe = new BoundPickaxe().setUnlocalizedName("boundPickaxe"); + boundAxe = new BoundAxe().setUnlocalizedName("boundAxe"); + boundShovel = new BoundShovel().setUnlocalizedName("boundShovel"); + boundHelmet = new BoundArmour(0).setUnlocalizedName("boundHelmet"); + boundPlate = new BoundArmour(1).setUnlocalizedName("boundPlate"); + boundLeggings = new BoundArmour(2).setUnlocalizedName("boundLeggings"); + boundBoots = new BoundArmour(3).setUnlocalizedName("boundBoots"); + weakBloodShard = new BloodShard().setUnlocalizedName("weakBloodShard"); + growthSigil = new SigilOfGrowth().setUnlocalizedName("growthSigil"); + blankSpell = new BlankSpell().setUnlocalizedName("blankSpell"); + alchemyFlask = new AlchemyFlask().setUnlocalizedName("alchemyFlask"); + standardBindingAgent = new StandardBindingAgent().setUnlocalizedName("standardBindingAgent"); + mundanePowerCatalyst = new MundanePowerCatalyst().setUnlocalizedName("mundanePowerCatalyst"); + averagePowerCatalyst = new AveragePowerCatalyst().setUnlocalizedName("averagePowerCatalyst"); + greaterPowerCatalyst = new GreaterPowerCatalyst().setUnlocalizedName("greaterPowerCatalyst"); + mundaneLengtheningCatalyst = new MundaneLengtheningCatalyst().setUnlocalizedName("mundaneLengtheningCatalyst"); + averageLengtheningCatalyst = new AverageLengtheningCatalyst().setUnlocalizedName("averageLengtheningCatalyst"); + greaterLengtheningCatalyst = new GreaterLengtheningCatalyst().setUnlocalizedName("greaterLengtheningCatalyst"); + incendium = new AlchemyReagent().setUnlocalizedName("incendium"); + magicales = new AlchemyReagent().setUnlocalizedName("magicales"); + sanctus = new AlchemyReagent().setUnlocalizedName("sanctus"); + aether = new AlchemyReagent().setUnlocalizedName("aether"); + simpleCatalyst = new AlchemyReagent().setUnlocalizedName("simpleCatalyst"); + crepitous = new AlchemyReagent().setUnlocalizedName("crepitous"); + crystallos = new AlchemyReagent().setUnlocalizedName("crystallos"); + terrae = new AlchemyReagent().setUnlocalizedName("terrae"); + aquasalus = new AlchemyReagent().setUnlocalizedName("aquasalus"); + tennebrae = new AlchemyReagent().setUnlocalizedName("tennebrae"); + demonBloodShard = new BloodShard().setUnlocalizedName("demonBloodShard"); + sigilOfWind = new SigilOfWind().setUnlocalizedName("sigilOfWind"); + telepositionFocus = new TelepositionFocus(1).setUnlocalizedName("telepositionFocus"); + enhancedTelepositionFocus = new EnhancedTelepositionFocus().setUnlocalizedName("enhancedTelepositionFocus"); + reinforcedTelepositionFocus = new ReinforcedTelepositionFocus().setUnlocalizedName("reinforcedTelepositionFocus"); + demonicTelepositionFocus = new DemonicTelepositionFocus().setUnlocalizedName("demonicTelepositionFocus"); + imbuedSlate = new AWBaseItems().setUnlocalizedName("imbuedSlate"); + demonicSlate = new AWBaseItems().setUnlocalizedName("demonicSlate"); + duskScribeTool = new DuskScribeTool().setUnlocalizedName("duskScribeTool"); + sigilOfTheBridge = new SigilOfTheBridge().setUnlocalizedName("sigilOfTheBridge"); + armourInhibitor = new ArmourInhibitor().setUnlocalizedName("armourInhibitor"); + creativeFiller = new CheatyItem().setUnlocalizedName("cheatyItem"); + demonPlacer = new DemonPlacer().setUnlocalizedName("demonPlacer"); + creativeDagger = new CreativeDagger().setUnlocalizedName("creativeDagger"); + weakFillingAgent = new WeakFillingAgent().setUnlocalizedName("weakFillingAgent"); + standardFillingAgent = new StandardFillingAgent().setUnlocalizedName("standardFillingAgent"); + enhancedFillingAgent = new EnhancedFillingAgent().setUnlocalizedName("enhancedFillingAgent"); + weakBindingAgent = new WeakBindingAgent().setUnlocalizedName("weakBindingAgent"); + itemRitualDiviner = new ItemRitualDiviner().setUnlocalizedName("ritualDiviner"); + sigilOfMagnetism = new SigilOfMagnetism().setUnlocalizedName("sigilOfMagnetism"); + itemKeyOfDiablo = new ItemDiabloKey().setUnlocalizedName("itemDiabloKey"); + energyBazooka = new EnergyBazooka().setUnlocalizedName("energyBazooka"); + itemBloodLightSigil = new SigilBloodLight().setUnlocalizedName("bloodLightSigil"); + itemComplexSpellCrystal = new ItemComplexSpellCrystal().setUnlocalizedName("itemComplexSpellCrystal"); + bucketLife = new LifeBucket(ModBlocks.blockLifeEssence).setUnlocalizedName("bucketLife").setContainerItem(Items.bucket).setCreativeTab(CreativeTabs.tabMisc); + itemSigilOfEnderSeverance = (new SigilOfEnderSeverance()).setUnlocalizedName("itemSigilOfEnderSeverance"); + baseItems = new ItemComponents().setUnlocalizedName("baseItems"); + baseAlchemyItems = new ItemAlchemyBase().setUnlocalizedName("baseAlchemyItems"); + itemSigilOfSupression = new SigilOfSupression().setUnlocalizedName("itemSigilOfSupression"); + itemFluidSigil = new SigilFluid().setUnlocalizedName("itemFluidSigil"); + itemSeerSigil = new SigilSeer().setUnlocalizedName("itemSeerSigil"); + customTool = new ItemSpellMultiTool().setUnlocalizedName("multiTool"); SpellParadigmTool.customTool = customTool; - itemCombinationalCatalyst = registerItem(new CombinationalCatalyst(), "combinational_catalyst"); - itemAttunedCrystal = registerItem(new AlchemicalRouter(), "alchemical_router"); - itemTankSegmenter = registerItem(new AlchemicalSegmenter(), "alchemical_segmenter"); - itemDestinationClearer = registerItem(new AlchemicalCleanser(), "alchemical_cleanser"); + itemCombinationalCatalyst = new CombinationalCatalyst().setUnlocalizedName("itemCombinationalCatalyst"); + itemAttunedCrystal = new ItemAttunedCrystal().setUnlocalizedName("itemAttunedCrystal"); + itemTankSegmenter = new ItemTankSegmenter().setUnlocalizedName("itemTankSegmenter"); + itemDestinationClearer = new ItemDestinationClearer().setUnlocalizedName("destinationClearer"); - dawnScribeTool = registerItem(new DawnScribeTool(), "dawn_scribe_tool"); + dawnScribeTool = new DawnScribeTool().setUnlocalizedName("dawnScribeTool"); - itemBloodPack = registerItem(new ItemBloodLetterPack(), "blood_pack"); - itemHarvestSigil = registerItem(new SigilHarvest(), "harvest_sigil"); - itemCompressionSigil = registerItem(new SigilCompress(), "compression_sigil"); - itemAssassinSigil = registerItem(new SigilOfTheAssassin(), "assassin_sigil"); + itemBloodPack = new ItemBloodLetterPack().setUnlocalizedName("itemBloodPack"); + itemHarvestSigil = new SigilHarvest().setUnlocalizedName("itemHarvestSigil"); + itemCompressionSigil = new SigilPackRat().setUnlocalizedName("itemCompressionSigil"); + itemAssassinSigil = new SigilOfTheAssassin().setUnlocalizedName("itemAssassinSigil"); - boundHelmetWater = registerItem(new OmegaArmourWater(0), "bound_helmet_water"); - boundChestplateWater = registerItem(new OmegaArmourWater(1), "bound_chestplate_water"); - boundLeggingsWater = registerItem(new OmegaArmourWater(2), "bound_leggings_water"); - boundBootsWater = registerItem(new OmegaArmourWater(3), "bound_boots_water"); + boundHelmetWater = new OmegaArmourWater(0).setUnlocalizedName("boundHelmetWater"); + boundPlateWater = new OmegaArmourWater(1).setUnlocalizedName("boundPlateWater"); + boundLeggingsWater = new OmegaArmourWater(2).setUnlocalizedName("boundLeggingsWater"); + boundBootsWater = new OmegaArmourWater(3).setUnlocalizedName("boundBootsWater"); - boundHelmetEarth = registerItem(new OmegaArmourEarth(0), "bound_helmet_earth"); - boundChestplateEarth = registerItem(new OmegaArmourEarth(1), "bound_chestplate_earth"); - boundLeggingsEarth = registerItem(new OmegaArmourEarth(2), "bound_leggings_earth"); - boundBootsEarth = registerItem(new OmegaArmourEarth(3), "bound_boots_earth"); + boundHelmetEarth = new OmegaArmourEarth(0).setUnlocalizedName("boundHelmetEarth"); + boundPlateEarth = new OmegaArmourEarth(1).setUnlocalizedName("boundPlateEarth"); + boundLeggingsEarth = new OmegaArmourEarth(2).setUnlocalizedName("boundLeggingsEarth"); + boundBootsEarth = new OmegaArmourEarth(3).setUnlocalizedName("boundBootsEarth"); - boundHelmetWind = registerItem(new OmegaArmourWind(0), "bound_helmet_wind"); - boundChestplateWind = registerItem(new OmegaArmourWind(1), "bound_chestplate_wind"); - boundLeggingsWind = registerItem(new OmegaArmourWind(2), "bound_leggings_wind"); - boundBootsWind = registerItem(new OmegaArmourWind(3), "bound_boots_wind"); + boundHelmetWind = new OmegaArmourWind(0).setUnlocalizedName("boundHelmetWind"); + boundPlateWind = new OmegaArmourWind(1).setUnlocalizedName("boundPlateWind"); + boundLeggingsWind = new OmegaArmourWind(2).setUnlocalizedName("boundLeggingsWind"); + boundBootsWind = new OmegaArmourWind(3).setUnlocalizedName("boundBootsWind"); - boundHelmetFire = registerItem(new OmegaArmourFire(0), "bound_helmet_fire"); - boundChestplateFire = registerItem(new OmegaArmourFire(1), "bound_chestplate_fire"); - boundLeggingsFire = registerItem(new OmegaArmourFire(2), "bound_leggings_fire"); - boundBootsFire = registerItem(new OmegaArmourFire(3), "bound_boots_fire"); + boundHelmetFire = new OmegaArmourFire(0).setUnlocalizedName("boundHelmetFire"); + boundPlateFire = new OmegaArmourFire(1).setUnlocalizedName("boundPlateFire"); + boundLeggingsFire = new OmegaArmourFire(2).setUnlocalizedName("boundLeggingsFire"); + boundBootsFire = new OmegaArmourFire(3).setUnlocalizedName("boundBootsFire"); - inputRoutingFocus = registerItem(new InputRoutingFocus(), "input_routing_focus"); - outputRoutingFocus = registerItem(new OutputRoutingFocus(), "output_routing_focus"); + inputRoutingFocus = new InputRoutingFocus().setUnlocalizedName("inputRoutingFocus"); + outputRoutingFocus = new OutputRoutingFocus().setUnlocalizedName("outputRoutingFocus"); - itemIncense = registerItem(new ItemIncense(), "incense"); + itemIncense = new ItemIncense().setUnlocalizedName("bloodMagicIncenseItem"); - ritualDismantler = registerItem(new ItemRitualDismantler(), "ritual_dismantler"); + ritualDismantler = new ItemRitualDismantler().setUnlocalizedName("ritualDismantler"); } - public static Item registerItem(Item item, String unlocalizedName) + public static void registerItems() { - item.setUnlocalizedName(unlocalizedName); - item.setCreativeTab(AlchemicalWizardry.tabBloodMagic); -// itemsNotToBeRegistered.clear(); + GameRegistry.registerItem(ModItems.weakBloodOrb, "weakBloodOrb"); + GameRegistry.registerItem(ModItems.apprenticeBloodOrb, "apprenticeBloodOrb"); + GameRegistry.registerItem(ModItems.magicianBloodOrb, "magicianBloodOrb"); + GameRegistry.registerItem(ModItems.energyBlaster, "energyBlaster"); -// for (String unlocName : BloodMagicConfiguration.itemsToBeDisabled) - { -// if (unlocName.equals(unlocalizedName)) - { -// itemsNotToBeRegistered.add(unlocName); - } - } + GameRegistry.registerItem(ModItems.energySword, "energySword"); + GameRegistry.registerItem(ModItems.lavaCrystal, "lavaCrystal"); + GameRegistry.registerItem(ModItems.waterSigil, "waterSigil"); + GameRegistry.registerItem(ModItems.lavaSigil, "lavaSigil"); + GameRegistry.registerItem(ModItems.voidSigil, "voidSigil"); + GameRegistry.registerItem(ModItems.blankSlate, "blankSlate"); + GameRegistry.registerItem(ModItems.reinforcedSlate, "reinforcedSlate"); + GameRegistry.registerItem(ModItems.sacrificialDagger, "sacrificialKnife"); + GameRegistry.registerItem(ModItems.daggerOfSacrifice, "daggerOfSacrifice"); + GameRegistry.registerItem(ModItems.airSigil, "airSigil"); + GameRegistry.registerItem(ModItems.sigilOfTheFastMiner, "sigilOfTheFastMiner"); + GameRegistry.registerItem(ModItems.sigilOfElementalAffinity, "sigilOfElementalAffinity"); + GameRegistry.registerItem(ModItems.sigilOfHaste, "sigilOfHaste"); + GameRegistry.registerItem(ModItems.sigilOfHolding, "sigilOfHolding"); + GameRegistry.registerItem(ModItems.divinationSigil, "divinationSigil"); + GameRegistry.registerItem(ModItems.waterScribeTool, "waterScribeTool"); + GameRegistry.registerItem(ModItems.fireScribeTool, "fireScribeTool"); + GameRegistry.registerItem(ModItems.earthScribeTool, "earthScribeTool"); + GameRegistry.registerItem(ModItems.airScribeTool, "airScribeTool"); + GameRegistry.registerItem(ModItems.activationCrystal, "activationCrystal"); + GameRegistry.registerItem(ModItems.boundPickaxe, "boundPickaxe"); + GameRegistry.registerItem(ModItems.boundAxe, "boundAxe"); + GameRegistry.registerItem(ModItems.boundShovel, "boundShovel"); + GameRegistry.registerItem(ModItems.boundHelmet, "boundHelmet"); + GameRegistry.registerItem(ModItems.boundPlate, "boundPlate"); + GameRegistry.registerItem(ModItems.boundLeggings, "boundLeggings"); + GameRegistry.registerItem(ModItems.boundBoots, "boundBoots"); + GameRegistry.registerItem(ModItems.weakBloodShard, "weakBloodShard"); + GameRegistry.registerItem(ModItems.growthSigil, "growthSigil"); + GameRegistry.registerItem(ModItems.blankSpell, "blankSpell"); + GameRegistry.registerItem(ModItems.masterBloodOrb, "masterBloodOrb"); + GameRegistry.registerItem(ModItems.alchemyFlask, "alchemyFlask"); + GameRegistry.registerItem(ModItems.standardBindingAgent, "standardBindingAgent"); + GameRegistry.registerItem(ModItems.mundanePowerCatalyst, "mundanePowerCatalyst"); + GameRegistry.registerItem(ModItems.averagePowerCatalyst, "averagePowerCatalyst"); + GameRegistry.registerItem(ModItems.greaterPowerCatalyst, "greaterPowerCatalyst"); + GameRegistry.registerItem(ModItems.mundaneLengtheningCatalyst, "mundaneLengtheningCatalyst"); + GameRegistry.registerItem(ModItems.averageLengtheningCatalyst, "averageLengtheningCatalyst"); + GameRegistry.registerItem(ModItems.greaterLengtheningCatalyst, "greaterLengtheningCatalyst"); + GameRegistry.registerItem(ModItems.incendium, "incendium"); + GameRegistry.registerItem(ModItems.magicales, "magicales"); + GameRegistry.registerItem(ModItems.sanctus, "sanctus"); + GameRegistry.registerItem(ModItems.aether, "aether"); + GameRegistry.registerItem(ModItems.simpleCatalyst, "simpleCatalyst"); + GameRegistry.registerItem(ModItems.crepitous, "crepitous"); + GameRegistry.registerItem(ModItems.crystallos, "crystallos"); + GameRegistry.registerItem(ModItems.terrae, "terrae"); + GameRegistry.registerItem(ModItems.aquasalus, "aquasalus"); + GameRegistry.registerItem(ModItems.tennebrae, "tennebrae"); + GameRegistry.registerItem(ModItems.demonBloodShard, "demonBloodShard"); + GameRegistry.registerItem(ModItems.archmageBloodOrb, "archmageBloodOrb"); + GameRegistry.registerItem(ModItems.transcendentBloodOrb, "transcendentBloodOrb"); + GameRegistry.registerItem(ModItems.sigilOfWind, "sigilOfWind"); + GameRegistry.registerItem(ModItems.telepositionFocus, "telepositionFocus"); + GameRegistry.registerItem(ModItems.enhancedTelepositionFocus, "enhancedTelepositionFocus"); + GameRegistry.registerItem(ModItems.reinforcedTelepositionFocus, "reinforcedTelepositionFocus"); + GameRegistry.registerItem(ModItems.demonicTelepositionFocus, "demonicTelepositionFocus"); + GameRegistry.registerItem(ModItems.imbuedSlate, "imbuedSlate"); + GameRegistry.registerItem(ModItems.demonicSlate, "demonicSlate"); + GameRegistry.registerItem(ModItems.duskScribeTool, "duskScribeTool"); + GameRegistry.registerItem(ModItems.sigilOfTheBridge, "sigilOfTheBridge"); + GameRegistry.registerItem(ModItems.armourInhibitor, "armourInhibitor"); + GameRegistry.registerItem(ModItems.creativeFiller, "creativeFiller"); + GameRegistry.registerItem(ModItems.demonPlacer, "demonPlacer"); + GameRegistry.registerItem(ModItems.creativeDagger, "creativeDagger"); -// if (!itemsNotToBeRegistered.contains(unlocalizedName)) - { - GameRegistry.registerItem(item, unlocalizedName); - } + GameRegistry.registerItem(ModItems.weakFillingAgent, "weakFillingAgent"); + GameRegistry.registerItem(ModItems.standardFillingAgent, "standardFillingAgent"); + GameRegistry.registerItem(ModItems.enhancedFillingAgent, "enhancedFillingAgent"); + GameRegistry.registerItem(ModItems.weakBindingAgent, "weakBindingAgent"); + GameRegistry.registerItem(ModItems.itemRitualDiviner, "itemRitualDiviner"); + GameRegistry.registerItem(ModItems.sigilOfMagnetism, "sigilOfMagnetism"); + GameRegistry.registerItem(ModItems.itemKeyOfDiablo, "itemKeyOfDiablo"); + GameRegistry.registerItem(ModItems.energyBazooka, "energyBazooka"); + GameRegistry.registerItem(ModItems.itemBloodLightSigil, "itemBloodLightSigil"); + GameRegistry.registerItem(ModItems.itemComplexSpellCrystal, "itemComplexSpellCrystal"); + GameRegistry.registerItem(ModItems.itemSigilOfSupression, "sigilOfSupression"); + GameRegistry.registerItem(ModItems.itemSigilOfEnderSeverance, "sigilOfEnderSeverance"); + GameRegistry.registerItem(ModItems.itemFluidSigil, "fluidSigil"); + GameRegistry.registerItem(ModItems.itemSeerSigil, "seerSigil"); - return item; + 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.dawnScribeTool, "dawnScribeTool"); + + GameRegistry.registerItem(ModItems.itemBloodPack, "itemBloodPack"); + GameRegistry.registerItem(ModItems.itemHarvestSigil, "itemHarvestSigil"); + GameRegistry.registerItem(ModItems.itemCompressionSigil, "itemCompressionSigil"); + GameRegistry.registerItem(ModItems.itemAssassinSigil, "itemAssassinSigil"); + + GameRegistry.registerItem(ModItems.boundHelmetWater, "boundHelmetWater"); + GameRegistry.registerItem(ModItems.boundPlateWater, "boundPlateWater"); + GameRegistry.registerItem(ModItems.boundLeggingsWater, "boundLeggingsWater"); + GameRegistry.registerItem(ModItems.boundBootsWater, "boundBootsWater"); + + GameRegistry.registerItem(ModItems.boundHelmetEarth, "boundHelmetEarth"); + GameRegistry.registerItem(ModItems.boundPlateEarth, "boundPlateEarth"); + GameRegistry.registerItem(ModItems.boundLeggingsEarth, "boundLeggingsEarth"); + GameRegistry.registerItem(ModItems.boundBootsEarth, "boundBootsEarth"); + + GameRegistry.registerItem(ModItems.boundHelmetWind, "boundHelmetWind"); + GameRegistry.registerItem(ModItems.boundPlateWind, "boundPlateWind"); + GameRegistry.registerItem(ModItems.boundLeggingsWind, "boundLeggingsWind"); + GameRegistry.registerItem(ModItems.boundBootsWind, "boundBootsWind"); + + GameRegistry.registerItem(ModItems.boundHelmetFire, "boundHelmetFire"); + GameRegistry.registerItem(ModItems.boundPlateFire, "boundPlateFire"); + GameRegistry.registerItem(ModItems.boundLeggingsFire, "boundLeggingsFire"); + GameRegistry.registerItem(ModItems.boundBootsFire, "boundBootsFire"); + + GameRegistry.registerItem(ModItems.inputRoutingFocus, "inputRoutingFocus"); + GameRegistry.registerItem(ModItems.outputRoutingFocus, "outputRoutingFocus"); + + GameRegistry.registerItem(ModItems.itemIncense, "bloodMagicIncenseItem"); + GameRegistry.registerItem(ModItems.ritualDismantler, "ritualDismantler"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java b/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java index 2d7a4912..30ab2ca8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java @@ -2,5 +2,5 @@ package WayofTime.alchemicalWizardry.api; public interface ILimitingLogic { - int getRoutingLimit(); + public int getRoutingLimit(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java b/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java index 7c8fa226..16facc02 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.api; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; + public class Int3 { @@ -9,11 +9,6 @@ public class Int3 public int yCoord; public int zCoord; - public Int3(BlockPos pos) - { - this(pos.getX(), pos.getY(), pos.getZ()); - } - public Int3(int xCoord, int yCoord, int zCoord) { this.xCoord = xCoord; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java index d77a2e1a..c41cab43 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java @@ -7,9 +7,9 @@ import net.minecraft.item.ItemStack; public class RoutingFocusParadigm { - public List logicList = new LinkedList(); + public List logicList = new LinkedList(); - public List locationList = new LinkedList(); + public List locationList = new LinkedList(); public int maximumAmount = 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusPosAndFacing.java b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusPosAndFacing.java index a49ffee1..a6ee34a9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusPosAndFacing.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusPosAndFacing.java @@ -1,13 +1,13 @@ package WayofTime.alchemicalWizardry.api; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public class RoutingFocusPosAndFacing { public Int3 location; - public EnumFacing facing; + public ForgeDirection facing; - public RoutingFocusPosAndFacing(Int3 location, EnumFacing facing) + public RoutingFocusPosAndFacing(Int3 location, ForgeDirection facing) { this.location = location; this.facing = facing; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java index a6ca090d..6af04910 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java @@ -6,7 +6,7 @@ import java.util.ArrayList; public class AlchemicalPotionCreationHandler { - public static ArrayList registeredPotionEffects = new ArrayList(); + public static ArrayList registeredPotionEffects = new ArrayList(); public static void addPotion(ItemStack itemStack, int potionID, int tickDuration) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java index 99ad2868..dfb24596 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java @@ -8,7 +8,7 @@ import java.util.List; public class AlchemyRecipeRegistry { - public static List recipes = new ArrayList(); + public static List recipes = new ArrayList(); public static void registerRecipe(ItemStack output, int amountNeeded, ItemStack[] recipe, int bloodOrbLevel) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java index cf1a3fdf..165e9ab3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/IReagentHandler.java @@ -1,18 +1,18 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public interface IReagentHandler { - int fill(EnumFacing from, ReagentStack resource, boolean doFill); + int fill(ForgeDirection from, ReagentStack resource, boolean doFill); - ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain); + ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain); - ReagentStack drain(EnumFacing from, int maxDrain, boolean doDrain); + ReagentStack drain(ForgeDirection from, int maxDrain, boolean doDrain); - boolean canFill(EnumFacing from, Reagent reagent); + boolean canFill(ForgeDirection from, Reagent reagent); - boolean canDrain(EnumFacing from, Reagent reagent); + boolean canDrain(ForgeDirection from, Reagent reagent); - ReagentContainerInfo[] getContainerInfo(EnumFacing from); + ReagentContainerInfo[] getContainerInfo(ForgeDirection from); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java index 429587a1..20b43931 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java @@ -9,8 +9,8 @@ import net.minecraft.item.ItemStack; public class ReagentRegistry { - public static Map reagentList = new HashMap(); - public static Map itemToReagentMap = new HashMap(); + public static Map reagentList = new HashMap(); + public static Map itemToReagentMap = new HashMap(); public static Reagent sanctusReagent; public static Reagent incendiumReagent; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java index 8923f3d3..f8583970 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java @@ -28,8 +28,9 @@ public class ReagentStack } int amount = tag.getInteger("amount"); + ReagentStack stack = new ReagentStack(reagent, amount); - return new ReagentStack(reagent, amount); + return stack; } public NBTTagCompound writeToNBT(NBTTagCompound tag) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java index 5a841651..3e754648 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileReagentHandler.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public class TileReagentHandler extends TileEntity implements IReagentHandler { @@ -25,13 +25,13 @@ public class TileReagentHandler extends TileEntity implements IReagentHandler /* IReagentHandler */ @Override - public int fill(EnumFacing from, ReagentStack resource, boolean doFill) + public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) { return tank.fill(resource, doFill); } @Override - public ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain) + public ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain) { if (resource == null || !resource.isReagentEqual(tank.getReagent())) { @@ -41,25 +41,25 @@ public class TileReagentHandler extends TileEntity implements IReagentHandler } @Override - public ReagentStack drain(EnumFacing from, int maxDrain, boolean doDrain) + public ReagentStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { return tank.drain(maxDrain, doDrain); } @Override - public boolean canFill(EnumFacing from, Reagent reagent) + public boolean canFill(ForgeDirection from, Reagent reagent) { return true; } @Override - public boolean canDrain(EnumFacing from, Reagent reagent) + public boolean canDrain(ForgeDirection from, Reagent reagent) { return true; } @Override - public ReagentContainerInfo[] getContainerInfo(EnumFacing from) + public ReagentContainerInfo[] getContainerInfo(ForgeDirection from) { return new ReagentContainerInfo[]{tank.getInfo()}; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java index f965ab7a..d1f2427f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java @@ -1,15 +1,15 @@ 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.minecraft.util.EnumFacing; 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 { @@ -30,7 +30,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente { super(); - this.attunedTankMap = new HashMap(); + this.attunedTankMap = new HashMap(); this.tanks = new ReagentContainer[numberOfTanks]; for (int i = 0; i < numberOfTanks; i++) { @@ -98,7 +98,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente /* ISegmentedReagentHandler */ @Override - public int fill(EnumFacing from, ReagentStack resource, boolean doFill) + public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) { int totalFill = 0; @@ -116,7 +116,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente ReagentStack remainingStack = resource.copy(); remainingStack.amount = maxFill - totalFill; - boolean doesReagentMatch = tanks[i].getReagent() != null && tanks[i].getReagent().isReagentEqual(remainingStack); + boolean doesReagentMatch = tanks[i].getReagent() == null ? false : tanks[i].getReagent().isReagentEqual(remainingStack); if (doesReagentMatch) { @@ -164,7 +164,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente } @Override - public ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain) + public ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain) { if (resource == null) { @@ -197,7 +197,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente /* Only returns the amount from the first available tank */ @Override - public ReagentStack drain(EnumFacing from, int maxDrain, boolean doDrain) + public ReagentStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { for (int i = 0; i < tanks.length; i++) { @@ -212,19 +212,19 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente } @Override - public boolean canFill(EnumFacing from, Reagent reagent) + public boolean canFill(ForgeDirection from, Reagent reagent) { return true; } @Override - public boolean canDrain(EnumFacing from, Reagent reagent) + public boolean canDrain(ForgeDirection from, Reagent reagent) { return true; } @Override - public ReagentContainerInfo[] getContainerInfo(EnumFacing from) + public ReagentContainerInfo[] getContainerInfo(ForgeDirection from) { ReagentContainerInfo[] info = new ReagentContainerInfo[this.getNumberOfTanks()]; for (int i = 0; i < this.getNumberOfTanks(); i++) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java b/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java index bb581251..7e6af770 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipe.java @@ -76,7 +76,7 @@ public class AltarRecipe protected boolean areTagsEqual(NBTTagCompound tag, NBTTagCompound comparedTag) { - Set set = tag.getKeySet(); + Set set = tag.func_150296_c(); for(Object obj : set) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java index 566fbfe9..528e7b75 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java @@ -9,8 +9,8 @@ import net.minecraft.item.ItemStack; public class AltarRecipeRegistry { - public static List altarRecipes = new LinkedList(); - public static Map orbMap = new HashMap(); + public static List altarRecipes = new LinkedList(); + public static Map orbMap = new HashMap(); public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java index 407f74ff..ba069118 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java @@ -7,7 +7,7 @@ import java.util.List; public class BindingRegistry { - public static List bindingRecipes = new LinkedList(); + public static List bindingRecipes = new LinkedList(); public static void registerRecipe(ItemStack output, ItemStack input) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java index d031edd3..3ae2eaf2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java @@ -7,7 +7,7 @@ import java.util.List; public class UnbindingRegistry { - public static List unbindingRecipes = new LinkedList(); + public static List unbindingRecipes = new LinkedList(); public static void addAllUnbindingRecipesFromBinding() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java index 342b9b7d..689b022a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java @@ -15,8 +15,8 @@ import net.minecraft.world.World; */ public class CompressionRegistry { - public static List compressionRegistry = new ArrayList(); - public static Map thresholdMap = new HashMap(); + public static List compressionRegistry = new ArrayList(); + public static Map thresholdMap = new HashMap(); public static void registerHandler(CompressionHandler handler) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java index 448f4712..ddcc3b01 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.api.event; -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; @Cancelable public class AddToNetworkEvent extends Event diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemBindEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemBindEvent.java index 5d78bcd0..95e15da4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemBindEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemBindEvent.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.api.event; +import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event; @Cancelable public class ItemBindEvent extends Event diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainInContainerEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainInContainerEvent.java index 0cd29c51..5a81c1d2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainInContainerEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainInContainerEvent.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Cancelable; @Cancelable public class ItemDrainInContainerEvent extends SoulNetworkEvent diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainNetworkEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainNetworkEvent.java index aa9c32d2..d75fd7dc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainNetworkEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/ItemDrainNetworkEvent.java @@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Cancelable; @Cancelable public class ItemDrainNetworkEvent extends PlayerDrainNetworkEvent diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerAddToNetworkEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerAddToNetworkEvent.java index c4a3820c..f7522557 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerAddToNetworkEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerAddToNetworkEvent.java @@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Cancelable; @Cancelable public class PlayerAddToNetworkEvent extends AddToNetworkEvent diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerDrainNetworkEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerDrainNetworkEvent.java index d70c3267..dacb26d8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerDrainNetworkEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/PlayerDrainNetworkEvent.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Cancelable; @Cancelable public class PlayerDrainNetworkEvent extends SoulNetworkEvent diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualActivatedEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualActivatedEvent.java index 5bcc7eeb..83c10c05 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualActivatedEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualActivatedEvent.java @@ -2,8 +2,8 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.eventhandler.Cancelable; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import cpw.mods.fml.common.eventhandler.Cancelable; @Cancelable public class RitualActivatedEvent extends RitualEvent diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualEvent.java index 36ee929c..fbe1649c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualEvent.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.api.event; -import net.minecraftforge.fml.common.eventhandler.Event; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import cpw.mods.fml.common.eventhandler.Event; public class RitualEvent extends Event { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualRunEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualRunEvent.java index 4b5134b7..4bcf075f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualRunEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/RitualRunEvent.java @@ -1,13 +1,16 @@ package WayofTime.alchemicalWizardry.api.event; -import net.minecraftforge.fml.common.eventhandler.Cancelable; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import cpw.mods.fml.common.eventhandler.Cancelable; @Cancelable public class RitualRunEvent extends RitualEvent { + + public RitualRunEvent(IMasterRitualStone mrs, String ownerKey, String ritualKey) { super(mrs, ownerKey, ritualKey); } + } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/SacrificeKnifeUsedEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/SacrificeKnifeUsedEvent.java index 1849c6c9..04acf352 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/SacrificeKnifeUsedEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/SacrificeKnifeUsedEvent.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; @Cancelable public class SacrificeKnifeUsedEvent extends Event diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/SoulNetworkEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/SoulNetworkEvent.java index 3d60650a..bf47a136 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/SoulNetworkEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/SoulNetworkEvent.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.api.event; -import net.minecraftforge.fml.common.eventhandler.Event; - +import cpw.mods.fml.common.eventhandler.Event; public class SoulNetworkEvent extends Event { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java index 4fc7310f..40c3170e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java @@ -1,50 +1,56 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; /** Fired when a teleposer attempts to transpose two blocks. Use this to perform special cleanup or compensation, or cancel it entirely to prevent the transposition. */ @Cancelable -public class TeleposeEvent extends Event -{ - public final World initialWorld; - public final BlockPos initialPos; +public class TeleposeEvent extends Event { - public final Block initialBlock; - public final IBlockState initialState; + public final World initialWorld; + public final int initialX; + public final int initialY; + public final int initialZ; - public final World finalWorld; - public final BlockPos finalPos; + public final Block initialBlock; + public final int initialMetadata; - public final Block finalBlock; - public final IBlockState finalState; + public final World finalWorld; + public final int finalX; + public final int finalY; + public final int finalZ; - public TeleposeEvent(World wi, BlockPos posi, IBlockState statei, World wf, BlockPos posf, IBlockState statef) - { - initialWorld = wi; - initialPos = posi; + public final Block finalBlock; + public final int finalMetadata; + + public TeleposeEvent(World wi, int xi, int yi, int zi, Block bi, int mi, World wf, int xf, int yf, int zf, Block bf, int mf) { + initialWorld = wi; + initialX = xi; + initialY = yi; + initialZ = zi; - initialState = statei; - initialBlock = initialState.getBlock(); + initialBlock = bi; + initialMetadata = mi; + + finalWorld = wf; + finalX = xf; + finalY = yf; + finalZ = zf; + + finalBlock = bf; + finalMetadata = mf; + } + + public TileEntity getInitialTile() { + return initialWorld.getTileEntity(initialX, initialY, initialZ); + } + + public TileEntity getFinalTile() { + return finalWorld.getTileEntity(finalX, finalY, finalZ); + } - finalWorld = wf; - finalPos = posf; - - finalState = statef; - finalBlock = finalState.getBlock(); - } - - public TileEntity getInitialTile() { - return initialWorld.getTileEntity(initialPos); - } - - public TileEntity getFinalTile() { - return finalWorld.getTileEntity(finalPos); - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/guide/OrbRecipeRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/api/guide/OrbRecipeRenderer.java index 2de81c65..e4926e1e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/guide/OrbRecipeRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/guide/OrbRecipeRenderer.java @@ -1,135 +1,135 @@ -//package WayofTime.alchemicalWizardry.api.guide; -// -//import java.util.ArrayList; -//import java.util.List; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.item.ItemStack; -//import net.minecraft.item.crafting.IRecipe; -//import net.minecraft.util.ResourceLocation; -//import net.minecraft.util.StatCollector; -//import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; -//import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; -//import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; -//import amerifrance.guideapi.ModInformation; -//import amerifrance.guideapi.api.abstraction.CategoryAbstract; -//import amerifrance.guideapi.api.abstraction.EntryAbstract; -//import amerifrance.guideapi.api.abstraction.IRecipeRenderer; -//import amerifrance.guideapi.api.base.Book; -//import amerifrance.guideapi.api.util.GuiHelper; -//import amerifrance.guideapi.gui.GuiBase; -//import cpw.mods.fml.relauncher.ReflectionHelper; -// -//public class OrbRecipeRenderer implements IRecipeRenderer -//{ -// public IRecipe recipe; -// -// public OrbRecipeRenderer(IRecipe recipe) -// { -// this.recipe = recipe; -// } -// -// @Override -// public void draw(Book book, CategoryAbstract category, EntryAbstract entry, -// int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, -// FontRenderer fontRenderer) { -// Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModInformation.GUITEXLOC + "recipe_elements.png")); -// guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 105, 65); -// -// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.shapedOrb"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0); -// if(recipe instanceof ShapelessBloodOrbRecipe) -// { -// ShapelessBloodOrbRecipe shapelessBloodOrbRecipe = (ShapelessBloodOrbRecipe) recipe; -// List list = shapelessBloodOrbRecipe.getInput(); -// -// int width = 3; -// int height = 3; -// for (int y = 0; y < height; y++) { -// for (int x = 0; x < width; x++) { -// if(list.size() - 1 < y * width + x) -// { -// continue; -// } -// -// int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7); -// int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5); -// -// Object component = list.get(y * width + x); -// if (component != null) { -// if (component instanceof ItemStack) { -// GuiHelper.drawItemStack((ItemStack) component, stackX, stackY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { -// guiBase.renderToolTip((ItemStack) component, stackX, stackY); -// } -// } else if (component instanceof Integer) { -// GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { -// guiBase.renderToolTip(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); -// } -// } else { -// if (((ArrayList) component).isEmpty()) return; -// GuiHelper.drawItemStack(((ArrayList) component).get(0), stackX, stackY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { -// guiBase.renderToolTip(((ArrayList) component).get(0), stackX, stackY); -// } -// } -// } -// } -// } -// int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7); -// int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5); -// GuiHelper.drawItemStack(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { -// guiBase.renderToolTip(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY); -// } -// }else -// { -// ShapedBloodOrbRecipe shapedBloodOrbRecipe = (ShapedBloodOrbRecipe) recipe; -// int width = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 4); -// int height = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 5); -// for (int y = 0; y < height; y++) { -// for (int x = 0; x < width; x++) { -// int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7); -// int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5); -// Object component = shapedBloodOrbRecipe.getInput()[y * width + x]; -// if (component != null) { -// if (component instanceof ItemStack) { -// GuiHelper.drawItemStack((ItemStack) component, stackX, stackY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { -// guiBase.renderToolTip((ItemStack) component, stackX, stackY); -// } -// } else if (component instanceof Integer) { -// GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { -// guiBase.renderToolTip(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); -// } -// } else { -// if (((ArrayList) component).isEmpty()) return; -// GuiHelper.drawItemStack(((ArrayList) component).get(0), stackX, stackY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { -// guiBase.renderToolTip(((ArrayList) component).get(0), stackX, stackY); -// } -// } -// } -// } -// } -// int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7); -// int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5); -// GuiHelper.drawItemStack(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { -// guiBase.renderToolTip(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY); -// } -// } -// -// } -// -// @Override -// public void drawExtras(Book book, CategoryAbstract category, -// EntryAbstract entry, int guiLeft, int guiTop, int mouseX, -// int mouseY, GuiBase guiBase, FontRenderer fontRenderer) { -// // TODO Auto-generated method stub -// -// } -// -//} +package WayofTime.alchemicalWizardry.api.guide; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; +import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; +import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; +import amerifrance.guideapi.ModInformation; +import amerifrance.guideapi.api.abstraction.CategoryAbstract; +import amerifrance.guideapi.api.abstraction.EntryAbstract; +import amerifrance.guideapi.api.abstraction.IRecipeRenderer; +import amerifrance.guideapi.api.base.Book; +import amerifrance.guideapi.api.util.GuiHelper; +import amerifrance.guideapi.gui.GuiBase; +import cpw.mods.fml.relauncher.ReflectionHelper; + +public class OrbRecipeRenderer implements IRecipeRenderer +{ + public IRecipe recipe; + + public OrbRecipeRenderer(IRecipe recipe) + { + this.recipe = recipe; + } + + @Override + public void draw(Book book, CategoryAbstract category, EntryAbstract entry, + int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, + FontRenderer fontRenderer) { + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModInformation.GUITEXLOC + "recipe_elements.png")); + guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 105, 65); + + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.shapedOrb"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0); + if(recipe instanceof ShapelessBloodOrbRecipe) + { + ShapelessBloodOrbRecipe shapelessBloodOrbRecipe = (ShapelessBloodOrbRecipe) recipe; + List list = shapelessBloodOrbRecipe.getInput(); + + int width = 3; + int height = 3; + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + if(list.size() - 1 < y * width + x) + { + continue; + } + + int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7); + int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5); + + Object component = list.get(y * width + x); + if (component != null) { + if (component instanceof ItemStack) { + GuiHelper.drawItemStack((ItemStack) component, stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip((ItemStack) component, stackX, stackY); + } + } else if (component instanceof Integer) { + GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); + } + } else { + if (((ArrayList) component).isEmpty()) return; + GuiHelper.drawItemStack(((ArrayList) component).get(0), stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip(((ArrayList) component).get(0), stackX, stackY); + } + } + } + } + } + int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7); + int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5); + GuiHelper.drawItemStack(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { + guiBase.renderToolTip(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY); + } + }else + { + ShapedBloodOrbRecipe shapedBloodOrbRecipe = (ShapedBloodOrbRecipe) recipe; + int width = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 4); + int height = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 5); + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7); + int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5); + Object component = shapedBloodOrbRecipe.getInput()[y * width + x]; + if (component != null) { + if (component instanceof ItemStack) { + GuiHelper.drawItemStack((ItemStack) component, stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip((ItemStack) component, stackX, stackY); + } + } else if (component instanceof Integer) { + GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY); + } + } else { + if (((ArrayList) component).isEmpty()) return; + GuiHelper.drawItemStack(((ArrayList) component).get(0), stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip(((ArrayList) component).get(0), stackX, stackY); + } + } + } + } + } + int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7); + int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5); + GuiHelper.drawItemStack(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { + guiBase.renderToolTip(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY); + } + } + + } + + @Override + public void drawExtras(Book book, CategoryAbstract category, + EntryAbstract entry, int guiLeft, int guiTop, int mouseX, + int mouseY, GuiBase guiBase, FontRenderer fontRenderer) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageAltarRecipe.java b/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageAltarRecipe.java index 7e61a8e5..cbad2be3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageAltarRecipe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageAltarRecipe.java @@ -1,69 +1,69 @@ -//package WayofTime.alchemicalWizardry.api.guide; -// -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.init.Blocks; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import net.minecraft.util.ResourceLocation; -//import net.minecraft.util.StatCollector; -//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; -//import amerifrance.guideapi.api.abstraction.CategoryAbstract; -//import amerifrance.guideapi.api.abstraction.EntryAbstract; -//import amerifrance.guideapi.api.base.Book; -//import amerifrance.guideapi.api.base.PageBase; -//import amerifrance.guideapi.api.util.GuiHelper; -//import amerifrance.guideapi.gui.GuiBase; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -// -//public class PageAltarRecipe extends PageBase { -// -// public ItemStack input; -// public ItemStack output; -// public int tier; -// public int bloodRequired; -// -// public PageAltarRecipe(AltarRecipe recipe) { -// this.input = recipe.getRequiredItem(); -// this.output = recipe.getResult(); -// this.tier = recipe.getMinTier(); -// this.bloodRequired = recipe.getLiquidRequired(); -// } -// -// @Override -// @SideOnly(Side.CLIENT) -// public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) { -// -// Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("alchemicalwizardry" + ":textures/gui/guide/altar.png")); -// guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104); -// -// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.altar"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0); -// -// int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7); -// int inputY = (20) + (guiTop + guiBase.ySize / 5); //1 * 20 -// GuiHelper.drawItemStack(input, inputX, inputY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15)) { -// guiBase.renderToolTip(input, mouseX, mouseY); -// } -// -// if (output == null) { -// output = new ItemStack(Blocks.fire); -// } -// int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7); -// int outputY = (20) + (guiTop + guiBase.xSize / 5); // 1 * 20 -// GuiHelper.drawItemStack(output, outputX, outputY); -// if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { -// guiBase.renderToolTip(output, outputX, outputY); -// } -// -// if (output.getItem() == Item.getItemFromBlock(Blocks.fire)) { -// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D); -// guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("bm.string.tier") + ": " + String.valueOf(tier), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); -// guiBase.drawCenteredString(fontRenderer, "LP: " + String.valueOf(bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0); -// } -// guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.tier"), String.valueOf(tier)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0); -// guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.bloodRequired"), String.valueOf(bloodRequired)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); -// } -//} +package WayofTime.alchemicalWizardry.api.guide; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; +import amerifrance.guideapi.api.abstraction.CategoryAbstract; +import amerifrance.guideapi.api.abstraction.EntryAbstract; +import amerifrance.guideapi.api.base.Book; +import amerifrance.guideapi.api.base.PageBase; +import amerifrance.guideapi.api.util.GuiHelper; +import amerifrance.guideapi.gui.GuiBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PageAltarRecipe extends PageBase { + + public ItemStack input; + public ItemStack output; + public int tier; + public int bloodRequired; + + public PageAltarRecipe(AltarRecipe recipe) { + this.input = recipe.getRequiredItem(); + this.output = recipe.getResult(); + this.tier = recipe.getMinTier(); + this.bloodRequired = recipe.getLiquidRequired(); + } + + @Override + @SideOnly(Side.CLIENT) + public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) { + + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("alchemicalwizardry" + ":textures/gui/guide/altar.png")); + guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104); + + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.altar"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0); + + int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7) + 1; + int inputY = (20) + (guiTop + guiBase.ySize / 5) - 1; //1 * 20 + GuiHelper.drawItemStack(input, inputX, inputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15)) { + guiBase.renderToolTip(input, mouseX, mouseY); + } + + if (output == null) { + output = new ItemStack(Blocks.fire); + } + int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7) + 1; + int outputY = (20) + (guiTop + guiBase.xSize / 5) - 1; // 1 * 20 + GuiHelper.drawItemStack(output, outputX, outputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { + guiBase.renderToolTip(output, outputX, outputY); + } + + if (output.getItem() == Item.getItemFromBlock(Blocks.fire)) { + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D); + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("bm.string.tier") + ": " + String.valueOf(tier), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); + guiBase.drawCenteredString(fontRenderer, "LP: " + String.valueOf(bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0); + } + guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.tier"), String.valueOf(tier)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0); + guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.bloodRequired"), String.valueOf(bloodRequired)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageMultiBlock.java b/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageMultiBlock.java index 0a0678f6..09f510c2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageMultiBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/guide/PageMultiBlock.java @@ -1,145 +1,145 @@ -//package WayofTime.alchemicalWizardry.api.guide; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.client.renderer.RenderHelper; -//import net.minecraft.client.renderer.entity.RenderItem; -//import net.minecraft.item.ItemStack; -// -//import org.lwjgl.opengl.GL11; -//import org.lwjgl.opengl.GL12; -// -//import amerifrance.guideapi.api.abstraction.CategoryAbstract; -//import amerifrance.guideapi.api.abstraction.EntryAbstract; -//import amerifrance.guideapi.api.base.Book; -//import amerifrance.guideapi.api.base.PageBase; -//import amerifrance.guideapi.gui.GuiBase; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -// -//public class PageMultiBlock extends PageBase -//{ -// ItemStack[][][] structure; -// boolean canTick = false; -// int tick = 0; -// int showLayer = -1; -// float scaleFactor = 1; -// -// boolean renderMouseOver = true; -// -// public PageMultiBlock(ItemStack[][][] structure) -// { -// this.structure = structure; -// initPage(structure); -// } -// -// int blockCount=0; -// int[] countPerLevel; -// int structureHeight = 0; -// int structureLength = 0; -// int structureWidth = 0; -// -// public void initPage(ItemStack[][][] structure) -// { -// structureHeight = structure.length; -// structureWidth=0; -// structureLength=0; -// countPerLevel = new int[structureHeight]; -// blockCount=0; -// for(int h=0; hstructureLength) -// structureLength = structure[h].length-1; -// int perLvl=0; -// for(int l=0; lstructureWidth) -// structureWidth = structure[h][l].length-1; -// for(ItemStack ss : structure[h][l]) -// if(ss!=null) -// perLvl++; -// } -// countPerLevel[h] = perLvl; -// blockCount += perLvl; -// } -// tick= (showLayer==-1?blockCount:countPerLevel[showLayer])*40; -//// int yOff = (structureHeight-1)*12+structureWidth*5+structureLength*5+16; -//// pageButtons.add(new GuiButtonManualNavigation(gui, 100, x+4,y+yOff/2-5, 10,10, 4)); -//// pageButtons.add(new GuiButtonManualNavigation(gui, 101, x+4,y+yOff/2-8-16, 10,16, 3)); -//// pageButtons.add(new GuiButtonManualNavigation(gui, 102, x+4,y+yOff/2+8, 10,16, 2)); -// } -// -// @Override -// @SideOnly(Side.CLIENT) -// public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) -// { -//// if(multiblock.getStructureManual()!=null) -// Minecraft mc = Minecraft.getMinecraft(); -// -// int x = guiLeft + 32; -// int y = guiTop + 30; -// { -// if(canTick) -// tick++; -// -// int prevLayers = 0; -// if(showLayer!=-1) -// for(int ll=0; ll=0; l--) -// { -// ItemStack[] row = level[l]; -// for(int w=row.length-1; w>=0; w--) -// { -// int xx = 60 +xHalf -10*w +10*l -7; -// int yy = yOffPartial - 5*w - 5*l -12*h; -// GL11.glTranslated(0, 0, 1); -// if(row[w]!=null && i<=limiter) -// { -// i++; -// RenderItem.getInstance().renderItemIntoGUI(mc.fontRendererObj, mc.renderEngine, row[w], x+xx, y+yy); -// if(mouseX>=x+xx&&mouseX=y+yy&&mouseYstructureLength) + structureLength = structure[h].length-1; + int perLvl=0; + for(int l=0; lstructureWidth) + structureWidth = structure[h][l].length-1; + for(ItemStack ss : structure[h][l]) + if(ss!=null) + perLvl++; + } + countPerLevel[h] = perLvl; + blockCount += perLvl; + } + tick= (showLayer==-1?blockCount:countPerLevel[showLayer])*40; +// int yOff = (structureHeight-1)*12+structureWidth*5+structureLength*5+16; +// pageButtons.add(new GuiButtonManualNavigation(gui, 100, x+4,y+yOff/2-5, 10,10, 4)); +// pageButtons.add(new GuiButtonManualNavigation(gui, 101, x+4,y+yOff/2-8-16, 10,16, 3)); +// pageButtons.add(new GuiButtonManualNavigation(gui, 102, x+4,y+yOff/2+8, 10,16, 2)); + } + + @Override + @SideOnly(Side.CLIENT) + public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) + { +// if(multiblock.getStructureManual()!=null) + Minecraft mc = Minecraft.getMinecraft(); + + int x = guiLeft + 32; + int y = guiTop + 30; + { + if(canTick) + tick++; + + int prevLayers = 0; + if(showLayer!=-1) + for(int ll=0; ll=0; l--) + { + ItemStack[] row = level[l]; + for(int w=row.length-1; w>=0; w--) + { + int xx = 60 +xHalf -10*w +10*l -7; + int yy = yOffPartial - 5*w - 5*l -12*h; + GL11.glTranslated(0, 0, 1); + if(row[w]!=null && i<=limiter) + { + i++; + RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, row[w], x+xx, y+yy); + if(mouseX>=x+xx&&mouseX=y+yy&&mouseY ritualComponents) -// { -// int minX = 0; -// int minY = 0; -// int minZ = 0; -// -// int maxX = 0; -// int maxY = 0; -// int maxZ = 0; -// -// for(RitualComponent comp : ritualComponents) -// { -// minX = Math.min(comp.getX(), minX); -// minY = Math.min(comp.getY(), minY); -// minZ = Math.min(comp.getZ(), minZ); -// -// maxX = Math.max(comp.getX(), maxX); -// maxY = Math.max(comp.getY(), maxY); -// maxZ = Math.max(comp.getZ(), maxZ); -// } -// -// System.out.println("Min: (" + minX + ", " + minY + ", " + minZ + "), Max: (" + maxX + ", " + maxY + ", " + maxZ + ")"); -// -// ItemStack[][][] tempStructure = new ItemStack[maxY-minY+1][maxX-minX+1][maxZ-minZ+1]; //First value is vertical, second is down to the left, third is down to the right -// -// for(RitualComponent comp : ritualComponents) -// { -// tempStructure[comp.getY() - minY][comp.getX() - minX][comp.getZ() - minZ] = getStackForRitualStone(comp.getStoneType()); -// } -// + } + + private PageRitualMultiBlock(ItemStack[][][] structure) + { + super(structure); + } + + public static PageRitualMultiBlock getPageForRitual(String ritualID) + { + return getPageForRitual(Rituals.getRitualList(ritualID)); + } + + public static PageRitualMultiBlock getPageForRitual(List ritualComponents) + { + int minX = 0; + int minY = 0; + int minZ = 0; + + int maxX = 0; + int maxY = 0; + int maxZ = 0; + + for(RitualComponent comp : ritualComponents) + { + minX = Math.min(comp.getX(), minX); + minY = Math.min(comp.getY(), minY); + minZ = Math.min(comp.getZ(), minZ); + + maxX = Math.max(comp.getX(), maxX); + maxY = Math.max(comp.getY(), maxY); + maxZ = Math.max(comp.getZ(), maxZ); + } + + System.out.println("Min: (" + minX + ", " + minY + ", " + minZ + "), Max: (" + maxX + ", " + maxY + ", " + maxZ + ")"); + + ItemStack[][][] tempStructure = new ItemStack[maxY-minY+1][maxX-minX+1][maxZ-minZ+1]; //First value is vertical, second is down to the left, third is down to the right + + for(RitualComponent comp : ritualComponents) + { + tempStructure[comp.getY() - minY][comp.getX() - minX][comp.getZ() - minZ] = getStackForRitualStone(comp.getStoneType()); + } + // tempStructure[-minY][-minX][-minZ] = new ItemStack(ModBlocks.blockMasterStone); -// -// return new PageRitualMultiBlock(tempStructure); -// } -// -// private static ItemStack getStackForRitualStone(int type) -// { -// switch(type) -// { -// case RitualComponent.BLANK: -// return blankStone; -// case RitualComponent.WATER: -// return waterStone; -// case RitualComponent.FIRE: -// return fireStone; -// case RitualComponent.EARTH: -// return earthStone; -// case RitualComponent.AIR: -// return airStone; -// case RitualComponent.DUSK: -// return duskStone; -// case RitualComponent.DAWN: -// return dawnStone; -// } -// return blankStone; -// } -//} + + return new PageRitualMultiBlock(tempStructure); + } + + private static ItemStack getStackForRitualStone(int type) + { + switch(type) + { + case RitualComponent.BLANK: + return blankStone; + case RitualComponent.WATER: + return waterStone; + case RitualComponent.FIRE: + return fireStone; + case RitualComponent.EARTH: + return earthStone; + case RitualComponent.AIR: + return airStone; + case RitualComponent.DUSK: + return duskStone; + case RitualComponent.DAWN: + return dawnStone; + } + return blankStone; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java index 2d5e884b..aac57f57 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java @@ -1,30 +1,28 @@ package WayofTime.alchemicalWizardry.api.harvest; +import net.minecraft.block.Block; +import net.minecraft.world.World; + import java.util.ArrayList; import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; - public class HarvestRegistry { - public static List handlerList = new ArrayList(); + public static List handlerList = new ArrayList(); public static void registerHarvestHandler(IHarvestHandler handler) { handlerList.add(handler); } - public static boolean harvestBlock(World world, BlockPos pos) + public static boolean harvestBlock(World world, int xCoord, int yCoord, int zCoord) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); + Block block = world.getBlock(xCoord, yCoord, zCoord); + int meta = world.getBlockMetadata(xCoord, yCoord, zCoord); for (IHarvestHandler handler : handlerList) { - if (handler.harvestAndPlant(world, pos, block, state)) + if (handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta)) { return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java index d7dc78a8..0d5fb32b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java @@ -1,8 +1,6 @@ package WayofTime.alchemicalWizardry.api.harvest; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; public interface IHarvestHandler @@ -11,8 +9,12 @@ 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 */ - boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state); + boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java index 40773cb5..2d7325ca 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java @@ -8,7 +8,7 @@ import java.util.Set; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -18,12 +18,12 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; 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.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; import WayofTime.alchemicalWizardry.api.spell.SpellEffect; @@ -43,6 +43,12 @@ public class ItemSpellMultiTool extends Item this.setMaxStackSize(1); this.setFull3D(); } + + @Override + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundTool"); + } @Override public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) @@ -92,7 +98,7 @@ public class ItemSpellMultiTool extends Item } @Override - public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) + public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { if (player.worldObj.isRemote) { @@ -103,23 +109,23 @@ public class ItemSpellMultiTool extends Item return false; World world = player.worldObj; - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); + Block block = player.worldObj.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); if (block == null || block == Blocks.air) return false; int hlvl = -1; - float blockHardness = block.getBlockHardness(world, pos); + float blockHardness = block.getBlockHardness(world, x, y, z); MovingObjectPosition mop = APISpellHelper.raytraceFromEntity(world, player, true, 5.0D); - IBlockState localState = world.getBlockState(pos); - Block localBlock = state.getBlock(); - String toolClass = block.getHarvestTool(state); + 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(state); + hlvl = block.getHarvestLevel(meta); int toolLevel = this.getHarvestLevel(stack, toolClass); - float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, pos); + float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, x, y, z); if (hlvl <= toolLevel && localHardness - 1.5 <= blockHardness) { @@ -133,7 +139,7 @@ public class ItemSpellMultiTool extends Item String localToolClass = this.getToolClassForMaterial(localBlock.getMaterial()); - if (localToolClass != null && this.getHarvestLevel(stack, toolClass) >= localBlock.getHarvestLevel(localState)) + if (localToolClass != null && this.getHarvestLevel(stack, toolClass) >= localBlock.getHarvestLevel(localMeta)) { isEffective = true; } @@ -148,31 +154,31 @@ public class ItemSpellMultiTool extends Item { if (isEffective) { - if (localBlock.removedByPlayer(world, pos, player, true)) + if (localBlock.removedByPlayer(world, player, x, y, z, true)) { - localBlock.onBlockDestroyedByPlayer(world, pos, localState); + localBlock.onBlockDestroyedByPlayer(world, x, y, z, localMeta); } - localBlock.onBlockHarvested(world, pos, localState, player); + localBlock.onBlockHarvested(world, x, y, z, localMeta, player); if (blockHardness > 0f) - onBlockDestroyed(stack, world, localBlock, pos, player); + onBlockDestroyed(stack, world, localBlock, x, y, z, player); - List items = APISpellHelper.getItemsFromBlock(world, pos, localBlock, localState, this.getSilkTouch(stack), this.getFortuneLevel(stack)); + List items = APISpellHelper.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) { - APISpellHelper.spawnItemListInWorld(newItems, world, pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f); + APISpellHelper.spawnItemListInWorld(newItems, world, x + 0.5f, y + 0.5f, z + 0.5f); } - world.markBlockForUpdate(pos); + 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, localState, pos, mop.field_178784_b); + cost += parad.onBreakBlock(stack, world, player, localBlock, localMeta, x, y, z, ForgeDirection.getOrientation(mop.sideHit)); if (cost > 0) { @@ -180,14 +186,14 @@ public class ItemSpellMultiTool extends Item } } else { - world.setBlockToAir(pos); - world.markBlockForUpdate(pos); + world.setBlockToAir(x, y, z); + world.func_147479_m(x, y, z); } } else { - world.setBlockToAir(pos); - world.markBlockForUpdate(pos); + world.setBlockToAir(x, y, z); + world.func_147479_m(x, y, z); } } } @@ -252,7 +258,7 @@ public class ItemSpellMultiTool extends Item public Set getToolClasses(ItemStack stack) { - Set set = new HashSet(); + Set set = new HashSet(); if (this.getHarvestLevel(stack, "pickaxe") > -1) { @@ -273,14 +279,18 @@ public class ItemSpellMultiTool extends Item } @Override - public float getDigSpeed(ItemStack stack, IBlockState state) + public float getDigSpeed(ItemStack stack, Block block, int meta) { - Block block = state.getBlock(); - String toolClass = block.getHarvestTool(state); + String toolClass = block.getHarvestTool(meta); if (toolClass == null || toolClass.equals("")) { - return 1.0f; + toolClass = getToolClassOfMaterial(block.getMaterial()); + + if(toolClass == "") + { + return 1.0f; + } } { if (stack.hasTagCompound()) @@ -296,6 +306,26 @@ public class ItemSpellMultiTool extends Item return 1.0f; } + + public String getToolClassOfMaterial(Material mat) + { + if(mat == Material.iron || mat == Material.anvil || mat == Material.rock) + { + return "pickaxe"; + } + + if(mat == Material.wood || mat == Material.plants || mat == Material.vine) + { + return "axe"; + } + + if(mat == Material.ground || mat == Material.grass) + { + return "shovel"; + } + + return ""; + } @Override public int getHarvestLevel(ItemStack stack, String toolClass) @@ -369,7 +399,7 @@ public class ItemSpellMultiTool extends Item MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); - int cost; + int cost = 0; if (mop != null && mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) { @@ -549,7 +579,10 @@ public class ItemSpellMultiTool extends Item public void setDuration(ItemStack container, World world, int duration) { - if (!world.isRemote) + if (world.isRemote) + { + return; + } else { World overWorld = DimensionManager.getWorld(0); long worldtime = overWorld.getTotalWorldTime(); @@ -629,10 +662,10 @@ public class ItemSpellMultiTool extends Item NBTTagList tagList = tagiest.getTagList("Effects", Constants.NBT.TAG_COMPOUND); - List spellEffectList = new LinkedList(); + List spellEffectList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = tagList.getCompoundTagAt(i); + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); SpellEffect eff = SpellEffect.getEffectFromTag(tag); if (eff != null) @@ -726,10 +759,10 @@ public class ItemSpellMultiTool extends Item NBTTagList tagList = tagiest.getTagList("ToolTips", Constants.NBT.TAG_COMPOUND); - List toolTipList = new LinkedList(); + List toolTipList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = tagList.getCompoundTagAt(i); + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); String str = tag.getString("tip"); if (str != null) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapedBloodOrbRecipe.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapedBloodOrbRecipe.java index ca2122bd..83461f3f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapedBloodOrbRecipe.java +++ b/src/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,7 +9,12 @@ 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; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; /** * Shaped Blood Orb Recipe Handler by joshie * @@ -278,10 +278,4 @@ public class ShapedBloodOrbRecipe implements IRecipe { return this.input; } - - @Override - public ItemStack[] func_179532_b(InventoryCrafting inventory) - { - return new ItemStack[1]; - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java index 0040f745..80662b3b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java @@ -134,7 +134,7 @@ public class ShapelessBloodOrbRecipe implements IRecipe //If target is integer, then we should be check the blood orb value of the item instead if (next instanceof Integer) { - if (slot.getItem() instanceof IBloodOrb) + if (slot != null && slot.getItem() instanceof IBloodOrb) { IBloodOrb orb = (IBloodOrb) slot.getItem(); if (orb.getOrbLevel() < (Integer) next) @@ -177,10 +177,4 @@ public class ShapelessBloodOrbRecipe implements IRecipe { return this.input; } - - @Override - public ItemStack[] func_179532_b(InventoryCrafting inventory) - { - return new ItemStack[1]; - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java index 2189a6ed..03094a88 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java @@ -2,21 +2,13 @@ package WayofTime.alchemicalWizardry.api.items.interfaces; import net.minecraft.item.ItemStack; -public interface IRitualDiviner -{ +public interface IRitualDiviner { int cycleDirection(ItemStack stack); - String getCurrentRitual(ItemStack stack); - int getDirection(ItemStack stack); - int getMaxRuneDisplacement(ItemStack stack); - String getNameForDirection(int direction); - void setCurrentRitual(ItemStack stack, String ritualID); - void setDirection(ItemStack stack, int direction); - void setMaxRuneDisplacement(ItemStack stack, int displacement); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/renderer/MRSRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/api/renderer/MRSRenderer.java index 8200f4e2..7eea34c1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/renderer/MRSRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/renderer/MRSRenderer.java @@ -1,6 +1,7 @@ package WayofTime.alchemicalWizardry.api.renderer; -import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.ResourceLocation; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; @@ -8,8 +9,13 @@ public abstract class MRSRenderer { public abstract void renderAt(IMasterRitualStone tile, double x, double y, double z); - protected void bindTexture(ResourceLocation location) + protected void bindTexture(ResourceLocation p_147499_1_) { - Minecraft.getMinecraft().getTextureManager().bindTexture(location); + TextureManager texturemanager = TileEntityRendererDispatcher.instance.field_147553_e; + + if (texturemanager != null) + { + texturemanager.bindTexture(p_147499_1_); + } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java index 8b38ecac..3577ad47 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IMasterRitualStone.java @@ -1,13 +1,12 @@ package WayofTime.alchemicalWizardry.api.rituals; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; public interface IMasterRitualStone extends ISegmentedReagentHandler { - void performRitual(World world, BlockPos pos, String ritualID); + void performRitual(World world, int x, int y, int z, String ritualID); String getOwner(); @@ -23,9 +22,13 @@ public interface IMasterRitualStone extends ISegmentedReagentHandler int getDirection(); - World getWorldObj(); + World getWorld(); - BlockPos getPosition(); + int getXCoord(); + + int getYCoord(); + + int getZCoord(); NBTTagCompound getCustomRitualTag(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java index 74d1e9a8..3ea6d90e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/IRitualStone.java @@ -1,7 +1,5 @@ package WayofTime.alchemicalWizardry.api.rituals; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; public interface IRitualStone @@ -9,10 +7,12 @@ public interface IRitualStone /** * x, y, and z give the position of the Ritual Stone * @param world - * @param pos - * @param state + * @param x + * @param y + * @param z + * @param meta * @param runeType * @return */ - boolean isRuneType(World world, BlockPos pos, IBlockState state, int runeType); + boolean isRuneType(World world, int x, int y, int z, int meta, int runeType); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java index d9d7cdfc..e5a3241b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/LocalRitualStorage.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.api.rituals; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import WayofTime.alchemicalWizardry.api.Int3; /** * This class is used to pass ritual-specific data into the RitualEffect from the containing Master Ritual Stone. This is basically used as auxillarary storage, @@ -10,27 +10,33 @@ import net.minecraft.util.BlockPos; */ public class LocalRitualStorage { - public BlockPos coords; + public int xCoord; + public int yCoord; + public int zCoord; public void writeToNBT(NBTTagCompound tag) { - tag.setInteger("xCoord", coords.getX()); - tag.setInteger("yCoord", coords.getY()); - tag.setInteger("zCoord", coords.getZ()); + tag.setInteger("xCoord", xCoord); + tag.setInteger("yCoord", yCoord); + tag.setInteger("zCoord", zCoord); } public void readFromNBT(NBTTagCompound tag) { - this.coords = new BlockPos(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord")); + this.xCoord = tag.getInteger("xCoord"); + this.yCoord = tag.getInteger("yCoord"); + this.zCoord = tag.getInteger("zCoord"); } - public BlockPos getLocation() + public Int3 getLocation() { - return coords; + return new Int3(xCoord, yCoord, zCoord); } - public void setLocation(BlockPos location) + public void setLocation(Int3 location) { - this.coords = location; + this.xCoord = location.xCoord; + this.yCoord = location.yCoord; + this.zCoord = location.zCoord; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java index 8bbe8397..85f291c7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; @@ -17,7 +17,10 @@ public abstract class RitualEffect return true; } - public void onRitualBroken(IMasterRitualStone ritualStone, RitualBreakMethod method) {} + public void onRitualBroken(IMasterRitualStone ritualStone, RitualBreakMethod method) + { + + } public abstract int getCostPerRefresh(); @@ -37,13 +40,13 @@ public abstract class RitualEffect ReagentStack reagentStack = new ReagentStack(reagent, amount); - ReagentStack stack = ritualStone.drain(EnumFacing.UP, reagentStack, false); + ReagentStack stack = ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, false); if (stack != null && stack.amount >= amount) { if (doDrain) { - ritualStone.drain(EnumFacing.UP, reagentStack, true); + ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, true); } return true; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java index a45f0fd1..4b9a48c6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java @@ -6,16 +6,14 @@ import java.util.List; import java.util.Map; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.Event; import WayofTime.alchemicalWizardry.api.event.RitualRunEvent; import WayofTime.alchemicalWizardry.api.event.RitualStopEvent; import WayofTime.alchemicalWizardry.api.renderer.MRSRenderer; +import cpw.mods.fml.common.eventhandler.Event; public class Rituals { @@ -26,8 +24,8 @@ public class Rituals public final 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) { @@ -97,11 +95,11 @@ public class Rituals } } - public static String checkValidRitual(World world, BlockPos pos) + public static String checkValidRitual(World world, int x, int y, int z) { for (String key : ritualMap.keySet()) { - if (checkRitualIsValid(world, pos, key)) + if (checkRitualIsValid(world, x, y, z, key)) { return key; } @@ -124,9 +122,9 @@ public class Rituals return false; } - public static boolean checkRitualIsValid(World world, BlockPos pos, String ritualID) + public static boolean checkRitualIsValid(World world, int x, int y, int z, String ritualID) { - int direction = Rituals.getDirectionOfRitual(world, pos, ritualID); + int direction = Rituals.getDirectionOfRitual(world, x, y, z, ritualID); return direction != -1; } @@ -137,7 +135,7 @@ public class Rituals * 3 - SOUTH * 4 - WEST */ - public static boolean checkDirectionOfRitualValid(World world, BlockPos pos, String ritualID, int direction) + public static boolean checkDirectionOfRitualValid(World world, int x, int y, int z, String ritualID, int direction) { List ritual = Rituals.getRitualList(ritualID); @@ -146,18 +144,15 @@ public class Rituals return false; } - IBlockState testState; Block test; TileEntity te; for (RitualComponent rc : ritual) { - BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction)); - testState = world.getBlockState(newPos); - test = testState.getBlock(); - te = world.getTileEntity(newPos); + test = world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); + te = world.getTileEntity(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); - if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, newPos, testState, rc.getStoneType())) + if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, x + rc.getX(direction), y, z+ rc.getZ(direction), world.getBlockMetadata(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)), rc.getStoneType())) && !(te instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType()))) { return false; @@ -167,11 +162,11 @@ public class Rituals return true; } - public static int getDirectionOfRitual(World world, BlockPos pos, String ritualID) + public static int getDirectionOfRitual(World world, int x, int y, int z, String ritualID) { for (int i = 1; i <= 4; i++) { - if (Rituals.checkDirectionOfRitualValid(world, pos, ritualID, i)) + if (Rituals.checkDirectionOfRitualValid(world, x, y, z, ritualID, i)) { return i; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/sacrifice/PlayerSacrificeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/sacrifice/PlayerSacrificeHandler.java index af286e12..1e3db2b2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/sacrifice/PlayerSacrificeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/sacrifice/PlayerSacrificeHandler.java @@ -1,11 +1,10 @@ package WayofTime.alchemicalWizardry.api.sacrifice; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; @@ -13,6 +12,7 @@ public class PlayerSacrificeHandler { public static float scalingOfSacrifice = 0.001f; public static int soulFrayDuration = 400; + public static Potion soulFrayId; public static float getPlayerIncense(EntityPlayer player) { return APISpellHelper.getCurrentIncense(player); @@ -41,7 +41,7 @@ public class PlayerSacrificeHandler public static boolean sacrificePlayerHealth(EntityPlayer player) { - if(player.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) + if(player.isPotionActive(soulFrayId)) { return false; } @@ -61,7 +61,7 @@ public class PlayerSacrificeHandler { player.setHealth(maxHealth/10.0f); setPlayerIncense(player, 0); - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, soulFrayDuration)); + player.addPotionEffect(new PotionEffect(soulFrayId.id, soulFrayDuration)); return true; } @@ -78,7 +78,10 @@ public class PlayerSacrificeHandler public static boolean findAndFillAltar(World world, EntityPlayer player, int amount) { - IBloodAltar altarEntity = getAltar(world, player.getPosition()); + int posX = (int) Math.round(player.posX - 0.5f); + int posY = (int) player.posY; + int posZ = (int) Math.round(player.posZ - 0.5f); + IBloodAltar altarEntity = getAltar(world, posX, posY, posZ); if (altarEntity == null) { @@ -91,7 +94,7 @@ public class PlayerSacrificeHandler return true; } - public static IBloodAltar getAltar(World world, BlockPos pos) + public static IBloodAltar getAltar(World world, int x, int y, int z) { TileEntity tileEntity; @@ -101,7 +104,7 @@ public class PlayerSacrificeHandler { for (int k = -2; k <= 1; k++) { - tileEntity = world.getTileEntity(pos.add(i, j, k)); + tileEntity = world.getTileEntity(i + x, k + y, j + z); if(tileEntity instanceof IBloodAltar) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java index 0718624a..c9b69311 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java @@ -12,9 +12,11 @@ import java.util.Map.Entry; import java.util.UUID; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.mojang.authlib.GameProfile; /** @@ -23,17 +25,46 @@ import com.google.gson.GsonBuilder; public class ComplexNetworkHandler { public static String fileName = "config/BloodMagic/soulnetworkKeys"; - static HashMap keyMap = new HashMap(); + static HashMap keyMap = new HashMap(); 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); + String str = uuid.toString(); + //TODO ServerConfigurationManager d.createPlayerForUser + UUID.fromString(str); + return null; + } public static String getKeyForPlayer(EntityPlayer player) { return ""; } + public static UUID getUUIDForKey(String key) + { +// if (MinecraftServer.getServer() == null) +// { +// return null; +// } +// +// World world = MinecraftServer.getServer().worldServers[0]; +// UUIDKeyMap data = (UUIDKeyMap) world.loadItemData(UUIDKeyMap.class, key); +// +// if (data == null) +// { +// data = new UUIDKeyMap(key); +// world.setItemData(key, data); +// } + return null; + } + public static String assignKeyToPlayer(EntityPlayer player) { return ""; @@ -70,8 +101,9 @@ public class ComplexNetworkHandler try { br = new BufferedReader(new FileReader(save)); - - keyMap = gson.fromJson(br, keyMap.getClass()); + HashMap schema = gson.fromJson(br, keyMap.getClass()); + + keyMap = schema; if(keyMap != null) { @@ -85,6 +117,7 @@ public class ComplexNetworkHandler e.printStackTrace(); } } + else { keyMap = null; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java index ea051a0d..d9f30f41 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java @@ -9,42 +9,16 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.Event; -import net.minecraftforge.fml.common.eventhandler.Event.Result; import WayofTime.alchemicalWizardry.api.event.AddToNetworkEvent; import WayofTime.alchemicalWizardry.api.event.ItemBindEvent; import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent; import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.Result; public class SoulNetworkHandler { - public static boolean canSyphonInContainer(ItemStack ist, int damageToBeDone) - { - if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) - { - String ownerName = ist.getTagCompound().getString("ownerName"); - - if (MinecraftServer.getServer() == null) - { - return false; - } - - 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); - } - - return data.currentEssence >= damageToBeDone; - } - - return false; - } - public static boolean syphonFromNetworkWhileInContainer(ItemStack ist, int damageToBeDone) { String ownerName = ""; @@ -422,7 +396,7 @@ public class SoulNetworkHandler public static String getUsername(EntityPlayer player) { - return player.getName(); + return player.getCommandSenderName(); } public static EntityPlayer getPlayerForUsername(String str) @@ -431,7 +405,7 @@ public class SoulNetworkHandler { return null; } - return MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(str); + return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str); } public static void causeNauseaToPlayer(ItemStack stack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java index 452085ec..ed3f65ad 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/APISpellHelper.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -14,15 +13,14 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.GameRegistry; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; +import cpw.mods.fml.common.registry.GameRegistry; public class APISpellHelper { @@ -232,7 +230,7 @@ public class APISpellHelper if (!world.isRemote && player instanceof EntityPlayer) d1 += 1.62D; double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; - Vec3 vec3 = new Vec3(d0, d1, d2); + Vec3 vec3 = APISpellHelper.createVec3(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); float f5 = -MathHelper.cos(-f1 * 0.017453292F); @@ -244,33 +242,56 @@ public class APISpellHelper // d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance(); } Vec3 vec31 = vec3.addVector((double) f7 * range, (double) f6 * range, (double) f8 * range); - return world.rayTraceBlocks(vec3, vec31, par3, !par3, par3); + return world.func_147447_a(vec3, vec31, par3, !par3, par3); } - public static List getItemsFromBlock(World world, BlockPos pos, Block block, IBlockState state, boolean silkTouch, int fortune) + public static Vec3 createVec3(double x, double y, double z) + { + return Vec3.createVectorHelper(x, y, z); + } + + 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, pos, state, null); //Null player + boolean canSilk = block.canSilkHarvest(world, null, x, y, z, meta); if (canSilk && silkTouch) { ArrayList items = new ArrayList(); - ItemStack item = new ItemStack(block, 1, block.getMetaFromState(state)); - + ItemStack item = createStackedBlock(block, meta); + items.add(item); return items; } else { - return block.getDrops(world, pos, state, fortune); + return block.getDrops(world, x, y, z, meta, fortune); } } + public static ItemStack createStackedBlock(Block block, int meta) + { + int j = 0; + if(block == Blocks.lit_redstone_ore) + { + block = Blocks.redstone_ore; + } + + Item item = Item.getItemFromBlock(block); + + if (item != null && item.getHasSubtypes()) + { + j = meta; + } + + return new ItemStack(item, 1, j); + } + 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.setDefaultPickupDelay(); + itemEntity.delayBeforeCanPickup = 10; world.spawnEntityInWorld(itemEntity); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java index c4afda4e..51657249 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java @@ -6,24 +6,20 @@ import java.util.LinkedList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; 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.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class EntitySpellProjectile extends Entity implements IProjectile { @@ -45,10 +41,10 @@ public class EntitySpellProjectile extends Entity implements IProjectile //Custom variables private int maxRicochet = 0; private float damage = 1; - public List impactList = new ArrayList(); + public List impactList = new ArrayList(); private boolean penetration = false; - public List updateEffectList = new ArrayList(); - public List spellEffectList = new LinkedList(); + public List updateEffectList = new ArrayList(); + public List spellEffectList = new LinkedList(); private int blocksBroken = 0; public EntitySpellProjectile(World par1World) @@ -62,6 +58,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile super(par1World); this.setSize(0.5F, 0.5F); this.setPosition(par2, par4, par6); + yOffset = 0.0F; } public EntitySpellProjectile(World par1World, EntityPlayer par2EntityPlayer) @@ -75,6 +72,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile 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); @@ -113,6 +111,18 @@ public class EntitySpellProjectile extends Entity implements IProjectile 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 @SideOnly(Side.CLIENT) /** @@ -148,7 +158,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile } if (shootingEntity == null) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); + 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; @@ -172,15 +182,14 @@ public class EntitySpellProjectile extends Entity implements IProjectile prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI); prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI); } - IBlockState state = worldObj.getBlockState(new BlockPos(xTile, yTile, zTile)); - Block var16 = state.getBlock(); + Block var16 = worldObj.getBlock(xTile, yTile, zTile); if (var16 != null) { - var16.setBlockBoundsBasedOnState(worldObj, new BlockPos(xTile, yTile, zTile)); - AxisAlignedBB var2 = var16.getCollisionBoundingBox(worldObj, new BlockPos(xTile, yTile, zTile), state); + var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); + AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); - if (var2 != null && var2.isVecInside(new Vec3(posX, posY, posZ))) + if (var2 != null && var2.isVecInside(APISpellHelper.createVec3(posX, posY, posZ))) { inGround = true; } @@ -188,7 +197,14 @@ public class EntitySpellProjectile extends Entity implements IProjectile if (inGround) { + Block var18 = worldObj.getBlock(xTile, yTile, zTile); + int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile); +// if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) + { + // this.groundImpact(); + // this.setDead(); + } } else { ++ticksInAir; @@ -202,19 +218,19 @@ public class EntitySpellProjectile extends Entity implements IProjectile } } - Vec3 var17 = new Vec3(posX, posY, posZ); - Vec3 var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); - MovingObjectPosition var4 = worldObj.rayTraceBlocks(var17, var3, true, false, false); - var17 = new Vec3(posX, posY, posZ); - var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); + Vec3 var17 = APISpellHelper.createVec3(posX, posY, posZ); + Vec3 var3 = APISpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false); + var17 = APISpellHelper.createVec3(posX, posY, posZ); + var3 = APISpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); if (var4 != null) { - var3 = new Vec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + var3 = APISpellHelper.createVec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); } Entity var5 = null; - List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, getBoundingBox().addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); double var7 = 0.0D; Iterator var9 = var6.iterator(); float var11; @@ -226,7 +242,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) { var11 = 0.3F; - AxisAlignedBB var12 = var10.getBoundingBox().expand(var11, var11, var11); + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); if (var13 != null) @@ -271,14 +287,14 @@ public class EntitySpellProjectile extends Entity implements IProjectile if (ticksInAir % 3 == 0) { double gauss = gaussian(1.0F); - worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB, posX, posY, posZ, gauss, gauss, 0.0F); + worldObj.spawnParticle("mobSpell", posX, posY, posZ, gauss, gauss, 0.0F); } } private void doFiringParticles() { - worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - worldObj.spawnParticle(EnumParticleTypes.FLAME, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + 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)); } /** @@ -301,6 +317,17 @@ public class EntitySpellProjectile extends Entity implements IProjectile effectList.appendTag(eff.getTag()); } +// for (String str : this.effectList) +// { +// if (str != null) +// { +// NBTTagCompound tag = new NBTTagCompound(); +// +// tag.setString("Class", str); +// effectList.appendTag(tag); +// } +// } + par1NBTTagCompound.setTag("Effects", effectList); par1NBTTagCompound.setInteger("blocksBroken", blocksBroken); par1NBTTagCompound.setBoolean("isSilkTouch", isSilkTouch); @@ -323,7 +350,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile NBTTagList tagList = par1NBTTagCompound.getTagList("Effects", Constants.NBT.TAG_COMPOUND); - List spellEffectList = new LinkedList(); + List spellEffectList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = tagList.getCompoundTagAt(i); @@ -361,6 +388,13 @@ public class EntitySpellProjectile extends Entity implements IProjectile return false; } + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + /** * Sets the amount of knockback the arrow applies when it hits a mob. */ @@ -414,7 +448,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile { if (!this.penetration) { - this.groundImpact(mop.field_178784_b); + this.groundImpact(mop.sideHit); this.performTileImpactEffects(mop); } } @@ -439,7 +473,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile { for (int particles = 0; particles < i; particles++) { - worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), posGauss(1.0F), posGauss(1.0F), 0.0F); + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), posGauss(1.0F), posGauss(1.0F), 0.0F); } } @@ -453,7 +487,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile return DamageSource.causePlayerDamage(shootingEntity); } - private void groundImpact(EnumFacing sideHit) + private void groundImpact(int sideHit) { this.ricochet(sideHit); } @@ -473,22 +507,22 @@ public class EntitySpellProjectile extends Entity implements IProjectile return d + d * ((rand.nextFloat() - 0.5D) / 4); } - private void ricochet(EnumFacing sideHit) + private void ricochet(int sideHit) { switch (sideHit) { - case UP: - case DOWN: + case 0: + case 1: // topHit, bottomHit, reflect Y motionY = motionY * -1; break; - case WEST: - case EAST: + case 2: + case 3: // westHit, eastHit, reflect Z motionZ = motionZ * -1; break; - case SOUTH: - case NORTH: + case 4: + case 5: // southHit, northHit, reflect X motionX = motionX * -1; break; @@ -501,23 +535,23 @@ public class EntitySpellProjectile extends Entity implements IProjectile { switch (sideHit) { - case UP: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); + case 0: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); break; - case DOWN: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + case 1: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); break; - case NORTH: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); + case 2: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); break; - case SOUTH: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + case 3: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); break; - case WEST: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + case 4: + worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); break; - case EAST: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + case 5: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); break; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/ExtrapolatedMeleeEntityEffect.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/ExtrapolatedMeleeEntityEffect.java index b5c58751..03929374 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/ExtrapolatedMeleeEntityEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/ExtrapolatedMeleeEntityEffect.java @@ -35,7 +35,7 @@ public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntity double y = entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord; double z = entityPlayer.posZ + lookVec.zCoord; - List entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x - 0.5f, y - 0.5f, z - 0.5f, x + 0.5f, y + 0.5f, z + 0.5f).expand(radius, radius, radius)); + 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) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/IOnBreakBlock.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/IOnBreakBlock.java index 6c8fbaa7..6c10f6c3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/IOnBreakBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/IOnBreakBlock.java @@ -1,14 +1,12 @@ package WayofTime.alchemicalWizardry.api.spell; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public interface IOnBreakBlock { - int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, IBlockState state, BlockPos pos, EnumFacing sideBroken); + int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/MeleeSpellCenteredWorldEffect.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/MeleeSpellCenteredWorldEffect.java index bccfe653..68ec0133 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/MeleeSpellCenteredWorldEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/MeleeSpellCenteredWorldEffect.java @@ -1,8 +1,6 @@ package WayofTime.alchemicalWizardry.api.spell; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -19,12 +17,11 @@ public abstract class MeleeSpellCenteredWorldEffect extends MeleeSpellWorldEffec public void onWorldEffect(World world, EntityPlayer entityPlayer) { Vec3 lookVec = entityPlayer.getLook(range).normalize(); - - int x = MathHelper.floor_double(entityPlayer.posX + lookVec.xCoord * range); - int y = MathHelper.floor_double(entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord * range); - int z = MathHelper.floor_double(entityPlayer.posZ + lookVec.zCoord * range); + int x = (int) (entityPlayer.posX + lookVec.xCoord * range); + int y = (int) (entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord * range); + int z = (int) (entityPlayer.posZ + lookVec.zCoord * range); - this.onCenteredWorldEffect(entityPlayer, world, new BlockPos(x, y, z)); + this.onCenteredWorldEffect(entityPlayer, world, x, y, z); } public void setRange(float range) @@ -32,5 +29,5 @@ public abstract class MeleeSpellCenteredWorldEffect extends MeleeSpellWorldEffec this.range = range; } - public abstract void onCenteredWorldEffect(EntityPlayer player, World world, BlockPos pos); + public abstract void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java index fcdd82f5..f217b12a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java @@ -8,9 +8,9 @@ import java.util.Map.Entry; public class SpellEffectRegistry { - public static Map, List> effectRegistry = new HashMap, List>(); - public static Map typeRegistry = new HashMap(); - public static Map modifierRegistry = new HashMap(); + public static Map, List> effectRegistry = new HashMap(); + public static Map typeRegistry = new HashMap(); + public static Map modifierRegistry = new HashMap(); public static void registerSpellEffect(Class paraClass, ComplexSpellEffect effect) { @@ -43,7 +43,7 @@ public class SpellEffectRegistry effectList.add(effect); }else { - List effectList = new LinkedList(); + List effectList = new LinkedList(); effectList.add(effect); effectRegistry.put(paraClass, effectList); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java index 4f72d4ff..5423cb4f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java @@ -9,7 +9,7 @@ import net.minecraft.world.World; public abstract class SpellParadigm { - protected List bufferedEffectList = new LinkedList(); + protected List bufferedEffectList = new LinkedList(); public void addBufferedEffect(SpellEffect effect) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java index 12023f7a..629f7dba 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java @@ -15,12 +15,15 @@ public class SpellParadigmMelee extends SpellParadigm public SpellParadigmMelee() { - this.entityEffectList = new ArrayList(); - this.worldEffectList = new ArrayList(); + this.entityEffectList = new ArrayList(); + this.worldEffectList = new ArrayList(); } @Override - public void enhanceParadigm(SpellEnhancement enh) {} + public void enhanceParadigm(SpellEnhancement enh) + { + + } @Override public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java index f1a33800..8b6f6a31 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java @@ -25,8 +25,8 @@ public class SpellParadigmProjectile extends SpellParadigm this.damageSource = DamageSource.generic; this.damage = 1; this.cost = 0; - this.impactList = new ArrayList(); - this.updateEffectList = new ArrayList(); + this.impactList = new ArrayList(); + this.updateEffectList = new ArrayList(); this.penetration = false; this.ricochetMax = 0; this.isSilkTouch = false; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java index 91c6ab1d..89cffe07 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java @@ -14,11 +14,14 @@ public class SpellParadigmSelf extends SpellParadigm public SpellParadigmSelf() { - selfSpellEffectList = new ArrayList(); + selfSpellEffectList = new ArrayList(); } @Override - public void enhanceParadigm(SpellEnhancement enh) {} + public void enhanceParadigm(SpellEnhancement enh) + { + + } @Override public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java index e61795b9..e407ef24 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java @@ -7,16 +7,14 @@ import java.util.Map.Entry; import java.util.Set; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; @@ -49,31 +47,31 @@ public class SpellParadigmTool extends SpellParadigm 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.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.toolInfoString = new HashMap(); + this.critChanceHash = new HashMap(); - this.harvestLevel = new HashMap(); + 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 = 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 = new HashMap(); this.maxDamageHash.put("default", 5.0f); this.fortuneLevel = 0; @@ -339,12 +337,12 @@ public class SpellParadigmTool extends SpellParadigm return total; } - public int onBreakBlock(ItemStack container, World world, EntityPlayer player, Block block, IBlockState state, BlockPos pos, EnumFacing sideBroken) + 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, state, pos, sideBroken); + total += effect.onBlockBroken(container, world, player, block, meta, x, y, z, sideBroken); } return total; @@ -356,7 +354,8 @@ public class SpellParadigmTool extends SpellParadigm for (IItemManipulator eff : this.itemManipulatorEffectList) { - heldList = eff.handleItemsOnBlockBroken(toolStack, heldList); + List newHeldList = eff.handleItemsOnBlockBroken(toolStack, heldList); + heldList = newHeldList; } return heldList; @@ -464,7 +463,7 @@ public class SpellParadigmTool extends SpellParadigm public float getAddedDamageForEntity(Entity entity) { - HashMap hash = new HashMap(); + HashMap hash = new HashMap(); for (ISpecialDamageEffect effect : this.specialDamageEffectList) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java index 01c065f8..18180d8c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java @@ -9,7 +9,7 @@ import java.util.List; public class SummoningRegistry { - public static List summoningList = new ArrayList(); + public static List summoningList = new ArrayList(); public static void registerSummon(SummoningHelper s, ItemStack[] ring1, ItemStack[] ring2, ItemStack[] ring3, int amountUsed, int bloodOrbLevel) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/tile/ISpellTile.java b/src/main/java/WayofTime/alchemicalWizardry/api/tile/ISpellTile.java index ac47e535..c5d868e0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/tile/ISpellTile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/tile/ISpellTile.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.api.tile; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.spell.SpellParadigm; public interface ISpellTile { void modifySpellParadigm(SpellParadigm parad); - boolean canInputRecieveOutput(EnumFacing output); + boolean canInputRecieveOutput(ForgeDirection output); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java deleted file mode 100644 index 8ade0296..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java +++ /dev/null @@ -1,14 +0,0 @@ -package WayofTime.alchemicalWizardry.client; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.item.Item; - -public class BlockRenderer -{ - public static void registerBlock(Block block) - { - Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("alchemicalwizardry:" + block.getUnlocalizedName().substring(5), "inventory")); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java index ee938546..b99319df 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/ClientEventHandler.java @@ -1,23 +1,55 @@ package WayofTime.alchemicalWizardry.client; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderBlockOverlayEvent; +import net.minecraftforge.client.event.RenderHandEvent; import net.minecraftforge.client.event.sound.SoundEvent; -import net.minecraftforge.fml.client.FMLClientHandler; -import net.minecraftforge.fml.common.eventhandler.Event.Result; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.InputEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; -import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; - +import WayofTime.alchemicalWizardry.client.renderer.RenderHelper; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.InputEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ClientEventHandler { - private Minecraft mcClient = FMLClientHandler.instance().getClient(); + private Minecraft mc = FMLClientHandler.instance().getClient(); + + public static ResourceLocation currentPlayerTexture = null; + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void renderPOVArmour(RenderHandEvent event) + { + if (this.mc.thePlayer.worldObj.isRemote && this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) + { + currentPlayerTexture = ((AbstractClientPlayer) mc.thePlayer).getLocationSkin(); + + ClientUtils.renderPlayerArmourInPOV(mc.thePlayer, event.partialTicks); + event.setCanceled(true); + } + } + +// @SubscribeEvent(priority = EventPriority.LOWEST) +// public void onPlayerRenderTick(RenderPlayerEvent.Pre event) +// { +// ModelBiped model = ((BoundArmour)ModItems.boundPlate).getArmorModel(event.entityPlayer, new ItemStack(ModItems.boundPlate), 2); +// String texture = ((BoundArmour)ModItems.boundPlate).getArmorTexture(new ItemStack(ModItems.boundPlate), event.entityPlayer, 2, ""); +// +// ResourceLocation resourcelocation = new ResourceLocation(texture); +// event.renderer.modelBipedMain.bipedBody.addChild(model.bipedBody); +// Minecraft.getMinecraft().renderEngine.bindTexture(resourcelocation); +// +// } + @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { @@ -66,7 +98,7 @@ public class ClientEventHandler if (event.phase.equals(Phase.START)) return; -// if (!RenderHelper.onTickInGame(mcClient)) + if (!RenderHelper.onTickInGame(mc)) { } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java index f5450b05..9c1112ff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java @@ -4,10 +4,7 @@ import net.minecraft.item.ItemBlock; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.client.FMLClientHandler; -import net.minecraftforge.fml.client.registry.ClientRegistry; -import net.minecraftforge.fml.client.registry.RenderingRegistry; -import net.minecraftforge.fml.common.FMLCommonHandler; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile; import WayofTime.alchemicalWizardry.client.renderer.RitualDivinerRender; @@ -41,9 +38,7 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazooka import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam; import WayofTime.alchemicalWizardry.common.items.sigil.holding.ScrollHelper; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderAlchemicalCalcinator; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderAltar; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderChemistrySet; +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; @@ -54,6 +49,8 @@ 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.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; @@ -88,10 +85,9 @@ import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBazoo import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor; import WayofTime.alchemicalWizardry.common.thread.GAPIChecker; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicalCalcinator; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; +import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; @@ -101,6 +97,11 @@ 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 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; public class ClientProxy extends CommonProxy { @@ -148,19 +149,22 @@ public class ClientProxy extends CommonProxy MinecraftForge.EVENT_BUS.register(new RitualDivinerRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TEAltar.class, new RenderAltar()); + ClientRegistry.bindTileEntitySpecialRenderer(TEAltar.class, new TEAltarRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TEPedestal.class, new RenderPedestal()); ClientRegistry.bindTileEntitySpecialRenderer(TEPlinth.class, new RenderPlinth()); - ClientRegistry.bindTileEntitySpecialRenderer(TEChemistrySet.class, new RenderChemistrySet()); + ClientRegistry.bindTileEntitySpecialRenderer(TEWritingTable.class, new RenderWritingTable()); ClientRegistry.bindTileEntitySpecialRenderer(TEConduit.class, new RenderConduit()); ClientRegistry.bindTileEntitySpecialRenderer(TESpellEffectBlock.class, new RenderSpellEffectBlock()); ClientRegistry.bindTileEntitySpecialRenderer(TESpellEnhancementBlock.class, new RenderSpellEnhancementBlock()); ClientRegistry.bindTileEntitySpecialRenderer(TESpellParadigmBlock.class, new RenderSpellParadigmBlock()); ClientRegistry.bindTileEntitySpecialRenderer(TESpellModifierBlock.class, new RenderSpellModifierBlock()); ClientRegistry.bindTileEntitySpecialRenderer(TEReagentConduit.class, new RenderReagentConduit()); - ClientRegistry.bindTileEntitySpecialRenderer(TEMasterStone.class, new RenderMasterStone()); - ClientRegistry.bindTileEntitySpecialRenderer(TEAlchemicalCalcinator.class, new RenderAlchemicalCalcinator()); - ClientRegistry.bindTileEntitySpecialRenderer(TEBelljar.class, new RenderCrystalBelljar()); + if (AlchemicalWizardry.displayRitualAnimation) + { + ClientRegistry.bindTileEntitySpecialRenderer(TEMasterStone.class, new RenderMasterStone()); + } + ClientRegistry.bindTileEntitySpecialRenderer(TEAlchemicCalcinator.class, new RenderAlchemicCalcinator()); + ClientRegistry.bindTileEntitySpecialRenderer(TEBellJar.class, new RenderCrystalBelljar()); //Item Renderer stuff MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockConduit), new TEConduitItemRenderer()); @@ -168,7 +172,7 @@ public class ClientProxy extends CommonProxy MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellEnhancement), new TESpellEnhancementBlockItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellParadigm), new TESpellParadigmBlockItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellModifier), new TESpellModifierBlockItemRenderer()); - MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAlchemicalCalcinator), new TEAlchemicalCalcinatorItemRenderer()); + MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAlchemicCalcinator), new TEAlchemicalCalcinatorItemRenderer()); MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockCrystalBelljar), new TEBellJarItemRenderer()); } @@ -179,7 +183,7 @@ public class ClientProxy extends CommonProxy } @Override - public void initRendering() + public void InitRendering() { MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAltar), new TEAltarItemRenderer()); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/ClientUtils.java b/src/main/java/WayofTime/alchemicalWizardry/client/ClientUtils.java new file mode 100644 index 00000000..b7474db3 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/client/ClientUtils.java @@ -0,0 +1,348 @@ +package WayofTime.alchemicalWizardry.client; + +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON; +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.FIRST_PERSON_MAP; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemCloth; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class ClientUtils +{ + public static Minecraft mc = Minecraft.getMinecraft(); + + private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); + + public static void renderPlayerArmourInPOV(EntityPlayer player, float partialTickTime) + { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + float f1 = 1.0f;//this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * partialTickTime; + EntityClientPlayerMP entityclientplayermp = mc.thePlayer; + float f2 = entityclientplayermp.prevRotationPitch + (entityclientplayermp.rotationPitch - entityclientplayermp.prevRotationPitch) * partialTickTime; +// GL11.glPushMatrix(); + GL11.glRotatef(180 - (entityclientplayermp.prevRotationYaw + (entityclientplayermp.rotationYaw - entityclientplayermp.prevRotationYaw) * partialTickTime), 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f2, 1.0F, 0.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); +// GL11.glPopMatrix(); + EntityPlayerSP entityplayersp = (EntityPlayerSP)entityclientplayermp; + float f3 = entityplayersp.prevRenderArmPitch + (entityplayersp.renderArmPitch - entityplayersp.prevRenderArmPitch) * partialTickTime; + float f4 = entityplayersp.prevRenderArmYaw + (entityplayersp.renderArmYaw - entityplayersp.prevRenderArmYaw) * partialTickTime; + GL11.glRotatef((entityclientplayermp.rotationPitch - f3) * 0.1F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef((entityclientplayermp.rotationYaw - f4) * 0.1F, 0.0F, 1.0F, 0.0F); + ItemStack itemstack = player.getCurrentEquippedItem(); + + if (itemstack != null && itemstack.getItem() instanceof ItemCloth) + { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + int i = mc.theWorld.getLightBrightnessForSkyBlocks(MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ), 0); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float f5; + float f6; + float f7; + + if (itemstack != null) + { + int l = itemstack.getItem().getColorFromItemStack(itemstack, 0); + f5 = (float)(l >> 16 & 255) / 255.0F; + f6 = (float)(l >> 8 & 255) / 255.0F; + f7 = (float)(l & 255) / 255.0F; + GL11.glColor4f(f5, f6, f7, 1.0F); + } + else + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + float f8; + float f9; + float f10; + float f13; + Render render; + RenderPlayer renderplayer; + + + if (itemstack != null && itemstack.getItem() instanceof ItemMap) + { + GL11.glPushMatrix(); + f13 = 0.8F; + f5 = entityclientplayermp.getSwingProgress(partialTickTime); + f6 = MathHelper.sin(f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glTranslatef(-f7 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI * 2.0F) * 0.2F, -f6 * 0.2F); + f5 = 1.0F - f2 / 45.0F + 0.1F; + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + if (f5 > 1.0F) + { + f5 = 1.0F; + } + + f5 = -MathHelper.cos(f5 * (float)Math.PI) * 0.5F + 0.5F; + GL11.glTranslatef(0.0F, 0.0F * f13 - (1.0F - f1) * 1.2F - f5 * 0.5F + 0.04F, -0.9F * f13); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(f5 * -85.0F, 0.0F, 0.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + mc.getTextureManager().bindTexture(entityclientplayermp.getLocationSkin()); + + for (int i1 = 0; i1 < 2; ++i1) + { + int j1 = i1 * 2 - 1; + GL11.glPushMatrix(); + GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float)j1); + GL11.glRotatef((float)(-45 * j1), 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef((float)(-65 * j1), 0.0F, 1.0F, 0.0F); + render = RenderManager.instance.getEntityRenderObject(mc.thePlayer); + renderplayer = (RenderPlayer)render; + f10 = 1.0F; + GL11.glScalef(f10, f10, f10); + renderFirstPersonArm(renderplayer, mc.thePlayer); + GL11.glPopMatrix(); + } + + f6 = entityclientplayermp.getSwingProgress(partialTickTime); + f7 = MathHelper.sin(f6 * f6 * (float)Math.PI); + f8 = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI); + GL11.glRotatef(-f7 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f8 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-f8 * 80.0F, 1.0F, 0.0F, 0.0F); + f9 = 0.38F; + GL11.glScalef(f9, f9, f9); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-1.0F, -1.0F, 0.0F); + f10 = 0.015625F; + GL11.glScalef(f10, f10, f10); + mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND); + Tessellator tessellator = Tessellator.instance; + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + tessellator.startDrawingQuads(); + byte b0 = 7; + tessellator.addVertexWithUV((double)(0 - b0), (double)(128 + b0), 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)(128 + b0), (double)(128 + b0), 0.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); + tessellator.draw(); + + IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP); + MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, mc.theWorld); + + if (custom == null) + { + if (mapdata != null) + { + mc.entityRenderer.getMapItemRenderer().func_148250_a(mapdata, false); + } + } + else + { + custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.getTextureManager(), mapdata); + } + + GL11.glPopMatrix(); + } + else if (itemstack != null) + { + GL11.glPushMatrix(); + f13 = 0.8F; + + if (entityclientplayermp.getItemInUseCount() > 0) + { + EnumAction enumaction = itemstack.getItemUseAction(); + + if (enumaction == EnumAction.eat || enumaction == EnumAction.drink) + { + f6 = (float)entityclientplayermp.getItemInUseCount() - partialTickTime + 1.0F; + f7 = 1.0F - f6 / (float)itemstack.getMaxItemUseDuration(); + f8 = 1.0F - f7; + f8 = f8 * f8 * f8; + f8 = f8 * f8 * f8; + f8 = f8 * f8 * f8; + f9 = 1.0F - f8; + GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(f6 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)f7 > 0.2D ? 1 : 0), 0.0F); + GL11.glTranslatef(f9 * 0.6F, -f9 * 0.5F, 0.0F); + GL11.glRotatef(f9 * 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(f9 * 10.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(f9 * 30.0F, 0.0F, 0.0F, 1.0F); + } + } + else + { + f5 = entityclientplayermp.getSwingProgress(partialTickTime); + f6 = MathHelper.sin(f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glTranslatef(-f7 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI * 2.0F) * 0.2F, -f6 * 0.2F); + } + + GL11.glTranslatef(0.7F * f13, -0.65F * f13 - (1.0F - f1) * 0.6F, -0.9F * f13); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + f5 = entityclientplayermp.getSwingProgress(partialTickTime); + f6 = MathHelper.sin(f5 * f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glRotatef(-f6 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f7 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-f7 * 80.0F, 1.0F, 0.0F, 0.0F); + f8 = 0.4F; + GL11.glScalef(f8, f8, f8); + float f11; + float f12; + + if (entityclientplayermp.getItemInUseCount() > 0) + { + EnumAction enumaction1 = itemstack.getItemUseAction(); + + if (enumaction1 == EnumAction.block) + { + GL11.glTranslatef(-0.5F, 0.2F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); + } + else if (enumaction1 == EnumAction.bow) + { + GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(-0.9F, 0.2F, 0.0F); + f10 = (float)itemstack.getMaxItemUseDuration() - ((float)entityclientplayermp.getItemInUseCount() - partialTickTime + 1.0F); + f11 = f10 / 20.0F; + f11 = (f11 * f11 + f11 * 2.0F) / 3.0F; + + if (f11 > 1.0F) + { + f11 = 1.0F; + } + + if (f11 > 0.1F) + { + GL11.glTranslatef(0.0F, MathHelper.sin((f10 - 0.1F) * 1.3F) * 0.01F * (f11 - 0.1F), 0.0F); + } + + GL11.glTranslatef(0.0F, 0.0F, f11 * 0.1F); + GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.5F, 0.0F); + f12 = 1.0F + f11 * 0.2F; + GL11.glScalef(1.0F, 1.0F, f12); + GL11.glTranslatef(0.0F, -0.5F, 0.0F); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + } + } + + if (itemstack.getItem().shouldRotateAroundWhenRendering()) + { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + if (itemstack.getItem().requiresMultipleRenderPasses()) + { + RenderManager.instance.itemRenderer.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); + for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) + { + int k1 = itemstack.getItem().getColorFromItemStack(itemstack, x); + f10 = (float)(k1 >> 16 & 255) / 255.0F; + f11 = (float)(k1 >> 8 & 255) / 255.0F; + f12 = (float)(k1 & 255) / 255.0F; + GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F); + RenderManager.instance.itemRenderer.renderItem(entityclientplayermp, itemstack, x, EQUIPPED_FIRST_PERSON); + } + } + else + { + RenderManager.instance.itemRenderer.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); + } + + GL11.glPopMatrix(); + } + else if (!entityclientplayermp.isInvisible()) + { + GL11.glPushMatrix(); + f13 = 0.8F; + f5 = entityclientplayermp.getSwingProgress(partialTickTime); + f6 = MathHelper.sin(f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glTranslatef(-f7 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI * 2.0F) * 0.4F, -f6 * 0.4F); + GL11.glTranslatef(0.8F * f13, -0.75F * f13 - (1.0F - f1) * 0.6F, -0.9F * f13); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + f5 = entityclientplayermp.getSwingProgress(partialTickTime); + f6 = MathHelper.sin(f5 * f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glRotatef(f7 * 70.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f6 * 20.0F, 0.0F, 0.0F, 1.0F); + mc.getTextureManager().bindTexture(entityclientplayermp.getLocationSkin()); + GL11.glTranslatef(-1.0F, 3.6F, 3.5F); + GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glTranslatef(5.6F, 0.0F, 0.0F); + render = RenderManager.instance.getEntityRenderObject(mc.thePlayer); + renderplayer = (RenderPlayer)render; + f10 = 1.0F; + GL11.glScalef(f10, f10, f10); + renderFirstPersonArm(renderplayer, mc.thePlayer); + GL11.glPopMatrix(); + } + + if (itemstack != null && itemstack.getItem() instanceof ItemCloth) + { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + } + + public static void renderFirstPersonArm(RenderPlayer renderer, EntityPlayer player) + { + float f = 1.0F; + GL11.glColor3f(f, f, f); + + GL11.glPushMatrix(); + ModelRenderer mRenderer = new POVArmourModelWrapper(renderer.modelBipedMain); + renderer.modelBipedMain.onGround = 0.0F; + renderer.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, player); + renderer.modelBipedMain.bipedRightArm.render(0.0625F); + + GL11.glPushMatrix(); + mRenderer.rotateAngleX = renderer.modelBipedMain.bipedRightArm.rotateAngleX; + mRenderer.rotateAngleY = renderer.modelBipedMain.bipedRightArm.rotateAngleY; + mRenderer.rotateAngleZ = renderer.modelBipedMain.bipedRightArm.rotateAngleZ; + mRenderer.render(0.0625F); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/POVArmourModelWrapper.java b/src/main/java/WayofTime/alchemicalWizardry/client/POVArmourModelWrapper.java new file mode 100644 index 00000000..1355fdac --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/client/POVArmourModelWrapper.java @@ -0,0 +1,47 @@ +package WayofTime.alchemicalWizardry.client; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class POVArmourModelWrapper extends ModelRenderer +{ + private final ModelRenderer armModel; + private final ResourceLocation resource; + + public POVArmourModelWrapper(ModelBase model) + { + super(model); + ItemStack plateStack = new ItemStack(ModItems.boundPlateFire); + ModelBiped bipedModel = ((BoundArmour)ModItems.boundPlateFire).getArmorModel(Minecraft.getMinecraft().thePlayer, plateStack, 1); + armModel = bipedModel.bipedRightArm; + resource = new ResourceLocation(((BoundArmour)ModItems.boundPlateFire).getArmorTexture(plateStack, Minecraft.getMinecraft().thePlayer, 1, "POV")); + addBox(0, 0, 0, 0, 0, 0); //Adds in a blank box as it's required in certain cases such as rendering arrows in entities + } + + @Override + public void render(float partialTicks) + { + GL11.glPushMatrix(); +// GL11.glTranslated(0.3, -.1, 0); + Minecraft.getMinecraft().renderEngine.bindTexture(resource); + armModel.rotateAngleX = this.rotateAngleX; + armModel.rotateAngleY = this.rotateAngleY; + armModel.rotateAngleZ = this.rotateAngleZ; + armModel.render(partialTicks); + + GL11.glPopMatrix(); + Minecraft.getMinecraft().renderEngine.bindTexture(ClientEventHandler.currentPlayerTexture); + + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGui.java b/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGui.java index 0030115d..f9299dec 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGui.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGui.java @@ -1,15 +1,15 @@ package WayofTime.alchemicalWizardry.client.gui; - -import static WayofTime.alchemicalWizardry.BloodMagicConfiguration.config; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigCategory; +import net.minecraftforge.common.config.ConfigElement; import java.util.ArrayList; import java.util.List; -import net.minecraft.client.gui.GuiScreen; -import net.minecraftforge.common.config.ConfigElement; -import net.minecraftforge.fml.client.config.GuiConfig; -import net.minecraftforge.fml.client.config.IConfigElement; +import static WayofTime.alchemicalWizardry.BloodMagicConfiguration.config; public class ConfigGui extends GuiConfig { @@ -22,16 +22,16 @@ public class ConfigGui extends GuiConfig { List list = new ArrayList(); // adds sections declared in ConfigHandler. toLowerCase() is used because the configuration class automatically does this, so must we. - list.add(new ConfigElement(config.getCategory("clientsettings".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("dungeon loot chances".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("meteor".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("orecrushing".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("potion id".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("wellofsufferingblacklist".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("wimpysettings".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("ritual blacklist".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("teleposer blacklist".toLowerCase()))); - list.add(new ConfigElement(config.getCategory("demon configs".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("clientsettings".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("dungeon loot chances".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("meteor".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("orecrushing".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("potion id".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("wellofsufferingblacklist".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("wimpysettings".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("ritual blacklist".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("teleposer blacklist".toLowerCase()))); + list.add(new ConfigElement(config.getCategory("demon configs".toLowerCase()))); return list; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java b/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java index 6413230c..e4705728 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java @@ -1,15 +1,17 @@ package WayofTime.alchemicalWizardry.client.gui; -import java.util.Set; - +import cpw.mods.fml.client.IModGuiFactory; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; -import net.minecraftforge.fml.client.IModGuiFactory; + +import java.util.Set; public class ConfigGuiFactory implements IModGuiFactory { @Override - public void initialize(Minecraft minecraftInstance) {} + public void initialize(Minecraft minecraftInstance) { + + } @Override public Class mainConfigGuiClass() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java index c92c0b0f..d06aded2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java @@ -6,7 +6,6 @@ import java.awt.Rectangle; import java.util.ArrayList; import java.util.List; -import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiChemistrySet; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.Item; @@ -16,6 +15,7 @@ import net.minecraft.util.StatCollector; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiWritingTable; import codechicken.nei.ItemList; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; @@ -104,7 +104,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler { @Override public Class getGuiClass() { - return GuiChemistrySet.class; + return GuiWritingTable.class; } @Override @@ -154,7 +154,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler { @Override public void drawExtras(int id) { CachedAlchemyRecipe cache = (CachedAlchemyRecipe) arecipes.get(id); - Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + cache.lp + "LP", getLPX(cache.lp), 34, 0); + Minecraft.getMinecraft().fontRenderer.drawString("\u00a77" + cache.lp + "LP", getLPX(cache.lp), 34, 0); } public int getLPX(int lp) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java index c932f60a..79f216dd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java @@ -30,7 +30,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { // PositionedStack inputItems; PositionedStack output; int tier, lp_amount, consumption, drain; - + public CachedAltarRecipe(AltarRecipe recipe) { // inputItems = new PositionedStack(recipe.input, 38, 2, false); input = new PositionedStack(recipe.requiredItem, 38, 2, false); @@ -40,18 +40,18 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { consumption = recipe.consumptionRate; drain = recipe.drainRate; } - + @Override public PositionedStack getIngredient() { return input; } - + @Override public PositionedStack getResult() { return output; } } - + @Override public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equals("alchemicalwizardry.altar") && getClass() == NEIAltarRecipeHandler.class) { @@ -62,7 +62,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { super.loadCraftingRecipes(outputId, results); } } - + @Override public void loadCraftingRecipes(ItemStack result) { for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { @@ -71,7 +71,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { } } } - + @Override public void loadUsageRecipes(ItemStack ingredient) { for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { @@ -80,7 +80,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { } } } - + //Mouse Position helper public Point getMouse(int width, int height) { Point mousepos = getMousePosition(); @@ -89,7 +89,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { Point relMouse = new Point(mousepos.x - guiLeft, mousepos.y - guiTop); return relMouse; } - + //width helper, getting width normal way hates me on compile public int getGuiWidth(GuiRecipe gui) { try { @@ -104,10 +104,10 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { } } catch (Exception e) { e.printStackTrace(); - return 0; + return 0; } } - + //height helper, getting height normal way hates me on compile public int getGuiHeight(GuiRecipe gui) { try { @@ -122,17 +122,17 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { } } catch (Exception e) { e.printStackTrace(); - return 0; + return 0; } } - + @Override public void drawExtras(int id) { CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id); - Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + StatCollector.translateToLocal("bm.string.tier") + ": " + recipe.tier, 78, 5, 0); - Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + "LP: " + recipe.lp_amount, 78, 15, 0); + Minecraft.getMinecraft().fontRenderer.drawString("\u00a77" + StatCollector.translateToLocal("bm.string.tier") + ": " + recipe.tier, 78, 5, 0); + Minecraft.getMinecraft().fontRenderer.drawString("\u00a77" + "LP: " + recipe.lp_amount, 78, 15, 0); } - + @Override public List handleTooltip(GuiRecipe gui, List currenttip, int id) { currenttip = super.handleTooltip(gui, currenttip, id); @@ -144,20 +144,20 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { currenttip.add(StatCollector.translateToLocal("bm.string.consume") + ": " + recipe.consumption + "LP/t"); currenttip.add(StatCollector.translateToLocal("bm.string.drain") + ": " + recipe.drain + "LP/t"); } - + return currenttip; } - + @Override public String getOverlayIdentifier() { return "altarrecipes"; } - + @Override public void loadTransferRects() { transferRects.add(new RecipeTransferRect(new Rectangle(90, 32, 22, 16), "alchemicalwizardry.altar")); } - + @Override public String getRecipeName() { return " " + StatCollector.translateToLocal("tile.bloodAltar.name"); @@ -167,7 +167,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler { public String getGuiTexture() { return new ResourceLocation("alchemicalwizardry", "gui/nei/altar.png").toString(); } - + public static Point getMousePosition() { Dimension size = displaySize(); Dimension res = displayRes(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java index b32f47cd..98e2b782 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java @@ -128,7 +128,7 @@ public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler { return new CachedBloodOrbRecipe(width, height, items, recipe.getRecipeOutput()); } - + @Override public void loadTransferRects() { transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java index ebf7afba..7be1ee25 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java @@ -34,7 +34,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { stack.setMaxSize(1); ingredients.add(stack); } else if (o instanceof Integer) { - ArrayList orbs = new ArrayList(); + ArrayList orbs = new ArrayList(); for (Item item : NEIConfig.bloodOrbs) { if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) { orbs.add(new ItemStack(item)); @@ -53,7 +53,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { } } } - + @Override public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equals("crafting") && getClass() == NEIBloodOrbShapelessHandler.class) { @@ -72,7 +72,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { super.loadCraftingRecipes(outputId, results); } } - + @Override public void loadCraftingRecipes(ItemStack result) { List allrecipes = CraftingManager.getInstance().getRecipeList(); @@ -89,7 +89,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { } } } - + @Override public void loadUsageRecipes(ItemStack ingredient) { List allrecipes = CraftingManager.getInstance().getRecipeList(); @@ -107,7 +107,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { } } } - + public CachedBloodOrbRecipe forgeShapelessRecipe(ShapelessBloodOrbRecipe recipe) { ArrayList items = recipe.getInput(); @@ -117,7 +117,7 @@ public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { return new CachedBloodOrbRecipe(items, recipe.getRecipeOutput()); } - + @Override public void loadTransferRects() { transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java index 4fa27786..c1ef8769 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java @@ -1,15 +1,14 @@ package WayofTime.alchemicalWizardry.client.nei; - import java.util.ArrayList; import net.minecraft.item.Item; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; -public class NEIConfig implements IConfigureNEI { +public class NEIConfig implements IConfigureNEI { public static ArrayList bloodOrbs = new ArrayList(); - + @Override public void loadConfig() { API.registerRecipeHandler(new NEIAlchemyRecipeHandler()); diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java index da724a81..f3f97f01 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDElement.java @@ -29,7 +29,7 @@ public class HUDElement public boolean showDamageOverlay = false; public boolean showItemCount = false; - static RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem(); + static RenderItem itemRenderer = new RenderItem(); public HUDElement(ItemStack itemStack, int iconW, int iconH, int padW, int value) { @@ -54,8 +54,8 @@ public class HUDElement private void initSize() { - elementH = enableItemName ? Math.max(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT * 2, iconH) : - Math.max(mc.fontRendererObj.FONT_HEIGHT, iconH); + elementH = enableItemName ? Math.max(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT * 2, iconH) : + Math.max(mc.fontRenderer.FONT_HEIGHT, iconH); if (itemStack != null) { @@ -65,7 +65,7 @@ public class HUDElement if (showValue) { maxDamage = itemStack.getMaxDamage() + 1; - damage = maxDamage - itemStack.getItemDamage(); + damage = maxDamage - itemStack.getItemDamageForDisplay(); boolean showSpecialValue = true; boolean showValue = false; @@ -88,17 +88,17 @@ public class HUDElement (damage * 100 / maxDamage) + "%"; } - itemDamageW = mc.fontRendererObj.getStringWidth(HUDUtils.stripCtrl(itemDamage)); + 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.fontRendererObj.getStringWidth(HUDUtils.stripCtrl(itemName)), itemDamageW); + Math.max(mc.fontRenderer.getStringWidth(HUDUtils.stripCtrl(itemName)), itemDamageW); } - itemNameW = mc.fontRendererObj.getStringWidth(HUDUtils.stripCtrl(itemName)); + itemNameW = mc.fontRenderer.getStringWidth(HUDUtils.stripCtrl(itemName)); } } @@ -114,27 +114,27 @@ public class HUDElement boolean toRight = true; if (toRight) { - itemRenderer.func_180450_b(itemStack, x - (iconW + padW), y); - HUDUtils.renderItemOverlayIntoGUI(mc.fontRendererObj, itemStack, x - (iconW + padW), y, showDamageOverlay, showItemCount); + 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.fontRendererObj.drawString(itemName + "\247r", x - (padW + iconW + padW) - itemNameW, y, 0xffffff); - mc.fontRendererObj.drawString(itemDamage + "\247r", x - (padW + iconW + padW) - itemDamageW, + 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 { - itemRenderer.func_180450_b(itemStack, x, y); - HUDUtils.renderItemOverlayIntoGUI(mc.fontRendererObj, itemStack, x, y, showDamageOverlay, showItemCount); + 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.fontRendererObj.drawString(itemName + "\247r", x + iconW + padW, y, 0xffffff); - mc.fontRendererObj.drawString(itemDamage + "\247r", x + iconW + padW, + 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); } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java index 957067e6..2c42afea 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/HUDUtils.java @@ -4,13 +4,11 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.entity.player.EntityPlayer; 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; /** @@ -171,13 +169,12 @@ public final class HUDUtils { float var7 = 0.00390625F; float var8 = 0.00390625F; - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer wr = tessellator.getWorldRenderer(); - wr.startDrawingQuads(); - wr.addVertexWithUV((x + 0), (y + height), zLevel, ((u + 0) * var7), ((v + height) * var8)); - wr.addVertexWithUV((x + width), (y + height), zLevel, ((u + width) * var7), ((v + height) * var8)); - wr.addVertexWithUV((x + width), (y + 0), zLevel, ((u + width) * var7), ((v + 0) * var8)); - wr.addVertexWithUV((x + 0), (y + 0), zLevel, ((u + 0) * var7), ((v + 0) * var8)); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((x + 0), (y + height), zLevel, ((u + 0) * var7), ((v + height) * var8)); + tessellator.addVertexWithUV((x + width), (y + height), zLevel, ((u + width) * var7), ((v + height) * var8)); + tessellator.addVertexWithUV((x + width), (y + 0), zLevel, ((u + width) * var7), ((v + 0) * var8)); + tessellator.addVertexWithUV((x + 0), (y + 0), zLevel, ((u + 0) * var7), ((v + 0) * var8)); tessellator.draw(); } @@ -198,12 +195,12 @@ public final class HUDUtils { if (itemStack.isItemDamaged() && showDamageBar) { - int var11 = (int) Math.round(13.0D - itemStack.getItemDamage() * 13.0D / itemStack.getMaxDamage()); - int var7 = (int) Math.round(255.0D - itemStack.getItemDamage() * 255.0D / itemStack.getMaxDamage()); + int var11 = (int) Math.round(13.0D - itemStack.getItemDamageForDisplay() * 13.0D / itemStack.getMaxDamage()); + int var7 = (int) Math.round(255.0D - itemStack.getItemDamageForDisplay() * 255.0D / itemStack.getMaxDamage()); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_TEXTURE_2D); - Tessellator var8 = Tessellator.getInstance(); + Tessellator var8 = Tessellator.instance; int var9 = 255 - var7 << 16 | var7 << 8; int var10 = (255 - var7) / 4 << 16 | 16128; renderQuad(var8, x + 2, y + 13, 13, 2, 0); @@ -229,7 +226,7 @@ public final class HUDUtils String var6 = "" + count; GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); - fontRenderer.drawString(var6, x + 19 - 2 - fontRenderer.getStringWidth(var6), y + 6 + 3, 16777215); + fontRenderer.drawStringWithShadow(var6, x + 19 - 2 - fontRenderer.getStringWidth(var6), y + 6 + 3, 16777215); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_DEPTH_TEST); } @@ -243,13 +240,12 @@ public final class HUDUtils */ public static void renderQuad(Tessellator tessellator, int x, int y, int width, int height, int color) { - WorldRenderer wr = tessellator.getWorldRenderer(); - wr.startDrawingQuads(); -// wr.setColorOpaque_I(color); - wr.addVertex((x + 0), (y + 0), 0.0D); - wr.addVertex((x + 0), (y + height), 0.0D); - wr.addVertex((x + width), (y + height), 0.0D); - wr.addVertex((x + width), (y + 0), 0.0D); + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(color); + tessellator.addVertex((x + 0), (y + 0), 0.0D); + tessellator.addVertex((x + 0), (y + height), 0.0D); + tessellator.addVertex((x + width), (y + height), 0.0D); + tessellator.addVertex((x + width), (y + 0), 0.0D); tessellator.draw(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderFakeBlocks.java b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderFakeBlocks.java index 954edba0..1ddd11d2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderFakeBlocks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderFakeBlocks.java @@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.client.renderer; import net.minecraft.block.Block; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.util.IIcon; import net.minecraft.world.World; /* @@ -16,11 +16,10 @@ public class RenderFakeBlocks double maxX = minX + 1; double maxY = minY + 1; double maxZ = minZ + 1; - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer wr = tessellator.getWorldRenderer(); + Tessellator tessellator = Tessellator.instance; - wr.startDrawingQuads(); -// wr.setColorRGBA(255, 255, 255, 200); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(255, 255, 255, 200); float texMinU, texMaxU, texMinV, texMaxV; @@ -28,76 +27,80 @@ public class RenderFakeBlocks texMaxU = getMaxU(block, meta, 0); texMinV = getMinV(block, meta, 0); texMaxV = getMaxV(block, meta, 0); - wr.addVertexWithUV(minX, minY, minZ, texMinU, texMinV); - wr.addVertexWithUV(maxX, minY, minZ, texMaxU, texMinV); - wr.addVertexWithUV(maxX, minY, maxZ, texMaxU, texMaxV); - wr.addVertexWithUV(minX, minY, maxZ, texMinU, texMaxV); + tessellator.addVertexWithUV(minX, minY, minZ, texMinU, texMinV); + tessellator.addVertexWithUV(maxX, minY, minZ, texMaxU, texMinV); + tessellator.addVertexWithUV(maxX, minY, maxZ, texMaxU, texMaxV); + tessellator.addVertexWithUV(minX, minY, maxZ, texMinU, texMaxV); texMinU = getMinU(block, meta, 1); texMaxU = getMaxU(block, meta, 1); texMinV = getMinV(block, meta, 1); texMaxV = getMaxV(block, meta, 1); - wr.addVertexWithUV(minX, maxY, maxZ, texMinU, texMaxV); - wr.addVertexWithUV(maxX, maxY, maxZ, texMaxU, texMaxV); - wr.addVertexWithUV(maxX, maxY, minZ, texMaxU, texMinV); - wr.addVertexWithUV(minX, maxY, minZ, texMinU, texMinV); + tessellator.addVertexWithUV(minX, maxY, maxZ, texMinU, texMaxV); + tessellator.addVertexWithUV(maxX, maxY, maxZ, texMaxU, texMaxV); + tessellator.addVertexWithUV(maxX, maxY, minZ, texMaxU, texMinV); + tessellator.addVertexWithUV(minX, maxY, minZ, texMinU, texMinV); texMinU = getMinU(block, meta, 2); texMaxU = getMaxU(block, meta, 2); texMinV = getMinV(block, meta, 2); texMaxV = getMaxV(block, meta, 2); - wr.addVertexWithUV(maxX, minY, minZ, texMinU, texMaxV); - wr.addVertexWithUV(minX, minY, minZ, texMaxU, texMaxV); - wr.addVertexWithUV(minX, maxY, minZ, texMaxU, texMinV); - wr.addVertexWithUV(maxX, maxY, minZ, texMinU, texMinV); + tessellator.addVertexWithUV(maxX, minY, minZ, texMinU, texMaxV); + tessellator.addVertexWithUV(minX, minY, minZ, texMaxU, texMaxV); + tessellator.addVertexWithUV(minX, maxY, minZ, texMaxU, texMinV); + tessellator.addVertexWithUV(maxX, maxY, minZ, texMinU, texMinV); texMinU = getMinU(block, meta, 3); texMaxU = getMaxU(block, meta, 3); texMinV = getMinV(block, meta, 3); texMaxV = getMaxV(block, meta, 3); - wr.addVertexWithUV(minX, minY, maxZ, texMinU, texMaxV); - wr.addVertexWithUV(maxX, minY, maxZ, texMaxU, texMaxV); - wr.addVertexWithUV(maxX, maxY, maxZ, texMaxU, texMinV); - wr.addVertexWithUV(minX, maxY, maxZ, texMinU, texMinV); + tessellator.addVertexWithUV(minX, minY, maxZ, texMinU, texMaxV); + tessellator.addVertexWithUV(maxX, minY, maxZ, texMaxU, texMaxV); + tessellator.addVertexWithUV(maxX, maxY, maxZ, texMaxU, texMinV); + tessellator.addVertexWithUV(minX, maxY, maxZ, texMinU, texMinV); texMinU = getMinU(block, meta, 4); texMaxU = getMaxU(block, meta, 4); texMinV = getMinV(block, meta, 4); texMaxV = getMaxV(block, meta, 4); - wr.addVertexWithUV(minX, minY, minZ, texMinU, texMaxV); - wr.addVertexWithUV(minX, minY, maxZ, texMaxU, texMaxV); - wr.addVertexWithUV(minX, maxY, maxZ, texMaxU, texMinV); - wr.addVertexWithUV(minX, maxY, minZ, texMinU, texMinV); + tessellator.addVertexWithUV(minX, minY, minZ, texMinU, texMaxV); + tessellator.addVertexWithUV(minX, minY, maxZ, texMaxU, texMaxV); + tessellator.addVertexWithUV(minX, maxY, maxZ, texMaxU, texMinV); + tessellator.addVertexWithUV(minX, maxY, minZ, texMinU, texMinV); texMinU = getMinU(block, meta, 5); texMaxU = getMaxU(block, meta, 5); texMinV = getMinV(block, meta, 5); texMaxV = getMaxV(block, meta, 5); - wr.addVertexWithUV(maxX, minY, maxZ, texMinU, texMaxV); - wr.addVertexWithUV(maxX, minY, minZ, texMaxU, texMaxV); - wr.addVertexWithUV(maxX, maxY, minZ, texMaxU, texMinV); - wr.addVertexWithUV(maxX, maxY, maxZ, texMinU, texMinV); + tessellator.addVertexWithUV(maxX, minY, maxZ, texMinU, texMaxV); + tessellator.addVertexWithUV(maxX, minY, minZ, texMaxU, texMaxV); + tessellator.addVertexWithUV(maxX, maxY, minZ, texMaxU, texMinV); + tessellator.addVertexWithUV(maxX, maxY, maxZ, texMinU, texMinV); tessellator.draw(); } private static float getMinU(Block block, int meta, int side) { - return 0; + IIcon icon = block.getIcon(side, meta); + return icon.getMinU(); } private static float getMaxU(Block block, int meta, int side) { - return 256; + IIcon icon = block.getIcon(side, meta); + return icon.getMaxU(); } private static float getMinV(Block block, int meta, int side) { - return 0; + IIcon icon = block.getIcon(side, meta); + return icon.getMinV(); } private static float getMaxV(Block block, int meta, int side) { - return 256; + IIcon icon = block.getIcon(side, meta); + return icon.getMaxV(); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java index 7c551e80..964feb72 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java @@ -7,14 +7,14 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; @@ -167,7 +167,7 @@ public class RenderHelper private static List getHUDElements(Minecraft mc) { - List elements = new ArrayList(); + List elements = new ArrayList(); MovingObjectPosition movingobjectposition = mc.objectMouseOver; World world = mc.theWorld; @@ -179,9 +179,11 @@ public class RenderHelper { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos pos = movingobjectposition.func_178782_a(); + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - TileEntity tile = world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(x, y, z); if (!(tile instanceof IReagentHandler)) { @@ -190,7 +192,7 @@ public class RenderHelper IReagentHandler relay = (IReagentHandler) tile; - ReagentContainerInfo[] infos = relay.getContainerInfo(movingobjectposition.field_178784_b); + ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.getOrientation(movingobjectposition.sideHit)); if (infos != null) { @@ -248,13 +250,12 @@ public class RenderHelper { float f = 0.00390625F; float f1 = 0.00390625F; - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer wr = tessellator.getWorldRenderer(); - wr.startDrawingQuads(); - wr.addVertexWithUV((double)p_73729_1_, p_73729_2_ + p_73729_6_, (double)zLevel, (p_73729_3_ * f), (p_73729_4_ + p_73729_6_) * f1); - wr.addVertexWithUV(p_73729_1_ + p_73729_5_, p_73729_2_ + p_73729_6_, (double)zLevel, (p_73729_3_ + p_73729_5_) * f, (p_73729_4_ + p_73729_6_) * f1); - wr.addVertexWithUV(p_73729_1_ + p_73729_5_, (double)p_73729_2_, (double)zLevel, (p_73729_3_ + p_73729_5_) * f, p_73729_4_ * f1); - wr.addVertexWithUV((double)p_73729_1_, (double)p_73729_2_, (double)zLevel, (double)(p_73729_3_ * f), p_73729_4_ * f1); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)p_73729_1_, p_73729_2_ + p_73729_6_, (double)zLevel, (p_73729_3_ * f), (p_73729_4_ + p_73729_6_) * f1); + tessellator.addVertexWithUV(p_73729_1_ + p_73729_5_, p_73729_2_ + p_73729_6_, (double)zLevel, (p_73729_3_ + p_73729_5_) * f, (p_73729_4_ + p_73729_6_) * f1); + tessellator.addVertexWithUV(p_73729_1_ + p_73729_5_, (double)p_73729_2_, (double)zLevel, (p_73729_3_ + p_73729_5_) * f, p_73729_4_ * f1); + tessellator.addVertexWithUV((double)p_73729_1_, (double)p_73729_2_, (double)zLevel, (double)(p_73729_3_ * f), p_73729_4_ * f1); tessellator.draw(); } @@ -287,6 +288,17 @@ public class RenderHelper GL11.glPopMatrix(); } + + public static void renderIcon(int p_94149_1_, int p_94149_2_, IIcon p_94149_3_, int p_94149_4_, int p_94149_5_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)p_94149_1_, (double)(p_94149_2_ + p_94149_5_), (double)zLevel, (double)p_94149_3_.getMinU(), (double)p_94149_3_.getMaxV()); + tessellator.addVertexWithUV((double)(p_94149_1_ + p_94149_4_), (double)(p_94149_2_ + p_94149_5_), (double)zLevel, (double)p_94149_3_.getMaxU(), (double)p_94149_3_.getMaxV()); + tessellator.addVertexWithUV((double)(p_94149_1_ + p_94149_4_), (double)p_94149_2_, (double)zLevel, (double)p_94149_3_.getMaxU(), (double)p_94149_3_.getMinV()); + tessellator.addVertexWithUV((double)p_94149_1_, (double)p_94149_2_, (double)zLevel, (double)p_94149_3_.getMinU(), (double)p_94149_3_.getMinV()); + tessellator.draw(); + } private static void displayArmorStatus(Minecraft mc) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java index 9b877d3f..94b0cfc1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java @@ -1,16 +1,7 @@ package WayofTime.alchemicalWizardry.client.renderer; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.ModBlocks; @@ -20,8 +11,15 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderWorldLastEvent; -/** +/* * Created in Scala by Alex-Hawks * Translated and implemented by Arcaratus */ @@ -32,24 +30,22 @@ public class RitualDivinerRender public void render(RenderWorldLastEvent event) { Minecraft minecraft = Minecraft.getMinecraft(); - EntityPlayer player = minecraft.thePlayer; + EntityClientPlayerMP player = minecraft.thePlayer; World world = player.worldObj; if (minecraft.objectMouseOver == null || minecraft.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) { return; } - - BlockPos pos = minecraft.objectMouseOver.func_178782_a(); - TileEntity tileEntity = world.getTileEntity(pos); + TileEntity tileEntity = world.getTileEntity(minecraft.objectMouseOver.blockX, minecraft.objectMouseOver.blockY, minecraft.objectMouseOver.blockZ); if (!(tileEntity instanceof IMasterRitualStone)) { return; } - Vector3 vec3 = new Vector3(pos.getX(), pos.getY(), pos.getZ()); + Vector3 vec3 = new Vector3(minecraft.objectMouseOver.blockX, minecraft.objectMouseOver.blockY, minecraft.objectMouseOver.blockZ); double posX = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.partialTicks; double posY = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.partialTicks; double posZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.partialTicks; @@ -75,7 +71,7 @@ public class RitualDivinerRender double minY = vX.y - posY; double minZ = vX.z - posZ; - if (!world.getBlockState(new BlockPos(vX.x, vX.y, vX.z)).getBlock().isOpaqueCube()) + if (!world.getBlock(vX.x, vX.y, vX.z).isOpaqueCube()) { RenderFakeBlocks.drawFakeBlock(vX, ModBlocks.ritualStone, ritualComponent.getStoneType(), minX, minY, minZ, world); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index beb46388..10b04848 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -7,6 +7,8 @@ import java.util.List; import java.util.Map; import java.util.Random; +import WayofTime.alchemicalWizardry.common.achievements.ModAchievements; +import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -22,26 +24,20 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.Vec3; import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import net.minecraftforge.event.AnvilUpdateEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; import net.minecraftforge.event.entity.player.EntityInteractEvent; -import net.minecraftforge.fml.client.event.ConfigChangedEvent; -import net.minecraftforge.fml.common.Optional; -import net.minecraftforge.fml.common.eventhandler.Event.Result; -import net.minecraftforge.fml.common.eventhandler.EventPriority; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; -import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.internal.IManaBurst; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.BloodMagicConfiguration; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; @@ -49,7 +45,7 @@ import WayofTime.alchemicalWizardry.api.event.TeleposeEvent; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; -import WayofTime.alchemicalWizardry.common.items.BoundBlade; +import WayofTime.alchemicalWizardry.common.items.EnergySword; import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; @@ -57,14 +53,21 @@ import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry; import WayofTime.alchemicalWizardry.common.omega.ReagentRegenConfiguration; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; +import cpw.mods.fml.common.registry.GameRegistry; public class AlchemicalWizardryEventHooks { - public static Map playerFlightBuff = new HashMap(); - public static List playersWith1Step = new ArrayList(); + public static Map playerFlightBuff = new HashMap(); + public static List playersWith1Step = new ArrayList(); - public static Map> respawnMap = new HashMap>(); - public static Map> forceSpawnMap = new HashMap>(); + public static Map> respawnMap = new HashMap(); + public static Map> forceSpawnMap = new HashMap(); public static Random rand = new Random(); @@ -83,7 +86,7 @@ public class AlchemicalWizardryEventHooks parad.onEmptyHandEntityInteract(player, event.target); }else { - if(heldItem.getItem() instanceof BoundBlade) + if(heldItem.getItem() instanceof EnergySword) { parad.onBoundSwordInteractWithEntity(player, event.target); } @@ -114,7 +117,7 @@ public class AlchemicalWizardryEventHooks float prevHp = APISpellHelper.getCurrentAdditionalHP((EntityPlayer)event.entityLiving); if(prevHp > 0) { - float recalculatedAmount = ArmorProperties.applyArmor(player, player.inventory.armorInventory, event.source, event.ammount); + float recalculatedAmount = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, event.source, event.ammount); if (recalculatedAmount <= 0) return; recalculatedAmount = SpellHelper.applyPotionDamageCalculations(player, event.source, recalculatedAmount); //Recalculated damage @@ -332,7 +335,7 @@ public class AlchemicalWizardryEventHooks String respawnRitual = "AW028SpawnWard"; - int dimension = event.world.provider.getDimensionId(); + int dimension = event.world.provider.dimensionId; if (respawnMap.containsKey(dimension)) { List list = respawnMap.get(dimension); @@ -341,7 +344,7 @@ public class AlchemicalWizardryEventHooks { for (CoordAndRange coords : list) { - TileEntity tile = event.world.getTileEntity(coords.getPos()); + TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(respawnRitual)) { @@ -385,7 +388,7 @@ public class AlchemicalWizardryEventHooks { for (CoordAndRange coords : list) { - TileEntity tile = event.world.getTileEntity(coords.getPos()); + TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(forceSpawnRitual)) { @@ -505,10 +508,10 @@ public class AlchemicalWizardryEventHooks double y = entityLiving.posY; double z = entityLiving.posZ; - BlockPos blockVector = entityLiving.getPosition(); - int xPos = blockVector.getX(); - int yPos = blockVector.getY(); - int zPos = blockVector.getZ(); + Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving); + int xPos = (int) (blockVector.xCoord); + int yPos = (int) (blockVector.yCoord); + int zPos = (int) (blockVector.zCoord); if (entityLiving instanceof EntityPlayer) { @@ -589,7 +592,7 @@ public class AlchemicalWizardryEventHooks int posY = (int) Math.round(entity.posY); int posZ = (int) Math.round(entity.posZ - 0.5f); int d0 = (int) ((i + 1) * 2.5); - AxisAlignedBB axisalignedbb = new AxisAlignedBB(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5).expand(d0, d0, d0); + 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(); @@ -694,7 +697,7 @@ public class AlchemicalWizardryEventHooks if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak)) { - entityLiving.worldObj.spawnParticle(EnumParticleTypes.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; @@ -715,7 +718,7 @@ public class AlchemicalWizardryEventHooks if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionIceCloak)) { if (entityLiving.worldObj.getWorldTime() % 2 == 0) - entityLiving.worldObj.spawnParticle(EnumParticleTypes.REDSTONE, x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0x74, 0xbb, 0xfb); + 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; @@ -729,7 +732,7 @@ public class AlchemicalWizardryEventHooks { for (int j = -vertRange - 1; j <= vertRange - 1; j++) { - SpellHelper.freezeWaterBlock(entityLiving.worldObj, new BlockPos(xPos + i, yPos + j, zPos + k)); + SpellHelper.freezeWaterBlock(entityLiving.worldObj, xPos + i, yPos + j, zPos + k); } } } @@ -738,7 +741,7 @@ public class AlchemicalWizardryEventHooks if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart)) { - entityLiving.worldObj.spawnParticle(EnumParticleTypes.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); @@ -756,7 +759,7 @@ public class AlchemicalWizardryEventHooks if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFireFuse)) { - entityLiving.worldObj.spawnParticle(EnumParticleTypes.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 r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getAmplifier(); int radius = r + 1; @@ -788,7 +791,7 @@ public class AlchemicalWizardryEventHooks meta = 0; if (block != null) - if ((block == event.initialBlock || block == event.finalBlock) && (meta == event.initialBlock.getMetaFromState(event.initialState) || meta == event.finalBlock.getMetaFromState(event.finalState) || meta == OreDictionary.WILDCARD_VALUE)) + if (( block == event.initialBlock || block == event.finalBlock) && (meta == event.initialMetadata || meta == event.finalMetadata || meta == OreDictionary.WILDCARD_VALUE)) event.setCanceled(true); // If the block uses shorthand syntax: modid:blockname @@ -798,12 +801,31 @@ public class AlchemicalWizardryEventHooks int meta = 0; if (block != null) - if (( block == event.initialBlock || block == event.finalBlock) && (meta == event.initialBlock.getMetaFromState(event.initialState) || meta == event.finalBlock.getMetaFromState(event.finalState) || meta == OreDictionary.WILDCARD_VALUE)) + if (( block == event.initialBlock || block == event.finalBlock) && (meta == event.initialMetadata || meta == event.finalMetadata || meta == OreDictionary.WILDCARD_VALUE)) event.setCanceled(true); } } } + @SubscribeEvent + public void onEntityDeath(LivingDeathEvent event) + { + EntityLivingBase entityLiving = event.entityLiving; + + if (entityLiving instanceof IDemon && event.source.getEntity() instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) event.source.getEntity(); + + player.addStat(ModAchievements.demonSpawn, 1); + } + if (entityLiving instanceof IHoardDemon && event.source.getEntity() instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) event.source.getEntity(); + + player.addStat(ModAchievements.demons, 1); + } + } + @SubscribeEvent public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { if (event.modID.equals("AWWayofTime")) { @@ -815,11 +837,11 @@ public class AlchemicalWizardryEventHooks @Optional.Method(modid = "Botania") private boolean isManaBurst(Entity entity) { -// if(entity instanceof IManaBurst) { -// ItemStack lens = ((IManaBurst)entity).getSourceLens(); -// return !(lens.getItemDamage()!=8 && lens.getItemDamage()!=11); -// } -// else + if(entity instanceof IManaBurst) { + ItemStack lens = ((IManaBurst)entity).getSourceLens(); + return !(lens.getItemDamage()!=8 && lens.getItemDamage()!=11); + } + else return false; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java index 730ac5cd..5a09d2b2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java +++ b/src/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 net.minecraftforge.fml.common.IFuelHandler; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.common.items.LavaCrystal; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class AlchemicalWizardryFuelHandler implements IFuelHandler { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/ClientToServerPacketHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/ClientToServerPacketHandler.java index 7a5f2fed..077bf2c4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/ClientToServerPacketHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/ClientToServerPacketHandler.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common; -import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import net.minecraftforge.fml.relauncher.Side; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.relauncher.Side; public class ClientToServerPacketHandler { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java b/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java index 1e9201a8..ee1a7d93 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common; import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.EntityRegistry; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile; import WayofTime.alchemicalWizardry.common.entity.mob.BookEntityItem; @@ -21,6 +20,10 @@ 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.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; public class CommonProxy { @@ -30,16 +33,38 @@ public class CommonProxy // Nothing here as the server doesn't render graphics! } - public void registerPostSideObjects() {} + public void registerPostSideObjects() + { + + } - public void registerEntities() {} + public void registerEntities() + { + } public World getClientWorld() { return null; } - public void registerEvents() {} + public void registerActions() + { + } + + public void registerEvents() + { + } + + public void registerSoundHandler() + { + // Nothing here as this is a server side proxy + } + + public void registerTileEntities() + { + GameRegistry.registerTileEntity(TEAltar.class, "containerAltar"); + GameRegistry.registerTileEntity(TEMasterStone.class, "containerMasterStone"); + } public void registerEntityTrackers() { @@ -63,5 +88,12 @@ public class CommonProxy EntityRegistry.registerModEntity(BookEntityItem.class, "bookEntityItem", 17, AlchemicalWizardry.instance, 120, 3, true); } - public void initRendering() {} + public void registerTickHandlers() + { + } + + public void InitRendering() + { + // TODO Auto-generated method stub + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java b/src/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java index a388a048..f4a89a65 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/CoordAndRange.java @@ -1,7 +1,5 @@ package WayofTime.alchemicalWizardry.common; -import net.minecraft.util.BlockPos; - public class CoordAndRange { public int xCoord; @@ -10,11 +8,6 @@ public class CoordAndRange public int horizRadius; public int vertRadius; - public CoordAndRange(BlockPos pos, int horiz, int vert) - { - this(pos.getX(), pos.getY(), pos.getZ(), horiz, vert); - } - public CoordAndRange(int x, int y, int z, int horiz, int vert) { this.xCoord = x; @@ -23,11 +16,6 @@ public class CoordAndRange this.horizRadius = horiz; this.vertRadius = vert; } - - public BlockPos getPos() - { - return new BlockPos(xCoord, yCoord, zCoord); - } @Override public boolean equals(Object o) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/EntityAITargetAggro.java b/src/main/java/WayofTime/alchemicalWizardry/common/EntityAITargetAggro.java index 1396e5ae..2b6fb25a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/EntityAITargetAggro.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/EntityAITargetAggro.java @@ -9,7 +9,7 @@ public class EntityAITargetAggro extends EntityAINearestAttackableTarget public EntityAITargetAggro(EntityDemon par1EntityDemon, Class par2Class, int par3, boolean par4) { - super(par1EntityDemon, par2Class, par4); + super(par1EntityDemon, par2Class, par3, par4); this.theCreature = par1EntityDemon; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java b/src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java index 9ec2079b..e71dabe0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/ItemType.java @@ -53,7 +53,7 @@ public class ItemType public ItemStack createStack(int count) { ItemStack result = new ItemStack(item, count, meta); - result.setTagCompound(nbtTag); + result.stackTagCompound = nbtTag; return result; } @@ -87,7 +87,7 @@ public class ItemType public static ItemType fromStack(ItemStack stack) { - return new ItemType(stack.getItem(), stack.getItemDamage(), stack.getTagCompound()); + return new ItemType(stack.getItem(), stack.getItemDamage(), stack.stackTagCompound); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java index fada6f98..3552f251 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java @@ -1,15 +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.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.FillBucketEvent; -import net.minecraftforge.fml.common.eventhandler.Event.Result; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.ModItems; public class LifeBucketHandler { @@ -29,12 +28,11 @@ public class LifeBucketHandler public ItemStack fillCustomBucket(World world, MovingObjectPosition pos) { - IBlockState state = world.getBlockState(pos.func_178782_a()); - Block block = state.getBlock(); + Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ); - if (block != null && (block.equals(ModBlocks.blockLifeEssence)) && block.getMetaFromState(state) == 0) + if (block != null && (block.equals(ModBlocks.blockLifeEssence)) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) { - world.setBlockToAir(pos.func_178782_a()); + world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ); return new ItemStack(ModItems.bucketLife); } else { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java b/src/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java index fdc69542..1892168e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/LifeEssence.java @@ -1,6 +1,7 @@ package WayofTime.alchemicalWizardry.common; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; public class LifeEssence extends Fluid { @@ -18,7 +19,7 @@ public class LifeEssence extends Fluid } @Override - public String getLocalizedName() + public String getLocalizedName(FluidStack fluidStack) { return "Life Essence"; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/MessageKeyPressed.java b/src/main/java/WayofTime/alchemicalWizardry/common/MessageKeyPressed.java index 055f91ff..ae4377f8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/MessageKeyPressed.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/MessageKeyPressed.java @@ -3,10 +3,10 @@ package WayofTime.alchemicalWizardry.common; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class MessageKeyPressed implements IMessage, IMessageHandler { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java b/src/main/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java index 185c1584..663c52c0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java +++ b/src/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 net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import WayofTime.alchemicalWizardry.ModItems; public class ModLivingDropsEvent { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java index f11a4853..5bdc65e4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java @@ -13,19 +13,9 @@ 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.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.network.FMLEmbeddedChannel; -import net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec; -import net.minecraftforge.fml.common.network.FMLOutboundHandler; -import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.ColourAndCoords; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; @@ -39,7 +29,14 @@ 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.TEChemistrySet; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.network.FMLEmbeddedChannel; +import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; +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; public enum NewPacketHandler { @@ -98,7 +95,7 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TEAltarMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TEAltar) { TEAltar altar = (TEAltar) te; @@ -114,11 +111,11 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TEOrientableMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TEOrientable) { - ((TEOrientable) te).setInputDirection(EnumFacing.getFront(msg.input)); - ((TEOrientable) te).setOutputDirection(EnumFacing.getFront(msg.output)); + ((TEOrientable) te).setInputDirection(ForgeDirection.getOrientation(msg.input)); + ((TEOrientable) te).setOutputDirection(ForgeDirection.getOrientation(msg.output)); } } } @@ -129,7 +126,7 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TEPedestalMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TEPedestal) { TEPedestal pedestal = (TEPedestal) te; @@ -145,7 +142,7 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TEPlinthMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TEPlinth) { TEPlinth Plinth = (TEPlinth) te; @@ -161,7 +158,7 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TESocketMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TESocket) { TESocket Socket = (TESocket) te; @@ -177,7 +174,7 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TETeleposerMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TETeleposer) { TETeleposer Teleposer = (TETeleposer) te; @@ -193,10 +190,10 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TEWritingTableMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); - if (te instanceof TEChemistrySet) + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEWritingTable) { - TEChemistrySet WritingTable = (TEChemistrySet) te; + TEWritingTable WritingTable = (TEWritingTable) te; WritingTable.handlePacketData(msg.items); } @@ -210,7 +207,7 @@ public enum NewPacketHandler { World world = AlchemicalWizardry.proxy.getClientWorld(); - world.spawnParticle(EnumParticleTypes.func_179342_a(msg.particle), msg.xCoord, msg.yCoord, msg.zCoord, msg.xVel, msg.yVel, msg.zVel); + world.spawnParticle(msg.particle, msg.xCoord, msg.yCoord, msg.zCoord, msg.xVel, msg.yVel, msg.zVel); } } @@ -236,7 +233,7 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TEMasterStoneMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TEMasterStone) { TEMasterStone masterStone = (TEMasterStone) te; @@ -253,7 +250,7 @@ public enum NewPacketHandler protected void channelRead0(ChannelHandlerContext ctx, TEReagentConduitMessage msg) throws Exception { World world = AlchemicalWizardry.proxy.getClientWorld(); - TileEntity te = world.getTileEntity(msg.pos); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); if (te instanceof TEReagentConduit) { TEReagentConduit reagentConduit = (TEReagentConduit) te; @@ -321,7 +318,9 @@ public enum NewPacketHandler public static class TEAltarMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; int[] items; int[] fluids; @@ -330,7 +329,9 @@ public enum NewPacketHandler public static class TEOrientableMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; int input; int output; @@ -338,42 +339,52 @@ public enum NewPacketHandler public static class TEPedestalMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; int[] items; } public static class TEPlinthMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; int[] items; } public static class TESocketMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; int[] items; } public static class TETeleposerMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; int[] items; } public static class TEWritingTableMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; int[] items; } public static class ParticleMessage extends BMMessage { - int particle; + String particle; double xCoord; double yCoord; @@ -393,7 +404,9 @@ public enum NewPacketHandler public static class TEMasterStoneMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; String ritual; boolean isRunning; @@ -401,7 +414,9 @@ public enum NewPacketHandler public static class TEReagentConduitMessage extends BMMessage { - BlockPos pos; + int x; + int y; + int z; List destinationList; } @@ -486,209 +501,231 @@ public enum NewPacketHandler @Override public void encodeInto(ChannelHandlerContext ctx, BMMessage msg, ByteBuf target) throws Exception { - PacketBuffer newBuffer = new PacketBuffer(target); - newBuffer.writeInt(msg.index); + target.writeInt(msg.index); switch (msg.index) { case 0: - newBuffer.writeBlockPos(((TEAltarMessage) msg).pos); + target.writeInt(((TEAltarMessage) msg).x); + target.writeInt(((TEAltarMessage) msg).y); + target.writeInt(((TEAltarMessage) msg).z); - newBuffer.writeBoolean(((TEAltarMessage) msg).items != null); + 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]; - newBuffer.writeInt(i); + target.writeInt(i); } } - newBuffer.writeBoolean(((TEAltarMessage) msg).fluids != null); + 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]; - newBuffer.writeInt(i); + target.writeInt(i); } } - newBuffer.writeInt(((TEAltarMessage) msg).capacity); + target.writeInt(((TEAltarMessage) msg).capacity); break; case 1: - newBuffer.writeBlockPos(((TEOrientableMessage) msg).pos); + target.writeInt(((TEOrientableMessage) msg).x); + target.writeInt(((TEOrientableMessage) msg).y); + target.writeInt(((TEOrientableMessage) msg).z); - newBuffer.writeInt(((TEOrientableMessage) msg).input); - newBuffer.writeInt(((TEOrientableMessage) msg).output); + target.writeInt(((TEOrientableMessage) msg).input); + target.writeInt(((TEOrientableMessage) msg).output); break; case 2: - newBuffer.writeBlockPos(((TEPedestalMessage) msg).pos); + target.writeInt(((TEPedestalMessage) msg).x); + target.writeInt(((TEPedestalMessage) msg).y); + target.writeInt(((TEPedestalMessage) msg).z); - newBuffer.writeBoolean(((TEPedestalMessage) msg).items != null); + 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]; - newBuffer.writeInt(i); + target.writeInt(i); } } break; case 3: - newBuffer.writeBlockPos(((TEPlinthMessage) msg).pos); + target.writeInt(((TEPlinthMessage) msg).x); + target.writeInt(((TEPlinthMessage) msg).y); + target.writeInt(((TEPlinthMessage) msg).z); - newBuffer.writeBoolean(((TEPlinthMessage) msg).items != null); + 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]; - newBuffer.writeInt(i); + target.writeInt(i); } } break; case 4: - newBuffer.writeBlockPos(((TESocketMessage) msg).pos); + target.writeInt(((TESocketMessage) msg).x); + target.writeInt(((TESocketMessage) msg).y); + target.writeInt(((TESocketMessage) msg).z); - newBuffer.writeBoolean(((TESocketMessage) msg).items != null); + 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]; - newBuffer.writeInt(i); + target.writeInt(i); } } break; case 5: - newBuffer.writeBlockPos(((TETeleposerMessage) msg).pos); + target.writeInt(((TETeleposerMessage) msg).x); + target.writeInt(((TETeleposerMessage) msg).y); + target.writeInt(((TETeleposerMessage) msg).z); - newBuffer.writeBoolean(((TETeleposerMessage) msg).items != null); + 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]; - newBuffer.writeInt(i); + target.writeInt(i); } } break; case 6: - newBuffer.writeBlockPos(((TEWritingTableMessage) msg).pos); + target.writeInt(((TEWritingTableMessage) msg).x); + target.writeInt(((TEWritingTableMessage) msg).y); + target.writeInt(((TEWritingTableMessage) msg).z); - newBuffer.writeBoolean(((TEWritingTableMessage) msg).items != null); + 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]; - newBuffer.writeInt(i); + target.writeInt(i); } } break; case 7: - newBuffer.writeInt(((ParticleMessage) msg).particle); + String str = ((ParticleMessage) msg).particle; + target.writeInt(str.length()); + for (int i = 0; i < str.length(); i++) + { + target.writeChar(str.charAt(i)); + } - newBuffer.writeDouble(((ParticleMessage) msg).xCoord); - newBuffer.writeDouble(((ParticleMessage) msg).yCoord); - newBuffer.writeDouble(((ParticleMessage) msg).zCoord); + target.writeDouble(((ParticleMessage) msg).xCoord); + target.writeDouble(((ParticleMessage) msg).yCoord); + target.writeDouble(((ParticleMessage) msg).zCoord); - newBuffer.writeDouble(((ParticleMessage) msg).xVel); - newBuffer.writeDouble(((ParticleMessage) msg).yVel); - newBuffer.writeDouble(((ParticleMessage) msg).zVel); + target.writeDouble(((ParticleMessage) msg).xVel); + target.writeDouble(((ParticleMessage) msg).yVel); + target.writeDouble(((ParticleMessage) msg).zVel); break; case 8: - newBuffer.writeDouble(((VelocityMessage) msg).xVel); - newBuffer.writeDouble(((VelocityMessage) msg).yVel); - newBuffer.writeDouble(((VelocityMessage) msg).zVel); + target.writeDouble(((VelocityMessage) msg).xVel); + target.writeDouble(((VelocityMessage) msg).yVel); + target.writeDouble(((VelocityMessage) msg).zVel); break; case 9: - newBuffer.writeBlockPos(((TEMasterStoneMessage) msg).pos); + target.writeInt(((TEMasterStoneMessage) msg).x); + target.writeInt(((TEMasterStoneMessage) msg).y); + target.writeInt(((TEMasterStoneMessage) msg).z); String ritual = ((TEMasterStoneMessage) msg).ritual; - newBuffer.writeInt(ritual.length()); + target.writeInt(ritual.length()); for (int i = 0; i < ritual.length(); i++) { - newBuffer.writeChar(ritual.charAt(i)); + target.writeChar(ritual.charAt(i)); } - newBuffer.writeBoolean(((TEMasterStoneMessage) msg).isRunning); + target.writeBoolean(((TEMasterStoneMessage) msg).isRunning); break; case 10: - newBuffer.writeBlockPos(((TEReagentConduitMessage) msg).pos); + target.writeInt(((TEReagentConduitMessage) msg).x); + target.writeInt(((TEReagentConduitMessage) msg).y); + target.writeInt(((TEReagentConduitMessage) msg).z); List list = ((TEReagentConduitMessage) msg).destinationList; - newBuffer.writeInt(list.size()); + target.writeInt(list.size()); for (ColourAndCoords colourSet : list) { - newBuffer.writeInt(colourSet.colourRed); - newBuffer.writeInt(colourSet.colourGreen); - newBuffer.writeInt(colourSet.colourBlue); - newBuffer.writeInt(colourSet.colourIntensity); - newBuffer.writeInt(colourSet.xCoord); - newBuffer.writeInt(colourSet.yCoord); - newBuffer.writeInt(colourSet.zCoord); + 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; case 11: - newBuffer.writeInt(((CurrentLPMessage) msg).currentLP); - newBuffer.writeInt(((CurrentLPMessage) msg).maxLP); + target.writeInt(((CurrentLPMessage) msg).currentLP); + target.writeInt(((CurrentLPMessage) msg).maxLP); break; case 12: char[] charSet = ((CurrentReagentBarMessage)msg).reagent.toCharArray(); - newBuffer.writeInt(charSet.length); + target.writeInt(charSet.length); for(char cha : charSet) { - newBuffer.writeChar(cha); + target.writeChar(cha); } - newBuffer.writeFloat(((CurrentReagentBarMessage)msg).currentAR); - newBuffer.writeFloat(((CurrentReagentBarMessage)msg).maxAR); + target.writeFloat(((CurrentReagentBarMessage)msg).currentAR); + target.writeFloat(((CurrentReagentBarMessage)msg).maxAR); break; case 13: - newBuffer.writeFloat(((CurrentAddedHPMessage) msg).currentHP); - newBuffer.writeFloat(((CurrentAddedHPMessage) msg).maxHP); + target.writeFloat(((CurrentAddedHPMessage) msg).currentHP); + target.writeFloat(((CurrentAddedHPMessage) msg).maxHP); break; case 14: System.out.println("Packet is being encoded"); - newBuffer.writeByte(((KeyboardMessage)msg).keyPressed); + target.writeByte(((KeyboardMessage)msg).keyPressed); break; } } @@ -697,14 +734,15 @@ public enum NewPacketHandler @Override public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, BMMessage msg) { - PacketBuffer newBuffer = new PacketBuffer(dat); - int index = newBuffer.readInt(); + int index = dat.readInt(); switch (index) { case 0: - ((TEAltarMessage) msg).pos = newBuffer.readBlockPos(); - boolean hasStacks = newBuffer.readBoolean(); + ((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) @@ -712,34 +750,38 @@ public enum NewPacketHandler ((TEAltarMessage) msg).items = new int[TEAltar.sizeInv * 3]; for (int i = 0; i < ((TEAltarMessage) msg).items.length; i++) { - ((TEAltarMessage) msg).items[i] = newBuffer.readInt(); + ((TEAltarMessage) msg).items[i] = dat.readInt(); } } - boolean hasFluids = newBuffer.readBoolean(); + 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] = newBuffer.readInt(); + ((TEAltarMessage) msg).fluids[i] = dat.readInt(); } - ((TEAltarMessage) msg).capacity = newBuffer.readInt(); + ((TEAltarMessage) msg).capacity = dat.readInt(); break; case 1: - ((TEOrientableMessage) msg).pos = newBuffer.readBlockPos(); + ((TEOrientableMessage) msg).x = dat.readInt(); + ((TEOrientableMessage) msg).y = dat.readInt(); + ((TEOrientableMessage) msg).z = dat.readInt(); - ((TEOrientableMessage) msg).input = newBuffer.readInt(); - ((TEOrientableMessage) msg).output = newBuffer.readInt(); + ((TEOrientableMessage) msg).input = dat.readInt(); + ((TEOrientableMessage) msg).output = dat.readInt(); break; case 2: - ((TEPedestalMessage) msg).pos = newBuffer.readBlockPos(); + ((TEPedestalMessage) msg).x = dat.readInt(); + ((TEPedestalMessage) msg).y = dat.readInt(); + ((TEPedestalMessage) msg).z = dat.readInt(); - boolean hasStacks1 = newBuffer.readBoolean(); + boolean hasStacks1 = dat.readBoolean(); ((TEPedestalMessage) msg).items = new int[TEPedestal.sizeInv * 3]; if (hasStacks1) @@ -747,16 +789,18 @@ public enum NewPacketHandler ((TEPedestalMessage) msg).items = new int[TEPedestal.sizeInv * 3]; for (int i = 0; i < ((TEPedestalMessage) msg).items.length; i++) { - ((TEPedestalMessage) msg).items[i] = newBuffer.readInt(); + ((TEPedestalMessage) msg).items[i] = dat.readInt(); } } break; case 3: - ((TEPlinthMessage) msg).pos = newBuffer.readBlockPos(); + ((TEPlinthMessage) msg).x = dat.readInt(); + ((TEPlinthMessage) msg).y = dat.readInt(); + ((TEPlinthMessage) msg).z = dat.readInt(); - boolean hasStacks2 = newBuffer.readBoolean(); + boolean hasStacks2 = dat.readBoolean(); ((TEPlinthMessage) msg).items = new int[TEPlinth.sizeInv * 3]; if (hasStacks2) @@ -764,16 +808,18 @@ public enum NewPacketHandler ((TEPlinthMessage) msg).items = new int[TEPlinth.sizeInv * 3]; for (int i = 0; i < ((TEPlinthMessage) msg).items.length; i++) { - ((TEPlinthMessage) msg).items[i] = newBuffer.readInt(); + ((TEPlinthMessage) msg).items[i] = dat.readInt(); } } break; case 4: - ((TESocketMessage) msg).pos = newBuffer.readBlockPos(); + ((TESocketMessage) msg).x = dat.readInt(); + ((TESocketMessage) msg).y = dat.readInt(); + ((TESocketMessage) msg).z = dat.readInt(); - boolean hasStacks3 = newBuffer.readBoolean(); + boolean hasStacks3 = dat.readBoolean(); ((TESocketMessage) msg).items = new int[TESocket.sizeInv * 3]; if (hasStacks3) @@ -781,16 +827,18 @@ public enum NewPacketHandler ((TESocketMessage) msg).items = new int[TESocket.sizeInv * 3]; for (int i = 0; i < ((TESocketMessage) msg).items.length; i++) { - ((TESocketMessage) msg).items[i] = newBuffer.readInt(); + ((TESocketMessage) msg).items[i] = dat.readInt(); } } break; case 5: - ((TETeleposerMessage) msg).pos = newBuffer.readBlockPos(); + ((TETeleposerMessage) msg).x = dat.readInt(); + ((TETeleposerMessage) msg).y = dat.readInt(); + ((TETeleposerMessage) msg).z = dat.readInt(); - boolean hasStacks4 = newBuffer.readBoolean(); + boolean hasStacks4 = dat.readBoolean(); ((TETeleposerMessage) msg).items = new int[TETeleposer.sizeInv * 3]; if (hasStacks4) @@ -798,75 +846,89 @@ public enum NewPacketHandler ((TETeleposerMessage) msg).items = new int[TETeleposer.sizeInv * 3]; for (int i = 0; i < ((TETeleposerMessage) msg).items.length; i++) { - ((TETeleposerMessage) msg).items[i] = newBuffer.readInt(); + ((TETeleposerMessage) msg).items[i] = dat.readInt(); } } break; case 6: - ((TEWritingTableMessage) msg).pos = newBuffer.readBlockPos(); + ((TEWritingTableMessage) msg).x = dat.readInt(); + ((TEWritingTableMessage) msg).y = dat.readInt(); + ((TEWritingTableMessage) msg).z = dat.readInt(); - boolean hasStacks5 = newBuffer.readBoolean(); + boolean hasStacks5 = dat.readBoolean(); - ((TEWritingTableMessage) msg).items = new int[TEChemistrySet.sizeInv * 3]; + ((TEWritingTableMessage) msg).items = new int[TEWritingTable.sizeInv * 3]; if (hasStacks5) { - ((TEWritingTableMessage) msg).items = new int[TEChemistrySet.sizeInv * 3]; + ((TEWritingTableMessage) msg).items = new int[TEWritingTable.sizeInv * 3]; for (int i = 0; i < ((TEWritingTableMessage) msg).items.length; i++) { - ((TEWritingTableMessage) msg).items[i] = newBuffer.readInt(); + ((TEWritingTableMessage) msg).items[i] = dat.readInt(); } } break; case 7: - ((ParticleMessage) msg).particle = newBuffer.readInt(); + int size = dat.readInt(); + String str = ""; - ((ParticleMessage) msg).xCoord = newBuffer.readDouble(); - ((ParticleMessage) msg).yCoord = newBuffer.readDouble(); - ((ParticleMessage) msg).zCoord = newBuffer.readDouble(); + for (int i = 0; i < size; i++) + { + str = str + dat.readChar(); + } - ((ParticleMessage) msg).xVel = newBuffer.readDouble(); - ((ParticleMessage) msg).yVel = newBuffer.readDouble(); - ((ParticleMessage) msg).zVel = newBuffer.readDouble(); + ((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 = newBuffer.readDouble(); - ((VelocityMessage) msg).yVel = newBuffer.readDouble(); - ((VelocityMessage) msg).zVel = newBuffer.readDouble(); + ((VelocityMessage) msg).xVel = dat.readDouble(); + ((VelocityMessage) msg).yVel = dat.readDouble(); + ((VelocityMessage) msg).zVel = dat.readDouble(); break; case 9: - ((TEMasterStoneMessage) msg).pos = newBuffer.readBlockPos(); + ((TEMasterStoneMessage) msg).x = dat.readInt(); + ((TEMasterStoneMessage) msg).y = dat.readInt(); + ((TEMasterStoneMessage) msg).z = dat.readInt(); - int ritualStrSize = newBuffer.readInt(); + int ritualStrSize = dat.readInt(); String ritual = ""; for (int i = 0; i < ritualStrSize; i++) { - ritual = ritual + newBuffer.readChar(); + ritual = ritual + dat.readChar(); } ((TEMasterStoneMessage) msg).ritual = ritual; - ((TEMasterStoneMessage) msg).isRunning = newBuffer.readBoolean(); + ((TEMasterStoneMessage) msg).isRunning = dat.readBoolean(); break; case 10: - ((TEReagentConduitMessage) msg).pos = newBuffer.readBlockPos(); - - int listSize = newBuffer.readInt(); + ((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(newBuffer.readInt(), newBuffer.readInt(), newBuffer.readInt(), newBuffer.readInt(), newBuffer.readInt(), newBuffer.readInt(), newBuffer.readInt())); + list.add(new ColourAndCoords(dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt(), dat.readInt())); } ((TEReagentConduitMessage) msg).destinationList = list; @@ -874,34 +936,34 @@ public enum NewPacketHandler break; case 11: - ((CurrentLPMessage) msg).currentLP = newBuffer.readInt(); - ((CurrentLPMessage) msg).maxLP = newBuffer.readInt(); + ((CurrentLPMessage) msg).currentLP = dat.readInt(); + ((CurrentLPMessage) msg).maxLP = dat.readInt(); break; case 12: - int size1 = newBuffer.readInt(); + int size1 = dat.readInt(); String str1 = ""; for(int i=0; i achievements = new ArrayList(); + public static List achievements = new ArrayList(); public AchievementsMod(String name, int x, int y, ItemStack icon, Achievement parent) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java index cd5f27b5..02e15ac6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java @@ -1,6 +1,9 @@ package WayofTime.alchemicalWizardry.common.achievements; +import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; +import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour; import net.minecraft.item.Item; import net.minecraft.block.Block; import net.minecraft.stats.Achievement; @@ -12,38 +15,90 @@ public class AchievementsRegistry { public final static List craftinglist = new ArrayList(); public final static List pickupList = new ArrayList(); + public final static List blockCraftingList = new ArrayList(); +// public final static List blockPickupList = new ArrayList(); public static void init() { addItemsToCraftingList(); + addBlocksToCraftingList(); addItemsToPickupList(); +// addBlocksToPickupList(); } public static void addItemsToCraftingList() { craftinglist.add(ModItems.sacrificialDagger); + craftinglist.add(ModItems.itemBloodPack); + craftinglist.add(ModItems.waterSigil); + craftinglist.add(ModItems.airSigil); + craftinglist.add(ModItems.sigilOfHolding); + craftinglist.add(ModItems.itemRitualDiviner); + craftinglist.add(ModItems.sigilOfTheBridge); + craftinglist.add(ModItems.itemSigilOfSupression); + craftinglist.add(ModItems.energyBazooka); + } + + public static void addBlocksToCraftingList() + { + blockCraftingList.add(ModBlocks.bloodRune); + blockCraftingList.add(ModBlocks.blockWritingTable); + blockCraftingList.add(ModBlocks.blockTeleposer); } public static void addItemsToPickupList() { pickupList.add(ModItems.weakBloodOrb); + pickupList.add(ModItems.apprenticeBloodOrb); + pickupList.add(ModItems.daggerOfSacrifice); + pickupList.add(ModItems.magicianBloodOrb); + pickupList.add(ModItems.energySword); + pickupList.add(ModItems.boundHelmet); + pickupList.add(ModItems.boundPlate); + pickupList.add(ModItems.boundLeggings); + pickupList.add(ModItems.boundBoots); + pickupList.add(ModItems.itemComplexSpellCrystal); + pickupList.add(ModItems.masterBloodOrb); + pickupList.add(ModItems.archmageBloodOrb); + pickupList.add(ModItems.transcendentBloodOrb); + } + + public static void addBlocksToPickupList() + { + } public static Achievement getAchievementForItem(Item item) { - if (item == ModItems.sacrificialDagger) - { - return ModAchievements.firstPrick; - } - if (item == ModItems.weakBloodOrb) - { - return ModAchievements.weakOrb; - } + if (item == ModItems.sacrificialDagger) return ModAchievements.firstPrick; + if (item == ModItems.weakBloodOrb) return ModAchievements.weakOrb; + if (item == ModItems.itemBloodPack) return ModAchievements.bloodLettersPack; + if (item == ModItems.waterSigil) return ModAchievements.waterSigil; + if (item == ModItems.apprenticeBloodOrb) return ModAchievements.apprenticeOrb; + if (item == ModItems.airSigil) return ModAchievements.airSigil; + if (item == ModItems.daggerOfSacrifice) return ModAchievements.daggerOfSacrifice; + if (item == ModItems.magicianBloodOrb) return ModAchievements.magicianOrb; + if (item == ModItems.sigilOfHolding) return ModAchievements.sigilHolding; + if (item == ModItems.energySword) return ModAchievements.boundBlade; + if (item instanceof BoundArmour) return ModAchievements.boundArmor; + if (item == ModItems.itemComplexSpellCrystal) return ModAchievements.complexSpells; + if (item instanceof ItemRitualDiviner) return ModAchievements.ritualDiviner; + if (item == ModItems.masterBloodOrb) return ModAchievements.masterOrb; + if (item == ModItems.sigilOfTheBridge) return ModAchievements.phantomBridgeSigil; + if (item == ModItems.itemSigilOfSupression) return ModAchievements.suppressionSigil; + if (item == ModItems.archmageBloodOrb) return ModAchievements.archmageOrb; + if (item == ModItems.energyBazooka) return ModAchievements.energyBazooka; + if (item == ModItems.transcendentBloodOrb) return ModAchievements.transcendentOrb; + return null; } public static Achievement getAchievementForBlock(Block block) { + if (block == ModBlocks.bloodRune) return ModAchievements.blankRunes; + if (block == ModBlocks.blockWritingTable) return ModAchievements.brewingPotions; + if (block == ModBlocks.blockTeleposer) return ModAchievements.teleposer; + return null; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/ICraftAchievement.java b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/ICraftAchievement.java deleted file mode 100644 index 47006462..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/ICraftAchievement.java +++ /dev/null @@ -1,11 +0,0 @@ -package WayofTime.alchemicalWizardry.common.achievements; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; - -public interface ICraftAchievement -{ - Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix); -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/IPickupAchievement.java b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/IPickupAchievement.java deleted file mode 100644 index 3d2a7351..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/IPickupAchievement.java +++ /dev/null @@ -1,11 +0,0 @@ -package WayofTime.alchemicalWizardry.common.achievements; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; - -public interface IPickupAchievement -{ - Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item); -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/ModAchievements.java b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/ModAchievements.java index ed4238ed..da29820f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/ModAchievements.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/ModAchievements.java @@ -1,10 +1,11 @@ package WayofTime.alchemicalWizardry.common.achievements; +import WayofTime.alchemicalWizardry.ModBlocks; +import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.AchievementPage; -import net.minecraftforge.fml.common.FMLCommonHandler; import WayofTime.alchemicalWizardry.ModItems; +import cpw.mods.fml.common.FMLCommonHandler; public class ModAchievements { @@ -12,13 +13,57 @@ public class ModAchievements public static Achievement firstPrick; public static Achievement weakOrb; + public static Achievement bloodLettersPack; + public static Achievement waterSigil; + public static Achievement blankRunes; + public static Achievement apprenticeOrb; + public static Achievement airSigil; + public static Achievement daggerOfSacrifice; + public static Achievement brewingPotions; + public static Achievement magicianOrb; + public static Achievement sigilHolding; + public static Achievement boundBlade; + public static Achievement boundArmor; + public static Achievement complexSpells; + public static Achievement ritualDiviner; + public static Achievement masterOrb; + public static Achievement demonSpawn; + public static Achievement phantomBridgeSigil; + public static Achievement teleposer; + public static Achievement suppressionSigil; + public static Achievement archmageOrb; + public static Achievement energyBazooka; + public static Achievement demons; + public static Achievement transcendentOrb; public static void init() { - firstPrick = new AchievementsMod(StatCollector.translateToLocal("firstPrick"), 0, 0, ModItems.sacrificialDagger, null); - weakOrb = new AchievementsMod(StatCollector.translateToLocal("weakOrb"), 3, 0, ModItems.weakBloodOrb, firstPrick); + firstPrick = new AchievementsMod("firstPrick", 0, 0, ModItems.sacrificialDagger, null).setSpecial(); + weakOrb = new AchievementsMod("weakOrb", 3, 0, ModItems.weakBloodOrb, firstPrick); + bloodLettersPack = new AchievementsMod("bloodLettersPack", 3, 2, ModItems.itemBloodPack, weakOrb); + waterSigil = new AchievementsMod("waterSigil", 6, 2, ModItems.waterSigil, weakOrb); + blankRunes = new AchievementsMod("blankRunes", 4, -2, ModBlocks.bloodRune, weakOrb); + apprenticeOrb = new AchievementsMod("apprenticeOrb", 4, -4, ModItems.apprenticeBloodOrb, blankRunes); + airSigil = new AchievementsMod("airSigil", 6, 1, ModItems.airSigil, apprenticeOrb); + daggerOfSacrifice = new AchievementsMod("daggerSacrifice", 4, -5, ModItems.daggerOfSacrifice, apprenticeOrb); + brewingPotions = new AchievementsMod("brewingPotions", 6, -3, ModBlocks.blockWritingTable, apprenticeOrb); + magicianOrb = new AchievementsMod("magicianOrb", 2, -2, ModItems.magicianBloodOrb, apprenticeOrb); + sigilHolding = new AchievementsMod("sigilHolding", 6, 0, ModItems.sigilOfHolding, magicianOrb); + boundBlade = new AchievementsMod("boundBlade", 0, -2, ModItems.energySword, magicianOrb); + boundArmor = new AchievementsMod("boundArmor", 1, -1, ModItems.boundPlate, magicianOrb); + complexSpells = new AchievementsMod("complexSpells", 1, -4, ModItems.itemComplexSpellCrystal, magicianOrb); + ritualDiviner = new AchievementsMod("ritualDiviner", 1, -3, ModItems.itemRitualDiviner, magicianOrb); + masterOrb = new AchievementsMod("masterOrb", -2, -1, ModItems.masterBloodOrb, boundBlade); + demonSpawn = new AchievementsMod("demonSpawn", -3, -2, ModItems.demonPlacer, masterOrb); + phantomBridgeSigil = new AchievementsMod("phantomBridgeSigil", 6, -1, ModItems.sigilOfTheBridge, masterOrb); + teleposer = new AchievementsMod("teleposer", -4, -1, ModBlocks.blockTeleposer, masterOrb); + suppressionSigil = new AchievementsMod("suppressionSigil", 6, -2, ModItems.itemSigilOfSupression, masterOrb); + archmageOrb = new AchievementsMod("archmageOrb", -1, 2, ModItems.archmageBloodOrb, masterOrb); + energyBazooka = new AchievementsMod("energyBazooka", -3, 2, ModItems.energyBazooka, archmageOrb); + demons = new AchievementsMod("demons", 0, 3, new ItemStack(ModItems.baseItems, 1, 29), archmageOrb).setSpecial(); + transcendentOrb = new AchievementsMod("trancsendentOrb", 0, 5, ModItems.transcendentBloodOrb, demons); - alchemicalWizardryPage = new AchievementPage("AlchemicalWizardry", AchievementsMod.achievements.toArray(new Achievement[AchievementsMod.achievements.size()])); + alchemicalWizardryPage = new AchievementPage("Blood Magic", AchievementsMod.achievements.toArray(new Achievement[AchievementsMod.achievements.size()])); AchievementPage.registerAchievementPage(alchemicalWizardryPage); AchievementsRegistry.init(); FMLCommonHandler.instance().bus().register(new AchievementTrigger()); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java index 0c0c4618..0ac3bf52 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java @@ -11,7 +11,7 @@ import java.util.List; public class CombinedPotionRegistry { - public static List potionList = new ArrayList(); + public static List potionList = new ArrayList(); public static void registerCombinedPotionRecipe(Potion result, Potion pot1, Potion pot2) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockArmourForge.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java similarity index 73% rename from src/main/java/WayofTime/alchemicalWizardry/common/block/BlockArmourForge.java rename to src/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java index 3a806593..e9f8eee9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockArmourForge.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java @@ -7,9 +7,11 @@ import WayofTime.alchemicalWizardry.common.ArmourComponent; import WayofTime.alchemicalWizardry.common.items.armour.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.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -17,46 +19,52 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import java.util.ArrayList; import java.util.List; -public class BlockArmourForge extends Block +public class ArmourForge extends Block { - public static List helmetList = new ArrayList(); - public static List plateList = new ArrayList(); - public static List leggingsList = new ArrayList(); - public static List bootsList = new ArrayList(); + public static List helmetList = new ArrayList(); + public static List plateList = new ArrayList(); + public static List leggingsList = new ArrayList(); + public static List bootsList = new ArrayList(); - public BlockArmourForge() + public ArmourForge() { super(Material.iron); setHardness(2.0F); setResistance(5.0F); setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("armourForge"); } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SoulForge"); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { if (world.isRemote) { return false; } - int armourType = getArmourType(world, blockPos); + int armourType = getArmourType(world, x, y, z); if (armourType == -1) { return false; } - int direction = getDirectionForArmourType(world, blockPos, armourType); + int direction = getDirectionForArmourType(world, x, y, z, armourType); - if (!isParadigmValid(armourType, direction, world, blockPos)) + if (!isParadigmValid(armourType, direction, world, x, y, z)) { return false; } @@ -68,7 +76,7 @@ public class BlockArmourForge extends Block { case 0: list = plateList; - armourPiece = new ItemStack(ModItems.boundChestplate, 1, 0); + armourPiece = new ItemStack(ModItems.boundPlate, 1, 0); break; case 1: @@ -111,27 +119,27 @@ public class BlockArmourForge extends Block switch (direction) { case 1: - tileEntity = world.getTileEntity(blockPos.add(xOff, 0, -zOff)); + tileEntity = world.getTileEntity(x + xOff, y, z - zOff); break; case 2: - tileEntity = world.getTileEntity(blockPos.add(zOff, 0, xOff)); + tileEntity = world.getTileEntity(x + zOff, y, z + xOff); break; case 3: - tileEntity = world.getTileEntity(blockPos.add(-xOff, 0, zOff)); + tileEntity = world.getTileEntity(x - xOff, y, z + zOff); break; case 4: - tileEntity = world.getTileEntity(blockPos.add(-zOff, 0, -xOff)); + tileEntity = world.getTileEntity(x - zOff, y, z - xOff); break; case 5: - tileEntity = world.getTileEntity(blockPos.add(xOff, zOff, 0)); + tileEntity = world.getTileEntity(x + xOff, y + zOff, z); break; case 6: - tileEntity = world.getTileEntity(blockPos.add(0, zOff, xOff)); + tileEntity = world.getTileEntity(x, y + zOff, z + xOff); break; default: @@ -141,13 +149,15 @@ public class BlockArmourForge extends Block if (tileEntity instanceof TESocket) { ItemStack itemStack = ((TESocket) tileEntity).getStackInSlot(0); - BlockPos tilePos = tileEntity.getPos(); + int xCoord = tileEntity.xCoord; + int yCoord = tileEntity.yCoord; + int zCoord = tileEntity.zCoord; ((TESocket) tileEntity).setInventorySlotContents(0, null); - world.setBlockToAir(tilePos); + world.setBlockToAir(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); for (int i = 0; i < 8; i++) { - SpellHelper.sendIndexedParticleToAllAround(world, tilePos, 20, world.provider.getDimensionId(), 1, tilePos); + SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, world.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (itemStack != null) @@ -167,19 +177,19 @@ public class BlockArmourForge extends Block { int xOff = (world.rand.nextInt(11) - 5); int zOff = (int) (Math.sqrt(25 - xOff * xOff) * (world.rand.nextInt(2) - 0.5) * 2); - world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX() + xOff, blockPos.getY() + 5, blockPos.getZ() + zOff)); - world.spawnEntityInWorld(new EntityItem(world, blockPos.getX(), blockPos.getY() + 1, blockPos.getZ(), armourPiece)); + world.addWeatherEffect(new EntityLightningBolt(world, x + xOff, y + 5, z + zOff)); + world.spawnEntityInWorld(new EntityItem(world, x, y + 1, z, armourPiece)); } return true; } //0 for plate, 1 for leggings, 2 for helmet, 3 for boots - public int getArmourType(World world, BlockPos blockPos) + public int getArmourType(World world, int x, int y, int z) { for (int i = 0; i <= 3; i++) { - if (getDirectionForArmourType(world, blockPos, i) != -1) + if (getDirectionForArmourType(world, x, y, z, i) != -1) { return i; } @@ -188,11 +198,11 @@ public class BlockArmourForge extends Block return -1; } - public int getDirectionForArmourType(World world, BlockPos blockPos, int armourType) + public int getDirectionForArmourType(World world, int x, int y, int z, int armourType) { for (int i = 1; i <= 6; i++) { - if (isParadigmValid(armourType, i, world, blockPos)) + if (isParadigmValid(armourType, i, world, x, y, z)) { return i; } @@ -201,7 +211,7 @@ public class BlockArmourForge extends Block return -1; } - public boolean isParadigmValid(int armourType, int direction, World world, BlockPos blockPos) + public boolean isParadigmValid(int armourType, int direction, World world, int x, int y, int z) { List list = null; @@ -237,7 +247,7 @@ public class BlockArmourForge extends Block switch (direction) { case 1: - if (!(world.getTileEntity(blockPos.add(xOff, 0, -zOff)) instanceof TESocket)) + if (!(world.getTileEntity(x + xOff, y, z - zOff) instanceof TESocket)) { return false; } @@ -245,7 +255,7 @@ public class BlockArmourForge extends Block break; case 2: - if (!(world.getTileEntity(blockPos.add(zOff, 0, xOff)) instanceof TESocket)) + if (!(world.getTileEntity(x + zOff, y, z + xOff) instanceof TESocket)) { return false; } @@ -253,7 +263,7 @@ public class BlockArmourForge extends Block break; case 3: - if (!(world.getTileEntity(blockPos.add(-xOff, 0, zOff)) instanceof TESocket)) + if (!(world.getTileEntity(x - xOff, y, z + zOff) instanceof TESocket)) { return false; } @@ -261,7 +271,7 @@ public class BlockArmourForge extends Block break; case 4: - if (!(world.getTileEntity(blockPos.add(-zOff, 0, -xOff)) instanceof TESocket)) + if (!(world.getTileEntity(x - zOff, y, z - xOff) instanceof TESocket)) { return false; } @@ -269,7 +279,7 @@ public class BlockArmourForge extends Block break; case 5: - if (!(world.getTileEntity(blockPos.add(xOff, zOff, 0)) instanceof TESocket)) + if (!(world.getTileEntity(x + xOff, y + zOff, z) instanceof TESocket)) { return false; } @@ -277,7 +287,7 @@ public class BlockArmourForge extends Block break; case 6: - if (!(world.getTileEntity(blockPos.add(0, zOff, xOff)) instanceof TESocket)) + if (!(world.getTileEntity(x, y + zOff, z + xOff) instanceof TESocket)) { return false; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicalCalcinator.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicCalcinator.java similarity index 75% rename from src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicalCalcinator.java rename to src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicCalcinator.java index ae0548f9..e9e98e44 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicalCalcinator.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAlchemicCalcinator.java @@ -1,36 +1,43 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicalCalcinator; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import java.util.Random; -public class BlockAlchemicalCalcinator extends BlockContainer +public class BlockAlchemicCalcinator extends BlockContainer { - public BlockAlchemicalCalcinator() + 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 TEAlchemicalCalcinator(); + return new TEAlchemicCalcinator(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; } @Override @@ -46,7 +53,7 @@ public class BlockAlchemicalCalcinator extends BlockContainer } @Override - public boolean hasTileEntity(IBlockState blockState) + public boolean hasTileEntity() { return true; } @@ -58,16 +65,16 @@ public class BlockAlchemicalCalcinator extends BlockContainer } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, blockPos); - super.breakBlock(world, blockPos, blockState); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } - private void dropItems(World world, BlockPos blockPos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(blockPos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -85,7 +92,9 @@ public class BlockAlchemicalCalcinator extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, + x + rx, y + ry, z + rz, + new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { @@ -103,9 +112,9 @@ public class BlockAlchemicalCalcinator extends BlockContainer } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { - TEAlchemicalCalcinator tileEntity = (TEAlchemicalCalcinator) world.getTileEntity(blockPos); + TEAlchemicCalcinator tileEntity = (TEAlchemicCalcinator) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -151,7 +160,7 @@ public class BlockAlchemicalCalcinator extends BlockContainer } } - tileEntity.getWorld().markBlockForUpdate(blockPos); + tileEntity.getWorldObj().markBlockForUpdate(x, y, z); return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java index 9397611b..1b425496 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java @@ -2,33 +2,67 @@ package WayofTime.alchemicalWizardry.common.block; import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.items.IAltarManipulator; -import WayofTime.alchemicalWizardry.common.items.Orb; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockAltar extends BlockContainer { + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + public BlockAltar() { super(Material.rock); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("bloodAltar"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon2; + } } @Override @@ -38,17 +72,17 @@ public class BlockAltar extends BlockContainer } @Override - public int getComparatorInputOverride(World world, BlockPos blockPos) + public int getComparatorInputOverride(World world, int x, int y, int z, int meta) { - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TEAltar) { ItemStack stack = ((TEAltar) tile).getStackInSlot(0); - if (stack != null && stack.getItem() instanceof Orb) + if (stack != null && stack.getItem() instanceof EnergyBattery) { - Orb bloodOrb = (Orb) stack.getItem(); + EnergyBattery bloodOrb = (EnergyBattery) stack.getItem(); int maxEssence = bloodOrb.getMaxEssence(); int currentEssence = bloodOrb.getCurrentEssence(stack); int level = currentEssence * 15 / maxEssence; @@ -60,9 +94,9 @@ public class BlockAltar extends BlockContainer } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + 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.getTileEntity(blockPos); + TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -77,7 +111,7 @@ public class BlockAltar extends BlockContainer { if (player.worldObj.isRemote) { - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); } else { tileEntity.sendChatInfoToPlayer(player); @@ -88,7 +122,7 @@ public class BlockAltar extends BlockContainer { if (player.worldObj.isRemote) { - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); } else { tileEntity.sendMoreChatInfoToPlayer(player); @@ -107,7 +141,7 @@ public class BlockAltar extends BlockContainer { if (player.worldObj.isRemote) { - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); } else { tileEntity.sendChatInfoToPlayer(player); @@ -118,7 +152,7 @@ public class BlockAltar extends BlockContainer { if (player.worldObj.isRemote) { - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); } else { tileEntity.sendMoreChatInfoToPlayer(player); @@ -142,21 +176,21 @@ public class BlockAltar extends BlockContainer tileEntity.setInventorySlotContents(0, null); tileEntity.setActive(); } - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); return true; } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, blockPos); - super.breakBlock(world, blockPos, blockState); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } - private void dropItems(World world, BlockPos blockPos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(blockPos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -174,7 +208,9 @@ public class BlockAltar extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, + x + rx, y + ry, z + rz, + new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { @@ -191,6 +227,12 @@ public class BlockAltar extends BlockContainer } } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { @@ -204,16 +246,15 @@ public class BlockAltar extends BlockContainer } @Override - public boolean hasTileEntity(IBlockState blockState) + public boolean hasTileEntity() { return true; } @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos blockPos, IBlockState blockState, Random rand) + public void randomDisplayTick(World world, int x, int y, int z, Random rand) { - TEAltar tileEntity = (TEAltar) world.getTileEntity(blockPos); + TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z); if (!tileEntity.isActive()) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java index 6ed3c8c0..e04354f3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBelljar.java @@ -5,7 +5,6 @@ import java.util.List; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -14,16 +13,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockBelljar extends BlockContainer { @@ -32,9 +30,11 @@ public class BlockBelljar extends BlockContainer super(Material.glass); setHardness(2.0F); setResistance(5.0F); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("crystalBelljar"); } - @Override + @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { @@ -73,16 +73,16 @@ public class BlockBelljar extends BlockContainer } @Override - public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState blockState, EntityLivingBase entityLiving, ItemStack stack) + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack) { - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); - if (tile instanceof TEBelljar) + if (tile instanceof TEBellJar) { NBTTagCompound tag = stack.getTagCompound(); if (tag != null) { - ((TEBelljar) tile).readTankNBTOnPlace(tag); + ((TEBellJar) tile).readTankNBTOnPlace(tag); } } } @@ -90,7 +90,13 @@ public class BlockBelljar extends BlockContainer @Override public TileEntity createNewTileEntity(World world, int meta) { - return new TEBelljar(); + return new TEBellJar(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; } @Override @@ -106,7 +112,7 @@ public class BlockBelljar extends BlockContainer } @Override - public boolean hasTileEntity(IBlockState blockState) + public boolean hasTileEntity() { return true; } @@ -118,35 +124,35 @@ public class BlockBelljar extends BlockContainer } @Override - public int getComparatorInputOverride(World world, BlockPos blockPos) + public int getComparatorInputOverride(World world, int x, int y, int z, int meta) { - TileEntity tile = world.getTileEntity(blockPos); - if (tile instanceof TEBelljar) + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TEBellJar) { - return ((TEBelljar) tile).getRSPowerOutput(); + return ((TEBellJar) tile).getRSPowerOutput(); } return 15; } @Override - public void onBlockHarvested(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player) + public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) { - this.dropBlockAsItem(world, blockPos, blockState, 0); - super.onBlockHarvested(world, blockPos, blockState, player); + this.dropBlockAsItem(world, x, y, z, meta, 0); + super.onBlockHarvested(world, x, y, z, meta, player); } @Override - public ArrayList getDrops(IBlockAccess world, BlockPos blockPos, IBlockState blockState, int fortune) + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); - if (tile instanceof TEBelljar) + if (tile instanceof TEBellJar) { ItemStack drop = new ItemStack(this); NBTTagCompound tag = new NBTTagCompound(); - ((TEBelljar) tile).writeTankNBT(tag); + ((TEBellJar) tile).writeTankNBT(tag); drop.setTagCompound(tag); list.add(drop); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java index 827fd08e..4b0dfb9a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.block; +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.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -18,10 +18,18 @@ public class BlockBloodLightSource extends Block public BlockBloodLightSource() { super(Material.cloth); + this.setBlockName("blockBloodLightSource"); } @Override - public int getLightValue(IBlockAccess world, BlockPos blockPos) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlockBloodLight"); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { return 15; } @@ -33,7 +41,13 @@ public class BlockBloodLightSource extends Block } @Override - public void randomDisplayTick(World world, BlockPos blockPos, IBlockState blockState, Random rand) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random rand) { if (rand.nextInt(3) != 0) { @@ -41,12 +55,13 @@ public class BlockBloodLightSource extends Block float f1 = f * 0.6F + 0.4F; float f2 = f * f * 0.7F - 0.5F; float f3 = f * f * 0.6F - 0.7F; - world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.5D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, f1, f2, f3); + world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 0.5D, z + 0.5D + rand.nextGaussian() / 8, f1, f2, f3); } } @Override - public void addCollisionBoxesToList(World par1World, BlockPos blockPos, IBlockState blockState, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + + 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); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java deleted file mode 100644 index 7bf74a8d..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java +++ /dev/null @@ -1,101 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.block.properties.IProperty; -import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockState; -import net.minecraft.block.state.IBlockState; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import WayofTime.alchemicalWizardry.ModBlocks; - -public class BlockBloodRune extends Block -{ - public static final PropertyInteger INTEGER = PropertyInteger.create("rune", 0, 5); - - public BlockBloodRune() - { - super(Material.iron); - this.setDefaultState(this.blockState.getBaseState().withProperty(INTEGER, Integer.valueOf(0))); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - protected BlockState createBlockState() - { - return new BlockState(this, new IProperty[] {INTEGER}); - } - - @Override - public IBlockState getStateFromMeta(int meta) - { - return this.getDefaultState().withProperty(INTEGER, Integer.valueOf(meta)); - } - - @Override - public int getMetaFromState(IBlockState state) - { - return ((Integer)state.getValue(INTEGER)).intValue(); - } - - public int getRuneEffect(int metaData) - { - switch (metaData) - { - case 0: - return 0; - - case 1: //Altar Capacity rune - return 5; - - case 2: //Filling/emptying rune - return 6; - - case 3: //Orb Capacity rune - return 7; - - case 4: //Better Capacity rune - return 8; - - case 5: //Acceleration rune - return 9; - } - - return 0; - } - - @Override - @SideOnly(Side.CLIENT) - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) - { - if (this.equals(ModBlocks.bloodRune)) - { - 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)); - par3List.add(new ItemStack(par1, 1, 4)); - par3List.add(new ItemStack(par1, 1, 5)); - } else - { - super.getSubBlocks(par1, par2CreativeTabs, par3List); - } - } - - @Override - public int damageDropped(IBlockState blockState) - { - return blockState.getBlock().damageDropped(blockState); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodStoneBrick.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodStoneBrick.java deleted file mode 100644 index dea4dc65..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodStoneBrick.java +++ /dev/null @@ -1,14 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; - -public class BlockBloodStoneBrick extends Block -{ - public BlockBloodStoneBrick() - { - super(Material.iron); - setHardness(2.0F); - setResistance(5.0F); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java index 0974291e..8be5b305 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java @@ -1,24 +1,61 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; -import net.minecraft.block.state.IBlockState; +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.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.world.World; public class BlockConduit extends BlockOrientable { + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + public BlockConduit() { super(); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("blockConduit"); } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { - super.breakBlock(world, blockPos, blockState); + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon2; + } + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + super.breakBlock(world, x, y, z, par5, par6); } @Override @@ -27,6 +64,12 @@ public class BlockConduit extends BlockOrientable return new TEConduit(); } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { @@ -40,7 +83,7 @@ public class BlockConduit extends BlockOrientable } @Override - public boolean hasTileEntity(IBlockState blockState) + public boolean hasTileEntity() { return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockIncenseCrucible.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockCrucible.java similarity index 59% rename from src/main/java/WayofTime/alchemicalWizardry/common/block/BlockIncenseCrucible.java rename to src/main/java/WayofTime/alchemicalWizardry/common/block/BlockCrucible.java index d12a848c..195375ed 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockIncenseCrucible.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockCrucible.java @@ -2,36 +2,48 @@ package WayofTime.alchemicalWizardry.common.block; import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.sacrifice.IIncense; import WayofTime.alchemicalWizardry.common.tileEntity.TECrucible; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class BlockIncenseCrucible extends BlockContainer +public class BlockCrucible extends BlockContainer { - public BlockIncenseCrucible() + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + + public BlockCrucible() { super(Material.anvil); this.setHardness(2.0f); this.setResistance(1.5f); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("blockCrucible"); this.setBlockBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.625F, 0.6875F); } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { - TECrucible tileEntity = (TECrucible) world.getTileEntity(blockPos); + TECrucible tileEntity = (TECrucible) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -51,10 +63,34 @@ public class BlockIncenseCrucible extends BlockContainer // player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); // tileEntity.setInventorySlotContents(0, null); } - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); return true; } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:Crucible_Top"); + this.sideIcon = iconRegister.registerIcon("AlchemicalWizardry:Crucible_Side"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:Crucible_Bottom"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon; + } + } + // @Override // public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) // { @@ -62,7 +98,7 @@ public class BlockIncenseCrucible extends BlockContainer // } @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos blockPos) + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { this.setBlockBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 0.625F, 0.6875F); } @@ -72,6 +108,12 @@ public class BlockIncenseCrucible extends BlockContainer { return false; } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } @Override public TileEntity createNewTileEntity(World world, int meta) @@ -80,20 +122,20 @@ public class BlockIncenseCrucible extends BlockContainer } @Override - public void randomDisplayTick(World world, BlockPos blockPos, IBlockState blockState, Random rand) + public void randomDisplayTick(World world, int x, int y, int z, Random rand) { if (rand.nextInt(3) != 0) { - TECrucible tile = (TECrucible)world.getTileEntity(blockPos); - tile.spawnClientParticle(world, blockPos, rand); + TECrucible tile = (TECrucible)world.getTileEntity(x, y, z); + tile.spawnClientParticle(world, x, y, z, rand); } } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, blockPos); - super.breakBlock(world, blockPos, blockState); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } @Override @@ -103,9 +145,9 @@ public class BlockIncenseCrucible extends BlockContainer } @Override - public int getComparatorInputOverride(World world, BlockPos blockPos) + public int getComparatorInputOverride(World world, int x, int y, int z, int meta) { - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TECrucible) { return ((TECrucible) tile).getRSPowerOutput(); @@ -113,10 +155,10 @@ public class BlockIncenseCrucible extends BlockContainer return 15; } - private void dropItems(World world, BlockPos blockPos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(blockPos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -134,7 +176,9 @@ public class BlockIncenseCrucible extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, + x + rx, y + ry, z + rz, + new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockCrystal.java index 1c917c3c..57184a4f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockCrystal.java @@ -1,28 +1,48 @@ package WayofTime.alchemicalWizardry.common.block; +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.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraft.util.IIcon; import java.util.List; public class BlockCrystal extends Block { + //private Icon bloodRuneIcon; + @SideOnly(Side.CLIENT) + private IIcon fullIcon; + @SideOnly(Side.CLIENT) + private IIcon brickIcon; + + public BlockCrystal() { super(Material.iron); + this.setBlockName("crystalBlock"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setHardness(2.0F); setResistance(5.0F); } @Override @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankRune"); + this.fullIcon = iconRegister.registerIcon("AlchemicalWizardry:ShardCluster"); + this.brickIcon = iconRegister.registerIcon("AlchemicalWizardry:ShardClusterBrick"); + } + + @SideOnly(Side.CLIENT) + /** * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) */ @@ -39,8 +59,25 @@ public class BlockCrystal extends Block } @Override - public int damageDropped(IBlockState blockState) + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { - return blockState.getBlock().damageDropped(blockState); + switch (meta) + { + case 0: + return fullIcon; + + case 1: + return brickIcon; + + default: + return blockIcon; + } + } + + @Override + public int damageDropped(int metadata) + { + return metadata; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java index 9dee123f..eb3ab934 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockDemonPortal.java @@ -1,13 +1,14 @@ package WayofTime.alchemicalWizardry.common.block; +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.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; public class BlockDemonPortal extends BlockContainer @@ -17,18 +18,27 @@ public class BlockDemonPortal extends BlockContainer super(Material.rock); setHardness(1000); setResistance(10000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("demonPortal"); } @Override - public void onBlockHarvested(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { - TileEntity tile = world.getTileEntity(blockPos); + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonPortal"); + } + + @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 TEDemonPortal) { ((TEDemonPortal) tile).notifyPortalOfBreak(); } - super.onBlockHarvested(world, blockPos, blockState, player); + super.onBlockHarvested(world, x, y, z, meta, player); } @Override @@ -38,16 +48,16 @@ public class BlockDemonPortal extends BlockContainer } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + 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(blockPos); + TEDemonPortal tileEntity = (TEDemonPortal) world.getTileEntity(x, y, z); - tileEntity.rightClickBlock(player, side.getIndex()); + tileEntity.rightClickBlock(player, side); return false; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEfficiencyRune.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEfficiencyRune.java deleted file mode 100644 index 2dbb1792..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEfficiencyRune.java +++ /dev/null @@ -1,17 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -public class BlockEfficiencyRune extends BlockBloodRune -{ - public BlockEfficiencyRune() - { - super(); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public int getRuneEffect(int metaData) - { - return 2; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEmptySocket.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEmptySocket.java deleted file mode 100644 index 8aa7e951..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEmptySocket.java +++ /dev/null @@ -1,20 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; - -public class BlockEmptySocket extends Block -{ - public BlockEmptySocket() - { - super(Material.iron); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java index 2eee791d..9cd21a37 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockEnchantmentGlyph.java @@ -4,27 +4,59 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.omega.IEnchantmentGlyph; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph { + @SideOnly(Side.CLIENT) + private IIcon enchantability; + @SideOnly(Side.CLIENT) + private IIcon enchantmentLevel; + public BlockEnchantmentGlyph() { super(Material.iron); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("enchantmentGlyph"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick"); + this.enchantability = iconRegister.registerIcon("AlchemicalWizardry:GlyphEnchantability"); + this.enchantmentLevel = iconRegister.registerIcon("AlchemicalWizardry:GlyphEnchantmentLevel"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (meta) + { + case 0: + return enchantability; + case 1: + return enchantmentLevel; + default: + return this.blockIcon; + } } @Override - public int getAdditionalStabilityForFaceCount(World world, BlockPos pos, int meta, int faceCount) + public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount) { switch(meta) { @@ -38,7 +70,7 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph } @Override - public int getEnchantability(World world, BlockPos pos, int meta) + public int getEnchantability(World world, int x, int y, int z, int meta) { switch(meta) { @@ -50,7 +82,7 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph } @Override - public int getEnchantmentLevel(World world, BlockPos pos, int meta) + public int getEnchantmentLevel(World world, int x, int y, int z, int meta) { switch(meta) { @@ -60,8 +92,7 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph return 0; } } - - @Override + @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { @@ -70,10 +101,10 @@ public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph par3List.add(new ItemStack(par1, 1, i)); } } - - @Override - public int damageDropped(IBlockState blockState) + + @Override + public int damageDropped(int metadata) { - return blockState.getBlock().damageDropped(blockState); + return metadata; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java new file mode 100644 index 00000000..f1ba267a --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java @@ -0,0 +1,98 @@ +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; +import net.minecraft.entity.player.EntityPlayer; +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; + +public class BlockHomHeart extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon; + + public BlockHomHeart() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("blockHomHeart"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_top"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_bottom"); + this.sideIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_side"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEHomHeart tileEntity = (TEHomHeart) world.getTileEntity(x, y, z); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem != null) + { + if (playerItem.getItem() instanceof BlankSpell) + { + if (playerItem.getTagCompound() == null) + { + playerItem.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound itemTag = playerItem.getTagCompound(); + itemTag.setInteger("xCoord", x); + itemTag.setInteger("yCoord", y); + itemTag.setInteger("zCoord", z); + itemTag.setInteger("dimensionId", world.provider.dimensionId); + return true; + } + } + + return false; + } + + @Override + public TileEntity createNewTileEntity(World world, int metaMaybe) + { + return new TEHomHeart(); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLargeBloodStoneBrick.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLargeBloodStoneBrick.java deleted file mode 100644 index 1f12e28d..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLargeBloodStoneBrick.java +++ /dev/null @@ -1,14 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; - -public class BlockLargeBloodStoneBrick extends Block -{ - public BlockLargeBloodStoneBrick() - { - super(Material.iron); - setHardness(2.0F); - setResistance(5.0F); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLifeEssence.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLifeEssence.java deleted file mode 100644 index 37276de0..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockLifeEssence.java +++ /dev/null @@ -1,29 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import net.minecraft.block.material.Material; -import net.minecraft.util.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.fluids.BlockFluidClassic; - -public class BlockLifeEssence extends BlockFluidClassic -{ - public BlockLifeEssence() - { - super(AlchemicalWizardry.lifeEssenceFluid, Material.water); - AlchemicalWizardry.lifeEssenceFluid.setBlock(this); - } - - @Override - public boolean canDisplace(IBlockAccess world, BlockPos blockPos) - { - return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.canDisplace(world, blockPos); - } - - @Override - public boolean displaceIfPossible(World world, BlockPos blockPos) - { - return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.displaceIfPossible(world, blockPos); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java index d30f3e5e..096dc60e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java @@ -1,16 +1,17 @@ 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.block.state.IBlockState; +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.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.Explosion; import net.minecraft.world.World; @@ -21,25 +22,34 @@ public class BlockMasterStone extends BlockContainer super(Material.iron); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("blockMasterStone"); } @Override - public void onBlockHarvested(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { - TileEntity tile = world.getTileEntity(blockPos); + 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, blockPos, blockState, player); + super.onBlockHarvested(world, x, y, z, meta, player); } @Override - public void onBlockDestroyedByExplosion(World world, BlockPos blockPos, Explosion explosion) + public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) { - super.onBlockDestroyedByExplosion(world, blockPos, explosion); - TileEntity tile = world.getTileEntity(blockPos); + super.onBlockDestroyedByExplosion(world, x, y, z, explosion); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TEMasterStone) { ((TEMasterStone) tile).useOnRitualBrokenExplosion(); @@ -47,9 +57,9 @@ public class BlockMasterStone extends BlockContainer } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { - TEMasterStone tileEntity = (TEMasterStone) world.getTileEntity(blockPos); + TEMasterStone tileEntity = (TEMasterStone) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -72,8 +82,8 @@ public class BlockMasterStone extends BlockContainer ActivationCrystal acItem = (ActivationCrystal) item; // tileEntity.setOwner(acItem.getOwnerName(playerItem)); - tileEntity.activateRitual(world, acItem.getCrystalLevel(playerItem), playerItem, player, ActivationCrystal.getOwnerName(playerItem)); - world.markBlockForUpdate(blockPos); + tileEntity.activateRitual(world, acItem.getCrystalLevel(playerItem), playerItem, player, acItem.getOwnerName(playerItem)); + world.markBlockForUpdate(x, y, z); return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMimic.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMimic.java deleted file mode 100644 index 7737d3ac..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockMimic.java +++ /dev/null @@ -1,210 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.particle.EffectRenderer; -import net.minecraft.client.particle.EntityDiggingFX; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.tileEntity.TEMimicBlock; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class BlockMimic extends BlockContainer -{ - public BlockMimic() - { - super(Material.water); - setHardness(2.0F); - setResistance(5.0F); -// this.setBlockBounds(0, 0, 0, 0, 0, 0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess world, BlockPos blockPos, EnumFacing side) - { - TileEntity TE = world.getTileEntity(blockPos); - if(!(TE instanceof TEMimicBlock)) - { - return true; - } - TEMimicBlock mimic = (TEMimicBlock)TE; - - Block block = mimic.getBlock(); - - return block == null || block.shouldSideBeRendered(world, blockPos, side); - } - - @Override - public boolean canCollideCheck(IBlockState blockState, boolean bool) - { - return blockState.getBlock().getMetaFromState(blockState) == 1; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) - { - return new TEMimicBlock(); - } - - @Override - public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) - { - return false; - } - - @Override - public int quantityDropped(Random random) - { - return 0; - } - - @Override - public boolean isBlockSolid(IBlockAccess world, BlockPos blockPos, EnumFacing side) - { - TileEntity tile = world.getTileEntity(blockPos); - if(tile instanceof TEMimicBlock) - { - Block block = ((TEMimicBlock) tile).getBlock(); - int mimicMeta = ((TEMimicBlock) tile).getMetaOfMimic(); - - if(block != null) - { - return block.isBlockSolid(world, blockPos, side); //side was mimicM - } - } - return super.isBlockSolid(world, blockPos, side); - } - - @Override - public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer) - { - TileEntity tile = world.getTileEntity(target.func_178782_a()); - - TEMimicBlock TE = (TEMimicBlock)tile; - - if (TE != null) - { - Block block = TE.getBlock(); - - double xOffset = target.func_178782_a().getX() + world.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinX(); - double yOffset = target.func_178782_a().getY() + world.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinY(); - double zOffset = target.func_178782_a().getZ() + world.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinZ(); - - switch (target.subHit) - { - case 0: - yOffset = target.func_178782_a().getY() + block.getBlockBoundsMinY() - 0.1D; - break; - case 1: - yOffset = target.func_178782_a().getY() + block.getBlockBoundsMaxY() + 0.1D; - break; - case 2: - zOffset = target.func_178782_a().getZ() + block.getBlockBoundsMinZ() - 0.1D; - break; - case 3: - zOffset = target.func_178782_a().getZ() + block.getBlockBoundsMaxZ() + 0.1D; - break; - case 4: - xOffset = target.func_178782_a().getX() + block.getBlockBoundsMinX() - 0.1D; - break; - case 5: - xOffset = target.func_178782_a().getX() + block.getBlockBoundsMaxX() + 0.1D; - break; - } - -// BlockMimic.addHitEffect(TE, target, xOffset, yOffset, zOffset, null, effectRenderer); - - return true; - - } - - return super.addHitEffects(world, target, effectRenderer); - } - - @Override - public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockPos, IBlockState blockState) - { - TEMimicBlock tile = (TEMimicBlock)world.getTileEntity(blockPos); - Block block = tile.getBlock(); - - return block != null ? block.getCollisionBoundingBox(world, blockPos, blockState) : super.getCollisionBoundingBox(world, blockPos, blockState); - } - - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess blockAccess, BlockPos blockPos, int renderPass) - { - TEMimicBlock TE = (TEMimicBlock)blockAccess.getTileEntity(blockPos); - if (TE != null) - { - Block block = TE.getBlock(); - if(block != null) - { - return block.colorMultiplier(blockAccess, blockPos); - } - } - - return super.colorMultiplier(blockAccess, blockPos); - } - -/* @Override - public void velocityToAddToEntity(World world, BlockPos, Entity entity, Vec3 vec) - { - TEMimicBlock TE = (TEMimicBlock)world.getTileEntity(x, y, z); - if (TE != null) - { - Block block = TE.getBlock(); - if(block != null) - { - block.velocityToAddToEntity(world, x, y, z, entity, vec); - } - } - } - No longer in 1.8 apparently - - public static void addHitEffect(TEMimicBlock TE, MovingObjectPosition target, double x, double y, double z, ItemStack itemStack, EffectRenderer effectRenderer) - { - EntityDiggingFX particle = new EntityDiggingFX(TE.getWorld(), x, y, z, 0.0D, 0.0D, 0.0D, TE.getBlock(), TE.getMetaOfMimic()); - effectRenderer.addEffect(particle.func_174846_a(target.func_178782_a()).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); - } -*/ - @Override - public void onEntityCollidedWithBlock(World world, BlockPos blockPos, Entity entity) - { - TEMimicBlock TE = (TEMimicBlock)world.getTileEntity(blockPos); - if (TE != null) - { - if(TE.getBlockEffectWhileInside(entity, blockPos)) - { - return; - }else - { - Block block = TE.getBlock(); - if(block != null) - { - block.onEntityCollidedWithBlock(world, blockPos, entity); - return; - } - } - } - - super.onEntityCollidedWithBlock(world, blockPos, entity); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java index 0e919d8e..6836b7ff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java @@ -1,14 +1,13 @@ package WayofTime.alchemicalWizardry.common.block; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class BlockOrientable extends BlockContainer { @@ -17,6 +16,7 @@ public class BlockOrientable extends BlockContainer super(Material.rock); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -26,7 +26,7 @@ public class BlockOrientable extends BlockContainer } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + 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. if (world.isRemote) @@ -34,20 +34,20 @@ public class BlockOrientable extends BlockContainer return false; } - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TEOrientable) { TEOrientable newTile = (TEOrientable) tile; if (player.isSneaking()) { - int nextSide = TEOrientable.getIntForEnumFacing(newTile.getInputDirection()) + 1; + int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection()) + 1; if (nextSide > 5) { nextSide = 0; } - if (EnumFacing.getFront(nextSide) == newTile.getOutputDirection()) + if (ForgeDirection.getOrientation(nextSide) == newTile.getOutputDirection()) { nextSide++; if (nextSide > 5) @@ -56,16 +56,16 @@ public class BlockOrientable extends BlockContainer } } - newTile.setInputDirection(EnumFacing.getFront(nextSide)); + newTile.setInputDirection(ForgeDirection.getOrientation(nextSide)); } else { - int nextSide = TEOrientable.getIntForEnumFacing(newTile.getOutputDirection()) + 1; + int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection()) + 1; if (nextSide > 5) { nextSide = 0; } - if (EnumFacing.getFront(nextSide) == newTile.getInputDirection()) + if (ForgeDirection.getOrientation(nextSide) == newTile.getInputDirection()) { nextSide++; if (nextSide > 5) @@ -74,17 +74,17 @@ public class BlockOrientable extends BlockContainer } } - newTile.setOutputDirection(EnumFacing.getFront(nextSide)); + newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide)); } } - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); return true; } @Override - public int damageDropped(IBlockState blockState) + public int damageDropped(int metadata) { - return blockState.getBlock().damageDropped(blockState); + return metadata; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java index 0a7ce6f4..d057b4a3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java @@ -2,35 +2,71 @@ package WayofTime.alchemicalWizardry.common.block; import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; 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; public class BlockPedestal extends BlockContainer { + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + public BlockPedestal() { super(Material.rock); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("bloodPedestal"); float f = 0.3125F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { - TEPedestal tileEntity = (TEPedestal) world.getTileEntity(blockPos); + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePedestal"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEPedestal tileEntity = (TEPedestal) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -51,21 +87,21 @@ public class BlockPedestal extends BlockContainer tileEntity.setInventorySlotContents(0, null); tileEntity.setActive(); } - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); return true; } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, blockPos); - super.breakBlock(world, blockPos, blockState); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } - private void dropItems(World world, BlockPos blockPos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(blockPos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -83,7 +119,7 @@ public class BlockPedestal extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { @@ -106,6 +142,12 @@ public class BlockPedestal extends BlockContainer return new TEPedestal(); } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { @@ -119,7 +161,7 @@ public class BlockPedestal extends BlockContainer } @Override - public boolean hasTileEntity(IBlockState blockState) + public boolean hasTileEntity() { return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java index 6d4b79e7..56d47c64 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java @@ -2,35 +2,71 @@ package WayofTime.alchemicalWizardry.common.block; import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; 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; public class BlockPlinth extends BlockContainer { + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + public BlockPlinth() { super(Material.rock); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("bloodPlinth"); float f = 0.0625F; this.setBlockBounds(f, 0.0F, f, 1.0f - f, 0.875f, 1.0f - f); } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { - TEPlinth tileEntity = (TEPlinth) world.getTileEntity(blockPos); + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePlinth"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEPlinth tileEntity = (TEPlinth) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -51,21 +87,21 @@ public class BlockPlinth extends BlockContainer tileEntity.setInventorySlotContents(0, null); tileEntity.setActive(); } - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); return true; } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, blockPos); - super.breakBlock(world, blockPos, blockState); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } - private void dropItems(World world, BlockPos blockPos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(blockPos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -83,7 +119,7 @@ public class BlockPlinth extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { @@ -106,6 +142,12 @@ public class BlockPlinth extends BlockContainer return new TEPlinth(); } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { @@ -119,7 +161,7 @@ public class BlockPlinth extends BlockContainer } @Override - public boolean hasTileEntity(IBlockState blockState) + public boolean hasTileEntity() { return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java index f6cb50a5..eeae6acc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockReagentConduit.java @@ -2,13 +2,14 @@ package WayofTime.alchemicalWizardry.common.block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; 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 { @@ -17,6 +18,15 @@ public class BlockReagentConduit extends BlockContainer super(Material.cloth); setHardness(2.0F); setResistance(5.0F); + this.setBlockName("blockReagentConduit"); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleTransCircle"); } @Override @@ -32,9 +42,9 @@ public class BlockReagentConduit extends BlockContainer } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + 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, blockPos, state, player, side, hitX, hitY, hitZ); + return super.onBlockActivated(world, x, y, z, player, side, what, these, are); } @Override @@ -43,6 +53,12 @@ public class BlockReagentConduit extends BlockContainer return false; } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRitualStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRitualStone.java deleted file mode 100644 index 6a5ed2db..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRitualStone.java +++ /dev/null @@ -1,69 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import WayofTime.alchemicalWizardry.api.rituals.IRitualStone; -import WayofTime.alchemicalWizardry.common.items.ScribeTool; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; - -public class BlockRitualStone extends Block implements IRitualStone -{ - public BlockRitualStone() - { - super(Material.iron); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public int damageDropped(IBlockState blockState) - { - return 0; - } - - @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) - { - ItemStack playerItem = player.getCurrentEquippedItem(); - - if (playerItem == null) - { - return false; - } - - Item item = playerItem.getItem(); - - if (!(item instanceof ScribeTool)) - { - return false; - } - - if (playerItem.getMaxDamage() <= playerItem.getItemDamage() && !(playerItem.getMaxDamage() == 0)) - { - return false; - } - - ScribeTool scribeTool = (ScribeTool) item; - - if (!player.capabilities.isCreativeMode) - { - playerItem.setItemDamage(playerItem.getItemDamage() + 1); - } - - world.setBlockState(blockPos, state.getBlock().getStateFromMeta(scribeTool.getType()), 3); - world.markBlockForUpdate(blockPos); - return true; - } - - @Override - public boolean isRuneType(World world, BlockPos blockPos, IBlockState blockState, int runeType) - { - return blockState.getBlock().getMetaFromState(blockState) == runeType; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSacrifice.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSacrifice.java deleted file mode 100644 index a5786b30..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSacrifice.java +++ /dev/null @@ -1,17 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -public class BlockRuneOfSacrifice extends BlockBloodRune -{ - public BlockRuneOfSacrifice() - { - super(); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public int getRuneEffect(int metaData) - { - return 3; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSelfSacrifice.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSelfSacrifice.java deleted file mode 100644 index c7b729a0..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockRuneOfSelfSacrifice.java +++ /dev/null @@ -1,17 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -public class BlockRuneOfSelfSacrifice extends BlockBloodRune -{ - public BlockRuneOfSelfSacrifice() - { - super(); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public int getRuneEffect(int metaData) - { - return 4; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java index 7d7ab440..813e00ad 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSchematicSaver.java @@ -1,13 +1,11 @@ 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.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; public class BlockSchematicSaver extends BlockContainer @@ -17,6 +15,8 @@ public class BlockSchematicSaver extends BlockContainer super(Material.rock); setHardness(2.0F); setResistance(5.0F); +// setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("schematicSaver"); } @Override @@ -26,16 +26,16 @@ public class BlockSchematicSaver extends BlockContainer } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + 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(blockPos); + TESchematicSaver tileEntity = (TESchematicSaver) world.getTileEntity(x, y, z); - tileEntity.rightClickBlock(); + tileEntity.rightClickBlock(player, side); return false; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockFilledSocket.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java similarity index 60% rename from src/main/java/WayofTime/alchemicalWizardry/common/block/BlockFilledSocket.java rename to src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java index d59b4cb9..9cfd5bcd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockFilledSocket.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java @@ -1,36 +1,72 @@ package WayofTime.alchemicalWizardry.common.block; +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; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import java.util.Random; -public class BlockFilledSocket extends BlockContainer +public class BlockSocket extends BlockContainer { - public BlockFilledSocket() + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + + public BlockSocket() { super(Material.rock); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("bloodSocket"); //func_111022_d("AlchemicalWizardry:blocks"); } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { - TESocket tileEntity = (TESocket) world.getTileEntity(blockPos); + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TESocket tileEntity = (TESocket) world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -60,21 +96,21 @@ public class BlockFilledSocket extends BlockContainer tileEntity.setActive(); return true; } - world.markBlockForUpdate(blockPos); + world.markBlockForUpdate(x, y, z); return false; } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, blockPos); - super.breakBlock(world, blockPos, blockState); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } - private void dropItems(World world, BlockPos blockPos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(blockPos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -92,7 +128,7 @@ public class BlockFilledSocket extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java index 9b024b1b..adf845bb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectralContainer.java @@ -1,13 +1,14 @@ package WayofTime.alchemicalWizardry.common.block; 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.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -19,9 +20,17 @@ public class BlockSpectralContainer extends BlockContainer public BlockSpectralContainer() { super(Material.cloth); + this.setBlockName("blockSpectralContainer"); this.setBlockBounds(0, 0, 0, 0, 0, 0); } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlockBloodLight"); + } + @Override public boolean isOpaqueCube() { @@ -29,22 +38,30 @@ public class BlockSpectralContainer extends BlockContainer } @Override - public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) {} + public boolean renderAsNormalBlock() + { + return false; + } @Override + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + { + + } + public int quantityDropped(Random par1Random) { return 0; } @Override - public boolean isReplaceable(World world, BlockPos blockPos) + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) { return true; } @Override - public boolean isAir(IBlockAccess world, BlockPos blockPos) + public boolean isAir(IBlockAccess world, int x, int y, int z) { return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpeedRune.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpeedRune.java deleted file mode 100644 index 4db82016..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpeedRune.java +++ /dev/null @@ -1,17 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -public class BlockSpeedRune extends BlockBloodRune -{ - public BlockSpeedRune() - { - super(); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public int getRuneEffect(int metaData) - { - return 1; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java index c7f31294..18e6d1bb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java @@ -2,21 +2,23 @@ package WayofTime.alchemicalWizardry.common.block; 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; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; + public class BlockSpellEffect extends BlockOrientable { public BlockSpellEffect() { super(); + this.setBlockName("blockSpellEffect"); } @Override @@ -25,6 +27,12 @@ public class BlockSpellEffect extends BlockOrientable return new TESpellEffectBlock(); } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { @@ -37,7 +45,6 @@ public class BlockSpellEffect extends BlockOrientable return false; } - @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java index 1a0f3ddf..b58d36c0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java @@ -2,13 +2,13 @@ package WayofTime.alchemicalWizardry.common.block; 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; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; @@ -17,6 +17,7 @@ public class BlockSpellEnhancement extends BlockOrientable public BlockSpellEnhancement() { super(); + this.setBlockName("blockSpellEnhancement"); } @Override @@ -25,6 +26,12 @@ public class BlockSpellEnhancement extends BlockOrientable return new TESpellEnhancementBlock(); } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { @@ -37,7 +44,6 @@ public class BlockSpellEnhancement extends BlockOrientable return false; } - @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java index 241f9fd8..80c384cc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java @@ -2,13 +2,13 @@ package WayofTime.alchemicalWizardry.common.block; 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; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; @@ -17,6 +17,7 @@ public class BlockSpellModifier extends BlockOrientable public BlockSpellModifier() { super(); + this.setBlockName("blockSpellModifier"); } @Override @@ -25,7 +26,6 @@ public class BlockSpellModifier extends BlockOrientable return new TESpellModifierBlock(); } - @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { @@ -47,6 +47,12 @@ public class BlockSpellModifier extends BlockOrientable return false; } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java index 6c8d15b9..e510791c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java @@ -3,18 +3,15 @@ package WayofTime.alchemicalWizardry.common.block; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal; import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; -import net.minecraft.block.state.IBlockState; +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.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; @@ -23,6 +20,7 @@ public class BlockSpellParadigm extends BlockOrientable public BlockSpellParadigm() { super(); + this.setBlockName("blockSpellParadigm"); } @Override @@ -31,8 +29,8 @@ public class BlockSpellParadigm extends BlockOrientable return new TESpellParadigmBlock(); } - @Override @SideOnly(Side.CLIENT) + /** * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) */ @@ -51,7 +49,7 @@ public class BlockSpellParadigm extends BlockOrientable } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + 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(); @@ -63,14 +61,14 @@ public class BlockSpellParadigm extends BlockOrientable } NBTTagCompound itemTag = stack.getTagCompound(); - itemTag.setInteger("xCoord", blockPos.getX()); - itemTag.setInteger("yCoord", blockPos.getY()); - itemTag.setInteger("zCoord", blockPos.getZ()); - itemTag.setInteger("dimensionId", world.provider.getDimensionId()); + itemTag.setInteger("xCoord", x); + itemTag.setInteger("yCoord", y); + itemTag.setInteger("zCoord", z); + itemTag.setInteger("dimensionId", world.provider.dimensionId); return true; } - return super.onBlockActivated(world, blockPos, state, player, side, hitX, hitY, hitZ); + return super.onBlockActivated(world, x, y, z, player, side, what, these, are); } @Override @@ -79,6 +77,12 @@ public class BlockSpellParadigm extends BlockOrientable return false; } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @Override public int getRenderType() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellTable.java deleted file mode 100644 index 89b4746e..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpellTable.java +++ /dev/null @@ -1,63 +0,0 @@ -package WayofTime.alchemicalWizardry.common.block; - -import WayofTime.alchemicalWizardry.common.items.BlankSpell; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellTable; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; - -public class BlockSpellTable extends BlockContainer -{ - public BlockSpellTable() - { - super(Material.rock); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) - { - TESpellTable tileEntity = (TESpellTable) world.getTileEntity(blockPos); - - if (tileEntity == null || player.isSneaking()) - { - return false; - } - - ItemStack playerItem = player.getCurrentEquippedItem(); - - if (playerItem != null) - { - if (playerItem.getItem() instanceof BlankSpell) - { - if (playerItem.getTagCompound() == null) - { - playerItem.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound itemTag = playerItem.getTagCompound(); - itemTag.setInteger("xCoord", blockPos.getX()); - itemTag.setInteger("yCoord", blockPos.getY()); - itemTag.setInteger("zCoord", blockPos.getZ()); - itemTag.setInteger("dimensionId", world.provider.getDimensionId()); - return true; - } - } - - return false; - } - - @Override - public TileEntity createNewTileEntity(World world, int metaMaybe) - { - return new TESpellTable(); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java index 55be5fde..50cddbf5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockStabilityGlyph.java @@ -4,26 +4,54 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.omega.IStabilityGlyph; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockStabilityGlyph extends Block implements IStabilityGlyph { + @SideOnly(Side.CLIENT) + private IIcon stability1; + public BlockStabilityGlyph() { super(Material.iron); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("stabilityGlyph"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick"); + this.stability1 = iconRegister.registerIcon("AlchemicalWizardry:GlyphStability1"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (meta) + { + case 0: + return stability1; + default: + return this.blockIcon; + } } @Override - public int getAdditionalStabilityForFaceCount(World world, BlockPos pos, int meta, int faceCount) + public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount) { switch(meta) { @@ -34,7 +62,7 @@ public class BlockStabilityGlyph extends Block implements IStabilityGlyph } } - @Override + @SideOnly(Side.CLIENT) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java index 56a31494..97dea481 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java @@ -7,7 +7,7 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockMobSpawner; import net.minecraft.block.BlockPortal; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -15,31 +15,65 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -//import net.minecraftforge.fml.common.Optional; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.event.TeleposeEvent; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; -//import codechicken.multipart.MultipartHelper; -//import codechicken.multipart.TileMultipart; +import codechicken.multipart.MultipartHelper; +import codechicken.multipart.TileMultipart; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockTeleposer extends BlockContainer { + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + public BlockTeleposer() { super(Material.rock); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("bloodTeleposer"); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Top"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { ItemStack playerItem = player.getCurrentEquippedItem(); @@ -55,28 +89,28 @@ public class BlockTeleposer extends BlockContainer } NBTTagCompound itemTag = playerItem.getTagCompound(); - itemTag.setInteger("xCoord", pos.getX()); - itemTag.setInteger("yCoord", pos.getY()); - itemTag.setInteger("zCoord", pos.getZ()); - itemTag.setInteger("dimensionId", world.provider.getDimensionId()); + itemTag.setInteger("xCoord", x); + itemTag.setInteger("yCoord", y); + itemTag.setInteger("zCoord", z); + itemTag.setInteger("dimensionId", world.provider.dimensionId); return true; } } - player.openGui(AlchemicalWizardry.instance, 1, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(AlchemicalWizardry.instance, 1, world, x, y, z); return true; } @Override - public void breakBlock(World world, BlockPos pos, IBlockState state) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, pos); - super.breakBlock(world, pos, state); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } - private void dropItems(World world, BlockPos pos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(pos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -94,7 +128,7 @@ public class BlockTeleposer extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, pos.getX() + rx, pos.getY() + ry, pos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { @@ -117,20 +151,20 @@ public class BlockTeleposer extends BlockContainer return new TETeleposer(); } - public static boolean swapBlocks(Object caller, World worldI, World worldF, BlockPos posi, BlockPos posf) + public static boolean swapBlocks(Object caller, World worldI, World worldF, int xi, int yi, int zi, int xf, int yf, int zf) { - return swapBlocks(caller, worldI, worldF, posi, posf, true, 3); + return swapBlocks(caller, worldI, worldF, xi, yi, zi, xf, yf, zf, true, 3); } - public static boolean swapBlocksWithoutSound(Object caller, World worldI, World worldF, BlockPos posi, BlockPos posf) + public static boolean swapBlocksWithoutSound(Object caller, World worldI, World worldF, int xi, int yi, int zi, int xf, int yf, int zf) { - return swapBlocks(caller, worldI, worldF, posi, posf, false, 3); + return swapBlocks(caller, worldI, worldF, xi, yi, zi, xf, yf, zf, false, 3); } - public static boolean swapBlocks(Object caller, World worldI, World worldF, BlockPos posi, BlockPos posf, boolean doSound, int flag) + public static boolean swapBlocks(Object caller, World worldI, World worldF, int xi, int yi, int zi, int xf, int yf, int zf, boolean doSound, int flag) { - TileEntity tileEntityI = worldI.getTileEntity(posi); - TileEntity tileEntityF = worldF.getTileEntity(posf); + TileEntity tileEntityI = worldI.getTileEntity(xi, yi, zi); + TileEntity tileEntityF = worldF.getTileEntity(xf, yf, zf); NBTTagCompound nbttag1 = new NBTTagCompound(); NBTTagCompound nbttag2 = new NBTTagCompound(); @@ -145,10 +179,8 @@ public class BlockTeleposer extends BlockContainer tileEntityF.writeToNBT(nbttag2); } - IBlockState stateI = worldI.getBlockState(posi); - Block blockI = stateI.getBlock(); - IBlockState stateF = worldF.getBlockState(posf); - Block blockF = stateF.getBlock(); + Block blockI = worldI.getBlock(xi, yi, zi); + Block blockF = worldF.getBlock(xf, yf, zf); if (blockI.equals(Blocks.air) && blockF.equals(Blocks.air)) @@ -160,15 +192,18 @@ public class BlockTeleposer extends BlockContainer { return false; } + + int metaI = worldI.getBlockMetadata(xi, yi, zi); + int metaF = worldF.getBlockMetadata(xf, yf, zf); - TeleposeEvent evt = new TeleposeEvent(worldI, posi, stateI, worldF, posf, stateF); + TeleposeEvent evt = new TeleposeEvent(worldI, xi, yi, zi, blockI, metaI, worldF, xf, yf, zf, blockF, metaF); if (MinecraftForge.EVENT_BUS.post(evt)) return false; if(doSound) { - worldI.playSoundEffect(posi.getX(), posi.getY(), posi.getZ(), "mob.endermen.portal", 1.0F, 1.0F); - worldF.playSoundEffect(posf.getX(), posf.getY(), posf.getZ(), "mob.endermen.portal", 1.0F, 1.0F); + worldI.playSoundEffect(xi, yi, zi, "mob.endermen.portal", 1.0F, 1.0F); + worldF.playSoundEffect(xf, yf, zf, "mob.endermen.portal", 1.0F, 1.0F); } //CLEAR TILES @@ -176,68 +211,73 @@ public class BlockTeleposer extends BlockContainer if (finalBlock != null) { - TileEntity tileToSet = finalBlock.createTileEntity(worldF, stateF); + TileEntity tileToSet = finalBlock.createTileEntity(worldF, metaF); - worldF.setTileEntity(posf, tileToSet); + worldF.setTileEntity(xf, yf, zf, tileToSet); } if (blockI != null) { - TileEntity tileToSet = blockI.createTileEntity(worldI, stateI); + TileEntity tileToSet = blockI.createTileEntity(worldI, metaI); - worldI.setTileEntity(posi, tileToSet); + worldI.setTileEntity(xi, yi, zi, tileToSet); } //TILES CLEARED - worldF.setBlockState(posf, stateI, flag); + worldF.setBlock(xf, yf, zf, blockI, metaI, flag); if (tileEntityI != null) { TileEntity newTileEntityI = TileEntity.createAndLoadEntity(nbttag1); -// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI)) + if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI)) { -// newTileEntityI = createMultipartFromNBT(worldF, nbttag1); + newTileEntityI = createMultipartFromNBT(worldF, nbttag1); } - worldF.setTileEntity(posf, newTileEntityI); + worldF.setTileEntity(xf, yf, zf, newTileEntityI); - newTileEntityI.setPos(posf); -// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI)) + newTileEntityI.xCoord = xf; + newTileEntityI.yCoord = yf; + newTileEntityI.zCoord = zf; + + if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityI)) { -// sendDescriptorOfTile(worldF, newTileEntityI); + sendDescriptorOfTile(worldF, newTileEntityI); } } - worldI.setBlockState(posi, stateF, flag); + worldI.setBlock(xi, yi, zi, finalBlock, metaF, flag); if (tileEntityF != null) { TileEntity newTileEntityF = TileEntity.createAndLoadEntity(nbttag2); -// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF)) + if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF)) { -// newTileEntityF = createMultipartFromNBT(worldI, nbttag2); + newTileEntityF = createMultipartFromNBT(worldI, nbttag2); } - worldI.setTileEntity(posi, newTileEntityF); + worldI.setTileEntity(xi, yi, zi, newTileEntityF); - newTileEntityF.setPos(posi); + newTileEntityF.xCoord = xi; + newTileEntityF.yCoord = yi; + newTileEntityF.zCoord = zi; -// if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF)) + if(AlchemicalWizardry.isFMPLoaded && isMultipart(tileEntityF)) { -// sendDescriptorOfTile(worldI, newTileEntityF); + sendDescriptorOfTile(worldI, newTileEntityF); } } return true; } -/* @Optional.Method(modid = "ForgeMultipart") + @Optional.Method(modid = "ForgeMultipart") public static boolean isMultipart(TileEntity tile) { return tile instanceof TileMultipart; } - + @Optional.Method(modid = "ForgeMultipart") public static TileEntity createMultipartFromNBT(World world, NBTTagCompound tag) { @@ -249,5 +289,4 @@ public class BlockTeleposer extends BlockContainer { MultipartHelper.sendDescPacket(world, tile); } - */ } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockChemistrySet.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java similarity index 50% rename from src/main/java/WayofTime/alchemicalWizardry/common/block/BlockChemistrySet.java rename to src/main/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java index 9830f182..c55e50a8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockChemistrySet.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java @@ -1,10 +1,13 @@ package WayofTime.alchemicalWizardry.common.block; import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; +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; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -13,26 +16,58 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import java.util.List; import java.util.Random; -public class BlockChemistrySet extends BlockContainer +public class BlockWritingTable extends BlockContainer { - public BlockChemistrySet() + @SideOnly(Side.CLIENT) + private IIcon topIcon; + @SideOnly(Side.CLIENT) + private IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + + public BlockWritingTable() { super(Material.wood); setHardness(2.0F); setResistance(5.0F); + this.setBlockName("blockWritingTable"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { - TileEntity tileEntity = world.getTileEntity(blockPos); + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:AlchemicChemistrySet"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + case 1: + return topIcon; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float what, float these, float are) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { @@ -40,21 +75,21 @@ public class BlockChemistrySet extends BlockContainer } //code to open gui explained later - player.openGui(AlchemicalWizardry.instance, 0, world, blockPos.getX(), blockPos.getY(), blockPos.getZ()); + player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); return true; } @Override - public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, blockPos); - super.breakBlock(world, blockPos, blockState); + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); } - private void dropItems(World world, BlockPos blockPos) + private void dropItems(World world, int x, int y, int z) { Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(blockPos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { @@ -72,7 +107,9 @@ public class BlockChemistrySet extends BlockContainer float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, blockPos.getX() + rx, blockPos.getY() + ry, blockPos.getZ() + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, + x + rx, y + ry, z + rz, + new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { @@ -92,7 +129,13 @@ public class BlockChemistrySet extends BlockContainer @Override public TileEntity createNewTileEntity(World world, int meta) { - return new TEChemistrySet(); + return new TEWritingTable(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; } @Override @@ -108,21 +151,20 @@ public class BlockChemistrySet extends BlockContainer } @Override - public boolean hasTileEntity(IBlockState blockState) + public boolean hasTileEntity() { return true; } @Override - public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.9375F, 0.5625F); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); this.setBlockBoundsForItemRender(); - super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } - @Override public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java new file mode 100644 index 00000000..9b1cdf56 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java @@ -0,0 +1,132 @@ +package WayofTime.alchemicalWizardry.common.block; + +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; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import java.util.List; + +public class BloodRune extends Block +{ + //private Icon bloodRuneIcon; + @SideOnly(Side.CLIENT) + private IIcon altarCapacityRuneIcon; + @SideOnly(Side.CLIENT) + private IIcon dislocationRuneIcon; + @SideOnly(Side.CLIENT) + private IIcon orbCapacityRuneIcon; + @SideOnly(Side.CLIENT) + private IIcon betterCapacityRuneIcon; + @SideOnly(Side.CLIENT) + private IIcon accelerationRuneIcon; + + public BloodRune() + { + super(Material.iron); + this.setBlockName("bloodRune"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankRune"); + this.altarCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AltarCapacityRune"); + this.dislocationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:DislocationRune"); + this.orbCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:OrbCapacityRune"); + this.betterCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:BetterCapacityRune"); + this.accelerationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AccelerationRune"); + } + + public int getRuneEffect(int metaData) + { + switch (metaData) + { + case 0: + return 0; + + case 1: //Altar Capacity rune + return 5; + + case 2: //Filling/emptying rune + return 6; + + case 3: //Orb Capacity rune + return 7; + + case 4: //Better Capacity rune + return 8; + + case 5: //Acceleration rune + return 9; + } + + return 0; + } + + @SideOnly(Side.CLIENT) + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.equals(ModBlocks.bloodRune)) + { + 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)); + par3List.add(new ItemStack(par1, 1, 4)); + par3List.add(new ItemStack(par1, 1, 5)); + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (meta) + { + case 0: + return blockIcon; + + case 1: + return altarCapacityRuneIcon; + + case 2: + return dislocationRuneIcon; + + case 3: + return this.orbCapacityRuneIcon; + + case 4: + return this.betterCapacityRuneIcon; + + case 5: + return this.accelerationRuneIcon; + default: + return blockIcon; + } + } + + @Override + public int damageDropped(int metadata) + { + return metadata; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java new file mode 100644 index 00000000..054cd8b8 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java @@ -0,0 +1,27 @@ +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.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class BloodStoneBrick extends Block +{ + public BloodStoneBrick() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("bloodStoneBrick"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodStoneBrick"); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java new file mode 100644 index 00000000..6226b917 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +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 +{ + public EfficiencyRune() + { + super(); + this.setBlockName("efficiencyRune"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:EfficiencyRune"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 2; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java new file mode 100644 index 00000000..f6964f63 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java @@ -0,0 +1,33 @@ +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.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class EmptySocket extends Block +{ + public EmptySocket() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("emptySocket"); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:EmptySocket"); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/IOrientable.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/IOrientable.java index f270aa72..7545d11c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/IOrientable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/IOrientable.java @@ -1,14 +1,14 @@ package WayofTime.alchemicalWizardry.common.block; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public interface IOrientable { - EnumFacing getInputDirection(); + ForgeDirection getInputDirection(); - EnumFacing getOutputDirection(); + ForgeDirection getOutputDirection(); - void setInputDirection(EnumFacing direction); + void setInputDirection(ForgeDirection direction); - void setOutputDirection(EnumFacing direction); + void setOutputDirection(ForgeDirection direction); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockImperfectRitualStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java similarity index 70% rename from src/main/java/WayofTime/alchemicalWizardry/common/block/BlockImperfectRitualStone.java rename to src/main/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java index 6e409014..cde800fc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockImperfectRitualStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java @@ -1,49 +1,59 @@ package WayofTime.alchemicalWizardry.common.block; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +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.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -public class BlockImperfectRitualStone extends Block +public class ImperfectRitualStone extends Block { - public BlockImperfectRitualStone() + public ImperfectRitualStone() { super(Material.iron); setHardness(2.0F); setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("imperfectRitualStone"); } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:ImperfectRitualStone"); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOff, float yOff, float zOff) { if(SpellHelper.isFakePlayer(player)) { return false; } { - Block block = world.getBlockState(blockPos.add(0, 1, 0)).getBlock(); + Block block = world.getBlock(x, y + 1, z); if (block == Blocks.water) { if (!player.capabilities.isCreativeMode && !world.isRemote) { - SoulNetworkHandler.hurtPlayer(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } if (!world.isRemote) { - world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ())); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); } world.getWorldInfo().setRaining(true); @@ -61,11 +71,11 @@ public class BlockImperfectRitualStone extends Block { if (!player.capabilities.isCreativeMode && !world.isRemote) { - SoulNetworkHandler.hurtPlayer(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } EntityZombie zomb = new EntityZombie(world); - zomb.setPosition(blockPos.getX() + 0.5, blockPos.getY() + 2, blockPos.getZ() + 0.5); + zomb.setPosition(x + 0.5, y + 2, z + 0.5); 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)); @@ -73,7 +83,7 @@ public class BlockImperfectRitualStone extends Block if (!world.isRemote) { world.spawnEntityInWorld(zomb); - world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ())); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); } return true; @@ -81,24 +91,24 @@ public class BlockImperfectRitualStone extends Block { if (!player.capabilities.isCreativeMode && !world.isRemote) { - SoulNetworkHandler.hurtPlayer(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } if (!world.isRemote) { - world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ())); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); world.setWorldTime((world.getWorldTime() / 24000) * 24000 + 13800); } } else if (block == Blocks.bedrock) { if (!player.capabilities.isCreativeMode && !world.isRemote) { - SoulNetworkHandler.hurtPlayer(player, 5000); + EnergyItems.drainPlayerNetwork(player, 5000); } if (!world.isRemote) { - world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY() + 2, blockPos.getZ())); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); } player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 1)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java new file mode 100644 index 00000000..623c2418 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java @@ -0,0 +1,27 @@ +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.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class LargeBloodStoneBrick extends Block +{ + public LargeBloodStoneBrick() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setBlockName("largeBloodStoneBrick"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick"); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java new file mode 100644 index 00000000..79c6f8a4 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java @@ -0,0 +1,49 @@ +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; + +public class LifeEssenceBlock extends BlockFluidClassic +{ + public LifeEssenceBlock() + { + super(AlchemicalWizardry.lifeEssenceFluid, Material.water); + AlchemicalWizardry.lifeEssenceFluid.setBlock(this); + this.setBlockName("lifeEssenceFluidBlock"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.blockIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:lifeEssenceStill"); + AlchemicalWizardry.lifeEssenceFluid.setFlowingIcon(blockIcon); + AlchemicalWizardry.lifeEssenceFluid.setStillIcon(blockIcon); + } + + @Override + public boolean canDisplace(IBlockAccess world, int x, int y, int z) + { + return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.canDisplace(world, x, y, z); + } + + @Override + public boolean displaceIfPossible(World world, int x, int y, int z) + { + return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.displaceIfPossible(world, x, y, z); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/MimicBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/MimicBlock.java new file mode 100644 index 00000000..84dcdcb6 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/MimicBlock.java @@ -0,0 +1,231 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMimicBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class MimicBlock extends BlockContainer +{ + public MimicBlock() + { + super(Material.water); + setHardness(2.0F); + setResistance(5.0F); + this.setBlockName("blockMimic"); +// this.setBlockBounds(0, 0, 0, 0, 0, 0); + } + + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) + { + TileEntity TE = world.getTileEntity(x, y, z); + if(!(TE instanceof TEMimicBlock)) + { + return true; + } + TEMimicBlock mimic = (TEMimicBlock)TE; + + Block block = mimic.getBlock(); + + return block == null || block.shouldSideBeRendered(world, x, y, z, side); + } + + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 1; + } + + @Override + public boolean canCollideCheck(int meta, boolean bool) + { + return meta == 1; + } + + @SideOnly(Side.CLIENT) + @Override + /** + * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side + */ + public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) + { + TileEntity TE = blockAccess.getTileEntity(x, y, z); + TEMimicBlock mimic = (TEMimicBlock)TE; + Block block = mimic.getBlock(); + int meta = mimic.getMetaOfMimic(); + + return block != null ? block.getIcon(side, meta) : this.blockIcon; + } + + public boolean isOpaqueCube() + { + return false; + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TEMimicBlock(); + } + + @Override + public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) + { + return false; + } + + @Override + public int quantityDropped(int meta, int fortune, Random random) + { + return 0; + } + + @Override + public boolean isBlockSolid(IBlockAccess world, int x, int y, int z, int meta) + { + TileEntity tile = world.getTileEntity(x, y, z); + if(tile instanceof TEMimicBlock) + { + Block block = ((TEMimicBlock) tile).getBlock(); + int mimicMeta = ((TEMimicBlock) tile).getMetaOfMimic(); + + if(block != null) + { + return block.isBlockSolid(world, x, y, z, mimicMeta); + } + } + return super.isBlockSolid(world, x, y, z, meta); + } + + @Override + public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer) + { + TileEntity tile = world.getTileEntity(target.blockX, target.blockY, target.blockZ); + + TEMimicBlock TE = (TEMimicBlock)tile; + + if (TE != null) + { + Block block = TE.getBlock(); + + double xOffset = target.blockX + world.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinX(); + double yOffset = target.blockY + world.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinY(); + double zOffset = target.blockZ + world.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - 0.1F * 2.0F) + 0.1F + block.getBlockBoundsMinZ(); + + switch (target.sideHit) { + case 0: + yOffset = target.blockY + block.getBlockBoundsMinY() - 0.1D; + break; + case 1: + yOffset = target.blockY + block.getBlockBoundsMaxY() + 0.1D; + break; + case 2: + zOffset = target.blockZ + block.getBlockBoundsMinZ() - 0.1D; + break; + case 3: + zOffset = target.blockZ + block.getBlockBoundsMaxZ() + 0.1D; + break; + case 4: + xOffset = target.blockX + block.getBlockBoundsMinX() - 0.1D; + break; + case 5: + xOffset = target.blockX + block.getBlockBoundsMaxX() + 0.1D; + break; + } + + MimicBlock.addHitEffect(TE, target, xOffset, yOffset, zOffset, null, effectRenderer); + + return true; + + } + + return super.addHitEffects(world, target, effectRenderer); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) + { + TEMimicBlock tile = (TEMimicBlock)world.getTileEntity(x, y, z); + Block block = tile.getBlock(); + + return block != null ? block.getCollisionBoundingBoxFromPool(world, x, y, z) : super.getCollisionBoundingBoxFromPool(world, x, y, z); + } + + @Override + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z) + { + TEMimicBlock TE = (TEMimicBlock)blockAccess.getTileEntity(x, y, z); + if (TE != null) + { + Block block = TE.getBlock(); + if(block != null) + { + return block.colorMultiplier(blockAccess, x, y, z); + } + } + + return super.colorMultiplier(blockAccess, x, y, z); + } + + @Override + public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec) + { + TEMimicBlock TE = (TEMimicBlock)world.getTileEntity(x, y, z); + if (TE != null) + { + Block block = TE.getBlock(); + if(block != null) + { + block.velocityToAddToEntity(world, x, y, z, entity, vec); + } + } + } + + public static void addHitEffect(TEMimicBlock TE, MovingObjectPosition target, double x, double y, double z, ItemStack itemStack, EffectRenderer effectRenderer) + { + EntityDiggingFX particle = new EntityDiggingFX(TE.getWorldObj(), x, y, z, 0.0D, 0.0D, 0.0D, TE.getBlock(), TE.getMetaOfMimic()); + effectRenderer.addEffect(particle.applyColourMultiplier(target.blockX, target.blockY, target.blockZ).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); + } + + @Override + public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) + { + TEMimicBlock TE = (TEMimicBlock)world.getTileEntity(x, y, z); + if (TE != null) + { + if(TE.getBlockEffectWhileInside(entity, x, y, z)) + { + return; + }else + { + Block block = TE.getBlock(); + if(block != null) + { + block.onEntityCollidedWithBlock(world, x, y, z, entity); + return; + } + } + } + + super.onEntityCollidedWithBlock(world, x, y, z, entity); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java new file mode 100644 index 00000000..ae839bed --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java @@ -0,0 +1,133 @@ +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; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class RitualStone extends Block implements IRitualStone +{ + @SideOnly(Side.CLIENT) + private IIcon blankIcon; + @SideOnly(Side.CLIENT) + private IIcon waterStoneIcon; + @SideOnly(Side.CLIENT) + private IIcon fireStoneIcon; + @SideOnly(Side.CLIENT) + private IIcon earthStoneIcon; + @SideOnly(Side.CLIENT) + private IIcon airStoneIcon; + @SideOnly(Side.CLIENT) + private IIcon duskStoneIcon; + @SideOnly(Side.CLIENT) + private IIcon dawnStoneIcon; + + public RitualStone() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + this.setBlockName("ritualStone"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blankIcon = iconRegister.registerIcon("AlchemicalWizardry:RitualStone"); + this.waterStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterRitualStone"); + this.fireStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:FireRitualStone"); + this.earthStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthRitualStone"); + this.airStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:AirRitualStone"); + this.duskStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskRitualStone"); + this.dawnStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:LightRitualStone"); + } + + @Override + public int damageDropped(int metadata) + { + return 0; + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem == null) + { + return false; + } + + Item item = playerItem.getItem(); + + if (!(item instanceof ScribeTool)) + { + return false; + } + + if (playerItem.getMaxDamage() <= playerItem.getItemDamage() && !(playerItem.getMaxDamage() == 0)) + { + return false; + } + + ScribeTool scribeTool = (ScribeTool) item; + + if (!player.capabilities.isCreativeMode) + { + playerItem.setItemDamage(playerItem.getItemDamage() + 1); + } + + world.setBlockMetadataWithNotify(x, y, z, scribeTool.getType(), 3); + world.markBlockForUpdate(x, y, z); + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) + { + switch (metadata) + { + case 0: + return blankIcon; + + case 1: + return waterStoneIcon; + + case 2: + return fireStoneIcon; + + case 3: + return earthStoneIcon; + + case 4: + return airStoneIcon; + + case 5: + return duskStoneIcon; + + case 6: + return dawnStoneIcon; + + default: + return blankIcon; + } + } + + @Override + public boolean isRuneType(World world, int x, int y, int z, int meta, int runeType) + { + return meta == runeType; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java new file mode 100644 index 00000000..2094e97a --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +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 +{ + public RuneOfSacrifice() + { + super(); + this.setBlockName("runeOfSacrifice"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:RuneOfSacrifice"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 3; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java new file mode 100644 index 00000000..2c13ce41 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +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 +{ + public RuneOfSelfSacrifice() + { + super(); + this.setBlockName("runeOfSelfSacrifice"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:RuneOfSelfSacrifice"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 4; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectral.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java similarity index 54% rename from src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectral.java rename to src/main/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java index 5ad9f527..9ff5313a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockSpectral.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java @@ -1,33 +1,41 @@ package WayofTime.alchemicalWizardry.common.block; 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.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.Facing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import java.util.Random; -public class BlockSpectral extends BlockContainer +public class SpectralBlock extends BlockContainer { - public BlockSpectral() + public SpectralBlock() { super(Material.rock); + this.setBlockName("spectralBlock"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SpectralBlock"); } @Override public boolean isOpaqueCube() { + Block d; return false; } @@ -37,13 +45,12 @@ public class BlockSpectral extends BlockContainer return 0; } - @Override @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, BlockPos blockPos, EnumFacing side) + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { - Block block = p_149646_1_.getBlockState(blockPos).getBlock(); + Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_); - if (p_149646_1_.getBlockState(blockPos) != p_149646_1_.getBlockState(blockPos.add(-side.getFrontOffsetX(), -side.getFrontOffsetY(), -side.getFrontOffsetZ()))) + if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) { return true; } @@ -53,11 +60,20 @@ public class BlockSpectral extends BlockContainer return false; } - return block != this && super.shouldSideBeRendered(p_149646_1_, blockPos, side); + return block != this && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } + + @SideOnly(Side.CLIENT) + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() + { + return 1; } @Override - public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { if (player.isSneaking()) { @@ -70,7 +86,7 @@ public class BlockSpectral extends BlockContainer { if (playerItem.getItem() instanceof ItemBlock) { - world.addBlockEvent(blockPos, ((ItemBlock) playerItem.getItem()).getBlock(), playerItem.getItemDamage(), 3); + world.setBlock(x, y, z, ((ItemBlock) (playerItem.getItem())).field_150939_a, playerItem.getItemDamage(), 3); if (!player.capabilities.isCreativeMode) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java new file mode 100644 index 00000000..ac628ad6 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +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 +{ + public SpeedRune() + { + super(); + this.setBlockName("speedRune"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SpeedRune"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 1; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarComponent.java b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarComponent.java index 06e1a3e6..4aeb4e75 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarComponent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarComponent.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; public class AltarComponent { @@ -48,11 +47,6 @@ public class AltarComponent { return metadata; } - - public IBlockState getBlockState() - { - return block.getStateFromMeta(getMetadata()); - } public boolean isBloodRune() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java index 013b550b..23d0845b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java @@ -4,28 +4,26 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.IFadedRune; -import WayofTime.alchemicalWizardry.common.block.BlockBloodRune; +import WayofTime.alchemicalWizardry.common.block.BloodRune; public class UpgradedAltars { - public static List secondTierAltar = new ArrayList(); - public static List thirdTierAltar = new ArrayList(); - public static List fourthTierAltar = new ArrayList(); - public static List fifthTierAltar = new ArrayList(); - public static List sixthTierAltar = new ArrayList(); + public static List secondTierAltar = new ArrayList(); + public static List thirdTierAltar = new ArrayList(); + public static List fourthTierAltar = new ArrayList(); + public static List fifthTierAltar = new ArrayList(); + public static List sixthTierAltar = new ArrayList(); public static int highestAltar = 6; - public static int isAltarValid(World world, BlockPos pos) + public static int isAltarValid(World world, int x, int y, int z) { for (int i = highestAltar; i >= 2; i--) { - if (checkAltarIsValid(world, pos, i)) + if (checkAltarIsValid(world, x, y, z, i)) { return i; } @@ -34,37 +32,144 @@ public class UpgradedAltars return 1; } - public static boolean checkAltarIsValid(World world, BlockPos pos, int altarTier) + public static boolean checkAltarIsValid(World world, int x, int y, int z, int altarTier) { - List list = UpgradedAltars.getAltarUpgradeListForTier(altarTier); - - for (AltarComponent ac : list) + switch (altarTier) { - BlockPos newPos = pos.add(ac.getX(), ac.getY(), ac.getZ()); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - - if (ac.isBloodRune()) - { - if (!(block instanceof BlockBloodRune)) - { - return false; - } - } else - { - int metadata = block.getMetaFromState(state); + case 1: + return true; - if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(newPos))) + case 2: + for (AltarComponent ac : secondTierAltar) { - return false; + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } } - } + + return true; + + case 3: + for (AltarComponent ac : thirdTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + case 4: + for (AltarComponent ac : fourthTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + case 5: + for (AltarComponent ac : fifthTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + case 6: + for (AltarComponent ac : sixthTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + default: + return false; } - - return true; } - public static AltarUpgradeComponent getUpgrades(World world, BlockPos pos, int altarTier) + public static AltarUpgradeComponent getUpgrades(World world, int x, int y, int z, int altarTier) { if(world.isRemote) { @@ -75,24 +180,21 @@ public class UpgradedAltars for (AltarComponent ac : list) { - BlockPos newPos = pos.add(ac.getX(), ac.getY(), ac.getZ()); - if (ac.isUpgradeSlot()) { //Currently checks the getRuneEffect. //TODO Change so that it uses the metadata instead, with the BlockID. - IBlockState state = world.getBlockState(newPos); - Block testBlock = state.getBlock(); - int meta = testBlock.getMetaFromState(state); + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int meta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); - if (testBlock instanceof BlockBloodRune) + if (testBlock instanceof BloodRune) { if (testBlock instanceof IFadedRune && altarTier > ((IFadedRune)testBlock).getAltarTierLimit(meta)) { - return UpgradedAltars.getUpgrades(world, pos, ((IFadedRune)testBlock).getAltarTierLimit(meta)); + return UpgradedAltars.getUpgrades(world, x, y, z, ((IFadedRune)testBlock).getAltarTierLimit(meta)); } - switch (((BlockBloodRune) testBlock).getRuneEffect(meta)) + switch (((BloodRune) testBlock).getRuneEffect(meta)) { case 1: upgrades.addSpeedUpgrade(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/book/BloodMagicGuide.java b/src/main/java/WayofTime/alchemicalWizardry/common/book/BloodMagicGuide.java index 071bfd5a..39204a70 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/book/BloodMagicGuide.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/book/BloodMagicGuide.java @@ -1,836 +1,836 @@ -//package WayofTime.alchemicalWizardry.common.book; -// -//import java.awt.Color; -//import java.util.ArrayList; -//import java.util.List; -// -//import net.minecraft.item.ItemStack; -//import net.minecraft.item.crafting.IRecipe; -//import net.minecraft.util.ResourceLocation; -//import net.minecraft.util.StatCollector; -//import WayofTime.alchemicalWizardry.AlchemicalWizardry; -//import WayofTime.alchemicalWizardry.ModBlocks; -//import WayofTime.alchemicalWizardry.ModItems; -//import WayofTime.alchemicalWizardry.api.guide.OrbRecipeRenderer; -//import WayofTime.alchemicalWizardry.api.guide.PageAltarRecipe; -//import WayofTime.alchemicalWizardry.common.guide.RecipeHolder; -//import amerifrance.guideapi.api.GuideRegistry; -//import amerifrance.guideapi.api.abstraction.CategoryAbstract; -//import amerifrance.guideapi.api.abstraction.EntryAbstract; -//import amerifrance.guideapi.api.abstraction.IPage; -//import amerifrance.guideapi.api.base.Book; -//import amerifrance.guideapi.api.util.BookBuilder; -//import amerifrance.guideapi.api.util.PageHelper; -//import amerifrance.guideapi.categories.CategoryItemStack; -//import amerifrance.guideapi.entries.EntryUniText; -//import amerifrance.guideapi.pages.PageIRecipe; -//import amerifrance.guideapi.pages.PageUnlocImage; -// -//public class BloodMagicGuide -//{ -// public static Book bloodMagicGuide; -// public static List categories = new ArrayList(); -// -// public static void registerGuide() -// { -// registerArchitectBook(); -// registerRitualBook(); -// registerDemonBook(); -// registerSpellBook(); -// registerAlchemyBook(); -// -// BookBuilder bmBookBuilder = new BookBuilder(); -// bmBookBuilder.setCategories(categories).setUnlocBookTitle("guide.BloodMagic.book.title").setUnlocWelcomeMessage("guide.BloodMagic.welcomeMessage").setUnlocDisplayName("guide.BloodMagic.book.name").setBookColor(new Color(190, 10, 0)).setAuthor("--Blood Magic"); -// -//// bloodMagicGuide = new Book(categories, "guide.BloodMagic.book.title", "guide.BloodMagic.welcomeMessage", "guide.BloodMagic.book.name", new Color(190, 10, 0)); -// bloodMagicGuide = bmBookBuilder.build(); -// GuideRegistry.registerBook(bloodMagicGuide); -// } -// -// public static PageIRecipe getOrbPageForRecipe(IRecipe recipe) -// { -// return new PageIRecipe(recipe, new OrbRecipeRenderer(recipe)); -// } -// -// public static void registerArchitectBook() -// { -// List entries = new ArrayList(); -// -// ArrayList introPages = new ArrayList(); -// introPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.intro"))); -// entries.add(new EntryUniText(introPages, "guide.BloodMagic.entryName.architect.intro")); -// -// ArrayList bloodAltarPages = new ArrayList(); -// bloodAltarPages.add(new PageIRecipe(RecipeHolder.bloodAltarRecipe)); -// bloodAltarPages.add(new PageIRecipe(RecipeHolder.knifeRecipe)); -// bloodAltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodAltar.1"))); -// bloodAltarPages.add(new PageAltarRecipe(RecipeHolder.weakBloodOrbRecipe)); -// bloodAltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodAltar.2"))); -// entries.add(new EntryUniText(bloodAltarPages, "guide.BloodMagic.entryName.architect.bloodAltar")); -// -// ArrayList soulNetworkPages = new ArrayList(); -// soulNetworkPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.soulNetwork"))); -// entries.add(new EntryUniText(soulNetworkPages, "guide.BloodMagic.entryName.architect.soulNetwork")); -// -// ArrayList blankSlatePages = new ArrayList(); -// blankSlatePages.add(new PageAltarRecipe(RecipeHolder.blankSlateRecipe)); -// blankSlatePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.blankSlate"))); -// entries.add(new EntryUniText(blankSlatePages, "guide.BloodMagic.entryName.architect.blankSlate")); -// -// ArrayList divinationSigilPages = new ArrayList(); -// divinationSigilPages.add(getOrbPageForRecipe(RecipeHolder.divinationSigilRecipe)); -// divinationSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.divination"))); -// entries.add(new EntryUniText(divinationSigilPages, "guide.BloodMagic.entryName.architect.divination")); -// -// ArrayList waterSigilPages = new ArrayList(); -// waterSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.waterSigil.1"))); -// waterSigilPages.add(getOrbPageForRecipe(RecipeHolder.waterSigilRecipe)); -// waterSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.waterSigil.2"))); -// entries.add(new EntryUniText(waterSigilPages, "guide.BloodMagic.entryName.architect.waterSigil")); -// -// ArrayList lavaCrystalPages = new ArrayList(); -// lavaCrystalPages.add(getOrbPageForRecipe(RecipeHolder.lavaCrystalRecipe)); -// lavaCrystalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.lavaCrystal"))); -// entries.add(new EntryUniText(lavaCrystalPages, "guide.BloodMagic.entryName.architect.lavaCrystal")); -// -// ArrayList hellHarvestPages = new ArrayList(); -// hellHarvestPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.hellHarvest"))); -// entries.add(new EntryUniText(hellHarvestPages, "guide.BloodMagic.entryName.architect.hellHarvest")); -// -// ArrayList lavaSigilPages = new ArrayList(); -// lavaSigilPages.add(new PageIRecipe(RecipeHolder.lavaSigilRecipe)); -// lavaSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.lavaSigil"))); -// entries.add(new EntryUniText(lavaSigilPages, "guide.BloodMagic.entryName.architect.lavaSigil")); -// -// ArrayList blankRunePages = new ArrayList(); -// blankRunePages.add(getOrbPageForRecipe(RecipeHolder.blankRuneRecipe)); -// blankRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.blankRunes.1"))); -// blankRunePages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T2.png"), true)); -// blankRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.blankRunes.2"))); -// entries.add(new EntryUniText(blankRunePages, "guide.BloodMagic.entryName.architect.blankRunes")); -// -// ArrayList speedRunePages = new ArrayList(); -// speedRunePages.add(new PageIRecipe(RecipeHolder.speedRuneRecipe)); -// speedRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.speedRunes"))); -// entries.add(new EntryUniText(speedRunePages, "guide.BloodMagic.entryName.architect.speedRunes")); -// -// ArrayList apprenticeOrbPages = new ArrayList(); -// apprenticeOrbPages.add(new PageAltarRecipe(RecipeHolder.apprenticeBloodOrbRecipe)); -// apprenticeOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.apprenticeOrb"))); -// entries.add(new EntryUniText(apprenticeOrbPages, "guide.BloodMagic.entryName.architect.apprenticeOrb")); -// -// ArrayList voidSigilPages = new ArrayList(); -// voidSigilPages.add(getOrbPageForRecipe(RecipeHolder.voidSigilRecipe)); -// voidSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.voidSigil"))); -// entries.add(new EntryUniText(voidSigilPages, "guide.BloodMagic.entryName.architect.voidSigil")); -// -// ArrayList airSigilPages = new ArrayList(); -// airSigilPages.add(getOrbPageForRecipe(RecipeHolder.airSigilRecipe)); -// airSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.airSigil"))); -// entries.add(new EntryUniText(airSigilPages, "guide.BloodMagic.entryName.architect.airSigil")); -// -// ArrayList sightSigilPages = new ArrayList(); -// sightSigilPages.add(getOrbPageForRecipe(RecipeHolder.sightSigilRecipe)); -// sightSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sightSigil"))); -// entries.add(new EntryUniText(sightSigilPages, "guide.BloodMagic.entryName.architect.sightSigil")); -// -// ArrayList advancedAltarPages = new ArrayList(); -// advancedAltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.advancedAltar"))); -// entries.add(new EntryUniText(advancedAltarPages, "guide.BloodMagic.entryName.architect.advancedAltar")); -// -// ArrayList fastMinerPages = new ArrayList(); -// fastMinerPages.add(getOrbPageForRecipe(RecipeHolder.fastMinerRecipe)); -// fastMinerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.fastMiner"))); -// entries.add(new EntryUniText(fastMinerPages, "guide.BloodMagic.entryName.architect.fastMiner")); -// -// ArrayList soulFrayPages = new ArrayList(); -// soulFrayPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.soulFray"))); -// entries.add(new EntryUniText(soulFrayPages, "guide.BloodMagic.entryName.architect.soulFray")); -// -// ArrayList greenGrovePages = new ArrayList(); -// greenGrovePages.add(getOrbPageForRecipe(RecipeHolder.greenGroveRecipe)); -// greenGrovePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.greenGrove"))); -// entries.add(new EntryUniText(greenGrovePages, "guide.BloodMagic.entryName.architect.greenGrove")); -// -// ArrayList daggerPages = new ArrayList(); -// daggerPages.add(new PageAltarRecipe(RecipeHolder.daggerRecipe)); -// daggerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.dagger"))); -// entries.add(new EntryUniText(daggerPages, "guide.BloodMagic.entryName.architect.dagger")); -// -// ArrayList sacrificePages = new ArrayList(); -// sacrificePages.add(getOrbPageForRecipe(RecipeHolder.selfSacrificeRuneRecipe)); -// sacrificePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sacrifice.1"))); -// sacrificePages.add(getOrbPageForRecipe(RecipeHolder.sacrificeRuneRecipe)); -// sacrificePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sacrifice.2"))); -// entries.add(new EntryUniText(sacrificePages, "guide.BloodMagic.entryName.architect.sacrifice")); -// -// ArrayList bloodPackPages = new ArrayList(); -// bloodPackPages.add(new PageIRecipe(RecipeHolder.bloodPackRecipe)); -// bloodPackPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodPack"))); -// entries.add(new EntryUniText(bloodPackPages, "guide.BloodMagic.entryName.architect.bloodPack")); -// -// ArrayList fivePeoplePages = new ArrayList(); -// fivePeoplePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.fivePeople"))); -// entries.add(new EntryUniText(fivePeoplePages, "guide.BloodMagic.entryName.architect.fivePeople")); -// -// ArrayList tier3Pages = new ArrayList(); -// tier3Pages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T3.png"), true)); -// tier3Pages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier3"))); -// entries.add(new EntryUniText(tier3Pages, "guide.BloodMagic.entryName.architect.tier3")); -// -// ArrayList magicianOrbPages = new ArrayList(); -// magicianOrbPages.add(new PageAltarRecipe(RecipeHolder.magicianBloodOrbRecipe)); -// magicianOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.magicianOrb"))); -// entries.add(new EntryUniText(magicianOrbPages, "guide.BloodMagic.entryName.architect.magicianOrb")); -// -// ArrayList newRunePages = new ArrayList(); -// newRunePages.add(getOrbPageForRecipe(RecipeHolder.capacityRuneRecipe)); -// newRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.newRune.1"))); -// newRunePages.add(getOrbPageForRecipe(RecipeHolder.dislocationRuneRecipe)); -// newRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.newRune.2"))); -// entries.add(new EntryUniText(newRunePages, "guide.BloodMagic.entryName.architect.newRune")); -// -// ArrayList magnetismPages = new ArrayList(); -// magnetismPages.add(getOrbPageForRecipe(RecipeHolder.magnetismSigilRecipe)); -// magnetismPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.magnetism"))); -// entries.add(new EntryUniText(magnetismPages, "guide.BloodMagic.entryName.architect.magnetism")); -// -// ArrayList phantomBridgePages = new ArrayList(); -// phantomBridgePages.add(getOrbPageForRecipe(RecipeHolder.phantomBridgeRecipe)); -// phantomBridgePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.phantomBridge"))); -// entries.add(new EntryUniText(phantomBridgePages, "guide.BloodMagic.entryName.architect.phantomBridge")); -// -// ArrayList holdingPages = new ArrayList(); -// holdingPages.add(getOrbPageForRecipe(RecipeHolder.holdingSigilRecipe)); -// holdingPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.holding"))); -// entries.add(new EntryUniText(holdingPages, "guide.BloodMagic.entryName.architect.holding")); -// -// ArrayList elementalAffinityPages = new ArrayList(); -// elementalAffinityPages.add(getOrbPageForRecipe(RecipeHolder.affinitySigilRecipe)); -// elementalAffinityPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.elementalAffinity"))); -// entries.add(new EntryUniText(elementalAffinityPages, "guide.BloodMagic.entryName.architect.elementalAffinity")); -// -// ArrayList ritualStonesPages = new ArrayList(); -// ritualStonesPages.add(getOrbPageForRecipe(RecipeHolder.ritualStoneRecipe)); -// ritualStonesPages.add(getOrbPageForRecipe(RecipeHolder.masterStoneRecipe)); -// ritualStonesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.ritualStones"))); -// entries.add(new EntryUniText(ritualStonesPages, "guide.BloodMagic.entryName.architect.ritualStones")); -// -// ArrayList bloodLampPages = new ArrayList(); -// bloodLampPages.add(getOrbPageForRecipe(RecipeHolder.bloodLampRecipe)); -// bloodLampPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodLamp"))); -// entries.add(new EntryUniText(bloodLampPages, "guide.BloodMagic.entryName.architect.bloodLamp")); -// -// ArrayList boundArmourPages = new ArrayList(); -// boundArmourPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.boundArmour.1"))); -// boundArmourPages.add(new PageIRecipe(RecipeHolder.emptySocketRecipe)); -// boundArmourPages.add(new PageAltarRecipe(RecipeHolder.filledSocketRecipe)); -// boundArmourPages.add(getOrbPageForRecipe(RecipeHolder.soulForgeRecipe)); -// boundArmourPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.boundArmour.2"))); -// entries.add(new EntryUniText(boundArmourPages, "guide.BloodMagic.entryName.architect.boundArmour")); -// -// if(AlchemicalWizardry.isThaumcraftLoaded) -// { -// ArrayList sanguineArmourPages = new ArrayList(); -// sanguineArmourPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sanguineArmour"), new ItemStack(ModItems.sanguineRobe))); -// entries.add(new EntryUniText(sanguineArmourPages, "guide.BloodMagic.entryName.architect.sanguineArmour")); -// } -// -// ArrayList soulSuppressPages = new ArrayList(); -// soulSuppressPages.add(new PageIRecipe(RecipeHolder.inhibitorRecipe)); -// soulSuppressPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.soulSuppress"))); -// entries.add(new EntryUniText(soulSuppressPages, "guide.BloodMagic.entryName.architect.soulSuppress")); -// -// ArrayList ritualDivinerPages = new ArrayList(); -// ritualDivinerPages.add(new PageIRecipe(RecipeHolder.ritualDiviner1Recipe)); -// ritualDivinerPages.add(new PageIRecipe(RecipeHolder.ritualDiviner2Recipe)); -// ritualDivinerPages.add(new PageIRecipe(RecipeHolder.ritualDiviner3Recipe)); -// ritualDivinerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.ritualDiviner"))); -// entries.add(new EntryUniText(ritualDivinerPages, "guide.BloodMagic.entryName.architect.ritualDiviner")); -// -// ArrayList bloodShardPages = new ArrayList(); -// bloodShardPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodShard"), new ItemStack(ModItems.weakBloodShard))); -// entries.add(new EntryUniText(bloodShardPages, "guide.BloodMagic.entryName.architect.bloodShard")); -// -// ArrayList tier4AltarPages = new ArrayList(); -// tier4AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier4Altar.1"))); -// tier4AltarPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T4.png"), true)); -// tier4AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier4Altar.2"))); -// entries.add(new EntryUniText(tier4AltarPages, "guide.BloodMagic.entryName.architect.tier4Altar")); -// -// ArrayList masterOrbPages = new ArrayList(); -// masterOrbPages.add(new PageAltarRecipe(RecipeHolder.masterBloodOrbRecipe)); -// masterOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.masterOrb"))); -// entries.add(new EntryUniText(masterOrbPages, "guide.BloodMagic.entryName.architect.masterOrb")); -// -// ArrayList whirlwindPages = new ArrayList(); -// whirlwindPages.add(getOrbPageForRecipe(RecipeHolder.whirlwindSigilRecipe)); -// whirlwindPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.whirlwind"))); -// entries.add(new EntryUniText(whirlwindPages, "guide.BloodMagic.entryName.architect.whirlwind")); -// -// ArrayList compressionPages = new ArrayList(); -// compressionPages.add(getOrbPageForRecipe(RecipeHolder.compressionSigilRecipe)); -// compressionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.compression"))); -// entries.add(new EntryUniText(compressionPages, "guide.BloodMagic.entryName.architect.compression")); -// -// ArrayList severancePages = new ArrayList(); -// severancePages.add(getOrbPageForRecipe(RecipeHolder.enderSeveranceSigilRecipe)); -// severancePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.severance"))); -// entries.add(new EntryUniText(severancePages, "guide.BloodMagic.entryName.architect.severance")); -// -// ArrayList teleposerPages = new ArrayList(); -// teleposerPages.add(new PageAltarRecipe(RecipeHolder.teleposerFocusRecipe1)); -// teleposerPages.add(new PageIRecipe(RecipeHolder.teleposerRecipe)); -// teleposerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.teleposer"))); -// entries.add(new EntryUniText(teleposerPages, "guide.BloodMagic.entryName.architect.teleposer")); -// -// ArrayList suppressionPages = new ArrayList(); -// suppressionPages.add(getOrbPageForRecipe(RecipeHolder.suppressionSigilRecipe)); -// suppressionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.suppression"))); -// entries.add(new EntryUniText(suppressionPages, "guide.BloodMagic.entryName.architect.suppression")); -// -// ArrayList superiorCapacityPages = new ArrayList(); -// superiorCapacityPages.add(getOrbPageForRecipe(RecipeHolder.superiorCapacityRecipe)); -// superiorCapacityPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.superiorCapacity"))); -// entries.add(new EntryUniText(superiorCapacityPages, "guide.BloodMagic.entryName.architect.superiorCapacity")); -// -// ArrayList orbRunePages = new ArrayList(); -// orbRunePages.add(getOrbPageForRecipe(RecipeHolder.orbRuneRecipe)); -// orbRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.orbRune"))); -// entries.add(new EntryUniText(orbRunePages, "guide.BloodMagic.entryName.architect.orbRune")); -// -// ArrayList fieldTripPages = new ArrayList(); -// fieldTripPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.fieldTrip"))); -// entries.add(new EntryUniText(fieldTripPages, "guide.BloodMagic.entryName.architect.fieldTrip")); -// -// ArrayList bindingKeyPages = new ArrayList(); -// bindingKeyPages.add(new PageIRecipe(RecipeHolder.keyOfBindingRecipe)); -// bindingKeyPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bindingKey"))); -// entries.add(new EntryUniText(bindingKeyPages, "guide.BloodMagic.entryName.architect.bindingKey")); -// -// ArrayList tier5AltarPages = new ArrayList(); -// tier5AltarPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T5.png"), true)); -// tier5AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier5Altar"))); -// entries.add(new EntryUniText(tier5AltarPages, "guide.BloodMagic.entryName.architect.tier5Altar")); -// -// ArrayList priceOfPowerPages = new ArrayList(); -// priceOfPowerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.priceOfPower"))); -// entries.add(new EntryUniText(priceOfPowerPages, "guide.BloodMagic.entryName.architect.priceOfPower")); -// -// ArrayList demonicOrbPages = new ArrayList(); -// demonicOrbPages.add(new PageAltarRecipe(RecipeHolder.archmageBloodOrbRecipe)); -// demonicOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.demonicOrb"))); -// entries.add(new EntryUniText(demonicOrbPages, "guide.BloodMagic.entryName.architect.demonicOrb")); -// -// ArrayList energyBazookaPages = new ArrayList(); -// demonicOrbPages.add(getOrbPageForRecipe(RecipeHolder.energyBazookaRecipe)); -// energyBazookaPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.energyBazooka"))); -// entries.add(new EntryUniText(energyBazookaPages, "guide.BloodMagic.entryName.architect.energyBazooka")); -// -// ArrayList accelerationRunePages = new ArrayList(); -// demonicOrbPages.add(getOrbPageForRecipe(RecipeHolder.accelerationRuneRecipe)); -// accelerationRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.accelerationRune"))); -// entries.add(new EntryUniText(accelerationRunePages, "guide.BloodMagic.entryName.architect.accelerationRune")); -// -// ArrayList harvestPages = new ArrayList(); -// demonicOrbPages.add(getOrbPageForRecipe(RecipeHolder.harvestSigilRecipe)); -// harvestPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.harvest"))); -// entries.add(new EntryUniText(harvestPages, "guide.BloodMagic.entryName.architect.harvest")); -// -// ArrayList demonProblemPages = new ArrayList(); -// demonProblemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.demonProblem"))); -// entries.add(new EntryUniText(demonProblemPages, "guide.BloodMagic.entryName.architect.demonProblem")); -// -// ArrayList tier6AltarPages = new ArrayList(); -// tier6AltarPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T6.png"), true)); -// tier6AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier6Altar"))); -// tier6AltarPages.add(new PageIRecipe(RecipeHolder.crystalCluserRecipe)); -// tier6AltarPages.add(new PageAltarRecipe(RecipeHolder.transcendentBloodOrbRecipe)); -// entries.add(new EntryUniText(tier6AltarPages, "guide.BloodMagic.entryName.architect.tier6Altar")); -// -// ArrayList moreThanHumanPages = new ArrayList(); -// moreThanHumanPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.moreThanHuman"))); -// entries.add(new EntryUniText(moreThanHumanPages, "guide.BloodMagic.entryName.architect.moreThanHuman")); -// -// categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.architect", new ItemStack(ModItems.divinationSigil))); -// } -// -// public static void registerRitualBook() -// { -// List entries = new ArrayList(); -// -//// ArrayList testPages = new ArrayList(); -//// testPages.add(PageRitualMultiBlock.getPageForRitual("AW031Convocation")); -//// entries.add(new EntryUniText(testPages, "Test page")); -// -// -// ArrayList introPages = new ArrayList(); -// introPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.intro"))); -// entries.add(new EntryUniText(introPages, "guide.BloodMagic.entryName.rituals.intro")); -// -// ArrayList weakRitualPages = new ArrayList(); -// weakRitualPages.add(getOrbPageForRecipe(RecipeHolder.weakRitualStoneRecipe)); -// weakRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.weakRitual"))); -// entries.add(new EntryUniText(weakRitualPages, "guide.BloodMagic.entryName.rituals.weakRitual")); -// -// ArrayList ritualsPages = new ArrayList(); -// ritualsPages.add(getOrbPageForRecipe(RecipeHolder.ritualStoneRecipe)); -// ritualsPages.add(getOrbPageForRecipe(RecipeHolder.masterStoneRecipe)); -// ritualsPages.add(new PageAltarRecipe(RecipeHolder.waterScribeTool)); -// ritualsPages.add(new PageAltarRecipe(RecipeHolder.fireScribeTool)); -// ritualsPages.add(new PageAltarRecipe(RecipeHolder.earthScribeTool)); -// ritualsPages.add(new PageAltarRecipe(RecipeHolder.airScribeTool)); -// ritualsPages.add(new PageIRecipe(RecipeHolder.ritualDiviner1Recipe)); -// ritualsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.rituals"))); -// ritualsPages.add(new PageAltarRecipe(RecipeHolder.weakActivationRecipe)); -// entries.add(new EntryUniText(ritualsPages, "guide.BloodMagic.entryName.rituals.rituals")); -// -// ArrayList waterRitualPages = new ArrayList(); -// waterRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Water.png"), true)); -// waterRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.waterRitual"))); -// entries.add(new EntryUniText(waterRitualPages, "guide.BloodMagic.entryName.rituals.waterRitual")); -// -// ArrayList lavaRitualPages = new ArrayList(); -// lavaRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Lava.png"), true)); -// lavaRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.lavaRitual"))); -// entries.add(new EntryUniText(lavaRitualPages, "guide.BloodMagic.entryName.rituals.lavaRitual")); -// -// ArrayList groveRitualPages = new ArrayList(); -// groveRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/GreenGrove.png"), true)); -// groveRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.groveRitual"))); -// entries.add(new EntryUniText(groveRitualPages, "guide.BloodMagic.entryName.rituals.groveRitual")); -// -// ArrayList interdictionRitualPages = new ArrayList(); -// interdictionRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Interdiction.png"), true)); -// interdictionRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.interdictionRitual"))); -// entries.add(new EntryUniText(interdictionRitualPages, "guide.BloodMagic.entryName.rituals.interdictionRitual")); -// -// ArrayList containmentRitualPages = new ArrayList(); -// containmentRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Containment.png"), true)); -// containmentRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.containmentRitual"))); -// entries.add(new EntryUniText(containmentRitualPages, "guide.BloodMagic.entryName.rituals.containmentRitual")); -// -// ArrayList bindingRitualPages = new ArrayList(); -// bindingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Binding.png"), true)); -// bindingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.bindingRitual"))); -// entries.add(new EntryUniText(bindingRitualPages, "guide.BloodMagic.entryName.rituals.bindingRitual")); -// -// ArrayList beastModePages = new ArrayList(); -// beastModePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.beastMode"))); -// entries.add(new EntryUniText(beastModePages, "guide.BloodMagic.entryName.rituals.beastMode")); -// -// ArrayList unbindingRitualPages = new ArrayList(); -// unbindingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Unbinding.png"), true)); -// unbindingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.unbindingRitual"))); -// entries.add(new EntryUniText(unbindingRitualPages, "guide.BloodMagic.entryName.rituals.unbindingRitual")); -// -// ArrayList jumpRitualPages = new ArrayList(); -// jumpRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Jump.png"), true)); -// jumpRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.jumpRitual"))); -// entries.add(new EntryUniText(jumpRitualPages, "guide.BloodMagic.entryName.rituals.jumpRitual")); -// -// ArrayList duskInkPages = new ArrayList(); -// duskInkPages.add(new PageAltarRecipe(RecipeHolder.duskRecipe)); -// duskInkPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.duskInk"))); -// entries.add(new EntryUniText(duskInkPages, "guide.BloodMagic.entryName.rituals.duskInk")); -// -// ArrayList magnetismRitualPages = new ArrayList(); -// magnetismRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Magnetism.png"), true)); -// magnetismRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.magnetismRitual"))); -// entries.add(new EntryUniText(magnetismRitualPages, "guide.BloodMagic.entryName.rituals.magnetismRitual")); -// -// ArrayList crusherRitualPages = new ArrayList(); -// crusherRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Crusher.png"), true)); -// crusherRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.crusherRitual"))); -// entries.add(new EntryUniText(crusherRitualPages, "guide.BloodMagic.entryName.rituals.crusherRitual")); -// -// ArrayList speedRitualPages = new ArrayList(); -// speedRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Speed.png"), true)); -// speedRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.speedRitual"))); -// entries.add(new EntryUniText(speedRitualPages, "guide.BloodMagic.entryName.rituals.speedRitual")); -// -// ArrayList shepherdRitualPages = new ArrayList(); -// shepherdRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/AnimalGrowth.png"), true)); -// shepherdRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.shepherdRitual"))); -// entries.add(new EntryUniText(shepherdRitualPages, "guide.BloodMagic.entryName.rituals.shepherdRitual")); -// -// ArrayList darkMagicPages = new ArrayList(); -// darkMagicPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.darkMagic"))); -// entries.add(new EntryUniText(darkMagicPages, "guide.BloodMagic.entryName.rituals.darkMagic")); -// -// ArrayList knifeAndSufferingRitualPages = new ArrayList(); -// knifeAndSufferingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/WellOfSuffering.png"), true)); -// knifeAndSufferingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.knifeAndSufferingRitual.1"))); -// knifeAndSufferingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/FeatheredKnife.png"), true)); -// knifeAndSufferingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.knifeAndSufferingRitual.2"))); -// entries.add(new EntryUniText(knifeAndSufferingRitualPages, "guide.BloodMagic.entryName.rituals.knifeAndSufferingRitual")); -// -// ArrayList regenerationRitualPages = new ArrayList(); -// regenerationRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Regeneration.png"), true)); -// regenerationRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.regenerationRitual"))); -// entries.add(new EntryUniText(regenerationRitualPages, "guide.BloodMagic.entryName.rituals.regenerationRitual")); -// -// ArrayList harvestFestivalPages = new ArrayList(); -// harvestFestivalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.harvestFestival"))); -// entries.add(new EntryUniText(harvestFestivalPages, "guide.BloodMagic.entryName.rituals.harvestFestival")); -// -// ArrayList thenThereWereFivePages = new ArrayList(); -// thenThereWereFivePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.thenThereWereFive"))); -// entries.add(new EntryUniText(thenThereWereFivePages, "guide.BloodMagic.entryName.rituals.thenThereWereFive")); -// -// ArrayList alchemyRitualPages = new ArrayList(); -// alchemyRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Alchemy.png"), true)); -// alchemyRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.alchemyRitual"))); -// entries.add(new EntryUniText(alchemyRitualPages, "guide.BloodMagic.entryName.rituals.alchemyRitual")); -// -// ArrayList domeRitualPages = new ArrayList(); -// domeRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Dome.png"), true)); -// domeRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.domeRitual"))); -// entries.add(new EntryUniText(domeRitualPages, "guide.BloodMagic.entryName.rituals.domeRitual")); -// -// ArrayList awakenedCrystalPages = new ArrayList(); -// awakenedCrystalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.awakenedCrystal"))); -// entries.add(new EntryUniText(awakenedCrystalPages, "guide.BloodMagic.entryName.rituals.awakenedCrystal")); -// -// ArrayList featheredEarthRitualPages = new ArrayList(); -// featheredEarthRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/FeatheredEarth.png"), true)); -// featheredEarthRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.featheredEarthRitual"))); -// entries.add(new EntryUniText(featheredEarthRitualPages, "guide.BloodMagic.entryName.rituals.featheredEarthRitual")); -// -// ArrayList gaiaRitualPages = new ArrayList(); -// gaiaRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Gaia.png"), true)); -// gaiaRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.gaiaRitual"))); -// entries.add(new EntryUniText(gaiaRitualPages, "guide.BloodMagic.entryName.rituals.gaiaRitual")); -// -// ArrayList condorRitualPages = new ArrayList(); -// condorRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Flight.png"), true)); -// condorRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.condorRitual"))); -// entries.add(new EntryUniText(condorRitualPages, "guide.BloodMagic.entryName.rituals.condorRitual")); -// -// ArrayList meteorRitualPages = new ArrayList(); -// meteorRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Meteor.png"), true)); -// meteorRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.meteorRitual"))); -// entries.add(new EntryUniText(meteorRitualPages, "guide.BloodMagic.entryName.rituals.meteorRitual")); -// -// ArrayList expulsionRitualPages = new ArrayList(); -// expulsionRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Expulsion.png"), true)); -// expulsionRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.expulsionRitual"))); -// entries.add(new EntryUniText(expulsionRitualPages, "guide.BloodMagic.entryName.rituals.expulsionRitual")); -// -// ArrayList costOfProgressPages = new ArrayList(); -// costOfProgressPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.costOfProgress.1"))); -// costOfProgressPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.costOfProgress.2"))); -// entries.add(new EntryUniText(costOfProgressPages, "guide.BloodMagic.entryName.rituals.costOfProgress")); -// -// ArrayList zephyrRitualPages = new ArrayList(); -// zephyrRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Zephyr.png"), true)); -// zephyrRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.zephyrRitual"))); -// entries.add(new EntryUniText(zephyrRitualPages, "guide.BloodMagic.entryName.rituals.zephyrRitual")); -// -// ArrayList harvestRitualPages = new ArrayList(); -// harvestRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Harvest.png"), true)); -// harvestRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.harvestRitual"))); -// entries.add(new EntryUniText(harvestRitualPages, "guide.BloodMagic.entryName.rituals.harvestRitual")); -// -// ArrayList eternalSoulRitualPages = new ArrayList(); -// eternalSoulRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/EternalSoul.png"), true)); -// eternalSoulRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.eternalSoulRitual"))); -// entries.add(new EntryUniText(eternalSoulRitualPages, "guide.BloodMagic.entryName.rituals.eternalSoulRitual")); -// -// ArrayList ellipsoidRitualPages = new ArrayList(); -// ellipsoidRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Ellipsoid.png"), true)); -// ellipsoidRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.ellipsoidRitual"))); -// entries.add(new EntryUniText(ellipsoidRitualPages, "guide.BloodMagic.entryName.rituals.ellipsoidRitual")); -// -// ArrayList evaporationRitualPages = new ArrayList(); -// evaporationRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Evaporation.png"), true)); -// evaporationRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.evaporationRitual"))); -// entries.add(new EntryUniText(evaporationRitualPages, "guide.BloodMagic.entryName.rituals.evaporationRitual")); -// -// ArrayList sacrosanctityRitualPages = new ArrayList(); -// sacrosanctityRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Sacrosanctity.png"), true)); -// sacrosanctityRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.sacrosanctityRitual"))); -// entries.add(new EntryUniText(sacrosanctityRitualPages, "guide.BloodMagic.entryName.rituals.sacrosanctityRitual")); -// -// ArrayList evilRitualPages = new ArrayList(); -// evilRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/VeilOfEvil.png"), true)); -// evilRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.evilRitual"))); -// entries.add(new EntryUniText(evilRitualPages, "guide.BloodMagic.entryName.rituals.evilRitual")); -// -// ArrayList stomachRitualPages = new ArrayList(); -// stomachRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Stomach.png"), true)); -// stomachRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.stomachRitual"))); -// entries.add(new EntryUniText(stomachRitualPages, "guide.BloodMagic.entryName.rituals.stomachRitual")); -// -// ArrayList reagentEffectsRitualPages = new ArrayList(); -// for(int i=1; i<=24; i++) -// { -// reagentEffectsRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.reagentEffects." + i))); -// } -// entries.add(new EntryUniText(reagentEffectsRitualPages, "guide.BloodMagic.entryName.rituals.reagentEffects")); -// -// ArrayList conclaveOfMagesPages = new ArrayList(); -// conclaveOfMagesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.conclaveOfMages"))); -// entries.add(new EntryUniText(conclaveOfMagesPages, "guide.BloodMagic.entryName.rituals.conclaveOfMages")); -// -// ArrayList forbiddenParadisePages = new ArrayList(); -// forbiddenParadisePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.forbiddenParadise"))); -// entries.add(new EntryUniText(forbiddenParadisePages, "guide.BloodMagic.entryName.rituals.forbiddenParadise")); -// -// ArrayList convocationRitualPages = new ArrayList(); -// convocationRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Convocation.png"), true)); -// convocationRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.convocationRitual"))); -// entries.add(new EntryUniText(convocationRitualPages, "guide.BloodMagic.entryName.rituals.convocationRitual")); -// -// ArrayList longHaulPages = new ArrayList(); -// longHaulPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.longHaul"))); -// entries.add(new EntryUniText(longHaulPages, "guide.BloodMagic.entryName.rituals.longHaul")); -// -// ArrayList phantomHandsRitualPages = new ArrayList(); -// phantomHandsRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/PhantomHands.png"), true)); -// phantomHandsRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.phantomHandsRitual"))); -// entries.add(new EntryUniText(phantomHandsRitualPages, "guide.BloodMagic.entryName.rituals.phantomHandsRitual")); -// -// ArrayList anvilRitualPages = new ArrayList(); -// anvilRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/BeatingAnvil.png"), true)); -// anvilRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.anvilRitual"))); -// entries.add(new EntryUniText(anvilRitualPages, "guide.BloodMagic.entryName.rituals.anvilRitual")); -// -// ArrayList dawnInkPages = new ArrayList(); -// dawnInkPages.add(new PageAltarRecipe(RecipeHolder.dawnRecipe)); -// dawnInkPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.dawnInk"))); -// entries.add(new EntryUniText(dawnInkPages, "guide.BloodMagic.entryName.rituals.dawnInk")); -// -// ArrayList symmetryRitualPages = new ArrayList(); -// symmetryRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/SymmetryOmega.png"), true)); -// symmetryRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.symmetryRitual"))); -// entries.add(new EntryUniText(symmetryRitualPages, "guide.BloodMagic.entryName.rituals.symmetryRitual")); -// -// ArrayList stallingRitualPages = new ArrayList(); -// stallingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/StallingOmega.png"), true)); -// stallingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.stallingRitual"))); -// entries.add(new EntryUniText(stallingRitualPages, "guide.BloodMagic.entryName.rituals.stallingRitual")); -// -// ArrayList newMoonRitualPages = new ArrayList(); -// newMoonRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.newMoonRitual"))); -// entries.add(new EntryUniText(newMoonRitualPages, "guide.BloodMagic.entryName.rituals.newMoonRitual")); -// -// categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.rituals", new ItemStack(ModBlocks.blockMasterStone))); -// } -// -// public static void registerDemonBook() -// { -// List entries = new ArrayList(); -// -// ArrayList ashesPages = new ArrayList(); -// ashesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.ashes"))); -// entries.add(new EntryUniText(ashesPages, "guide.BloodMagic.entryName.demons.ashes")); -// -// ArrayList tamedDemonPages = new ArrayList(); -// tamedDemonPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.tamedDemon"))); -// entries.add(new EntryUniText(tamedDemonPages, "guide.BloodMagic.entryName.demons.tamedDemon")); -// -// ArrayList futurePages = new ArrayList(); -// futurePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.future"))); -// entries.add(new EntryUniText(futurePages, "guide.BloodMagic.entryName.demons.future")); -// -// ArrayList knightPages = new ArrayList(); -// knightPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.knight"))); -// entries.add(new EntryUniText(knightPages, "guide.BloodMagic.entryName.demons.knight")); -// -// ArrayList demonShardPages = new ArrayList(); -// demonShardPages.addAll(PageHelper.pagesForLongText((StatCollector.translateToLocal("aw.entries.demons.demonShard")), new ItemStack(ModItems.demonBloodShard))); -// entries.add(new EntryUniText(demonShardPages, "guide.BloodMagic.entryName.demons.demonShard")); -// -// -// ArrayList demonSummoningPages = new ArrayList(); -// demonSummoningPages.add(new PageIRecipe(RecipeHolder.arcanePedestalRecipe)); -// demonSummoningPages.add(new PageIRecipe(RecipeHolder.arcanePlinthRecipe)); -// demonSummoningPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/demons/Ring1.png"), true)); -// demonSummoningPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/demons/Ring2.png"), true)); -// demonSummoningPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.demonSummoning"))); -// entries.add(new EntryUniText(demonSummoningPages, "guide.BloodMagic.entryName.demons.demonSummoning")); -// -// ArrayList keysGatePages = new ArrayList(); -// for(int i=1; i<=10; i++) -// { -// keysGatePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.keysGate." + i))); -// } -// entries.add(new EntryUniText(keysGatePages, "guide.BloodMagic.entryName.demons.keysGate")); -// -// ArrayList futurePlansPages = new ArrayList(); -// futurePlansPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.futurePlans"))); -// entries.add(new EntryUniText(futurePlansPages, "guide.BloodMagic.entryName.demons.futurePlans")); -// -// ArrayList demonInvasionPages = new ArrayList(); -// demonInvasionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.demonInvasion"))); -// entries.add(new EntryUniText(demonInvasionPages, "guide.BloodMagic.entryName.demons.demonInvasion")); -// -// ArrayList observationsPages = new ArrayList(); -// observationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.observations"))); -// entries.add(new EntryUniText(observationsPages, "guide.BloodMagic.entryName.demons.observations")); -// -// categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.demons", new ItemStack(ModItems.demonBloodShard))); -// } -// -// public static void registerSpellBook() -// { -// List entries = new ArrayList(); -// -// ArrayList demonGirlPages = new ArrayList(); -// demonGirlPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.demonGirl"))); -// entries.add(new EntryUniText(demonGirlPages, "guide.BloodMagic.entryName.spells.demonGirl")); -// -// ArrayList spellTablePages = new ArrayList(); -// spellTablePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.spellTable.1"))); -// spellTablePages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/SimpleSpellTable.png"), true)); -// spellTablePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.spellTable.2"))); -// entries.add(new EntryUniText(spellTablePages, "guide.BloodMagic.entryName.spells.spellTable")); -// -// ArrayList simpleEffectsPages = new ArrayList(); -// for(int i=1; i<=11; i++) -// { -// simpleEffectsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.simpleEffects." + i))); -// } -// entries.add(new EntryUniText(simpleEffectsPages, "guide.BloodMagic.entryName.spells.simpleEffects")); -// -// ArrayList tableAndSkullsPages = new ArrayList(); -// tableAndSkullsPages.add(new PageAltarRecipe(RecipeHolder.blankSpellRecipe)); -// tableAndSkullsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.tableAndSkulls.1"))); -// tableAndSkullsPages.add(getOrbPageForRecipe(RecipeHolder.spellTableRecipe)); -// tableAndSkullsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.tableAndSkulls.2"))); -// entries.add(new EntryUniText(tableAndSkullsPages, "guide.BloodMagic.entryName.spells.tableAndSkulls")); -// -// ArrayList timePassesPages = new ArrayList(); -// timePassesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.timePasses"))); -// entries.add(new EntryUniText(timePassesPages, "guide.BloodMagic.entryName.spells.timePasses")); -// -// ArrayList complexSpellBasicsPages = new ArrayList(); -// complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics.1"))); -// complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Paradigm.png"), true)); -// -// for(int i=2; i<=6; i++) -// complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics." + i))); -// -// complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Effect.png"), true)); -// complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics.7"))); -// complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Modifier.png"), true)); -// -// for(int i=8; i<=12; i++) -// complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics." + i))); -// -// complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Enhancement.png"), true)); -// -// for(int i=13; i<=16; i++) -// complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics." + i))); -// -// complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Conduit.png"), true)); -// complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics.17"))); -// -// entries.add(new EntryUniText(complexSpellBasicsPages, "guide.BloodMagic.entryName.spells.complexSpellBasics")); -// -// ArrayList complexSpellEffectsPages = new ArrayList(); -// for(int i=1; i<=17; i++) -// complexSpellEffectsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellEffects." + i))); -// entries.add(new EntryUniText(complexSpellEffectsPages, "guide.BloodMagic.entryName.spells.complexSpellEffects")); -// -// ArrayList offTopicPages = new ArrayList(); -// offTopicPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.offTopic"))); -// entries.add(new EntryUniText(offTopicPages, "guide.BloodMagic.entryName.spells.offTopic")); -// -// ArrayList demonicPowerPages = new ArrayList(); -// demonicPowerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.demonicPower"))); -// entries.add(new EntryUniText(demonicPowerPages, "guide.BloodMagic.entryName.spells.demonicPower")); -// -// categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.spells", new ItemStack(ModItems.itemComplexSpellCrystal))); -// } -// -// public static void registerAlchemyBook() -// { -// List entries = new ArrayList(); -// -// ArrayList fatedMeetingPages = new ArrayList(); -// fatedMeetingPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.fatedMeeting"))); -// entries.add(new EntryUniText(fatedMeetingPages, "guide.BloodMagic.entryName.alchemy.fatedMeeting")); -// -// ArrayList firstStepsPages = new ArrayList(); -// firstStepsPages.add(getOrbPageForRecipe(RecipeHolder.alchemySetRecipe)); -// firstStepsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.firstSteps"))); -// entries.add(new EntryUniText(firstStepsPages, "guide.BloodMagic.entryName.alchemy.firstSteps")); -// -// ArrayList chemistrySetPages = new ArrayList(); -// for(int i=1; i<=10; i++) -// chemistrySetPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.chemistrySet." + i))); -// entries.add(new EntryUniText(chemistrySetPages, "guide.BloodMagic.entryName.alchemy.chemistrySet")); -// -// ArrayList incensePages = new ArrayList(); -// incensePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.incense.1"))); -// incensePages.add(new PageIRecipe(RecipeHolder.crucibleRecipe)); -// incensePages.add(new PageIRecipe(RecipeHolder.woodAshRecipe)); -// incensePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.incense.2"))); -// incensePages.add(getOrbPageForRecipe(RecipeHolder.byrrusRecipe)); -// incensePages.add(getOrbPageForRecipe(RecipeHolder.livensRecipe)); -// incensePages.add(getOrbPageForRecipe(RecipeHolder.virRecipe)); -// incensePages.add(getOrbPageForRecipe(RecipeHolder.purpuraRecipe)); -// incensePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.incense.3"))); -// entries.add(new EntryUniText(incensePages, "guide.BloodMagic.entryName.alchemy.incense")); -// -// ArrayList potionsPages = new ArrayList(); -// potionsPages.add(new PageAltarRecipe(RecipeHolder.flaskRecipe)); -// potionsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.potions"))); -// entries.add(new EntryUniText(potionsPages, "guide.BloodMagic.entryName.alchemy.potions")); -// -// ArrayList reagentRevolutionPages = new ArrayList(); -// for(int i=1; i<=8; i++) -// reagentRevolutionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentRevolution." + i))); -// entries.add(new EntryUniText(reagentRevolutionPages, "guide.BloodMagic.entryName.alchemy.reagentRevolution")); -// -// ArrayList newPotionsPages = new ArrayList(); -// newPotionsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.newPotions"))); -// entries.add(new EntryUniText(newPotionsPages, "guide.BloodMagic.entryName.alchemy.newPotions")); -// -// ArrayList soulSandPages = new ArrayList(); -// soulSandPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.soulSand"))); -// entries.add(new EntryUniText(soulSandPages, "guide.BloodMagic.entryName.alchemy.soulSand")); -// -// ArrayList timeGoesByPages = new ArrayList(); -// timeGoesByPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.timeGoesBy"))); -// entries.add(new EntryUniText(timeGoesByPages, "guide.BloodMagic.entryName.alchemy.timeGoesBy")); -// -// ArrayList catalystsPages = new ArrayList(); -// catalystsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.catalysts"))); -// entries.add(new EntryUniText(catalystsPages, "guide.BloodMagic.entryName.alchemy.catalysts")); -// -// ArrayList activationCrystalPages = new ArrayList(); -// activationCrystalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.activationCrystal"))); -// entries.add(new EntryUniText(activationCrystalPages, "guide.BloodMagic.entryName.alchemy.activationCrystal")); -// -// ArrayList reagentSystemPages = new ArrayList(); -// reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.1"))); -// reagentSystemPages.add(new PageIRecipe(RecipeHolder.calcinatorRecipe)); -// reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.2"))); -// reagentSystemPages.add(new PageIRecipe(RecipeHolder.belljarRecipe)); -// reagentSystemPages.add(new PageIRecipe(RecipeHolder.relayRecipe)); -// reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.3"))); -// reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.4"))); -// reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.5"))); -// reagentSystemPages.add(new PageIRecipe(RecipeHolder.routerRecipe)); -// reagentSystemPages.add(new PageIRecipe(RecipeHolder.segmenterRecipe)); -// reagentSystemPages.add(new PageIRecipe(RecipeHolder.cleanserRecipe)); -// reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.6"))); -// -// reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.7"))); -// -// entries.add(new EntryUniText(reagentSystemPages, "guide.BloodMagic.entryName.alchemy.reagentSystem")); -// -// ArrayList magusSecretPages = new ArrayList(); -// magusSecretPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.magusSecret"))); -// entries.add(new EntryUniText(magusSecretPages, "guide.BloodMagic.entryName.alchemy.magusSecret")); -// -// ArrayList simpleCreationsPages = new ArrayList(); -// simpleCreationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.simpleCreations"))); -// entries.add(new EntryUniText(simpleCreationsPages, "guide.BloodMagic.entryName.alchemy.simpleCreations")); -// -// categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.alchemy", new ItemStack(ModItems.alchemyFlask))); -// } -//} +package WayofTime.alchemicalWizardry.common.book; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.guide.OrbRecipeRenderer; +import WayofTime.alchemicalWizardry.api.guide.PageAltarRecipe; +import WayofTime.alchemicalWizardry.common.guide.RecipeHolder; +import amerifrance.guideapi.api.GuideRegistry; +import amerifrance.guideapi.api.abstraction.CategoryAbstract; +import amerifrance.guideapi.api.abstraction.EntryAbstract; +import amerifrance.guideapi.api.abstraction.IPage; +import amerifrance.guideapi.api.base.Book; +import amerifrance.guideapi.api.util.BookBuilder; +import amerifrance.guideapi.api.util.PageHelper; +import amerifrance.guideapi.categories.CategoryItemStack; +import amerifrance.guideapi.entries.EntryUniText; +import amerifrance.guideapi.pages.PageIRecipe; +import amerifrance.guideapi.pages.PageUnlocImage; + +public class BloodMagicGuide +{ + public static Book bloodMagicGuide; + public static List categories = new ArrayList(); + + public static void registerGuide() + { + registerArchitectBook(); + registerRitualBook(); + registerDemonBook(); + registerSpellBook(); + registerAlchemyBook(); + + BookBuilder bmBookBuilder = new BookBuilder(); + bmBookBuilder.setCategories(categories).setUnlocBookTitle("guide.BloodMagic.book.title").setUnlocWelcomeMessage("guide.BloodMagic.welcomeMessage").setUnlocDisplayName("guide.BloodMagic.book.name").setBookColor(new Color(190, 10, 0)).setAuthor("-Blood Magic"); + +// bloodMagicGuide = new Book(categories, "guide.BloodMagic.book.title", "guide.BloodMagic.welcomeMessage", "guide.BloodMagic.book.name", new Color(190, 10, 0)); + bloodMagicGuide = bmBookBuilder.build(); + GuideRegistry.registerBook(bloodMagicGuide); + } + + public static PageIRecipe getOrbPageForRecipe(IRecipe recipe) + { + return new PageIRecipe(recipe, new OrbRecipeRenderer(recipe)); + } + + public static void registerArchitectBook() + { + List entries = new ArrayList(); + + ArrayList introPages = new ArrayList(); + introPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.intro"))); + entries.add(new EntryUniText(introPages, "guide.BloodMagic.entryName.architect.intro")); + + ArrayList bloodAltarPages = new ArrayList(); + bloodAltarPages.add(new PageIRecipe(RecipeHolder.bloodAltarRecipe)); + bloodAltarPages.add(new PageIRecipe(RecipeHolder.knifeRecipe)); + bloodAltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodAltar.1"))); + bloodAltarPages.add(new PageAltarRecipe(RecipeHolder.weakBloodOrbRecipe)); + bloodAltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodAltar.2"))); + entries.add(new EntryUniText(bloodAltarPages, "guide.BloodMagic.entryName.architect.bloodAltar")); + + ArrayList soulNetworkPages = new ArrayList(); + soulNetworkPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.soulNetwork"))); + entries.add(new EntryUniText(soulNetworkPages, "guide.BloodMagic.entryName.architect.soulNetwork")); + + ArrayList blankSlatePages = new ArrayList(); + blankSlatePages.add(new PageAltarRecipe(RecipeHolder.blankSlateRecipe)); + blankSlatePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.blankSlate"))); + entries.add(new EntryUniText(blankSlatePages, "guide.BloodMagic.entryName.architect.blankSlate")); + + ArrayList divinationSigilPages = new ArrayList(); + divinationSigilPages.add(getOrbPageForRecipe(RecipeHolder.divinationSigilRecipe)); + divinationSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.divination"))); + entries.add(new EntryUniText(divinationSigilPages, "guide.BloodMagic.entryName.architect.divination")); + + ArrayList waterSigilPages = new ArrayList(); + waterSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.waterSigil.1"))); + waterSigilPages.add(getOrbPageForRecipe(RecipeHolder.waterSigilRecipe)); + waterSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.waterSigil.2"))); + entries.add(new EntryUniText(waterSigilPages, "guide.BloodMagic.entryName.architect.waterSigil")); + + ArrayList lavaCrystalPages = new ArrayList(); + lavaCrystalPages.add(getOrbPageForRecipe(RecipeHolder.lavaCrystalRecipe)); + lavaCrystalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.lavaCrystal"))); + entries.add(new EntryUniText(lavaCrystalPages, "guide.BloodMagic.entryName.architect.lavaCrystal")); + + ArrayList hellHarvestPages = new ArrayList(); + hellHarvestPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.hellHarvest"))); + entries.add(new EntryUniText(hellHarvestPages, "guide.BloodMagic.entryName.architect.hellHarvest")); + + ArrayList lavaSigilPages = new ArrayList(); + lavaSigilPages.add(new PageIRecipe(RecipeHolder.lavaSigilRecipe)); + lavaSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.lavaSigil"))); + entries.add(new EntryUniText(lavaSigilPages, "guide.BloodMagic.entryName.architect.lavaSigil")); + + ArrayList blankRunePages = new ArrayList(); + blankRunePages.add(getOrbPageForRecipe(RecipeHolder.blankRuneRecipe)); + blankRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.blankRunes.1"))); + blankRunePages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T2.png"), true)); + blankRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.blankRunes.2"))); + entries.add(new EntryUniText(blankRunePages, "guide.BloodMagic.entryName.architect.blankRunes")); + + ArrayList speedRunePages = new ArrayList(); + speedRunePages.add(new PageIRecipe(RecipeHolder.speedRuneRecipe)); + speedRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.speedRunes"))); + entries.add(new EntryUniText(speedRunePages, "guide.BloodMagic.entryName.architect.speedRunes")); + + ArrayList apprenticeOrbPages = new ArrayList(); + apprenticeOrbPages.add(new PageAltarRecipe(RecipeHolder.apprenticeBloodOrbRecipe)); + apprenticeOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.apprenticeOrb"))); + entries.add(new EntryUniText(apprenticeOrbPages, "guide.BloodMagic.entryName.architect.apprenticeOrb")); + + ArrayList voidSigilPages = new ArrayList(); + voidSigilPages.add(getOrbPageForRecipe(RecipeHolder.voidSigilRecipe)); + voidSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.voidSigil"))); + entries.add(new EntryUniText(voidSigilPages, "guide.BloodMagic.entryName.architect.voidSigil")); + + ArrayList airSigilPages = new ArrayList(); + airSigilPages.add(getOrbPageForRecipe(RecipeHolder.airSigilRecipe)); + airSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.airSigil"))); + entries.add(new EntryUniText(airSigilPages, "guide.BloodMagic.entryName.architect.airSigil")); + + ArrayList sightSigilPages = new ArrayList(); + sightSigilPages.add(getOrbPageForRecipe(RecipeHolder.sightSigilRecipe)); + sightSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sightSigil"))); + entries.add(new EntryUniText(sightSigilPages, "guide.BloodMagic.entryName.architect.sightSigil")); + + ArrayList advancedAltarPages = new ArrayList(); + advancedAltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.advancedAltar"))); + entries.add(new EntryUniText(advancedAltarPages, "guide.BloodMagic.entryName.architect.advancedAltar")); + + ArrayList fastMinerPages = new ArrayList(); + fastMinerPages.add(getOrbPageForRecipe(RecipeHolder.fastMinerRecipe)); + fastMinerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.fastMiner"))); + entries.add(new EntryUniText(fastMinerPages, "guide.BloodMagic.entryName.architect.fastMiner")); + + ArrayList soulFrayPages = new ArrayList(); + soulFrayPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.soulFray"))); + entries.add(new EntryUniText(soulFrayPages, "guide.BloodMagic.entryName.architect.soulFray")); + + ArrayList greenGrovePages = new ArrayList(); + greenGrovePages.add(getOrbPageForRecipe(RecipeHolder.greenGroveRecipe)); + greenGrovePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.greenGrove"))); + entries.add(new EntryUniText(greenGrovePages, "guide.BloodMagic.entryName.architect.greenGrove")); + + ArrayList daggerPages = new ArrayList(); + daggerPages.add(new PageAltarRecipe(RecipeHolder.daggerRecipe)); + daggerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.dagger"))); + entries.add(new EntryUniText(daggerPages, "guide.BloodMagic.entryName.architect.dagger")); + + ArrayList sacrificePages = new ArrayList(); + sacrificePages.add(getOrbPageForRecipe(RecipeHolder.selfSacrificeRuneRecipe)); + sacrificePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sacrifice.1"))); + sacrificePages.add(getOrbPageForRecipe(RecipeHolder.sacrificeRuneRecipe)); + sacrificePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sacrifice.2"))); + entries.add(new EntryUniText(sacrificePages, "guide.BloodMagic.entryName.architect.sacrifice")); + + ArrayList bloodPackPages = new ArrayList(); + bloodPackPages.add(new PageIRecipe(RecipeHolder.bloodPackRecipe)); + bloodPackPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodPack"))); + entries.add(new EntryUniText(bloodPackPages, "guide.BloodMagic.entryName.architect.bloodPack")); + + ArrayList fivePeoplePages = new ArrayList(); + fivePeoplePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.fivePeople"))); + entries.add(new EntryUniText(fivePeoplePages, "guide.BloodMagic.entryName.architect.fivePeople")); + + ArrayList tier3Pages = new ArrayList(); + tier3Pages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T3.png"), true)); + tier3Pages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier3"))); + entries.add(new EntryUniText(tier3Pages, "guide.BloodMagic.entryName.architect.tier3")); + + ArrayList magicianOrbPages = new ArrayList(); + magicianOrbPages.add(new PageAltarRecipe(RecipeHolder.magicianBloodOrbRecipe)); + magicianOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.magicianOrb"))); + entries.add(new EntryUniText(magicianOrbPages, "guide.BloodMagic.entryName.architect.magicianOrb")); + + ArrayList newRunePages = new ArrayList(); + newRunePages.add(getOrbPageForRecipe(RecipeHolder.capacityRuneRecipe)); + newRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.newRune.1"))); + newRunePages.add(getOrbPageForRecipe(RecipeHolder.dislocationRuneRecipe)); + newRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.newRune.2"))); + entries.add(new EntryUniText(newRunePages, "guide.BloodMagic.entryName.architect.newRune")); + + ArrayList magnetismPages = new ArrayList(); + magnetismPages.add(getOrbPageForRecipe(RecipeHolder.magnetismSigilRecipe)); + magnetismPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.magnetism"))); + entries.add(new EntryUniText(magnetismPages, "guide.BloodMagic.entryName.architect.magnetism")); + + ArrayList phantomBridgePages = new ArrayList(); + phantomBridgePages.add(getOrbPageForRecipe(RecipeHolder.phantomBridgeRecipe)); + phantomBridgePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.phantomBridge"))); + entries.add(new EntryUniText(phantomBridgePages, "guide.BloodMagic.entryName.architect.phantomBridge")); + + ArrayList holdingPages = new ArrayList(); + holdingPages.add(getOrbPageForRecipe(RecipeHolder.holdingSigilRecipe)); + holdingPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.holding"))); + entries.add(new EntryUniText(holdingPages, "guide.BloodMagic.entryName.architect.holding")); + + ArrayList elementalAffinityPages = new ArrayList(); + elementalAffinityPages.add(getOrbPageForRecipe(RecipeHolder.affinitySigilRecipe)); + elementalAffinityPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.elementalAffinity"))); + entries.add(new EntryUniText(elementalAffinityPages, "guide.BloodMagic.entryName.architect.elementalAffinity")); + + ArrayList ritualStonesPages = new ArrayList(); + ritualStonesPages.add(getOrbPageForRecipe(RecipeHolder.ritualStoneRecipe)); + ritualStonesPages.add(getOrbPageForRecipe(RecipeHolder.masterStoneRecipe)); + ritualStonesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.ritualStones"))); + entries.add(new EntryUniText(ritualStonesPages, "guide.BloodMagic.entryName.architect.ritualStones")); + + ArrayList bloodLampPages = new ArrayList(); + bloodLampPages.add(getOrbPageForRecipe(RecipeHolder.bloodLampRecipe)); + bloodLampPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodLamp"))); + entries.add(new EntryUniText(bloodLampPages, "guide.BloodMagic.entryName.architect.bloodLamp")); + + ArrayList boundArmourPages = new ArrayList(); + boundArmourPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.boundArmour.1"))); + boundArmourPages.add(new PageIRecipe(RecipeHolder.emptySocketRecipe)); + boundArmourPages.add(new PageAltarRecipe(RecipeHolder.filledSocketRecipe)); + boundArmourPages.add(getOrbPageForRecipe(RecipeHolder.soulForgeRecipe)); + boundArmourPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.boundArmour.2"))); + entries.add(new EntryUniText(boundArmourPages, "guide.BloodMagic.entryName.architect.boundArmour")); + + if(AlchemicalWizardry.isThaumcraftLoaded) + { + ArrayList sanguineArmourPages = new ArrayList(); + sanguineArmourPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.sanguineArmour"), new ItemStack(ModItems.sanguineRobe))); + entries.add(new EntryUniText(sanguineArmourPages, "guide.BloodMagic.entryName.architect.sanguineArmour")); + } + + ArrayList soulSuppressPages = new ArrayList(); + soulSuppressPages.add(new PageIRecipe(RecipeHolder.inhibitorRecipe)); + soulSuppressPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.soulSuppress"))); + entries.add(new EntryUniText(soulSuppressPages, "guide.BloodMagic.entryName.architect.soulSuppress")); + + ArrayList ritualDivinerPages = new ArrayList(); + ritualDivinerPages.add(new PageIRecipe(RecipeHolder.ritualDiviner1Recipe)); + ritualDivinerPages.add(new PageIRecipe(RecipeHolder.ritualDiviner2Recipe)); + ritualDivinerPages.add(new PageIRecipe(RecipeHolder.ritualDiviner3Recipe)); + ritualDivinerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.ritualDiviner"))); + entries.add(new EntryUniText(ritualDivinerPages, "guide.BloodMagic.entryName.architect.ritualDiviner")); + + ArrayList bloodShardPages = new ArrayList(); + bloodShardPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bloodShard"), new ItemStack(ModItems.weakBloodShard))); + entries.add(new EntryUniText(bloodShardPages, "guide.BloodMagic.entryName.architect.bloodShard")); + + ArrayList tier4AltarPages = new ArrayList(); + tier4AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier4Altar.1"))); + tier4AltarPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T4.png"), true)); + tier4AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier4Altar.2"))); + entries.add(new EntryUniText(tier4AltarPages, "guide.BloodMagic.entryName.architect.tier4Altar")); + + ArrayList masterOrbPages = new ArrayList(); + masterOrbPages.add(new PageAltarRecipe(RecipeHolder.masterBloodOrbRecipe)); + masterOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.masterOrb"))); + entries.add(new EntryUniText(masterOrbPages, "guide.BloodMagic.entryName.architect.masterOrb")); + + ArrayList whirlwindPages = new ArrayList(); + whirlwindPages.add(getOrbPageForRecipe(RecipeHolder.whirlwindSigilRecipe)); + whirlwindPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.whirlwind"))); + entries.add(new EntryUniText(whirlwindPages, "guide.BloodMagic.entryName.architect.whirlwind")); + + ArrayList compressionPages = new ArrayList(); + compressionPages.add(getOrbPageForRecipe(RecipeHolder.compressionSigilRecipe)); + compressionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.compression"))); + entries.add(new EntryUniText(compressionPages, "guide.BloodMagic.entryName.architect.compression")); + + ArrayList severancePages = new ArrayList(); + severancePages.add(getOrbPageForRecipe(RecipeHolder.enderSeveranceSigilRecipe)); + severancePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.severance"))); + entries.add(new EntryUniText(severancePages, "guide.BloodMagic.entryName.architect.severance")); + + ArrayList teleposerPages = new ArrayList(); + teleposerPages.add(new PageAltarRecipe(RecipeHolder.teleposerFocusRecipe1)); + teleposerPages.add(new PageIRecipe(RecipeHolder.teleposerRecipe)); + teleposerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.teleposer"))); + entries.add(new EntryUniText(teleposerPages, "guide.BloodMagic.entryName.architect.teleposer")); + + ArrayList suppressionPages = new ArrayList(); + suppressionPages.add(getOrbPageForRecipe(RecipeHolder.suppressionSigilRecipe)); + suppressionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.suppression"))); + entries.add(new EntryUniText(suppressionPages, "guide.BloodMagic.entryName.architect.suppression")); + + ArrayList superiorCapacityPages = new ArrayList(); + superiorCapacityPages.add(getOrbPageForRecipe(RecipeHolder.superiorCapacityRecipe)); + superiorCapacityPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.superiorCapacity"))); + entries.add(new EntryUniText(superiorCapacityPages, "guide.BloodMagic.entryName.architect.superiorCapacity")); + + ArrayList orbRunePages = new ArrayList(); + orbRunePages.add(getOrbPageForRecipe(RecipeHolder.orbRuneRecipe)); + orbRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.orbRune"))); + entries.add(new EntryUniText(orbRunePages, "guide.BloodMagic.entryName.architect.orbRune")); + + ArrayList fieldTripPages = new ArrayList(); + fieldTripPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.fieldTrip"))); + entries.add(new EntryUniText(fieldTripPages, "guide.BloodMagic.entryName.architect.fieldTrip")); + + ArrayList bindingKeyPages = new ArrayList(); + bindingKeyPages.add(new PageIRecipe(RecipeHolder.keyOfBindingRecipe)); + bindingKeyPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.bindingKey"))); + entries.add(new EntryUniText(bindingKeyPages, "guide.BloodMagic.entryName.architect.bindingKey")); + + ArrayList tier5AltarPages = new ArrayList(); + tier5AltarPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T5.png"), true)); + tier5AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier5Altar"))); + entries.add(new EntryUniText(tier5AltarPages, "guide.BloodMagic.entryName.architect.tier5Altar")); + + ArrayList priceOfPowerPages = new ArrayList(); + priceOfPowerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.priceOfPower"))); + entries.add(new EntryUniText(priceOfPowerPages, "guide.BloodMagic.entryName.architect.priceOfPower")); + + ArrayList demonicOrbPages = new ArrayList(); + demonicOrbPages.add(new PageAltarRecipe(RecipeHolder.archmageBloodOrbRecipe)); + demonicOrbPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.demonicOrb"))); + entries.add(new EntryUniText(demonicOrbPages, "guide.BloodMagic.entryName.architect.demonicOrb")); + + ArrayList energyBazookaPages = new ArrayList(); + demonicOrbPages.add(getOrbPageForRecipe(RecipeHolder.energyBazookaRecipe)); + energyBazookaPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.energyBazooka"))); + entries.add(new EntryUniText(energyBazookaPages, "guide.BloodMagic.entryName.architect.energyBazooka")); + + ArrayList accelerationRunePages = new ArrayList(); + demonicOrbPages.add(getOrbPageForRecipe(RecipeHolder.accelerationRuneRecipe)); + accelerationRunePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.accelerationRune"))); + entries.add(new EntryUniText(accelerationRunePages, "guide.BloodMagic.entryName.architect.accelerationRune")); + + ArrayList harvestPages = new ArrayList(); + demonicOrbPages.add(getOrbPageForRecipe(RecipeHolder.harvestSigilRecipe)); + harvestPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.harvest"))); + entries.add(new EntryUniText(harvestPages, "guide.BloodMagic.entryName.architect.harvest")); + + ArrayList demonProblemPages = new ArrayList(); + demonProblemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.demonProblem"))); + entries.add(new EntryUniText(demonProblemPages, "guide.BloodMagic.entryName.architect.demonProblem")); + + ArrayList tier6AltarPages = new ArrayList(); + tier6AltarPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/altars/T6.png"), true)); + tier6AltarPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.tier6Altar"))); + tier6AltarPages.add(new PageIRecipe(RecipeHolder.crystalCluserRecipe)); + tier6AltarPages.add(new PageAltarRecipe(RecipeHolder.transcendentBloodOrbRecipe)); + entries.add(new EntryUniText(tier6AltarPages, "guide.BloodMagic.entryName.architect.tier6Altar")); + + ArrayList moreThanHumanPages = new ArrayList(); + moreThanHumanPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.architect.moreThanHuman"))); + entries.add(new EntryUniText(moreThanHumanPages, "guide.BloodMagic.entryName.architect.moreThanHuman")); + + categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.architect", new ItemStack(ModItems.divinationSigil))); + } + + public static void registerRitualBook() + { + List entries = new ArrayList(); + +// ArrayList testPages = new ArrayList(); +// testPages.add(PageRitualMultiBlock.getPageForRitual("AW031Convocation")); +// entries.add(new EntryUniText(testPages, "Test page")); + + + ArrayList introPages = new ArrayList(); + introPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.intro"))); + entries.add(new EntryUniText(introPages, "guide.BloodMagic.entryName.rituals.intro")); + + ArrayList weakRitualPages = new ArrayList(); + weakRitualPages.add(getOrbPageForRecipe(RecipeHolder.weakRitualStoneRecipe)); + weakRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.weakRitual"))); + entries.add(new EntryUniText(weakRitualPages, "guide.BloodMagic.entryName.rituals.weakRitual")); + + ArrayList ritualsPages = new ArrayList(); + ritualsPages.add(getOrbPageForRecipe(RecipeHolder.ritualStoneRecipe)); + ritualsPages.add(getOrbPageForRecipe(RecipeHolder.masterStoneRecipe)); + ritualsPages.add(new PageAltarRecipe(RecipeHolder.waterScribeTool)); + ritualsPages.add(new PageAltarRecipe(RecipeHolder.fireScribeTool)); + ritualsPages.add(new PageAltarRecipe(RecipeHolder.earthScribeTool)); + ritualsPages.add(new PageAltarRecipe(RecipeHolder.airScribeTool)); + ritualsPages.add(new PageIRecipe(RecipeHolder.ritualDiviner1Recipe)); + ritualsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.rituals"))); + ritualsPages.add(new PageAltarRecipe(RecipeHolder.weakActivationRecipe)); + entries.add(new EntryUniText(ritualsPages, "guide.BloodMagic.entryName.rituals.rituals")); + + ArrayList waterRitualPages = new ArrayList(); + waterRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Water.png"), true)); + waterRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.waterRitual"))); + entries.add(new EntryUniText(waterRitualPages, "guide.BloodMagic.entryName.rituals.waterRitual")); + + ArrayList lavaRitualPages = new ArrayList(); + lavaRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Lava.png"), true)); + lavaRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.lavaRitual"))); + entries.add(new EntryUniText(lavaRitualPages, "guide.BloodMagic.entryName.rituals.lavaRitual")); + + ArrayList groveRitualPages = new ArrayList(); + groveRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/GreenGrove.png"), true)); + groveRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.groveRitual"))); + entries.add(new EntryUniText(groveRitualPages, "guide.BloodMagic.entryName.rituals.groveRitual")); + + ArrayList interdictionRitualPages = new ArrayList(); + interdictionRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Interdiction.png"), true)); + interdictionRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.interdictionRitual"))); + entries.add(new EntryUniText(interdictionRitualPages, "guide.BloodMagic.entryName.rituals.interdictionRitual")); + + ArrayList containmentRitualPages = new ArrayList(); + containmentRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Containment.png"), true)); + containmentRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.containmentRitual"))); + entries.add(new EntryUniText(containmentRitualPages, "guide.BloodMagic.entryName.rituals.containmentRitual")); + + ArrayList bindingRitualPages = new ArrayList(); + bindingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Binding.png"), true)); + bindingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.bindingRitual"))); + entries.add(new EntryUniText(bindingRitualPages, "guide.BloodMagic.entryName.rituals.bindingRitual")); + + ArrayList beastModePages = new ArrayList(); + beastModePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.beastMode"))); + entries.add(new EntryUniText(beastModePages, "guide.BloodMagic.entryName.rituals.beastMode")); + + ArrayList unbindingRitualPages = new ArrayList(); + unbindingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Unbinding.png"), true)); + unbindingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.unbindingRitual"))); + entries.add(new EntryUniText(unbindingRitualPages, "guide.BloodMagic.entryName.rituals.unbindingRitual")); + + ArrayList jumpRitualPages = new ArrayList(); + jumpRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Jump.png"), true)); + jumpRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.jumpRitual"))); + entries.add(new EntryUniText(jumpRitualPages, "guide.BloodMagic.entryName.rituals.jumpRitual")); + + ArrayList duskInkPages = new ArrayList(); + duskInkPages.add(new PageAltarRecipe(RecipeHolder.duskRecipe)); + duskInkPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.duskInk"))); + entries.add(new EntryUniText(duskInkPages, "guide.BloodMagic.entryName.rituals.duskInk")); + + ArrayList magnetismRitualPages = new ArrayList(); + magnetismRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Magnetism.png"), true)); + magnetismRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.magnetismRitual"))); + entries.add(new EntryUniText(magnetismRitualPages, "guide.BloodMagic.entryName.rituals.magnetismRitual")); + + ArrayList crusherRitualPages = new ArrayList(); + crusherRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Crusher.png"), true)); + crusherRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.crusherRitual"))); + entries.add(new EntryUniText(crusherRitualPages, "guide.BloodMagic.entryName.rituals.crusherRitual")); + + ArrayList speedRitualPages = new ArrayList(); + speedRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Speed.png"), true)); + speedRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.speedRitual"))); + entries.add(new EntryUniText(speedRitualPages, "guide.BloodMagic.entryName.rituals.speedRitual")); + + ArrayList shepherdRitualPages = new ArrayList(); + shepherdRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/AnimalGrowth.png"), true)); + shepherdRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.shepherdRitual"))); + entries.add(new EntryUniText(shepherdRitualPages, "guide.BloodMagic.entryName.rituals.shepherdRitual")); + + ArrayList darkMagicPages = new ArrayList(); + darkMagicPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.darkMagic"))); + entries.add(new EntryUniText(darkMagicPages, "guide.BloodMagic.entryName.rituals.darkMagic")); + + ArrayList knifeAndSufferingRitualPages = new ArrayList(); + knifeAndSufferingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/WellOfSuffering.png"), true)); + knifeAndSufferingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.knifeAndSufferingRitual.1"))); + knifeAndSufferingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/FeatheredKnife.png"), true)); + knifeAndSufferingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.knifeAndSufferingRitual.2"))); + entries.add(new EntryUniText(knifeAndSufferingRitualPages, "guide.BloodMagic.entryName.rituals.knifeAndSufferingRitual")); + + ArrayList regenerationRitualPages = new ArrayList(); + regenerationRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Regeneration.png"), true)); + regenerationRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.regenerationRitual"))); + entries.add(new EntryUniText(regenerationRitualPages, "guide.BloodMagic.entryName.rituals.regenerationRitual")); + + ArrayList harvestFestivalPages = new ArrayList(); + harvestFestivalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.harvestFestival"))); + entries.add(new EntryUniText(harvestFestivalPages, "guide.BloodMagic.entryName.rituals.harvestFestival")); + + ArrayList thenThereWereFivePages = new ArrayList(); + thenThereWereFivePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.thenThereWereFive"))); + entries.add(new EntryUniText(thenThereWereFivePages, "guide.BloodMagic.entryName.rituals.thenThereWereFive")); + + ArrayList alchemyRitualPages = new ArrayList(); + alchemyRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Alchemy.png"), true)); + alchemyRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.alchemyRitual"))); + entries.add(new EntryUniText(alchemyRitualPages, "guide.BloodMagic.entryName.rituals.alchemyRitual")); + + ArrayList domeRitualPages = new ArrayList(); + domeRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Dome.png"), true)); + domeRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.domeRitual"))); + entries.add(new EntryUniText(domeRitualPages, "guide.BloodMagic.entryName.rituals.domeRitual")); + + ArrayList awakenedCrystalPages = new ArrayList(); + awakenedCrystalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.awakenedCrystal"))); + entries.add(new EntryUniText(awakenedCrystalPages, "guide.BloodMagic.entryName.rituals.awakenedCrystal")); + + ArrayList featheredEarthRitualPages = new ArrayList(); + featheredEarthRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/FeatheredEarth.png"), true)); + featheredEarthRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.featheredEarthRitual"))); + entries.add(new EntryUniText(featheredEarthRitualPages, "guide.BloodMagic.entryName.rituals.featheredEarthRitual")); + + ArrayList gaiaRitualPages = new ArrayList(); + gaiaRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Gaia.png"), true)); + gaiaRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.gaiaRitual"))); + entries.add(new EntryUniText(gaiaRitualPages, "guide.BloodMagic.entryName.rituals.gaiaRitual")); + + ArrayList condorRitualPages = new ArrayList(); + condorRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Flight.png"), true)); + condorRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.condorRitual"))); + entries.add(new EntryUniText(condorRitualPages, "guide.BloodMagic.entryName.rituals.condorRitual")); + + ArrayList meteorRitualPages = new ArrayList(); + meteorRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Meteor.png"), true)); + meteorRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.meteorRitual"))); + entries.add(new EntryUniText(meteorRitualPages, "guide.BloodMagic.entryName.rituals.meteorRitual")); + + ArrayList expulsionRitualPages = new ArrayList(); + expulsionRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Expulsion.png"), true)); + expulsionRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.expulsionRitual"))); + entries.add(new EntryUniText(expulsionRitualPages, "guide.BloodMagic.entryName.rituals.expulsionRitual")); + + ArrayList costOfProgressPages = new ArrayList(); + costOfProgressPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.costOfProgress.1"))); + costOfProgressPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.costOfProgress.2"))); + entries.add(new EntryUniText(costOfProgressPages, "guide.BloodMagic.entryName.rituals.costOfProgress")); + + ArrayList zephyrRitualPages = new ArrayList(); + zephyrRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Zephyr.png"), true)); + zephyrRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.zephyrRitual"))); + entries.add(new EntryUniText(zephyrRitualPages, "guide.BloodMagic.entryName.rituals.zephyrRitual")); + + ArrayList harvestRitualPages = new ArrayList(); + harvestRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Harvest.png"), true)); + harvestRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.harvestRitual"))); + entries.add(new EntryUniText(harvestRitualPages, "guide.BloodMagic.entryName.rituals.harvestRitual")); + + ArrayList eternalSoulRitualPages = new ArrayList(); + eternalSoulRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/EternalSoul.png"), true)); + eternalSoulRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.eternalSoulRitual"))); + entries.add(new EntryUniText(eternalSoulRitualPages, "guide.BloodMagic.entryName.rituals.eternalSoulRitual")); + + ArrayList ellipsoidRitualPages = new ArrayList(); + ellipsoidRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Ellipsoid.png"), true)); + ellipsoidRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.ellipsoidRitual"))); + entries.add(new EntryUniText(ellipsoidRitualPages, "guide.BloodMagic.entryName.rituals.ellipsoidRitual")); + + ArrayList evaporationRitualPages = new ArrayList(); + evaporationRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Evaporation.png"), true)); + evaporationRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.evaporationRitual"))); + entries.add(new EntryUniText(evaporationRitualPages, "guide.BloodMagic.entryName.rituals.evaporationRitual")); + + ArrayList sacrosanctityRitualPages = new ArrayList(); + sacrosanctityRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Sacrosanctity.png"), true)); + sacrosanctityRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.sacrosanctityRitual"))); + entries.add(new EntryUniText(sacrosanctityRitualPages, "guide.BloodMagic.entryName.rituals.sacrosanctityRitual")); + + ArrayList evilRitualPages = new ArrayList(); + evilRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/VeilOfEvil.png"), true)); + evilRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.evilRitual"))); + entries.add(new EntryUniText(evilRitualPages, "guide.BloodMagic.entryName.rituals.evilRitual")); + + ArrayList stomachRitualPages = new ArrayList(); + stomachRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Stomach.png"), true)); + stomachRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.stomachRitual"))); + entries.add(new EntryUniText(stomachRitualPages, "guide.BloodMagic.entryName.rituals.stomachRitual")); + + ArrayList reagentEffectsRitualPages = new ArrayList(); + for(int i=1; i<=24; i++) + { + reagentEffectsRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.reagentEffects." + i))); + } + entries.add(new EntryUniText(reagentEffectsRitualPages, "guide.BloodMagic.entryName.rituals.reagentEffects")); + + ArrayList conclaveOfMagesPages = new ArrayList(); + conclaveOfMagesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.conclaveOfMages"))); + entries.add(new EntryUniText(conclaveOfMagesPages, "guide.BloodMagic.entryName.rituals.conclaveOfMages")); + + ArrayList forbiddenParadisePages = new ArrayList(); + forbiddenParadisePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.forbiddenParadise"))); + entries.add(new EntryUniText(forbiddenParadisePages, "guide.BloodMagic.entryName.rituals.forbiddenParadise")); + + ArrayList convocationRitualPages = new ArrayList(); + convocationRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/Convocation.png"), true)); + convocationRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.convocationRitual"))); + entries.add(new EntryUniText(convocationRitualPages, "guide.BloodMagic.entryName.rituals.convocationRitual")); + + ArrayList longHaulPages = new ArrayList(); + longHaulPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.longHaul"))); + entries.add(new EntryUniText(longHaulPages, "guide.BloodMagic.entryName.rituals.longHaul")); + + ArrayList phantomHandsRitualPages = new ArrayList(); + phantomHandsRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/PhantomHands.png"), true)); + phantomHandsRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.phantomHandsRitual"))); + entries.add(new EntryUniText(phantomHandsRitualPages, "guide.BloodMagic.entryName.rituals.phantomHandsRitual")); + + ArrayList anvilRitualPages = new ArrayList(); + anvilRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/BeatingAnvil.png"), true)); + anvilRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.anvilRitual"))); + entries.add(new EntryUniText(anvilRitualPages, "guide.BloodMagic.entryName.rituals.anvilRitual")); + + ArrayList dawnInkPages = new ArrayList(); + dawnInkPages.add(new PageAltarRecipe(RecipeHolder.dawnRecipe)); + dawnInkPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.dawnInk"))); + entries.add(new EntryUniText(dawnInkPages, "guide.BloodMagic.entryName.rituals.dawnInk")); + + ArrayList symmetryRitualPages = new ArrayList(); + symmetryRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/SymmetryOmega.png"), true)); + symmetryRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.symmetryRitual"))); + entries.add(new EntryUniText(symmetryRitualPages, "guide.BloodMagic.entryName.rituals.symmetryRitual")); + + ArrayList stallingRitualPages = new ArrayList(); + stallingRitualPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/rituals/StallingOmega.png"), true)); + stallingRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.stallingRitual"))); + entries.add(new EntryUniText(stallingRitualPages, "guide.BloodMagic.entryName.rituals.stallingRitual")); + + ArrayList newMoonRitualPages = new ArrayList(); + newMoonRitualPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.rituals.newMoonRitual"))); + entries.add(new EntryUniText(newMoonRitualPages, "guide.BloodMagic.entryName.rituals.newMoonRitual")); + + categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.rituals", new ItemStack(ModBlocks.blockMasterStone))); + } + + public static void registerDemonBook() + { + List entries = new ArrayList(); + + ArrayList ashesPages = new ArrayList(); + ashesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.ashes"))); + entries.add(new EntryUniText(ashesPages, "guide.BloodMagic.entryName.demons.ashes")); + + ArrayList tamedDemonPages = new ArrayList(); + tamedDemonPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.tamedDemon"))); + entries.add(new EntryUniText(tamedDemonPages, "guide.BloodMagic.entryName.demons.tamedDemon")); + + ArrayList futurePages = new ArrayList(); + futurePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.future"))); + entries.add(new EntryUniText(futurePages, "guide.BloodMagic.entryName.demons.future")); + + ArrayList knightPages = new ArrayList(); + knightPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.knight"))); + entries.add(new EntryUniText(knightPages, "guide.BloodMagic.entryName.demons.knight")); + + ArrayList demonShardPages = new ArrayList(); + demonShardPages.addAll(PageHelper.pagesForLongText((StatCollector.translateToLocal("aw.entries.demons.demonShard")), new ItemStack(ModItems.demonBloodShard))); + entries.add(new EntryUniText(demonShardPages, "guide.BloodMagic.entryName.demons.demonShard")); + + + ArrayList demonSummoningPages = new ArrayList(); + demonSummoningPages.add(new PageIRecipe(RecipeHolder.arcanePedestalRecipe)); + demonSummoningPages.add(new PageIRecipe(RecipeHolder.arcanePlinthRecipe)); + demonSummoningPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/demons/Ring1.png"), true)); + demonSummoningPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/demons/Ring2.png"), true)); + demonSummoningPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.demonSummoning"))); + entries.add(new EntryUniText(demonSummoningPages, "guide.BloodMagic.entryName.demons.demonSummoning")); + + ArrayList keysGatePages = new ArrayList(); + for(int i=1; i<=10; i++) + { + keysGatePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.keysGate." + i))); + } + entries.add(new EntryUniText(keysGatePages, "guide.BloodMagic.entryName.demons.keysGate")); + + ArrayList futurePlansPages = new ArrayList(); + futurePlansPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.futurePlans"))); + entries.add(new EntryUniText(futurePlansPages, "guide.BloodMagic.entryName.demons.futurePlans")); + + ArrayList demonInvasionPages = new ArrayList(); + demonInvasionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.demonInvasion"))); + entries.add(new EntryUniText(demonInvasionPages, "guide.BloodMagic.entryName.demons.demonInvasion")); + + ArrayList observationsPages = new ArrayList(); + observationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.demons.observations"))); + entries.add(new EntryUniText(observationsPages, "guide.BloodMagic.entryName.demons.observations")); + + categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.demons", new ItemStack(ModItems.demonBloodShard))); + } + + public static void registerSpellBook() + { + List entries = new ArrayList(); + + ArrayList demonGirlPages = new ArrayList(); + demonGirlPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.demonGirl"))); + entries.add(new EntryUniText(demonGirlPages, "guide.BloodMagic.entryName.spells.demonGirl")); + + ArrayList spellTablePages = new ArrayList(); + spellTablePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.spellTable.1"))); + spellTablePages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/SimpleSpellTable.png"), true)); + spellTablePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.spellTable.2"))); + entries.add(new EntryUniText(spellTablePages, "guide.BloodMagic.entryName.spells.spellTable")); + + ArrayList simpleEffectsPages = new ArrayList(); + for(int i=1; i<=11; i++) + { + simpleEffectsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.simpleEffects." + i))); + } + entries.add(new EntryUniText(simpleEffectsPages, "guide.BloodMagic.entryName.spells.simpleEffects")); + + ArrayList tableAndSkullsPages = new ArrayList(); + tableAndSkullsPages.add(new PageAltarRecipe(RecipeHolder.blankSpellRecipe)); + tableAndSkullsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.tableAndSkulls.1"))); + tableAndSkullsPages.add(getOrbPageForRecipe(RecipeHolder.spellTableRecipe)); + tableAndSkullsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.tableAndSkulls.2"))); + entries.add(new EntryUniText(tableAndSkullsPages, "guide.BloodMagic.entryName.spells.tableAndSkulls")); + + ArrayList timePassesPages = new ArrayList(); + timePassesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.timePasses"))); + entries.add(new EntryUniText(timePassesPages, "guide.BloodMagic.entryName.spells.timePasses")); + + ArrayList complexSpellBasicsPages = new ArrayList(); + complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics.1"))); + complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Paradigm.png"), true)); + + for(int i=2; i<=6; i++) + complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics." + i))); + + complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Effect.png"), true)); + complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics.7"))); + complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Modifier.png"), true)); + + for(int i=8; i<=12; i++) + complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics." + i))); + + complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Enhancement.png"), true)); + + for(int i=13; i<=16; i++) + complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics." + i))); + + complexSpellBasicsPages.add(new PageUnlocImage("", new ResourceLocation("alchemicalwizardry:textures/misc/screenshots/spells/Conduit.png"), true)); + complexSpellBasicsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellBasics.17"))); + + entries.add(new EntryUniText(complexSpellBasicsPages, "guide.BloodMagic.entryName.spells.complexSpellBasics")); + + ArrayList complexSpellEffectsPages = new ArrayList(); + for(int i=1; i<=17; i++) + complexSpellEffectsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.complexSpellEffects." + i))); + entries.add(new EntryUniText(complexSpellEffectsPages, "guide.BloodMagic.entryName.spells.complexSpellEffects")); + + ArrayList offTopicPages = new ArrayList(); + offTopicPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.offTopic"))); + entries.add(new EntryUniText(offTopicPages, "guide.BloodMagic.entryName.spells.offTopic")); + + ArrayList demonicPowerPages = new ArrayList(); + demonicPowerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.spells.demonicPower"))); + entries.add(new EntryUniText(demonicPowerPages, "guide.BloodMagic.entryName.spells.demonicPower")); + + categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.spells", new ItemStack(ModItems.itemComplexSpellCrystal))); + } + + public static void registerAlchemyBook() + { + List entries = new ArrayList(); + + ArrayList fatedMeetingPages = new ArrayList(); + fatedMeetingPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.fatedMeeting"))); + entries.add(new EntryUniText(fatedMeetingPages, "guide.BloodMagic.entryName.alchemy.fatedMeeting")); + + ArrayList firstStepsPages = new ArrayList(); + firstStepsPages.add(getOrbPageForRecipe(RecipeHolder.alchemySetRecipe)); + firstStepsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.firstSteps"))); + entries.add(new EntryUniText(firstStepsPages, "guide.BloodMagic.entryName.alchemy.firstSteps")); + + ArrayList chemistrySetPages = new ArrayList(); + for(int i=1; i<=10; i++) + chemistrySetPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.chemistrySet." + i))); + entries.add(new EntryUniText(chemistrySetPages, "guide.BloodMagic.entryName.alchemy.chemistrySet")); + + ArrayList incensePages = new ArrayList(); + incensePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.incense.1"))); + incensePages.add(new PageIRecipe(RecipeHolder.crucibleRecipe)); + incensePages.add(new PageIRecipe(RecipeHolder.woodAshRecipe)); + incensePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.incense.2"))); + incensePages.add(getOrbPageForRecipe(RecipeHolder.byrrusRecipe)); + incensePages.add(getOrbPageForRecipe(RecipeHolder.livensRecipe)); + incensePages.add(getOrbPageForRecipe(RecipeHolder.virRecipe)); + incensePages.add(getOrbPageForRecipe(RecipeHolder.purpuraRecipe)); + incensePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.incense.3"))); + entries.add(new EntryUniText(incensePages, "guide.BloodMagic.entryName.alchemy.incense")); + + ArrayList potionsPages = new ArrayList(); + potionsPages.add(new PageAltarRecipe(RecipeHolder.flaskRecipe)); + potionsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.potions"))); + entries.add(new EntryUniText(potionsPages, "guide.BloodMagic.entryName.alchemy.potions")); + + ArrayList reagentRevolutionPages = new ArrayList(); + for(int i=1; i<=8; i++) + reagentRevolutionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentRevolution." + i))); + entries.add(new EntryUniText(reagentRevolutionPages, "guide.BloodMagic.entryName.alchemy.reagentRevolution")); + + ArrayList newPotionsPages = new ArrayList(); + newPotionsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.newPotions"))); + entries.add(new EntryUniText(newPotionsPages, "guide.BloodMagic.entryName.alchemy.newPotions")); + + ArrayList soulSandPages = new ArrayList(); + soulSandPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.soulSand"))); + entries.add(new EntryUniText(soulSandPages, "guide.BloodMagic.entryName.alchemy.soulSand")); + + ArrayList timeGoesByPages = new ArrayList(); + timeGoesByPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.timeGoesBy"))); + entries.add(new EntryUniText(timeGoesByPages, "guide.BloodMagic.entryName.alchemy.timeGoesBy")); + + ArrayList catalystsPages = new ArrayList(); + catalystsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.catalysts"))); + entries.add(new EntryUniText(catalystsPages, "guide.BloodMagic.entryName.alchemy.catalysts")); + + ArrayList activationCrystalPages = new ArrayList(); + activationCrystalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.activationCrystal"))); + entries.add(new EntryUniText(activationCrystalPages, "guide.BloodMagic.entryName.alchemy.activationCrystal")); + + ArrayList reagentSystemPages = new ArrayList(); + reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.1"))); + reagentSystemPages.add(new PageIRecipe(RecipeHolder.calcinatorRecipe)); + reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.2"))); + reagentSystemPages.add(new PageIRecipe(RecipeHolder.belljarRecipe)); + reagentSystemPages.add(new PageIRecipe(RecipeHolder.relayRecipe)); + reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.3"))); + reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.4"))); + reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.5"))); + reagentSystemPages.add(new PageIRecipe(RecipeHolder.routerRecipe)); + reagentSystemPages.add(new PageIRecipe(RecipeHolder.segmenterRecipe)); + reagentSystemPages.add(new PageIRecipe(RecipeHolder.cleanserRecipe)); + reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.6"))); + + reagentSystemPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.reagentSystem.7"))); + + entries.add(new EntryUniText(reagentSystemPages, "guide.BloodMagic.entryName.alchemy.reagentSystem")); + + ArrayList magusSecretPages = new ArrayList(); + magusSecretPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.magusSecret"))); + entries.add(new EntryUniText(magusSecretPages, "guide.BloodMagic.entryName.alchemy.magusSecret")); + + ArrayList simpleCreationsPages = new ArrayList(); + simpleCreationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("aw.entries.alchemy.simpleCreations"))); + entries.add(new EntryUniText(simpleCreationsPages, "guide.BloodMagic.entryName.alchemy.simpleCreations")); + + categories.add(new CategoryItemStack(entries, "guide.BloodMagic.category.alchemy", new ItemStack(ModItems.alchemyFlask))); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java new file mode 100644 index 00000000..c97515a8 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandBind.java @@ -0,0 +1,76 @@ +package WayofTime.alchemicalWizardry.common.commands; + +import java.util.List; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; + +public class CommandBind extends CommandBase +{ + public CommandBind() {} + + public String getCommandName() + { + return "bind"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender icommandsender) + { + return "commands.bind.usage"; + } + + public void processCommand(ICommandSender iCommandSender, String[] astring) + { + EntityPlayerMP entityplayermp = getCommandSenderAsPlayer(iCommandSender); + ItemStack item = entityplayermp.getCurrentEquippedItem(); + EntityPlayerMP targetPlayer = getPlayer(iCommandSender, astring[0]); + + if (targetPlayer == null) + { + throw new CommandException("commands.bind.failed.noPlayer"); + } + + if (item != null && item.getItem() instanceof IBindable) + { + if (EnergyItems.getOwnerName(item).isEmpty()) + { + EnergyItems.checkAndSetItemOwner(item, targetPlayer); + func_152373_a(iCommandSender, this, "commands.bind.success"); + } + else + { + throw new CommandException("commands.bind.failed.alreadyBound"); + } + } + else if (!(item.getItem() instanceof IBindable)) + { + throw new CommandException("commands.bind.failed.notBindable"); + } + } + + public List addTabCompletionOptions(ICommandSender iCommandSender, String[] astring) + { + return getListOfStringsMatchingLastWord(astring, this.getPlayer()); + } + + protected String[] getPlayer() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] astring, int par2) + { + return par2 == 0; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java new file mode 100644 index 00000000..5f96be2d --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java @@ -0,0 +1,137 @@ +package WayofTime.alchemicalWizardry.common.commands; + +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +import java.util.List; + +public class CommandSN extends CommandBase +{ + public CommandSN() {} + + @Override + public String getCommandName() + { + return "soulnetwork"; + } + + @Override + public int getRequiredPermissionLevel() + { + return 2; + } + + @Override + public String getCommandUsage(ICommandSender icommandsender) + { + return "commands.soulnetwork.usage"; + } + + @Override + public void processCommand(ICommandSender icommandsender, String[] astring) + { + EntityPlayerMP targetPlayer = getPlayer(icommandsender, astring[0]); + String owner = targetPlayer.getDisplayName(); + EntityPlayerMP proxyPlayerName = getPlayer(icommandsender, astring[0]); + + if (astring.length >= 2 && astring.length <= 3) + { + if ("add".equalsIgnoreCase(astring[1])) + { + int amount = parseIntBounded(icommandsender, astring[2], Integer.MIN_VALUE, Integer.MAX_VALUE); + + SoulNetworkHandler.addCurrentEssenceToMaximum(owner, amount, Integer.MAX_VALUE); + func_152373_a(icommandsender, this, "commands.soulnetwork.add.success", amount, owner); + } + else if ("subtract".equalsIgnoreCase(astring[1])) + { + int amount = parseIntBounded(icommandsender, astring[2], Integer.MIN_VALUE, Integer.MAX_VALUE); + + if (amount > SoulNetworkHandler.getCurrentEssence(owner)) + { + int lp = SoulNetworkHandler.getCurrentEssence(owner); + SoulNetworkHandler.syphonFromNetwork(owner, lp); + func_152373_a(icommandsender, this, "commands.soulnetwork.subtract.success", SoulNetworkHandler.getCurrentEssence(owner), owner); + } + else + { + SoulNetworkHandler.syphonFromNetwork(owner, amount); + func_152373_a(icommandsender, this, "commands.soulnetwork.subtract.success", amount, owner); + } + } + else if ("fill".equalsIgnoreCase(astring[1])) + { + int amount = Integer.MAX_VALUE - SoulNetworkHandler.getCurrentEssence(owner); + SoulNetworkHandler.addCurrentEssenceToMaximum(owner, amount, Integer.MAX_VALUE); + func_152373_a(icommandsender, this, "commands.soulnetwork.fill.success", owner); + } + else if ("empty".equalsIgnoreCase(astring[1])) + { + SoulNetworkHandler.syphonFromNetwork(owner, SoulNetworkHandler.getCurrentEssence(owner)); + func_152373_a(icommandsender, this, "commands.soulnetwork.empty.success", owner); + } + else if ("get".equalsIgnoreCase(astring[1])) + { + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); + func_152373_a(icommandsender, this, "commands.soulnetwork.get.success", currentEssence, owner); + } + else if ("fillMax".equalsIgnoreCase(astring[1])) + { + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); + int orbTier = SoulNetworkHandler.getCurrentMaxOrb(owner); + int maxForOrb = SoulNetworkHandler.getMaximumForOrbTier(orbTier); + int fillAmount = maxForOrb - currentEssence; + SoulNetworkHandler.addCurrentEssenceToMaximum(owner, fillAmount, fillAmount); + func_152373_a(icommandsender, this, "commands.soulnetwork.fillMax.success", owner); + } + else if ("create".equalsIgnoreCase(astring[1])) + { + int orbTier = parseIntBounded(icommandsender, astring[2], 1, 6); + SoulNetworkHandler.setMaxOrbToMax(proxyPlayerName.getDisplayName(), orbTier); + func_152373_a(icommandsender, this, "commands.soulnetwork.create.success", owner, orbTier); + } + else + { + throw new CommandException("commands.soulnetwork.notACommand"); + } + } + else if (astring.length == 0) + { + throw new CommandException("commands.soulnetwork.noPlayer"); + } + else if (astring.length == 1) + { + throw new CommandException("commands.soulnetwork.noCommand"); + } + } + + @Override + public List addTabCompletionOptions(ICommandSender iCommandSender, String[] astring) + { + if (astring.length == 1) + { + return getListOfStringsMatchingLastWord(astring, this.getPlayer()); + } + else if (astring.length == 2) + { + return getListOfStringsMatchingLastWord(astring, "add", "subtract", "fill", "empty", "get", "fillMax", "create"); + } + + return null; + } + + protected String[] getPlayer() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + @Override + public boolean isUsernameIndex(String[] astring, int par2) + { + return par2 == 0; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java new file mode 100644 index 00000000..3a1cc09a --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandUnbind.java @@ -0,0 +1,52 @@ +package WayofTime.alchemicalWizardry.common.commands; + +import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; + +public class CommandUnbind extends CommandBase +{ + public CommandUnbind() {} + + public String getCommandName() + { + return "unbind"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender icommandsender) + { + return "commands.unbind.usage"; + } + + public void processCommand(ICommandSender iCommandSender, String[] astring) + { + EntityPlayerMP entityplayermp = getCommandSenderAsPlayer(iCommandSender); + ItemStack item = entityplayermp.getCurrentEquippedItem(); + + if (item != null && item.getItem() instanceof IBindable) + { + if (!EnergyItems.getOwnerName(item).isEmpty()) + { + item.getTagCompound().removeTag("ownerName"); + func_152373_a(iCommandSender, this, "commands.unbind.success"); + } + else + { + throw new CommandException("commands.unbind.failed.notBindable"); + } + } + else if (!(item.getItem() instanceof IBindable)) + { + throw new CommandException("commands.unbind.failed.notBindable"); + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/compress/StorageBlockCraftingManager.java b/src/main/java/WayofTime/alchemicalWizardry/common/compress/StorageBlockCraftingManager.java index b8ce890d..6f52fefa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/compress/StorageBlockCraftingManager.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/compress/StorageBlockCraftingManager.java @@ -231,8 +231,8 @@ public class StorageBlockCraftingManager if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) { Item item = itemstack.getItem(); - int j1 = item.getMaxDamage() - itemstack.getItemDamage(); - int k = item.getMaxDamage() - itemstack1.getItemDamage(); + int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); + int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); int l = j1 + k + item.getMaxDamage() * 5 / 100; int i1 = item.getMaxDamage() - l; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java index 6186b6c9..18503f85 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java @@ -14,16 +14,15 @@ import net.minecraft.block.BlockTrapDoor; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.common.registry.GameRegistry.UniqueIdentifier; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.common.demonVillage.loot.DemonVillageLootRegistry; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.IBlockPortalNode; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.ITilePortalNode; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; public class BlockSet { @@ -40,7 +39,7 @@ public class BlockSet { this.blockid = blockid; this.metadata = new int[4]; - positions = new ArrayList(); + positions = new ArrayList(); } public BlockSet(Block block) @@ -277,7 +276,7 @@ public class BlockSet return GameRegistry.findBlock(modId, name); } - public int getMetaForDirection(EnumFacing dir) + public int getMetaForDirection(ForgeDirection dir) { if (metadata.length < 4) { @@ -299,7 +298,7 @@ public class BlockSet } } - public void buildAtIndex(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, EnumFacing dir, int index, boolean populateInventories, int tier) + public void buildAtIndex(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, int index, boolean populateInventories, int tier) { Block block = this.getBlock(); if (index >= positions.size() || block == null) @@ -334,15 +333,14 @@ public class BlockSet default: } - BlockPos newPos = new BlockPos(xCoord + xOff, yCoord + yOff, zCoord + zOff); - world.setBlockState(newPos, block.getStateFromMeta(meta), 3); + world.setBlock(xCoord + xOff, yCoord + yOff, zCoord + zOff, block, meta, 3); if(populateInventories) { - this.populateIfIInventory(world, newPos, tier); + this.populateIfIInventory(world, xCoord + xOff, yCoord + yOff, zCoord + zOff, tier); } if(block instanceof IBlockPortalNode) { - TileEntity tile = world.getTileEntity(newPos); + TileEntity tile = world.getTileEntity(xCoord + xOff, yCoord + yOff, zCoord + zOff); if(tile instanceof ITilePortalNode) { ((ITilePortalNode) tile).setPortalLocation(teDemonPortal); @@ -350,16 +348,16 @@ public class BlockSet } } - public void populateIfIInventory(World world, BlockPos pos, int tier) + public void populateIfIInventory(World world, int x, int y, int z, int tier) { - TileEntity tile = world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(x, y, z); if(tile instanceof IInventory) { DemonVillageLootRegistry.populateChest((IInventory)tile, tier); } } - public void buildAll(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, EnumFacing dir, boolean populateInventories, int tier) + public void buildAll(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, boolean populateInventories, int tier) { for (int i = 0; i < positions.size(); i++) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java index 6c62e88a..fc1ba6b7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java @@ -4,10 +4,8 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; @@ -30,7 +28,7 @@ public class BuildingSchematic public BuildingSchematic(String name) { this.name = name; - blockList = new ArrayList(); + blockList = new ArrayList(); this.doorX = 0; this.doorZ = 0; this.doorY = 0; @@ -54,7 +52,7 @@ public class BuildingSchematic blockList.add(set); } - public void buildAll(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, EnumFacing dir, boolean populateInventories) + public void buildAll(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, boolean populateInventories) { for (BlockSet set : blockList) { @@ -88,9 +86,9 @@ public class BuildingSchematic return new Int3(gridX, doorY, gridZ); } - public List getGriddedPositions(EnumFacing dir) + public List getGriddedPositions(ForgeDirection dir) { - List positionList = new ArrayList(); + List positionList = new ArrayList(); for (BlockSet blockSet : blockList) { @@ -129,7 +127,7 @@ public class BuildingSchematic return positionList; } - public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, EnumFacing dir) + 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 @@ -139,12 +137,10 @@ public class BuildingSchematic { for (Int3 pos : positionList) { - BlockPos newPos = new BlockPos(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord); if (block != ModBlocks.blockDemonPortal) { - world.setBlockToAir(newPos); + world.setBlockToAir(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java index fa6450d7..aa190a28 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.demonVillage; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; @@ -30,17 +30,17 @@ public class DemonBuilding return schematic.getName(); } - public boolean isValid(GridSpaceHolder master, int gridX, int gridZ, EnumFacing dir) + public boolean isValid(GridSpaceHolder master, int gridX, int gridZ, ForgeDirection dir) { return area.doesContainAll(master, gridX, gridZ, dir); } - public void buildAll(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, EnumFacing dir, boolean populateInventories) + public void buildAll(TEDemonPortal teDemonPortal, World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, boolean populateInventories) { schematic.buildAll(teDemonPortal, world, xCoord, yCoord, zCoord, dir, populateInventories); } - public void setAllGridSpaces(int xInit, int zInit, int yLevel, EnumFacing dir, int type, GridSpaceHolder master) + public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master) { area.setAllGridSpaces(xInit, zInit, yLevel, dir, type, master); } @@ -57,7 +57,7 @@ public class DemonBuilding return scheme.createGSH(); } - public Int3 getDoorSpace(EnumFacing dir) + public Int3 getDoorSpace(ForgeDirection dir) { int x; int z; @@ -84,7 +84,7 @@ public class DemonBuilding return new Int3(x, doorGridSpace.yCoord, z); } - public Int3 getGridOffsetFromRoad(EnumFacing sideOfRoad, int yLevel) + public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel) { Int3 doorSpace = this.getDoorSpace(sideOfRoad); int x = doorSpace.xCoord; @@ -109,7 +109,7 @@ public class DemonBuilding return new Int3(x, yLevel, z); } - public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, EnumFacing dir) + public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) { schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java index eeb4da3c..ee83c7f8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonVillagePath.java @@ -3,11 +3,9 @@ package WayofTime.alchemicalWizardry.common.demonVillage; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.IRoadWard; @@ -18,19 +16,19 @@ public class DemonVillagePath public int xPos; public int yPos; public int zPos; - public EnumFacing dir; + public ForgeDirection dir; public int length; public static boolean canGoDown = true; public static boolean tunnelIfObstructed = false; public static boolean createBridgeInAirIfObstructed = false; - public DemonVillagePath(int xi, int yi, int zi, EnumFacing dir2, int length) + public DemonVillagePath(int xi, int yi, int zi, ForgeDirection dir, int length) { this.xPos = xi; this.yPos = yi; this.zPos = zi; - this.dir = dir2; + this.dir = dir; this.length = length; } @@ -42,11 +40,11 @@ public class DemonVillagePath int rad = this.getRoadRadius(); int value = 0; - int finalYPos = this.constructPartialPath(portal, world, clearance, xi - rad * dir.getFrontOffsetX(), yi, zi - rad * dir.getFrontOffsetZ(), dir, length + rad, false); + int finalYPos = this.constructPartialPath(portal, world, clearance, xi - rad * dir.offsetX, yi, zi - rad * dir.offsetZ, dir, length + rad, false); for (int i = -rad; i <= rad; i++) { - value = Math.max(this.constructPartialPath(portal, world, clearance, xi - rad * dir.getFrontOffsetX() + i * dir.getFrontOffsetZ(), yi, zi - rad * dir.getFrontOffsetZ() + i * dir.getFrontOffsetX(), dir, length + 2 * rad, true), value); + value = Math.max(this.constructPartialPath(portal, world, clearance, xi - rad * dir.offsetX + i * dir.offsetZ, yi, zi - rad * dir.offsetZ + i * dir.offsetX, dir, length + 2 * rad, true), value); if(TEDemonPortal.printDebug) System.out.println("" + (length + 2 * rad) + ", " + value + ""); } @@ -82,12 +80,12 @@ public class DemonVillagePath * @param doConstruct * @return length if doConstruct, yi if !doConstruct */ - public int constructPartialPath(TEDemonPortal portal, World world, int clearance, int xi, int yi, int zi, EnumFacing dir, int length, boolean doConstruct) + public int constructPartialPath(TEDemonPortal portal, World world, int clearance, int xi, int yi, int zi, ForgeDirection dir, int length, boolean doConstruct) { for (int i = 0; i < length; i++) { - int xOffset = i * dir.getFrontOffsetX(); - int zOffset = i * dir.getFrontOffsetZ(); + int xOffset = i * dir.offsetX; + int zOffset = i * dir.offsetZ; boolean completed = false; @@ -95,19 +93,14 @@ public class DemonVillagePath { int sign = 1; - BlockPos pos1 = new BlockPos(xi + xOffset, yi + sign * yOffset, zi + zOffset); - BlockPos highPos1 = pos1.offsetUp(); - - IBlockState state1 = world.getBlockState(pos1); - IBlockState highState1 = world.getBlockState(highPos1); - Block block1 = state1.getBlock(); - Block highBlock1 = highState1.getBlock(); + Block block1 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset); + Block highBlock1 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset); - if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, pos1) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, highPos1))) + if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset))) { if(doConstruct) { - world.setBlockState(pos1, portal.getRoadState(), 3); + world.setBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3); } yi += sign * yOffset; completed = true; @@ -115,19 +108,14 @@ public class DemonVillagePath } else if(canGoDown) { sign = -1; - pos1 = new BlockPos(xi + xOffset, yi + sign * yOffset, zi + zOffset); - highPos1 = pos1.offsetUp(); - - state1 = world.getBlockState(pos1); - highState1 = world.getBlockState(highPos1); - block1 = state1.getBlock(); - highBlock1 = highState1.getBlock(); + Block block2 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset); + Block highBlock2 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset); - if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, pos1) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, highPos1))) + if ((this.forceReplaceBlock(block2))||(!block2.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block2)) && (this.forceCanTunnelUnder(highBlock2) || highBlock2.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset))) { - if(doConstruct) + if(doConstruct) { - world.setBlockState(pos1, portal.getRoadState(), 3); + world.setBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3); } yi += sign * yOffset; completed = true; @@ -141,17 +129,15 @@ public class DemonVillagePath boolean returnAmount = true; if(createBridgeInAirIfObstructed) { - BlockPos pos1 = new BlockPos(xi + xOffset, yi, zi + zOffset); - IBlockState state1 = world.getBlockState(pos1); - Block block1 = state1.getBlock(); + Block block1 = world.getBlock(xi + xOffset, yi, zi + zOffset); - if (block1.isReplaceable(world, pos1) || !this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1)) + if (block1.isReplaceable(world, xi + xOffset, yi, zi + zOffset) || !this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1)) { returnAmount = false; if(doConstruct) { - world.setBlockState(pos1, portal.getRoadState(), 3); + world.setBlock(xi + xOffset, yi, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3); } }else { @@ -160,20 +146,18 @@ public class DemonVillagePath }else if(tunnelIfObstructed) { - BlockPos pos1 = new BlockPos(xi + xOffset, yi, zi + zOffset); - IBlockState state1 = world.getBlockState(pos1); - Block block1 = state1.getBlock(); + Block block1 = world.getBlock(xi + xOffset, yi, zi + zOffset); - if (!block1.isReplaceable(world, pos1) || this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1)) + if (!block1.isReplaceable(world, xi + xOffset, yi, zi + zOffset) || this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1)) { returnAmount = false; if(doConstruct) { - world.setBlockState(pos1, portal.getRoadState(), 3); - world.setBlockToAir(pos1.offsetUp(1)); - world.setBlockToAir(pos1.offsetUp(2)); - world.setBlockToAir(pos1.offsetUp(3)); + world.setBlock(xi + xOffset, yi, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3); + world.setBlockToAir(xi + xOffset, yi + 1, zi + zOffset); + world.setBlockToAir(xi + xOffset, yi + 2, zi + zOffset); + world.setBlockToAir(xi + xOffset, yi + 3, zi + zOffset); } }else { @@ -199,37 +183,27 @@ public class DemonVillagePath for (int i = 0; i < length; i++) { - int xOffset = i * dir.getFrontOffsetX(); - int zOffset = i * dir.getFrontOffsetZ(); + int xOffset = i * dir.offsetX; + int zOffset = i * dir.offsetZ; for (int yOffset = 0; yOffset <= clearance; yOffset++) { int sign = 1; - BlockPos pos1 = new BlockPos(xi + xOffset, yi + sign * yOffset, zi + zOffset); - BlockPos highPos1 = pos1.offsetUp(); - - IBlockState state1 = world.getBlockState(pos1); - IBlockState highState1 = world.getBlockState(highPos1); - Block block1 = state1.getBlock(); - Block highBlock1 = highState1.getBlock(); + Block block1 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset); + Block highBlock1 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset); - if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, pos1) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, highPos1))) + if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset))) { yi += sign * yOffset; break; } else { sign = -1; - BlockPos pos2 = new BlockPos(xi + xOffset, yi + sign * yOffset, zi + zOffset); - BlockPos highPos2 = pos2.offsetUp(); - - IBlockState state2 = world.getBlockState(pos2); - IBlockState highState2 = world.getBlockState(highPos2); - Block block2 = state2.getBlock(); - Block highBlock2 = highState2.getBlock(); + Block block2 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset); + Block highBlock2 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset); - if ((this.forceReplaceBlock(block2))||(!block2.isReplaceable(world, pos2) && this.isBlockReplaceable(block2) ) && (this.forceCanTunnelUnder(highBlock2) || highBlock2.isReplaceable(world, highPos2))) + if ((this.forceReplaceBlock(block2))||(!block2.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block2) ) && (this.forceCanTunnelUnder(highBlock2) || highBlock2.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset))) { yi += sign * yOffset; break; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java index bbb3c04f..e4c58087 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java @@ -1,13 +1,11 @@ package WayofTime.alchemicalWizardry.common.demonVillage; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class GridSpaceHolder { @@ -141,7 +139,7 @@ public class GridSpaceHolder } } - public boolean doesContainAll(GridSpaceHolder master, int xInit, int zInit, EnumFacing dir) + public boolean doesContainAll(GridSpaceHolder master, int xInit, int zInit, ForgeDirection dir) { if (master != null) { @@ -193,7 +191,7 @@ public class GridSpaceHolder return false; } - public void setAllGridSpaces(int xInit, int zInit, int yLevel, EnumFacing dir, int type, GridSpaceHolder master) + public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master) { if(TEDemonPortal.printDebug) AlchemicalWizardry.logger.info("Grid space selected: (" + xInit + "," + zInit + ")"); @@ -241,7 +239,7 @@ public class GridSpaceHolder } } - public void destroyAllInGridSpaces(World world, int xCoord, int yCoord, int zCoord, EnumFacing dir) + public void destroyAllInGridSpaces(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir) { for (int i = -negXRadius; i <= posXRadius; i++) { @@ -280,14 +278,12 @@ public class GridSpaceHolder { for (int m = -2; m <= 2; m++) { - BlockPos newPos = new BlockPos(xCoord + xOff * 5 + l, yCoord, zCoord + zOff * 5 + m); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(xCoord + xOff * 5 + l, yCoord, zCoord + zOff * 5 + m); if (block == ModBlocks.blockDemonPortal) { continue; } - world.setBlockToAir(newPos); + world.setBlockToAir(xCoord + xOff * 5 + l, yCoord, zCoord + zOff * 5 + m); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java new file mode 100644 index 00000000..a135df1a --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java @@ -0,0 +1,8 @@ +package WayofTime.alchemicalWizardry.common.demonVillage; + +import net.minecraft.nbt.NBTTagCompound; + +public class TileBlockSet extends BlockSet +{ + public NBTTagCompound tag; +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityAIOccasionalRangedAttack.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityAIOccasionalRangedAttack.java index 9d7ea89f..d23816ae 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityAIOccasionalRangedAttack.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityAIOccasionalRangedAttack.java @@ -24,6 +24,7 @@ public class EntityAIOccasionalRangedAttack extends EntityAIBase private int maxRangedAttackTime; private float field_96562_i; private float field_82642_h; + private static final String __OBFID = "CL_00001609"; private double range; public EntityAIOccasionalRangedAttack(IOccasionalRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_, double range) @@ -109,7 +110,7 @@ public class EntityAIOccasionalRangedAttack extends EntityAIBase */ public void updateTask() { - double d0 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.getBoundingBox().minY, this.attackTarget.posZ); + double d0 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.boundingBox.minY, this.attackTarget.posZ); boolean flag = this.entityHost.getEntitySenses().canSee(this.attackTarget); if (flag) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java index 303ab7a2..147ddd73 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.demonVillage.ai; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; @@ -20,14 +20,14 @@ public class EntityDemonAIHurtByTarget extends EntityAIHurtByTarget @Override public void startExecuting() { - BlockPos portalPosition = ((IHoardDemon)this.taskOwner).getPortalLocation(); + Int3 portalPosition = ((IHoardDemon)this.taskOwner).getPortalLocation(); if(portalPosition == null) { super.startExecuting(); return; } - TileEntity portal = this.taskOwner.worldObj.getTileEntity(portalPosition); + TileEntity portal = this.taskOwner.worldObj.getTileEntity(portalPosition.xCoord, portalPosition.yCoord, portalPosition.zCoord); if((this.taskOwner.getAITarget() instanceof IHoardDemon && portalPosition.equals(((IHoardDemon)this.taskOwner.getAITarget()).getPortalLocation()))) { @@ -36,7 +36,7 @@ public class EntityDemonAIHurtByTarget extends EntityAIHurtByTarget this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - if (this.entityCallsForHelp) + if (this.entityCallsForHelp && this.taskOwner instanceof IHoardDemon) { if(portal instanceof TEDemonPortal) @@ -45,7 +45,7 @@ public class EntityDemonAIHurtByTarget extends EntityAIHurtByTarget } // double d0 = this.getTargetDistance(); -// List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), new AxisAlignedBB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); +// List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); // Iterator iterator = list.iterator(); // // while (iterator.hasNext()) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java index 8d0274ad..ba35ddde 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java @@ -5,7 +5,10 @@ import net.minecraft.world.World; public abstract class DemonHoardPacket { - public DemonHoardPacket() {} + public DemonHoardPacket() + { + + } public abstract int summonDemons(TEDemonPortal teDemonPortal, World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java index 2d30d788..fd193f95 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java @@ -9,7 +9,7 @@ import net.minecraft.world.World; public class DemonPacketRegistry { - public static Map packetMap = new HashMap(); + public static Map packetMap = new HashMap(); public static boolean registerDemonPacket(String string, DemonHoardPacket packet) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java index f257f01b..c507d72a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java @@ -20,11 +20,11 @@ import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; import WayofTime.alchemicalWizardry.common.EntityAITargetAggroCloaking; @@ -34,6 +34,7 @@ import WayofTime.alchemicalWizardry.common.demonVillage.ai.IOccasionalRangedAtta import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import WayofTime.alchemicalWizardry.common.rituals.LocalStorageAlphaPact; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRangedAttackMob, IHoardDemon @@ -42,7 +43,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); private boolean isAngry = true; - private BlockPos demonPortal; + private Int3 demonPortal; private static float maxTamedHealth = 200.0F; private static float maxUntamedHealth = 200.0F; @@ -53,7 +54,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan { super(par1World, AlchemicalWizardry.entityMinorDemonGruntID); this.setSize(0.7F, 1.8F); -// this.getNavigator().setAvoidsWater(true); + this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); @@ -67,7 +68,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan this.setAggro(false); this.setTamed(false); - demonPortal = new BlockPos(0,0,0); + demonPortal = new Int3(0,0,0); if (par1World != null && !par1World.isRemote) { @@ -127,13 +128,13 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan } @Override - public void setPortalLocation(BlockPos position) + public void setPortalLocation(Int3 position) { this.demonPortal = position; } @Override - public BlockPos getPortalLocation() + public Int3 getPortalLocation() { return this.demonPortal; } @@ -175,25 +176,23 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan * (abstract) Protected helper method to write subclass entity data to NBT. */ @Override - public void writeEntityToNBT(NBTTagCompound tag) + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(tag); - tag.setBoolean("Angry", this.isAngry()); + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - tag.setInteger("xCoord", this.demonPortal.getX()); - tag.setInteger("yCoord", this.demonPortal.getY()); - tag.setInteger("zCoord", this.demonPortal.getZ()); + this.demonPortal.writeToNBT(par1NBTTagCompound); } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ @Override - public void readEntityFromNBT(NBTTagCompound tag) + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(tag); - this.setAngry(tag.getBoolean("Angry")); - this.demonPortal = new BlockPos(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord")); + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + this.demonPortal = Int3.readFromNBT(par1NBTTagCompound); this.setCombatTask(); } @@ -253,7 +252,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan { if(!this.enthralled) { - TileEntity tile = this.worldObj.getTileEntity(this.demonPortal); + TileEntity tile = this.worldObj.getTileEntity(this.demonPortal.xCoord, this.demonPortal.yCoord, this.demonPortal.zCoord); if(tile instanceof TEDemonPortal) { ((TEDemonPortal) tile).enthrallDemon(this); @@ -262,12 +261,12 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan { IMasterRitualStone stone = (IMasterRitualStone)tile; LocalRitualStorage stor = stone.getLocalStorage(); -// if(stor instanceof LocalStorageAlphaPact) -// { -// LocalStorageAlphaPact storage = (LocalStorageAlphaPact)stor; -// -// storage.thrallDemon(this); -// } + if(stor instanceof LocalStorageAlphaPact) + { + LocalStorageAlphaPact storage = (LocalStorageAlphaPact)stor; + + storage.thrallDemon(this); + } } } super.onUpdate(); @@ -326,7 +325,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan --itemstack.stackSize; } - this.heal((float) itemfood.getHealAmount(itemstack)); + this.heal((float) itemfood.func_150905_g(itemstack)); if (itemstack.stackSize <= 0) { @@ -344,8 +343,8 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan { this.aiSit.setSitting(!this.isSitting()); this.isJumping = false; -// this.setPathToEntity(null); -// this.setTarget(null); + this.setPathToEntity(null); + this.setTarget(null); this.setAttackTarget(null); } @@ -368,7 +367,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan if (this.rand.nextInt(1) == 0) { this.setTamed(true); -// this.setPathToEntity(null); + this.setPathToEntity(null); this.setAttackTarget(null); this.aiSit.setSitting(true); this.setHealth(maxTamedHealth); @@ -501,7 +500,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan } @Override - public boolean thrallDemon(BlockPos location) + public boolean thrallDemon(Int3 location) { this.setPortalLocation(location); return true; @@ -510,9 +509,9 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan @Override public boolean isSamePortal(IHoardDemon demon) { - BlockPos position = demon.getPortalLocation(); - TileEntity portal = worldObj.getTileEntity(this.demonPortal); + Int3 position = demon.getPortalLocation(); + TileEntity portal = worldObj.getTileEntity(this.demonPortal.xCoord, this.demonPortal.yCoord, this.demonPortal.zCoord); - return portal instanceof TEDemonPortal && portal == worldObj.getTileEntity(position); + return portal instanceof TEDemonPortal ? portal == worldObj.getTileEntity(position.xCoord, position.yCoord, position.zCoord) : false; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java index aee48836..7f9f2660 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java @@ -1,14 +1,11 @@ package WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon; -import net.minecraft.util.BlockPos; +import WayofTime.alchemicalWizardry.api.Int3; public interface IHoardDemon { - void setPortalLocation(BlockPos position); - - BlockPos getPortalLocation(); - - boolean thrallDemon(BlockPos location); - + void setPortalLocation(Int3 position); + Int3 getPortalLocation(); + boolean thrallDemon(Int3 location); boolean isSamePortal(IHoardDemon demon); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java index b5e4d0d1..a501269b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java @@ -11,14 +11,14 @@ import WayofTime.alchemicalWizardry.ModItems; public class DemonVillageLootRegistry { - public static ArrayList list1 = new ArrayList(); + public static ArrayList list1 = new ArrayList(); public static void init() { String[] tier1Strings = new String[]{ChestGenHooks.DUNGEON_CHEST, ChestGenHooks.PYRAMID_DESERT_CHEST}; for(String str : tier1Strings) { - List contents = ChestGenHooks.getItems(str, new Random()); + WeightedRandomChestContent[] contents = ChestGenHooks.getItems(str, new Random()); if(contents != null) { for(WeightedRandomChestContent content : contents) @@ -34,6 +34,16 @@ public class DemonVillageLootRegistry public static void populateChest(IInventory tile, int tier) { - WeightedRandomChestContent.generateChestContents(new Random(), list1, tile, tile.getSizeInventory() / 3); + WeightedRandomChestContent.generateChestContents(new Random(), toArray(list1), tile, tile.getSizeInventory() / 3); + } + + public static WeightedRandomChestContent[] toArray(List aList) + { + int size = aList.size(); + WeightedRandomChestContent[] contents = new WeightedRandomChestContent[size]; + + contents = aList.toArray(contents); + + return contents; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/BlockDemonChest.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/BlockDemonChest.java index f880b4e1..eec54945 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/BlockDemonChest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/BlockDemonChest.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.demonVillage.tileEntity; +import net.minecraft.block.Block; import net.minecraft.block.BlockChest; -import net.minecraft.block.state.IBlockState; +import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; @@ -12,10 +12,15 @@ public class BlockDemonChest extends BlockChest implements IBlockPortalNode public BlockDemonChest() { super(0); - this.setHardness(2.5F).setStepSound(soundTypeWood).setUnlocalizedName("demonChest"); + this.setHardness(2.5F).setStepSound(soundTypeWood).setBlockName("demonChest"); this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); } + public IInventory func_149951_m(World world, int x, int y, int z) + { + return (IInventory)world.getTileEntity(x, y, z); + } + @Override public TileEntity createNewTileEntity(World var1, int var2) { @@ -23,18 +28,18 @@ public class BlockDemonChest extends BlockChest implements IBlockPortalNode } @Override - public void breakBlock(World world, BlockPos pos, IBlockState state) + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - TileEntity tile = world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(x, y, z); if(tile instanceof TEDemonChest) { ((TEDemonChest) tile).notifyPortalOfInteraction(); } - super.breakBlock(world, pos, state); + super.breakBlock(world, x, y, z, block, meta); } @Override - public boolean canPlaceBlockAt(World world, BlockPos pos) + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java index 528d6142..a1d4fd88 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java @@ -1,17 +1,16 @@ package WayofTime.alchemicalWizardry.common.demonVillage.tileEntity; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.BlockPos; +import WayofTime.alchemicalWizardry.api.Int3; public class TEDemonChest extends TileEntityChest implements ITilePortalNode { - public BlockPos portalLocation = BlockPos.ORIGIN; + public Int3 portalLocation = new Int3(0,0,0); @Override - public String getName() + public String getInventoryName() { return "Demon's Chest"; } @@ -21,42 +20,42 @@ public class TEDemonChest extends TileEntityChest implements ITilePortalNode { super.readFromNBT(tag); NBTTagCompound portalTag = tag.getCompoundTag("portalLocation"); - portalLocation = new BlockPos(portalTag.getInteger("xCoord"), portalTag.getInteger("yCoord"), portalTag.getInteger("zCoord")); + portalLocation = Int3.readFromNBT(portalTag); } @Override public void writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); - NBTTagCompound portalTag = new NBTTagCompound(); - portalTag.setInteger("xCoord", portalLocation.getX()); - portalTag.setInteger("yCoord", portalLocation.getY()); - portalTag.setInteger("zCoord", portalLocation.getZ()); + NBTTagCompound portalTag = portalLocation.writeToNBT(new NBTTagCompound()); tag.setTag("portalLocation", portalTag); } @Override - public void openInventory(EntityPlayer player) + public void openInventory() { - super.openInventory(player); + super.openInventory(); this.notifyPortalOfInteraction(); } @Override - public void checkForAdjacentChests() {} + public void checkForAdjacentChests() + { + + } @Override public void setPortalLocation(TEDemonPortal teDemonPortal) { if(teDemonPortal != null) { - portalLocation = teDemonPortal.getPos(); + portalLocation = new Int3(teDemonPortal.xCoord, teDemonPortal.yCoord, teDemonPortal.zCoord); } } public TEDemonPortal getDemonPortal() { - TileEntity tile = worldObj.getTileEntity(portalLocation); + TileEntity tile = worldObj.getTileEntity(portalLocation.xCoord, portalLocation.yCoord, portalLocation.zCoord); if(tile instanceof TEDemonPortal) { return (TEDemonPortal)tile; @@ -72,6 +71,6 @@ public class TEDemonChest extends TileEntityChest implements ITilePortalNode return; } - portal.notifyDemons(pos.getX(), pos.getY(), pos.getZ(), 50); + portal.notifyDemons(xCoord, yCoord, zCoord, 50); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java index d5a1fee6..5c6f43c4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java @@ -15,7 +15,6 @@ import java.util.Random; import java.util.Set; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; @@ -23,11 +22,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraftforge.common.util.Constants; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; @@ -45,7 +42,7 @@ import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardD import com.google.gson.Gson; import com.google.gson.GsonBuilder; -public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox +public class TEDemonPortal extends TileEntity { public DemonType type = DemonType.FIRE; @@ -66,9 +63,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public static int[] tierCostList = new int[]{1500}; - public Set hoardList = new HashSet(); + public Set hoardList = new HashSet(); - public static List buildingList = new ArrayList(); + public static List buildingList = new ArrayList(); public Random rand = new Random(); private GridSpace[][] area; @@ -88,7 +85,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public float pointPool; public String nextDemonPortalName = ""; - public EnumFacing nextDemonPortalDirection = EnumFacing.DOWN; + public ForgeDirection nextDemonPortalDirection = ForgeDirection.DOWN; public int buildingStage = -1; @@ -119,7 +116,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox isInitialized = false; - this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, pos.getY())); + this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); this.houseCooldown = 0; this.roadCooldown = 0; @@ -168,7 +165,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox { float totalChance = 0; - Map map = new HashMap(); + Map map = new HashMap(); map.put("roadChance", this.getRoadChance()); map.put("houseChance", this.getHouseChance()); map.put("demonPortalChance", this.getDemonPortalChance()); @@ -285,7 +282,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox { if(demon instanceof IHoardDemon) { - boolean enthrall = ((IHoardDemon) demon).thrallDemon(pos); + boolean enthrall = ((IHoardDemon) demon).thrallDemon(new Int3(this.xCoord, this.yCoord, this.zCoord)); if(enthrall) { this.hoardList.add((IHoardDemon)demon); @@ -309,10 +306,10 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox { if (Math.abs(xIndex) == 1 || Math.abs(zIndex) == 1) { - this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD, pos.getY())); + this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD, yCoord)); } else if (xIndex == 0 && zIndex == 0) { - this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, pos.getY())); + this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); } else { this.setGridSpace(xIndex, zIndex, new GridSpace()); @@ -337,7 +334,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public void createParty() { - worldObj.createExplosion(null, pos.getX() + rand.nextInt(10) - rand.nextInt(10), pos.getY(), pos.getZ() + rand.nextInt(10) - rand.nextInt(10), 5*rand.nextFloat(), false); + worldObj.createExplosion(null, xCoord + rand.nextInt(10) - rand.nextInt(10), yCoord, zCoord + rand.nextInt(10) - rand.nextInt(10), 5*rand.nextFloat(), false); } public void start() @@ -349,7 +346,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox * Randomly increase one of the cooldowns such that a road, house, or a demon portal tier is caused. Demons are also randomly spawned via this mechanic. */ @Override - public void update() + public void updateEntity() { if(worldObj.isRemote) { @@ -367,7 +364,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox if(delayBeforeParty <= 0) { - worldObj.createExplosion(null, pos.getX(), pos.getY(), pos.getZ(), 15, false); + worldObj.createExplosion(null, xCoord, yCoord, zCoord, 15, false); this.initialize(); } @@ -496,7 +493,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox this.nextDemonPortalName = par1NBTTagCompound.getString("nextDemonPortalName"); this.buildingStage = par1NBTTagCompound.getInteger("buildingStage"); - this.nextDemonPortalDirection = EnumFacing.getFront(par1NBTTagCompound.getInteger("nextDemonPortalDirection")); + this.nextDemonPortalDirection = ForgeDirection.getOrientation(par1NBTTagCompound.getInteger("nextDemonPortalDirection")); this.pointPool = par1NBTTagCompound.getFloat("pointPool"); this.lockdownTimer = par1NBTTagCompound.getInteger("lockdownTimer"); @@ -556,24 +553,24 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public int createRandomDemonHoard(TEDemonPortal teDemonPortal, int tier, DemonType type, boolean spawnGuardian) { int next = rand.nextInt(4); - EnumFacing dir; + ForgeDirection dir; switch (next) { case 0: - dir = EnumFacing.NORTH; + dir = ForgeDirection.NORTH; break; case 1: - dir = EnumFacing.SOUTH; + dir = ForgeDirection.SOUTH; break; case 2: - dir = EnumFacing.EAST; + dir = ForgeDirection.EAST; break; case 3: - dir = EnumFacing.WEST; + dir = ForgeDirection.WEST; break; default: - dir = EnumFacing.NORTH; + dir = ForgeDirection.NORTH; } Int3 road = findRoadSpaceFromDirection(dir, (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1); @@ -585,30 +582,30 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox if(TEDemonPortal.printDebug) System.out.println("Spawning Demons"); - return DemonPacketRegistry.spawnDemons(teDemonPortal, worldObj, pos.getX() + road.xCoord * 5, road.yCoord + 1, pos.getZ() + road.zCoord * 5, type, tier, spawnGuardian); + return DemonPacketRegistry.spawnDemons(teDemonPortal, worldObj, xCoord + road.xCoord * 5, road.yCoord + 1, zCoord + road.zCoord * 5, type, tier, spawnGuardian); } public int createRandomRoad() //Return the number of road spaces { int next = rand.nextInt(4); - EnumFacing dir; + ForgeDirection dir; switch (next) { case 0: - dir = EnumFacing.NORTH; + dir = ForgeDirection.NORTH; break; case 1: - dir = EnumFacing.SOUTH; + dir = ForgeDirection.SOUTH; break; case 2: - dir = EnumFacing.EAST; + dir = ForgeDirection.EAST; break; case 3: - dir = EnumFacing.WEST; + dir = ForgeDirection.WEST; break; default: - dir = EnumFacing.NORTH; + dir = ForgeDirection.NORTH; } Int3 road = findRoadSpaceFromDirection(dir, (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1); @@ -620,7 +617,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox if(printDebug) AlchemicalWizardry.logger.info("X: " + x + " Z: " + z + " Direction: " + dir.toString()); - List directions = this.findValidExtentionDirection(x, z); + List directions = this.findValidExtentionDirection(x, z); if (directions.size() <= 0) { @@ -630,9 +627,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox int maxDistance = 5; int distance = 0; - EnumFacing dominantDirection = null; + ForgeDirection dominantDirection = null; - for (EnumFacing direction : directions) + for (ForgeDirection direction : directions) { int amt = this.getLength(direction, maxDistance, x, z); if (amt > distance) @@ -659,9 +656,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return distance; } - public List findValidExtentionDirection(int x, int z) + public List findValidExtentionDirection(int x, int z) { - List directions = new LinkedList(); + List directions = new LinkedList(); if (this.getGridSpace(x, z) == null || !this.getGridSpace(x, z).isRoadSegment()) { @@ -671,41 +668,41 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox GridSpace nextGrid = this.getGridSpace(x + 1, z); if (nextGrid.isEmpty()) { - directions.add(EnumFacing.EAST); + directions.add(ForgeDirection.EAST); } nextGrid = this.getGridSpace(x - 1, z); if (nextGrid.isEmpty()) { - directions.add(EnumFacing.WEST); + directions.add(ForgeDirection.WEST); } nextGrid = this.getGridSpace(x, z + 1); if (nextGrid.isEmpty()) { - directions.add(EnumFacing.SOUTH); + directions.add(ForgeDirection.SOUTH); } nextGrid = this.getGridSpace(x, z - 1); if (nextGrid.isEmpty()) { - directions.add(EnumFacing.NORTH); + directions.add(ForgeDirection.NORTH); } return directions; } - public int getLength(EnumFacing dir, int maxLength, int x, int z) //Number of spaces forward + 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.getFrontOffsetX(), z + i * dir.getFrontOffsetZ()); + 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.getFrontOffsetX() + dir.getFrontOffsetZ() * k, z + i * dir.getFrontOffsetZ() + dir.getFrontOffsetX() * k); - GridSpace space2 = this.getGridSpace(x + i * dir.getFrontOffsetX() - dir.getFrontOffsetZ() * k, z + i * dir.getFrontOffsetZ() - dir.getFrontOffsetX() * 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()) { @@ -726,10 +723,10 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return maxLength; } - public Int3 findRoadSpaceFromDirection(EnumFacing dir, int amount) //TODO + public Int3 findRoadSpaceFromDirection(ForgeDirection dir, int amount) //TODO { int index = 0; - if (dir == EnumFacing.NORTH) + if (dir == ForgeDirection.NORTH) { if(printDebug) System.out.print("NORTH!"); @@ -748,7 +745,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.SOUTH) + } else if (dir == ForgeDirection.SOUTH) { for (int i = negZRadius + Math.min(posZRadius, limit); i >= Math.max(0, -limit + negZRadius); i--) { @@ -765,7 +762,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.EAST) + } else if (dir == ForgeDirection.EAST) { for (int i = negXRadius + Math.min(posXRadius, limit); i >= Math.max(0, -limit + negXRadius); i--) { @@ -782,7 +779,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.WEST) + } else if (dir == ForgeDirection.WEST) { for (int i = Math.max(0, -limit + negXRadius); i <= negXRadius + Math.min(posXRadius, limit); i++) { @@ -804,10 +801,10 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return new Int3(0, 0, 0); } - public Int3 findEmptySpaceNearRoad(EnumFacing dir, int amount, int closeness) + public Int3 findEmptySpaceNearRoad(ForgeDirection dir, int amount, int closeness) { int index = 0; - if (dir == EnumFacing.NORTH) + if (dir == ForgeDirection.NORTH) { if(printDebug) System.out.print("NORTH!"); @@ -831,7 +828,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.SOUTH) + } else if (dir == ForgeDirection.SOUTH) { for (int i = negZRadius + posZRadius; i >= 0; i--) { @@ -853,7 +850,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.EAST) + } else if (dir == ForgeDirection.EAST) { for (int i = negXRadius + posXRadius; i >= 0; i--) { @@ -875,7 +872,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.WEST) + } else if (dir == ForgeDirection.WEST) { for (int i = 0; i <= negXRadius + posXRadius; i++) { @@ -902,10 +899,10 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return new Int3(0, 0, 0); } - public Int3 findEmptySpaceFromDirection(EnumFacing dir, int amount) + public Int3 findEmptySpaceFromDirection(ForgeDirection dir, int amount) { int index = 0; - if (dir == EnumFacing.NORTH) + if (dir == ForgeDirection.NORTH) { if(printDebug) System.out.print("NORTH!"); @@ -924,7 +921,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.SOUTH) + } else if (dir == ForgeDirection.SOUTH) { for (int i = negZRadius + posZRadius; i >= 0; i--) { @@ -941,7 +938,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.EAST) + } else if (dir == ForgeDirection.EAST) { for (int i = negXRadius + posXRadius; i >= 0; i--) { @@ -958,7 +955,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } } } - } else if (dir == EnumFacing.WEST) + } else if (dir == ForgeDirection.WEST) { for (int i = 0; i <= negXRadius + posXRadius; i++) { @@ -980,7 +977,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return new Int3(0, 0, 0); } - public int createGriddedRoad(int gridXi, int yi, int gridZi, EnumFacing dir, int gridLength, boolean convertStarter) //Total grid length + public int createGriddedRoad(int gridXi, int yi, int gridZi, ForgeDirection dir, int gridLength, boolean convertStarter) //Total grid length { if (gridLength == 0 || gridLength == 1) { @@ -995,13 +992,13 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox { this.setGridSpace(initGridX, initGridZ, new GridSpace(GridSpace.CROSSROAD, initY)); - DemonCrosspath crosspath = new DemonCrosspath(pos.getX() + initGridX * 5, initY, pos.getZ() + initGridZ * 5); + 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(pos.getX() + initGridX * 5, initY, pos.getZ() + initGridZ * 5, dir, 6); + DemonVillagePath path = new DemonVillagePath(xCoord + initGridX * 5, initY, zCoord + initGridZ * 5, dir, 6); Int3AndBool temp = path.constructFullPath(this, worldObj, this.getRoadStepClearance()); Int3 next = temp.coords; @@ -1018,8 +1015,8 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return index; } - initGridX += dir.getFrontOffsetX(); - initGridZ += dir.getFrontOffsetZ(); + initGridX += dir.offsetX; + initGridZ += dir.offsetZ; if (!this.getGridSpace(initGridX, initGridZ).isRoadSegment()) { @@ -1160,10 +1157,10 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox // // this.initialize(); // -// if (EnumFacing.getOrientation(side) == EnumFacing.UP) +// if (ForgeDirection.getOrientation(side) == ForgeDirection.UP) // { // this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0); -// } else if (EnumFacing.getOrientation(side) == EnumFacing.DOWN) +// } else if (ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) // { // this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0); // } else @@ -1197,11 +1194,11 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox // GridSpaceHolder grid = this.createGSH(); - List directions = new ArrayList(); + List directions = new ArrayList(); for (int i = 2; i < 6; i++) { - EnumFacing testDir = EnumFacing.getFront(i); + ForgeDirection testDir = ForgeDirection.getOrientation(i); directions.add(testDir); } @@ -1210,9 +1207,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - HashMap> schemMap = new HashMap>(); + HashMap> schemMap = new HashMap(); - for (EnumFacing nextDir : directions) + for (ForgeDirection nextDir : directions) { for (DemonBuilding build : TEDemonPortal.buildingList) { @@ -1226,7 +1223,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox schemMap.get(nextDir).add(build); } else { - schemMap.put(nextDir, new ArrayList()); + schemMap.put(nextDir, new ArrayList()); schemMap.get(nextDir).add(build); } } @@ -1237,7 +1234,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - EnumFacing chosenDirection = (EnumFacing) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; + 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 portalSpace = build.getDoorSpace(chosenDirection); @@ -1279,7 +1276,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox GridSpaceHolder grid = this.createGSH(); - EnumFacing chosenDirection = this.nextDemonPortalDirection; + ForgeDirection chosenDirection = this.nextDemonPortalDirection; Int3 portalSpace = build.getDoorSpace(chosenDirection); int yOffset = portalSpace.yCoord; @@ -1291,9 +1288,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox case 1: int yDestination = yLevel + yOffset; - if(pos.getY() != yDestination) + if(yCoord != yDestination) { - BlockTeleposer.swapBlocks(this, worldObj, worldObj, pos, new BlockPos(pos.getX(), yDestination, pos.getZ())); + BlockTeleposer.swapBlocks(this, worldObj, worldObj, xCoord, yCoord, zCoord, xCoord, yDestination, zCoord); }else { //Nuthin - just as a reminder that we can now increment properly @@ -1301,9 +1298,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox break; case 2: - build.destroyAllInField(worldObj, pos.getX() + (x) * 5, yLevel, pos.getZ() + (z) * 5, chosenDirection.getOpposite()); + build.destroyAllInField(worldObj, xCoord + (x) * 5, yLevel, zCoord + (z) * 5, chosenDirection.getOpposite()); - build.buildAll(this, worldObj, pos.getX() + (x) * 5, yLevel, pos.getZ() + (z) * 5, chosenDirection.getOpposite(), true); + build.buildAll(this, worldObj, xCoord + (x) * 5, yLevel, zCoord + (z) * 5, chosenDirection.getOpposite(), true); build.setAllGridSpaces(x, z, yLevel, chosenDirection.getOpposite(), GridSpace.MAIN_PORTAL, grid); this.loadGSH(grid); break; @@ -1317,24 +1314,24 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public int createRandomHouse(int buildingTier) { int next = rand.nextInt(4); - EnumFacing dir; + ForgeDirection dir; switch (next) { case 0: - dir = EnumFacing.NORTH; + dir = ForgeDirection.NORTH; break; case 1: - dir = EnumFacing.SOUTH; + dir = ForgeDirection.SOUTH; break; case 2: - dir = EnumFacing.EAST; + dir = ForgeDirection.EAST; break; case 3: - dir = EnumFacing.WEST; + dir = ForgeDirection.WEST; break; default: - dir = EnumFacing.NORTH; + dir = ForgeDirection.NORTH; } Int3 space = this.findRoadSpaceFromDirection(dir, (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1); // Second: 1 * @@ -1353,12 +1350,12 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - List directions = new ArrayList(); + List directions = new ArrayList(); for (int i = 2; i < 6; i++) { - EnumFacing testDir = EnumFacing.getFront(i); - if (this.getGridSpace(x + testDir.getFrontOffsetX(), z + testDir.getFrontOffsetZ()).isEmpty()) + ForgeDirection testDir = ForgeDirection.getOrientation(i); + if (this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty()) { directions.add(testDir); } @@ -1369,9 +1366,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - HashMap> schemMap = new HashMap>(); + HashMap> schemMap = new HashMap(); - for (EnumFacing nextDir : directions) + for (ForgeDirection nextDir : directions) { for (DemonBuilding build : TEDemonPortal.buildingList) { @@ -1390,7 +1387,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox schemMap.get(nextDir).add(build); } else { - schemMap.put(nextDir, new ArrayList()); + schemMap.put(nextDir, new ArrayList()); schemMap.get(nextDir).add(build); } } else @@ -1406,18 +1403,22 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - EnumFacing chosenDirection = (EnumFacing) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; + 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, pos.getX() + (x + xOff) * 5, yLevel, pos.getZ() + (z + zOff) * 5, chosenDirection.getOpposite()); - build.buildAll(this, worldObj, pos.getX() + (x + xOff) * 5, yLevel, pos.getZ() + (z + zOff) * 5, chosenDirection.getOpposite(), true); + build.destroyAllInField(worldObj, xCoord + (x + xOff) * 5, yLevel, zCoord + (z + zOff) * 5, chosenDirection.getOpposite()); + build.buildAll(this, worldObj, xCoord + (x + xOff) * 5, yLevel, zCoord + (z + zOff) * 5, chosenDirection.getOpposite(), true); build.setAllGridSpaces(x + xOff, z + zOff, yLevel, chosenDirection.getOpposite(), GridSpace.HOUSE, grid); this.loadGSH(grid); + DemonVillagePath path = new DemonVillagePath(xCoord + (x) * 5, yLevel, zCoord + (z) * 5, chosenDirection, 2); + + Int3AndBool temp = path.constructFullPath(this, worldObj, this.getRoadStepClearance()); + return build.getNumberOfGridSpaces(); } @@ -1445,9 +1446,14 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return -1; } - public void createRoad(int xi, int yi, int zi, EnumFacing dir, int length, boolean doesNotDrop) + public void createRoad(int xi, int yi, int zi, ForgeDirection dir, int length, boolean doesNotDrop) { - if (dir.getFrontOffsetY() != 0) + int curX = xi; + int curY = yi; + int curZ = zi; + int roadRadius = this.getRoadRadius(); + + if (dir.offsetY != 0) { return; } @@ -1489,11 +1495,6 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox } return 0; } - - public IBlockState getRoadState() - { - return getRoadBlock().getStateFromMeta(getRoadMeta()); - } public int getRoadStepClearance() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/BookEntityItem.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/BookEntityItem.java index 00187b3d..14f06b92 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/BookEntityItem.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/BookEntityItem.java @@ -26,7 +26,7 @@ public class BookEntityItem extends EntityItem public BookEntityItem(World world, Entity original, ItemStack stack) { this(world, original.posX, original.posY, original.posZ); - this.setDefaultPickupDelay(); + this.delayBeforeCanPickup = 20; this.motionX = original.motionX; this.motionY = original.motionY; this.motionZ = original.motionZ; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java index 08dbb8bc..3d21cda8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java @@ -1,29 +1,34 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -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.player.EntityPlayer; -import net.minecraft.pathfinding.PathNavigateGround; -import net.minecraft.world.World; 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.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; public class EntityBileDemon extends EntityDemon { + private static float maxTamedHealth = 100.0F; + private static float maxUntamedHealth = 200.0F; + private int attackTimer; + public EntityBileDemon(World par1World) { super(par1World, AlchemicalWizardry.entityBileDemonID); - maxTamedHealth = 100.0F; - maxUntamedHealth = 200.0F; this.setSize(1.3F, 2.0F); - ((PathNavigateGround)this.getNavigator()).func_179690_a(true); + this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true)); this.tasks.addTask(3, this.aiSit); @@ -36,7 +41,6 @@ public class EntityBileDemon extends EntityDemon this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); this.setTamed(false); attackTimer = 0; - this.applyEntityAttributes(); } @Override @@ -57,4 +61,338 @@ public class EntityBileDemon extends EntityDemon //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + attackTimer = par1NBTTagCompound.getByte("attackTimer"); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 1.0F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (attackTimer > 0) + { + attackTimer--; + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte) 4); + boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) (7 + this.rand.nextInt(15))); + + if (flag) + { + par1Entity.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + @Override + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityBileDemon) + { + EntityBileDemon entitywolf = (EntityBileDemon) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java index 7d431217..2dad0271 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java @@ -1,31 +1,37 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -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.EntityAILeapAtTarget; -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.player.EntityPlayer; -import net.minecraft.pathfinding.PathNavigateGround; -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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; public class EntityBoulderFist extends EntityDemon { private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + private static float maxTamedHealth = 60.0F; + private static float maxUntamedHealth = 50.0F; + public EntityBoulderFist(World par1World) { super(par1World, AlchemicalWizardry.entityBoulderFistID); this.setSize(0.8F, 1.2F); - ((PathNavigateGround)this.getNavigator()).func_179690_a(true); + 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)); @@ -53,8 +59,6 @@ public class EntityBoulderFist extends EntityDemon super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); - float maxTamedHealth = 60.0F; - float maxUntamedHealth = 50.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -66,6 +70,334 @@ public class EntityBoulderFist extends EntityDemon } } + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + //TODO change sounds + return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.wolf.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.wolf.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 6 : 7; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + @Override + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityBoulderFist) + { + EntityBoulderFist entitywolf = (EntityBoulderFist) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) + { + HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600); + this.worldObj.spawnEntityInWorld(hol); + } + /** * sets this entity's combat AI. */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java index e87ee5a8..a9179329 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java @@ -1,35 +1,21 @@ 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.SharedMonsterAttributes; -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.EntityTameable; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.DamageSource; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.IDemon; -import WayofTime.alchemicalWizardry.common.items.DemonCrystal; +import WayofTime.alchemicalWizardry.common.items.DemonPlacer; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class EntityDemon extends EntityTameable implements IDemon { - protected boolean isAggro; - protected String demonID; - - protected float maxTamedHealth = 100.0F; - protected float maxUntamedHealth = 200.0F; - protected int attackTimer; + private boolean isAggro; + private String demonID; protected boolean dropCrystal = true; @@ -75,15 +61,13 @@ public class EntityDemon extends EntityTameable implements IDemon // TODO Auto-generated method stub return null; } - + @Override public void writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); tag.setBoolean("dropCrystal", this.getDoesDropCrystal()); - tag.setBoolean("isAggro", isAggro); - tag.setString("demonID", demonID); } @Override @@ -92,8 +76,6 @@ public class EntityDemon extends EntityTameable implements IDemon super.readFromNBT(tag); this.setDropCrystal(tag.getBoolean("dropCrystal")); - isAggro = tag.getBoolean("isAggro"); - demonID = tag.getString("demonID"); } @Override @@ -103,14 +85,14 @@ public class EntityDemon extends EntityTameable implements IDemon { ItemStack drop = new ItemStack(ModItems.demonPlacer); - DemonCrystal.setDemonString(drop, this.getDemonID()); + DemonPlacer.setDemonString(drop, this.getDemonID()); if ((this.getOwner() instanceof EntityPlayer)) { - DemonCrystal.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer) this.getOwner())); + DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer) this.getOwner())); } - if (this.hasCustomName()) + if (this.hasCustomNameTag()) { drop.setStackDisplayName(this.getCustomNameTag()); } @@ -156,368 +138,4 @@ public class EntityDemon extends EntityTameable implements IDemon { this.demonID = id; } - - - /** - * Returns true if the newer Entity AI code should be run - */ - public boolean isAIEnabled() - { - return true; - } - - /** - * Sets the active target the Task system uses for tracking - */ - public void setAttackTarget(EntityLivingBase par1EntityLivingBase) - { - super.setAttackTarget(par1EntityLivingBase); - - if (par1EntityLivingBase == null) - { - this.setAngry(false); - } else if (!this.isTamed()) - { - this.setAngry(true); - } - } - - @Override - /** - * main AI tick function, replaces updateEntityActionState - */ - protected void updateAITick() - { - this.dataWatcher.updateObject(18, this.getHealth()); - } - - @Override - protected void entityInit() - { - super.entityInit(); - this.dataWatcher.addObject(18, this.getHealth()); - this.dataWatcher.addObject(19, 0); - //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); - } - - /** - * Plays step sound at given x, y, z for the entity - */ - protected void playStepSound(int par1, int par2, int par3, int par4) - { - this.playSound("mob.zombie.step", 0.15F, 1.0F); - } - - @Override - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); - } - - @Override - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - super.readEntityFromNBT(par1NBTTagCompound); - this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - - attackTimer = par1NBTTagCompound.getByte("attackTimer"); - } - - @Override - /** - * Returns the sound this mob makes while it's alive. - */ - protected String getLivingSound() - { - return "none"; - } - - @Override - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() - { - return "mob.irongolem.hit"; - } - - @Override - /** - * Returns the sound this mob makes on death. - */ - protected String getDeathSound() - { - return "mob.irongolem.death"; - } - - @Override - /** - * Returns the volume for the sounds this mob makes. - */ - protected float getSoundVolume() - { - return 1.0F; - } - - /** - * Returns the item ID for the item the mob drops on death. - */ - protected int getDropItemId() - { - return -1; - } - - public int getAttackTimer() - { - return attackTimer; - } - - @Override - /** - * Called to update the entity's position/logic. - */ - public void onUpdate() - { - super.onUpdate(); - } - - @Override - public float getEyeHeight() - { - return this.height * 0.8F; - } - - @Override - /** - * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently - * use in wolves. - */ - public int getVerticalFaceSpeed() - { - return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); - } - - @Override - /** - * Called when the entity is attacked. - */ - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { -// if (this.isEntityInvulnerable()) -// { -// return false; -// } else - { - Entity entity = par1DamageSource.getEntity(); - this.aiSit.setSitting(false); - - if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) - { - par2 = (par2 + 1.0F) / 2.0F; - } - - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean attackEntityAsMob(Entity par1Entity) - { - this.attackTimer = 10; - this.worldObj.setEntityState(this, (byte) 4); - boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) (7 + this.rand.nextInt(15))); - - if (flag) - { - par1Entity.motionY += 0.4000000059604645D; - } - - this.playSound("mob.irongolem.throw", 1.0F, 1.0F); - return flag; - } - - @Override - public void setTamed(boolean par1) - { - super.setTamed(par1); - - if (par1) - { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); - } else - { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); - } - } - - /** - * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. - */ - @Override - public boolean interact(EntityPlayer par1EntityPlayer) - { - ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); - - if (this.isTamed()) - { - if (itemstack != null) - { - if (itemstack.getItem() instanceof ItemFood) - { - ItemFood itemfood = (ItemFood) itemstack.getItem(); - - if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) - { - if (!par1EntityPlayer.capabilities.isCreativeMode) - { - --itemstack.stackSize; - } - - this.heal((float) itemfood.getHealAmount(itemstack)); - - if (itemstack.stackSize <= 0) - { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); - } - - return true; - } - } - } - - if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) - { - if (!this.worldObj.isRemote) - { - this.aiSit.setSitting(!this.isSitting()); - this.isJumping = false; -// this.setPathToEntity(null); -// this.setTarget(null); - this.setAttackTarget(null); - } - - this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); - } - } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) - { - if (!par1EntityPlayer.capabilities.isCreativeMode) - { - --itemstack.stackSize; - } - - if (itemstack.stackSize <= 0) - { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); - } - - if (!this.worldObj.isRemote) - { - if (this.rand.nextInt(1) == 0) - { - this.setTamed(true); -// this.setPathToEntity(null); - this.setAttackTarget(null); - this.aiSit.setSitting(true); - this.setHealth(maxTamedHealth); - this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); - this.playTameEffect(true); - this.worldObj.setEntityState(this, (byte) 7); - } else - { - this.playTameEffect(false); - this.worldObj.setEntityState(this, (byte) 6); - } - } - - return true; - } - - return super.interact(par1EntityPlayer); - } - - /** - * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on - * the animal type) - */ - public boolean isBreedingItem(ItemStack par1ItemStack) - { - return false; - } - - /** - * Determines whether this wolf is angry or not. - */ - public boolean isAngry() - { - return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; - } - - /** - * Sets whether this wolf is angry or not. - */ - public void setAngry(boolean par1) - { - byte b0 = this.dataWatcher.getWatchableObjectByte(16); - - if (par1) - { - this.dataWatcher.updateObject(16, b0 | 2); - } else - { - this.dataWatcher.updateObject(16, b0 & -3); - } - } - - @Override - /** - * Returns true if the mob is currently able to mate with the specified mob. - */ - public boolean canMateWith(EntityAnimal par1EntityAnimal) - { - return false; - } - - public boolean func_70922_bv() - { - return this.dataWatcher.getWatchableObjectByte(19) == 1; - } - - @Override - /** - * Determines if an entity can be despawned, used on idle far away entities - */ - protected boolean canDespawn() - { - return false; - } - - @Override - public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) - { - if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) - { - if (par1EntityLivingBase instanceof EntityBileDemon) - { - EntityBileDemon entitywolf = (EntityBileDemon) par1EntityLivingBase; - - if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) - { - return false; - } - } - - return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); - } else - { - return false; - } - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java index b37b4695..6b6d73e2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java @@ -2,13 +2,13 @@ package WayofTime.alchemicalWizardry.common.entity.mob; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; 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.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; @@ -16,12 +16,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; @@ -45,20 +42,19 @@ public class EntityElemental extends EntityDemon } } -// public int courseChangeCooldown; + public int courseChangeCooldown; public double waypointX; public double waypointY; public double waypointZ; -/* private Entity targetedEntity; + private Entity targetedEntity; /** * Cooldown time between target loss and new target aquirement. - + */ private int aggroCooldown; public int prevAttackCounter; public int attackCounter; -*/ - @Override + /** * The explosion radius of spawned fireballs. */ @@ -70,67 +66,74 @@ public class EntityElemental extends EntityDemon } } - @Override + protected void fall(float par1) + { + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double par1, boolean par3) + { + } + /** * Moves the entity based on the specified heading. Args: strafe, forward */ - public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) + public void moveEntityWithHeading(float par1, float par2) { if (this.isInWater()) { - this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveFlying(par1, par2, 0.02F); this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.800000011920929D; this.motionY *= 0.800000011920929D; this.motionZ *= 0.800000011920929D; - } - else if (this.isInLava()) + } else if (this.handleLavaMovement()) { - this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveFlying(par1, par2, 0.02F); this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.5D; this.motionY *= 0.5D; this.motionZ *= 0.5D; - } - else + } else { float f2 = 0.91F; if (this.onGround) { - f2 = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + f2 = 0.54600006F; + Block i = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); + + if (i != null) + { + f2 = i.slipperiness * 0.91F; + } } float f3 = 0.16277136F / (f2 * f2 * f2); - this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * f3 : 0.02F); + this.moveFlying(par1, par2, this.onGround ? 0.1F * f3 : 0.02F); f2 = 0.91F; if (this.onGround) { - f2 = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + f2 = 0.54600006F; + Block j = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); + + if (j != null) + { + f2 = j.slipperiness * 0.91F; + } } this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; + this.motionX *= (double) f2; + this.motionY *= (double) f2; + this.motionZ *= (double) f2; } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double d1 = this.posX - this.prevPosX; - double d0 = this.posZ - this.prevPosZ; - float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; - - if (f4 > 1.0F) - { - f4 = 1.0F; - } - - this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; } - @Override /** * returns true if this entity is by a ladder, false otherwise */ @@ -139,10 +142,115 @@ public class EntityElemental extends EntityDemon return false; } - @SideOnly(Side.CLIENT) - public boolean func_110182_bF() + protected void updateEntityActionState() { - return this.dataWatcher.getWatchableObjectByte(25) != 0; + if (this.getHealth() <= this.getMaxHealth() / 2.0f && worldObj.rand.nextInt(200) == 0) + { + this.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionReciprocation.id, 100, 1)); + } + + this.prevAttackCounter = this.attackCounter; + double d0 = this.waypointX - this.posX; + double d1 = this.waypointY - this.posY; + double d2 = this.waypointZ - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d3 < 1.0D || d3 > 3600.0D) + { + this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + + if (this.courseChangeCooldown-- <= 0) + { + this.courseChangeCooldown += this.rand.nextInt(5) + 2; + d3 = (double) MathHelper.sqrt_double(d3); + + if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3)) + { + this.motionX += d0 / d3 * 0.1D; + this.motionY += d1 / d3 * 0.1D; + this.motionZ += d2 / d3 * 0.1D; + } else + { + this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + } + + if (this.targetedEntity != null && this.targetedEntity.isDead) + { + this.targetedEntity = null; + } + + if (this.targetedEntity == null || this.aggroCooldown-- <= 0) + { + this.targetedEntity = getClosestVulnerableMonsterToEntity(this, 100.0D); + + if (this.targetedEntity != null) + { + this.aggroCooldown = 20; + } + } + + double d4 = 64.0D; + + if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) + { + double d5 = this.targetedEntity.posX - this.posX; + double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F) - (this.posY + (double) (this.height / 2.0F)); + double d7 = this.targetedEntity.posZ - this.posZ; + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI; + + if (this.courseChangeCooldown <= 0) + { + if (isCourseTraversable(this.targetedEntity.posX, this.targetedEntity.posY, this.targetedEntity.posZ, Math.sqrt(d5 * d5 + d6 * d6 + d7 * d7))) + { + this.waypointX = this.targetedEntity.posX; + this.waypointY = this.targetedEntity.posY; + this.waypointZ = this.targetedEntity.posZ; + this.motionX += d5 / d3 * 0.1D; + this.motionY += d6 / d3 * 0.1D; + this.motionZ += d7 / d3 * 0.1D; + } else + { + this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.motionX += d5 / d3 * 0.1D; + this.motionY += d6 / d3 * 0.1D; + this.motionZ += d7 / d3 * 0.1D; + } + } + + if (this.canEntityBeSeen(this.targetedEntity)) + { + if (Math.sqrt(d5 * d5 + d6 * d6 + d7 * d7) < 4) + { + ++this.attackCounter; + + if (this.attackCounter >= 10) + { + this.worldObj.playAuxSFXAtEntity(null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + this.inflictEffectOnEntity(this.targetedEntity); + this.attackCounter = -40; + } + } + } else if (this.attackCounter > 0) + { + --this.attackCounter; + } + } else + { + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(motionX, this.motionZ)) * 180.0F / (float) Math.PI; + + if (this.attackCounter > 0) + { + --this.attackCounter; + } + } } /** @@ -153,7 +261,7 @@ public class EntityElemental extends EntityDemon double d4 = (this.waypointX - this.posX) / par7; double d5 = (this.waypointY - this.posY) / par7; double d6 = (this.waypointZ - this.posZ) / par7; - AxisAlignedBB axisalignedbb = this.getBoundingBox(); + AxisAlignedBB axisalignedbb = this.boundingBox.copy(); for (int i = 1; (double) i < par7; ++i) { @@ -168,7 +276,6 @@ public class EntityElemental extends EntityDemon return true; } - @Override /** * Will return how many at most can spawn in a chunk at once. */ @@ -177,7 +284,6 @@ public class EntityElemental extends EntityDemon return 1; } - @Override /** * (abstract) Protected helper method to write subclass entity data to NBT. */ @@ -186,14 +292,12 @@ public class EntityElemental extends EntityDemon super.writeEntityToNBT(par1NBTTagCompound); } - @Override /** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); - this.setAngry(par1NBTTagCompound.getBoolean("Angry")); this.setCombatTask(); } @@ -215,7 +319,6 @@ public class EntityElemental extends EntityDemon } } - @Override /** * Returns true if the newer Entity AI code should be run */ @@ -224,24 +327,14 @@ public class EntityElemental extends EntityDemon return false; } - @Override /** * Sets the active target the Task system uses for tracking */ public void setAttackTarget(EntityLivingBase par1EntityLivingBase) { super.setAttackTarget(par1EntityLivingBase); - - if (par1EntityLivingBase == null) - { - this.setAngry(false); - } else if (!this.isTamed()) - { - this.setAngry(true); - } } - @Override /** * main AI tick function, replaces updateEntityActionState */ @@ -250,16 +343,13 @@ public class EntityElemental extends EntityDemon this.dataWatcher.updateObject(18, this.getHealth()); } - @Override protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(18, this.getHealth()); this.dataWatcher.addObject(19, 0); - this.dataWatcher.addObject(25, 0); } - @Override /** * Plays step sound at given x, y, z for the entity */ @@ -268,7 +358,6 @@ public class EntityElemental extends EntityDemon this.playSound("mob.zombie.step", 0.15F, 1.0F); } - @Override /** * Returns the sound this mob makes while it's alive. */ @@ -278,7 +367,6 @@ public class EntityElemental extends EntityDemon return "none"; } - @Override /** * Returns the sound this mob makes when it is hurt. */ @@ -287,7 +375,6 @@ public class EntityElemental extends EntityDemon return "none"; } - @Override /** * Returns the sound this mob makes on death. */ @@ -296,7 +383,6 @@ public class EntityElemental extends EntityDemon return "none"; } - @Override /** * Returns the volume for the sounds this mob makes. */ @@ -305,36 +391,28 @@ public class EntityElemental extends EntityDemon return 0.4F; } - @Override /** - * Returns the item ID for the item the mob drops on death. + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. */ - protected int getDropItemId() + public void onLivingUpdate() { - return -1; + super.onLivingUpdate(); } - @Override /** * Called to update the entity's position/logic. */ public void onUpdate() { super.onUpdate(); - - if (this.getHealth() <= this.getMaxHealth() / 2.0f && worldObj.rand.nextInt(200) == 0) - { - this.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionReciprocation.id, 100, 1)); - } } - @Override public float getEyeHeight() { return this.height * 0.8F; } - @Override /** * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently * use in wolves. @@ -344,18 +422,17 @@ public class EntityElemental extends EntityDemon return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); } - @Override /** * Called when the entity is attacked. */ - public boolean attackEntityFrom(DamageSource source, float par2) + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.func_180431_b(source)) + if (this.isEntityInvulnerable()) { return false; } else { - Entity entity = source.getEntity(); + Entity entity = par1DamageSource.getEntity(); this.aiSit.setSitting(false); if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) @@ -363,18 +440,16 @@ public class EntityElemental extends EntityDemon par2 = (par2 + 1.0F) / 2.0F; } - return super.attackEntityFrom(source, par2); + return super.attackEntityFrom(par1DamageSource, par2); } } - @Override public boolean attackEntityAsMob(Entity par1Entity) { int i = this.isTamed() ? 6 : 7; return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); } - @Override public void setTamed(boolean par1) { super.setTamed(par1); @@ -388,7 +463,10 @@ public class EntityElemental extends EntityDemon } } - @Override + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + /** * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on * the animal type) @@ -398,59 +476,6 @@ public class EntityElemental extends EntityDemon return false; } - @Override - /** - * Determines whether this wolf is angry or not. - */ - public boolean isAngry() - { - return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; - } - - @Override - /** - * Sets whether this wolf is angry or not. - */ - public void setAngry(boolean par1) - { - byte b0 = this.dataWatcher.getWatchableObjectByte(16); - - if (par1) - { - this.dataWatcher.updateObject(16, b0 | 2); - } else - { - this.dataWatcher.updateObject(16, b0 & -3); - } - } - - public void func_70918_i(boolean par1) - { - if (par1) - { - this.dataWatcher.updateObject(19, 1); - } else - { - this.dataWatcher.updateObject(19, 0); - } - } - - @Override - /** - * Returns true if the mob is currently able to mate with the specified mob. - */ - public boolean canMateWith(EntityAnimal par1EntityAnimal) - { - return false; - } - - @Override - public boolean func_70922_bv() - { - return this.dataWatcher.getWatchableObjectByte(19) == 1; - } - - @Override /** * Determines if an entity can be despawned, used on idle far away entities */ @@ -511,7 +536,7 @@ public class EntityElemental extends EntityDemon double range = Math.sqrt(par2); double verticalRange = Math.sqrt(par2); - List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(par1 - 0.5f, par3 - 0.5f, par5 - 0.5f, par1 + 0.5f, par3 + 0.5f, par5 + 0.5f).expand(range, verticalRange, range)); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par1 - 0.5f, par3 - 0.5f, par5 - 0.5f, par1 + 0.5f, par3 + 0.5f, par5 + 0.5f).expand(range, verticalRange, range)); if (entities == null) { return null; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java index 8c654f08..3187dccf 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java @@ -1,35 +1,36 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -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 net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathNavigateGround; -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; +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.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob { 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; + private static float maxUntamedHealth = 50.0F; + public EntityFallenAngel(World par1World) { super(par1World, AlchemicalWizardry.entityFallenAngelID); this.setSize(0.7F, 1.8F); - ((PathNavigateGround)this.getNavigator()).func_179690_a(true); + this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); @@ -57,8 +58,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); - float maxTamedHealth = 50.0F; - float maxUntamedHealth = 50.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -70,6 +69,327 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob } } + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + //TODO change sounds + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.wolf.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityFallenAngel) + { + EntityFallenAngel entitywolf = (EntityFallenAngel) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + /** * Attack the specified entity using a ranged attack. */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java index c54d4588..b09aa6e5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java @@ -15,7 +15,6 @@ public class EntityFireElemental extends EntityElemental implements IMob this.isImmuneToFire = true; } - @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java index bbccf90e..51be44c9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java @@ -16,7 +16,6 @@ public class EntityHolyElemental extends EntityElemental implements IMob super(world, AlchemicalWizardry.entityHolyElementalID); } - @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java index 33f72245..854926e7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.entity.mob; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; @@ -13,17 +14,31 @@ 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.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +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 { private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 30, 50, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + private static float maxTamedHealth = 50.0F; + private static float maxUntamedHealth = 30.0F; + public EntityIceDemon(World par1World) { super(par1World, AlchemicalWizardry.entityIceDemonID); @@ -53,8 +68,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.40000001192092896D); - float maxTamedHealth = 50.0F; - float maxUntamedHealth = 30.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -66,7 +79,345 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob } } + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + 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); + + for (int i = -range; i <= range; i++) + { + for (int j = -range; j <= range; j++) + { + for (int k = -range; k <= range; k++) + { + if (worldObj.rand.nextFloat() < 0.25f) + { + SpellHelper.freezeWaterBlock(worldObj, xCoord + i, yCoord + j, zCoord + k); + } + } + } + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityIceDemon) + { + EntityIceDemon entitywolf = (EntityIceDemon) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + /** * Attack the specified entity using a ranged attack. */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java index 6429aa2c..e6d9955f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java @@ -1,29 +1,35 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -import net.minecraft.entity.EntityAgeable; -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.player.EntityPlayer; -import net.minecraft.pathfinding.PathNavigateGround; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; public class EntityLowerGuardian extends EntityDemon { + private static float maxTamedHealth = 50.0F; + private static float maxUntamedHealth = 30.0F; + private int attackTimer; + public EntityLowerGuardian(World par1World) { super(par1World, AlchemicalWizardry.entityLowerGuardianID); this.setSize(0.7F, 1.8F); - ((PathNavigateGround)this.getNavigator()).func_179690_a(true); + this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true)); this.tasks.addTask(3, this.aiSit); @@ -37,6 +43,7 @@ public class EntityLowerGuardian extends EntityDemon this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); this.setTamed(false); + attackTimer = 0; } @Override @@ -45,8 +52,6 @@ public class EntityLowerGuardian extends EntityDemon super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); - float maxTamedHealth = 50.0F; - float maxUntamedHealth = 30.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -58,10 +63,342 @@ public class EntityLowerGuardian extends EntityDemon } } -/* public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { - return this.spawnBabyAnimal(par1EntityAgeable); + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); + par1NBTTagCompound.setBoolean("isAggro", this.isAggro()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + attackTimer = par1NBTTagCompound.getByte("attackTimer"); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 1.0F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (attackTimer > 0) + { + attackTimer--; + } + } + + public int getAttackTimer() + { + return attackTimer; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte) 4); + boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) (7 + this.rand.nextInt(15))); + + if (flag) + { + par1Entity.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityLowerGuardian) + { + EntityLowerGuardian entitywolf = (EntityLowerGuardian) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } } - I don't know what this method changed to - */ } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java index 4f76dc33..f73ba7c8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java @@ -1,32 +1,37 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -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.player.EntityPlayer; -import net.minecraft.pathfinding.PathNavigateGround; -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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; public class EntityShade extends EntityDemon { private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + private static float maxTamedHealth = 50.0F; + private static float maxUntamedHealth = 100.0F; + public EntityShade(World par1World) { super(par1World, AlchemicalWizardry.entityShadeID); this.setSize(0.8F, 2.0F); - ((PathNavigateGround)this.getNavigator()).func_179690_a(true); + this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, true)); @@ -53,8 +58,6 @@ public class EntityShade extends EntityDemon super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); - float maxTamedHealth = 50.0F; - float maxUntamedHealth = 100.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -66,6 +69,328 @@ public class EntityShade extends EntityDemon } } + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + //TODO change sounds + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "none"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 6 : 7; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityBoulderFist) + { + EntityBoulderFist entitywolf = (EntityBoulderFist) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + /** + * Attack the specified entity using a ranged attack. + */ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java index 3e5ed0f3..004fcce4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java @@ -15,7 +15,6 @@ public class EntityShadeElemental extends EntityElemental implements IMob super(world, AlchemicalWizardry.entityShadeElementalID); } - @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java index d8b5da90..0ebeb103 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java @@ -1,35 +1,36 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -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 net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathNavigateGround; -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; +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.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackMob { private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 25, 25, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + private static float maxTamedHealth = 20.0F; + private static float maxUntamedHealth = 10.0F; + public EntitySmallEarthGolem(World par1World) { super(par1World, AlchemicalWizardry.entitySmallEarthGolemID); this.setSize(0.2F, 1.0F); - ((PathNavigateGround)this.getNavigator()).func_179690_a(true); + this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); @@ -55,8 +56,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.40000001192092896D); - float maxTamedHealth = 20.0F; - float maxUntamedHealth = 10.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -68,7 +67,324 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM } } + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntitySmallEarthGolem) + { + EntitySmallEarthGolem entitywolf = (EntitySmallEarthGolem) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + /** * Attack the specified entity using a ranged attack. */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java index 449a1ea2..ab141887 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java @@ -14,7 +14,6 @@ public class EntityWaterElemental extends EntityElemental implements IMob super(world, AlchemicalWizardry.entityWaterElementalID); } - @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java index ef2de0c2..02389aac 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java @@ -1,35 +1,36 @@ package WayofTime.alchemicalWizardry.common.entity.mob; -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 net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathNavigateGround; -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; +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.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackMob { 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; + private static float maxUntamedHealth = 200.0F; + public EntityWingedFireDemon(World par1World) { super(par1World, AlchemicalWizardry.entityWingedFireDemonID); this.setSize(0.7F, 1.8F); - ((PathNavigateGround)this.getNavigator()).func_179690_a(true); + this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); @@ -57,8 +58,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); - float maxTamedHealth = 100.0F; - float maxUntamedHealth = 200.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -72,13 +71,338 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, this.getHealth()); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, this.getHealth()); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.blaze.breathe"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.blaze.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.blaze.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(maxTamedHealth); + this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityWingedFireDemon) + { + EntityWingedFireDemon entitywolf = (EntityWingedFireDemon) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + /** * Attack the specified entity using a ranged attack. */ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { - this.worldObj.playAuxSFXAtEntity(null, 1009, this.getPosition(), 0); + this.worldObj.playAuxSFXAtEntity(null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0); FireProjectile hol = new FireProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600); this.worldObj.spawnEntityInWorld(hol); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/MailOrderEntityItem.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/MailOrderEntityItem.java index 26ddfa57..bf7f5263 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/MailOrderEntityItem.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/MailOrderEntityItem.java @@ -1,12 +1,15 @@ package WayofTime.alchemicalWizardry.common.entity.mob; +import pneumaticCraft.api.PneumaticRegistry; +import cpw.mods.fml.common.Optional; import net.minecraft.entity.Entity; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.fml.common.Optional; import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.book.BloodMagicGuide; +import amerifrance.guideapi.api.GuideRegistry; public class MailOrderEntityItem extends EntityItem { @@ -28,7 +31,7 @@ public class MailOrderEntityItem extends EntityItem public MailOrderEntityItem(World world, Entity original, ItemStack stack) { this(world, original.posX, original.posY, original.posZ); - this.setDefaultPickupDelay(); + this.delayBeforeCanPickup = 20; this.motionX = original.motionX; this.motionY = original.motionY; this.motionZ = original.motionZ; @@ -54,11 +57,11 @@ public class MailOrderEntityItem extends EntityItem this.deliverItemViaDrone(this.posX, this.posY, this.posZ); }else { -// EntityItem entity = new BookEntityItem(worldObj, this.posX, this.posY, this.posZ, GuideRegistry.getItemStackForBook(BloodMagicGuide.bloodMagicGuide)); -// entity.lifespan = 6000; -// entity.setDefaultPickupDelay(); -// entity.motionY = 1; -// worldObj.spawnEntityInWorld(entity); + EntityItem entity = new BookEntityItem(worldObj, this.posX, this.posY, this.posZ, GuideRegistry.getItemStackForBook(BloodMagicGuide.bloodMagicGuide)); + entity.lifespan = 6000; + entity.delayBeforeCanPickup = 20; + entity.motionY = 1; + worldObj.spawnEntityInWorld(entity); } this.setDead(); @@ -68,6 +71,6 @@ public class MailOrderEntityItem extends EntityItem @Optional.Method(modid = "PneumaticCraft") public void deliverItemViaDrone(double x, double y, double z) { -// PneumaticRegistry.getInstance().deliverItemsAmazonStyle(worldObj, (int)x, (int)y, (int)z, GuideRegistry.getItemStackForBook(BloodMagicGuide.bloodMagicGuide)); + PneumaticRegistry.getInstance().deliverItemsAmazonStyle(worldObj, (int)x, (int)y, (int)z, GuideRegistry.getItemStackForBook(BloodMagicGuide.bloodMagicGuide)); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java index 57cde54c..3e5e9bfa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java @@ -4,7 +4,6 @@ import java.util.Iterator; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; @@ -13,18 +12,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.IThrowableEntity; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.common.registry.IThrowableEntity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -//Shamelessly ripped off from x3n0ph0b3 //Shame! +//Shamelessly ripped off from x3n0ph0b3 public class EnergyBlastProjectile extends Entity implements IProjectile, IThrowableEntity { protected int xTile = -1; @@ -39,6 +37,8 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow public EntityLivingBase shootingEntity; protected int ticksInAir = 0; protected int maxTicksInAir = 600; + private int ricochetCounter = 0; + private boolean scheduledForDeath = false; protected int projectileDamage; public EnergyBlastProjectile(World par1World) @@ -53,6 +53,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow super(par1World); this.setSize(0.5F, 0.5F); this.setPosition(par2, par4, par6); + yOffset = 0.0F; this.maxTicksInAir = 600; } @@ -67,6 +68,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow 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); @@ -86,6 +88,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow 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); @@ -101,7 +104,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow this.shootingEntity = par2EntityLivingBase; this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; - double d1 = par3EntityLivingBase.getBoundingBox().minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY; + double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY; double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); @@ -112,6 +115,8 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float) d3 * 0.2F; this.setThrowableHeading(d0, d1, d2, par4, par5); } @@ -150,6 +155,18 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow 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 @SideOnly(Side.CLIENT) /** @@ -187,7 +204,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow if (shootingEntity == null) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); + 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; @@ -216,21 +233,28 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI); } - IBlockState state = worldObj.getBlockState(new BlockPos(xTile, yTile, zTile)); - Block var16 = state.getBlock(); + Block var16 = worldObj.getBlock(xTile, yTile, zTile); if (var16 != null) { - var16.setBlockBoundsBasedOnState(worldObj, new BlockPos(xTile, yTile, zTile)); - AxisAlignedBB var2 = var16.getCollisionBoundingBox(worldObj, new BlockPos(xTile, yTile, zTile), state); + var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); + AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); - if (var2 != null && var2.isVecInside(new Vec3(posX, posY, posZ))) + if (var2 != null && var2.isVecInside(SpellHelper.createVec3(posX, posY, posZ))) { inGround = true; } } - if (!inGround) + if (inGround) + { + Block var18 = worldObj.getBlock(xTile, yTile, zTile); + int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile); + + if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) + { + } + } else { ++ticksInAir; @@ -242,23 +266,22 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow } } - Vec3 var17 = new Vec3(posX, posY, posZ); - Vec3 var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); - MovingObjectPosition var4 = worldObj.rayTraceBlocks(var17, var3, true, false, false); - var17 = new Vec3(posX, posY, posZ); - var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); + Vec3 var17 = SpellHelper.createVec3(posX, posY, posZ); + Vec3 var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false); + var17 = SpellHelper.createVec3(posX, posY, posZ); + var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); if (var4 != null) { - var3 = new Vec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + var3 = SpellHelper.createVec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); } Entity var5 = null; - List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, getBoundingBox().addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); double var7 = 0.0D; Iterator var9 = var6.iterator(); float var11; - boolean scheduledForDeath = false; while (var9.hasNext()) { @@ -267,7 +290,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) { var11 = 0.3F; - AxisAlignedBB var12 = var10.getBoundingBox().expand(var11, var11, var11); + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); if (var13 != null) @@ -308,8 +331,8 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow public void doFiringParticles() { - worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - worldObj.spawnParticle(EnumParticleTypes.FLAME, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + 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)); } /** @@ -356,6 +379,20 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow return false; } + @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) + { + } + /** * If returns false, the item will not inflict any damage against entities. */ @@ -425,15 +462,20 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true); } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } - protected void spawnHitParticles(EnumParticleTypes type, int i) + private int d6() + { + return rand.nextInt(6) + 1; + } + + protected void spawnHitParticles(String string, int i) { for (int particles = 0; particles < i; particles++) { - worldObj.spawnParticle(type, posX, posY - (type == EnumParticleTypes.PORTAL ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); } } @@ -474,5 +516,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow { if (entity instanceof EntityLivingBase) this.shootingEntity = (EntityLivingBase) entity; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java new file mode 100644 index 00000000..d4029d91 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java @@ -0,0 +1,16 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.client.particle.EntityFX; +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 + } + +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java index 4b1665fb..c0490bd8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java @@ -1,15 +1,13 @@ 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.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModBlocks; + public class EntityBloodLightProjectile extends EnergyBlastProjectile { @@ -57,12 +55,39 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - EnumFacing facing = mop.field_178784_b; - BlockPos position = mop.func_178782_a().offset(facing); - - if(this.worldObj.isAirBlock(position)) + int sideHit = mop.sideHit; + int blockX = mop.blockX; + int blockY = mop.blockY; + int blockZ = mop.blockZ; + + if (sideHit == 0 && this.worldObj.isAirBlock(blockX, blockY - 1, blockZ)) { - this.worldObj.setBlockState(position, ModBlocks.blockBloodLight.getDefaultState()); + this.worldObj.setBlock(blockX, blockY - 1, blockZ, ModBlocks.blockBloodLight); + } + + if (sideHit == 1 && this.worldObj.isAirBlock(blockX, blockY + 1, blockZ)) + { + this.worldObj.setBlock(blockX, blockY + 1, blockZ, ModBlocks.blockBloodLight); + } + + if (sideHit == 2 && this.worldObj.isAirBlock(blockX, blockY, blockZ - 1)) + { + this.worldObj.setBlock(blockX, blockY, blockZ - 1, ModBlocks.blockBloodLight); + } + + if (sideHit == 3 && this.worldObj.isAirBlock(blockX, blockY, blockZ + 1)) + { + this.worldObj.setBlock(blockX, blockY, blockZ + 1, ModBlocks.blockBloodLight); + } + + if (sideHit == 4 && this.worldObj.isAirBlock(blockX - 1, blockY, blockZ)) + { + this.worldObj.setBlock(blockX - 1, blockY, blockZ, ModBlocks.blockBloodLight); + } + + if (sideHit == 5 && this.worldObj.isAirBlock(blockX + 1, blockY, blockZ)) + { + this.worldObj.setBlock(blockX + 1, blockY, blockZ, ModBlocks.blockBloodLight); } } @@ -85,13 +110,12 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile } } - BlockPos pos = new BlockPos(this.posX, this.posY, this.posZ); - if (worldObj.isAirBlock(pos)) + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) { - worldObj.setBlockState(pos, Blocks.fire.getDefaultState()); + worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Blocks.fire); } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java index 55f8b9f0..fbc3fa57 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java @@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.entity.projectile; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -53,7 +52,7 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, 5.0f, false); + worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false); this.spawnSecondaryProjectiles(); } @@ -74,10 +73,10 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile spawnSecondaryProjectiles(); } - worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, 5.0f, false); + worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false); } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java index ad105632..617db735 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java @@ -4,23 +4,20 @@ import java.util.Iterator; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectile implements IProjectile { @@ -51,6 +48,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil super(par1World); this.setSize(0.5F, 0.5F); this.setPosition(par2, par4, par6); + yOffset = 0.0F; this.damage = damage; } @@ -65,6 +63,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil 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); @@ -103,6 +102,18 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil 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 @SideOnly(Side.CLIENT) /** @@ -140,7 +151,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil if (shootingEntity == null) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); + 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; @@ -169,21 +180,28 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI); } - IBlockState state = worldObj.getBlockState(new BlockPos(xTile, yTile, zTile)); - Block var16 = state.getBlock(); + Block var16 = worldObj.getBlock(xTile, yTile, zTile); if (var16 != null) { - var16.setBlockBoundsBasedOnState(worldObj, new BlockPos(xTile, yTile, zTile)); - AxisAlignedBB var2 = var16.getCollisionBoundingBox(worldObj, new BlockPos(xTile, yTile, zTile), state); + var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); + AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); - if (var2 != null && var2.isVecInside(new Vec3(posX, posY, posZ))) + if (var2 != null && var2.isVecInside(SpellHelper.createVec3(posX, posY, posZ))) { inGround = true; } } - if (!inGround) + if (inGround) + { + Block var18 = worldObj.getBlock(xTile, yTile, zTile); + int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile); + + if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) + { + } + } else { ++ticksInAir; @@ -195,19 +213,19 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil } } - Vec3 var17 = new Vec3(posX, posY, posZ); - Vec3 var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); - MovingObjectPosition var4 = worldObj.rayTraceBlocks(var17, var3, true, false, false); - var17 = new Vec3(posX, posY, posZ); - var3 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); + Vec3 var17 = SpellHelper.createVec3(posX, posY, posZ); + Vec3 var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false); + var17 = SpellHelper.createVec3(posX, posY, posZ); + var3 = SpellHelper.createVec3(posX + motionX, posY + motionY, posZ + motionZ); if (var4 != null) { - var3 = new Vec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + var3 = SpellHelper.createVec3(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); } Entity var5 = null; - List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, getBoundingBox().addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); double var7 = 0.0D; Iterator var9 = var6.iterator(); float var11; @@ -219,7 +237,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) { var11 = 0.3F; - AxisAlignedBB var12 = var10.getBoundingBox().expand(var11, var11, var11); + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); if (var13 != null) @@ -260,8 +278,8 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil public void doFiringParticles() { - worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - worldObj.spawnParticle(EnumParticleTypes.FLAME, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + 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)); } /** @@ -302,6 +320,20 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return false; } + @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) + { + } + /** * If returns false, the item will not inflict any damage against entities. */ @@ -311,7 +343,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return false; } - @Override /** * Whether the arrow has a stream of critical hit particles flying behind * it. @@ -329,7 +360,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil } } - @Override /** * Whether the arrow has a stream of critical hit particles flying behind * it. @@ -340,7 +370,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return (var1 & 1) != 0; } - @Override public void onImpact(MovingObjectPosition mop) { if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) @@ -353,12 +382,11 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - this.groundImpact(mop.field_178784_b); + this.groundImpact(mop.sideHit); worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false); } } - @Override public void onImpact(Entity mop) { if (mop == shootingEntity && ticksInAir > 3) @@ -371,7 +399,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false); } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } @@ -380,59 +408,60 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return rand.nextInt(6) + 1; } - @Override - protected void spawnHitParticles(EnumParticleTypes type, int i) + public void spawnHitParticles(String string, int i) { for (int particles = 0; particles < i; particles++) { - worldObj.spawnParticle(type, posX, posY - (type == EnumParticleTypes.PORTAL ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); } } - @Override public void doDamage(int i, Entity mop) { mop.attackEntityFrom(this.getDamageSource(), i); } - @Override public DamageSource getDamageSource() { return DamageSource.causeMobDamage(shootingEntity); } - public void groundImpact(EnumFacing sideHit) + public void groundImpact(int sideHit) { this.ricochet(sideHit); } - @Override public double smallGauss(double d) { return (worldObj.rand.nextFloat() - 0.5D) * d; } - @Override public double gaussian(double d) { return d + d * ((rand.nextFloat() - 0.5D) / 4); } - private void ricochet(EnumFacing sideHit) - { - if(sideHit.getFrontOffsetX() != 0) + private void ricochet(int sideHit) + { + switch (sideHit) { - motionX *= -1; - } - - if(sideHit.getFrontOffsetY() != 0) - { - motionY *= -1; - } - - if(sideHit.getFrontOffsetZ() != 0) - { - motionZ *= -1; + 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++; @@ -443,33 +472,32 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil for (int particles = 0; particles < 4; particles++) { - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); -// 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; -// } + 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; + } } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java index 9b234851..2307236c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java @@ -74,7 +74,7 @@ public class EntityMeteor extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - MeteorRegistry.createMeteorImpact(worldObj, mop.func_178782_a(), this.meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae}); + MeteorRegistry.createMeteorImpact(worldObj, mop.blockX, mop.blockY, mop.blockZ, this.meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae}); } this.setDead(); @@ -83,7 +83,7 @@ public class EntityMeteor extends EnergyBlastProjectile @Override public void onImpact(Entity mop) { - MeteorRegistry.createMeteorImpact(worldObj, this.getPosition(), 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/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java index 32ac5547..88c92ad2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java @@ -1,17 +1,18 @@ 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; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.IThrowableEntity; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; //Shamelessly ripped off from x3n0ph0b3 public class EntityParticleBeam extends Entity implements IProjectile, IThrowableEntity @@ -34,6 +35,7 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl public EntityLivingBase shootingEntity; protected int ticksInAir = 0; protected int maxTicksInAir = 600; + private int ricochetCounter = 0; private boolean scheduledForDeath = false; protected int projectileDamage; @@ -49,6 +51,7 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl super(par1World); this.setSize(0.5F, 0.5F); this.setPosition(par2, par4, par6); + yOffset = 0.0F; this.maxTicksInAir = 600; } @@ -63,6 +66,7 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl 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); @@ -82,6 +86,7 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl 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); @@ -97,7 +102,7 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl this.shootingEntity = par2EntityLivingBase; this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; - double d1 = par3EntityLivingBase.getBoundingBox().minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY; + double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY; double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); @@ -108,6 +113,8 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float) d3 * 0.2F; this.setThrowableHeading(d0, d1, d2, par4, par5); } @@ -146,6 +153,18 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl 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 @SideOnly(Side.CLIENT) /** @@ -206,11 +225,9 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl { return; } - - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, 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); + 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); } /** @@ -265,6 +282,21 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl return false; } + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + protected void spawnHitParticles(String string, int i) + { + for (int particles = 0; particles < i; particles++) + { + worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } + } + public DamageSource getDamageSource() { return DamageSource.causeMobDamage(shootingEntity); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java index 6ab68863..24c6af9b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java @@ -4,7 +4,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -82,15 +81,15 @@ public class ExplosionProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } @Override public void doFiringParticles() { - worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + worldObj.spawnParticle("explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java index 19b1086a..ba8f3041 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java @@ -4,9 +4,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -62,10 +60,9 @@ public class FireProjectile extends EnergyBlastProjectile { for (int k = -1; k <= 1; k++) { - BlockPos newPos = new BlockPos(this.posX + i, this.posY + j, this.posZ + k); - if (worldObj.isAirBlock(newPos)) + if (worldObj.isAirBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k)) { - worldObj.setBlockState(newPos, Blocks.fire.getDefaultState()); + worldObj.setBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k, Blocks.fire); } } } @@ -86,12 +83,12 @@ public class FireProjectile extends EnergyBlastProjectile { if (mop instanceof EntityLivingBase) { - mop.setFire(10 * this.projectileDamage); + ((EntityLivingBase) mop).setFire(10 * this.projectileDamage); ((EntityLivingBase) mop).setRevengeTarget(shootingEntity); - if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || mop.isImmuneToFire()) + if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase) mop).isImmuneToFire()) { - mop.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + ((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); } else { doDamage(projectileDamage, mop); @@ -100,13 +97,12 @@ public class FireProjectile extends EnergyBlastProjectile } } - BlockPos newPos = new BlockPos(this.posX, this.posY, this.posZ); - if (worldObj.isAirBlock(newPos)) + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) { - worldObj.setBlockState(newPos, Blocks.fire.getDefaultState()); + worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Blocks.fire); } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java index f662ab31..3fc5e2ac 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java @@ -4,7 +4,6 @@ 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.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -52,7 +51,7 @@ public class HolyProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - } //else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } @@ -72,7 +71,7 @@ public class HolyProjectile extends EnergyBlastProjectile { if (((EntityLivingBase) mop).isEntityUndead()) { - doDamage(projectileDamage * 2, mop); + doDamage((int) (projectileDamage * 2), mop); } else { doDamage(projectileDamage, mop); @@ -80,14 +79,18 @@ public class HolyProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) + { + } + + spawnHitParticles("magicCrit", 8); this.setDead(); } @Override public void doFiringParticles() { - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java index 130f88f9..3ba02709 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java @@ -5,7 +5,6 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; @@ -54,7 +53,7 @@ public class IceProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } this.setDead(); @@ -71,9 +70,9 @@ public class IceProjectile extends EnergyBlastProjectile { if (mop instanceof EntityLivingBase) { - if (mop.isImmuneToFire()) + if (((EntityLivingBase) mop).isImmuneToFire()) { - doDamage(projectileDamage * 2, mop); + doDamage((int) (projectileDamage * 2), mop); ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2)); } else { @@ -83,14 +82,19 @@ public class IceProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + 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); this.setDead(); } @Override public void doFiringParticles() { - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.EXPLOSION_LARGE, posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java index f936106f..fe521b4c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java @@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -84,15 +83,15 @@ public class LightningBoltProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } @Override public void doFiringParticles() { - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java index 6995f529..cc9cf06c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java @@ -7,7 +7,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -60,7 +59,7 @@ public class MudProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } @@ -88,15 +87,15 @@ public class MudProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } @Override public void doFiringParticles() { - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 0.5F, 0.297F, 0.0664F); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 0.5F, 0.297F, 0.0664F); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java index 8b2308b7..48ea1bf5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java @@ -7,7 +7,6 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; @@ -84,7 +83,7 @@ public class TeleportProjectile extends EnergyBlastProjectile { if (shootingEntity.isRiding()) { - shootingEntity.mountEntity(null); + shootingEntity.mountEntity((Entity) null); } shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); } @@ -118,7 +117,7 @@ public class TeleportProjectile extends EnergyBlastProjectile { if (shootingEntity.isRiding()) { - shootingEntity.mountEntity(null); + shootingEntity.mountEntity((Entity) null); } shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); @@ -132,15 +131,15 @@ public class TeleportProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } @Override public void doFiringParticles() { - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.PORTAL, posX, posY, posZ, -motionX, -motionY, -motionZ); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "portal", posX, posY, posZ, -motionX, -motionY, -motionZ); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java index 556bddbe..4ec890ff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java @@ -6,7 +6,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -49,7 +48,7 @@ public class WaterProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } @@ -66,7 +65,7 @@ public class WaterProjectile extends EnergyBlastProjectile { if (mop instanceof EntityLivingBase) { - if (mop.isImmuneToFire()) + if (((EntityLivingBase) mop).isImmuneToFire()) { doDamage(projectileDamage * 2, mop); ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 1)); @@ -78,14 +77,14 @@ public class WaterProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } @Override public void doFiringParticles() { - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.PORTAL, posX, posY, posZ, -motionX, -motionY, -motionZ); - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "portal", posX, posY, posZ, -motionX, -motionY, -motionZ); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java index 6af663b7..fbe86c24 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java @@ -4,7 +4,6 @@ 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.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -52,7 +51,7 @@ public class WindGustProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } @@ -75,14 +74,14 @@ public class WindGustProjectile extends EnergyBlastProjectile } } - spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); + spawnHitParticles("magicCrit", 8); this.setDead(); } @Override public void doFiringParticles() { - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB_AMBIENT, posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); - SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, posX, posY, posZ, 1.0F, 1.0F, 1.0F); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/guide/RecipeHolder.java b/src/main/java/WayofTime/alchemicalWizardry/common/guide/RecipeHolder.java index 10003173..8bbbaba9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/guide/RecipeHolder.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/guide/RecipeHolder.java @@ -155,7 +155,7 @@ public class RecipeHolder arcanePlinthRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockPlinth)); arcanePedestalRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockPedestal)); - spellTableRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockSpellTable)); + spellTableRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockHomHeart)); alchemySetRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockWritingTable)); crucibleRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockCrucible)); @@ -168,7 +168,7 @@ public class RecipeHolder routerRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemAttunedCrystal)); segmenterRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemTankSegmenter)); cleanserRecipe = getRecipeForItemStack(new ItemStack(ModItems.itemDestinationClearer)); - calcinatorRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockAlchemicalCalcinator)); + calcinatorRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockAlchemicCalcinator)); belljarRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockCrystalBelljar)); relayRecipe = getRecipeForItemStack(new ItemStack(ModBlocks.blockReagentConduit)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/AgriCraftCropHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/AgriCraftCropHarvestHandler.java new file mode 100644 index 00000000..6ed664b2 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/AgriCraftCropHarvestHandler.java @@ -0,0 +1,83 @@ +package WayofTime.alchemicalWizardry.common.harvest; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; +import cpw.mods.fml.common.registry.GameRegistry; + +public class AgriCraftCropHarvestHandler implements IHarvestHandler +{ + public Block harvestBlock; + public Method isMature; + public Method harvest; + + public AgriCraftCropHarvestHandler() + { + this.harvestBlock = getBlockForString("AgriCraft:crops"); + if(this.harvestBlock != null) + { + try { + Class clazz = Class.forName("com.InfinityRaider.AgriCraft.blocks.BlockCrop"); + if(clazz != null) + { + isMature = clazz.getMethod("isMature", World.class, int.class, int.class, int.class); + harvest = clazz.getMethod("harvest", World.class, int.class, int.class, int.class); + } + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchMethodException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + public boolean isHarvesterValid() + { + return harvestBlock != null && isMature != null && harvest != 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 boolean canHandleBlock(Block block) + { + return block == harvestBlock; + } + + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if (!this.canHandleBlock(block)) + { + return false; + } + + try { + return (Boolean)(isMature.invoke(block, world, xCoord, yCoord, zCoord)) && (Boolean)(harvest.invoke(block, world, xCoord, yCoord, zCoord)); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InvocationTargetException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return false; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java index 4703ebaa..3b437fac 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java @@ -3,13 +3,12 @@ package WayofTime.alchemicalWizardry.common.harvest; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; +import net.minecraft.block.BlockCrops; 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.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; @@ -23,6 +22,10 @@ public class BloodMagicHarvestHandler implements IHarvestHandler public int getHarvestMeta(Block block) { + if(block instanceof BlockCrops) + { + + } if (block == Blocks.wheat) { return 7; @@ -43,9 +46,9 @@ public class BloodMagicHarvestHandler implements IHarvestHandler } @Override - public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) { - if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta(block)) + if (!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) { return false; } @@ -59,7 +62,7 @@ public class BloodMagicHarvestHandler implements IHarvestHandler int fortune = 0; - List list = block.getDrops(world, pos, state, fortune); + List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); boolean foundAndRemovedSeed = false; for (ItemStack stack : list) @@ -89,15 +92,16 @@ public class BloodMagicHarvestHandler implements IHarvestHandler if (foundAndRemovedSeed) { - IBlockState plantState = seed.getPlant(world, pos); + int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord); + Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord); - world.destroyBlock(pos, false); + world.func_147480_a(xCoord, yCoord, zCoord, false); - world.setBlockState(pos, plantState, 3); + world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3); for (ItemStack stack : list) { - EntityItem itemEnt = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack); + EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); world.spawnEntityInWorld(itemEnt); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java index f8c2d7ee..3f948080 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/CactusReedHarvestHandler.java @@ -1,11 +1,9 @@ package WayofTime.alchemicalWizardry.common.harvest; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; 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 { @@ -15,19 +13,19 @@ public class CactusReedHarvestHandler implements IHarvestHandler } @Override - public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) { if (!this.canHandleBlock(block)) { return false; } - if (world.getBlockState(pos.offsetDown(1)).getBlock() != block || world.getBlockState(pos.offsetDown(2)).getBlock() != block) + if (world.getBlock(xCoord, yCoord - 1, zCoord) != block || world.getBlock(xCoord, yCoord - 2, zCoord) != block) { return false; } - world.destroyBlock(pos, true); + world.func_147480_a(xCoord, yCoord, zCoord, true); return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericItemStackHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericItemStackHarvestHandler.java index 77837d15..45dee807 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericItemStackHarvestHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericItemStackHarvestHandler.java @@ -1,18 +1,17 @@ package WayofTime.alchemicalWizardry.common.harvest; +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; + import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; -import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; - public class GenericItemStackHarvestHandler implements IHarvestHandler { + public Block harvestBlock; public int harvestMeta; public ItemStack harvestItem; @@ -31,15 +30,15 @@ public class GenericItemStackHarvestHandler implements IHarvestHandler return block == harvestBlock; } - public int getHarvestMeta() + public int getHarvestMeta(Block block) { return harvestMeta; } @Override - public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) { - if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta()) + if (!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) { return false; } @@ -48,14 +47,14 @@ public class GenericItemStackHarvestHandler implements IHarvestHandler if (seed == null) { - world.destroyBlock(pos, true); + world.func_147480_a(xCoord, yCoord, zCoord, true); return true; } else { int fortune = 0; - List list = block.getDrops(world, pos, state, fortune); + List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); boolean foundAndRemovedSeed = false; for (ItemStack stack : list) @@ -86,15 +85,16 @@ public class GenericItemStackHarvestHandler implements IHarvestHandler if (foundAndRemovedSeed) { - IBlockState plantState = seed.getPlant(world, pos); + int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord); + Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord); - world.destroyBlock(pos, false); + world.func_147480_a(xCoord, yCoord, zCoord, false); - world.setBlockState(pos, plantState, 3); + world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3); for (ItemStack stack : list) { - EntityItem itemEnt = new EntityItem(world, pos.getX(), pos.getY(), pos.getZ(), stack); + EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); world.spawnEntityInWorld(itemEnt); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java index 581c6ada..a5d4b036 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericPamSeedlessFruitHarvestHandler.java @@ -1,69 +1,67 @@ -//package WayofTime.alchemicalWizardry.common.harvest; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.state.IBlockState; -//import net.minecraft.item.Item; -//import net.minecraft.util.BlockPos; -//import net.minecraft.world.World; -//import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; -//import cpw.mods.fml.common.registry.GameRegistry; -// -//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 int getHarvestMeta() -// { -// return harvestMeta; -// } -// -// @Override -// public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) -// { -// if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta()) -// { -// return false; -// } -// -// world.destroyBlock(pos, true); -// -// world.setBlockState(pos, harvestBlock.getStateFromMeta(resetMeta), 3); -// -// return true; -// } -//} +package WayofTime.alchemicalWizardry.common.harvest; + +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.world.World; + +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 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/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java index ff07bdf0..0fbd69e1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GenericSeededHarvestHandler.java @@ -1,138 +1,137 @@ -//package WayofTime.alchemicalWizardry.common.harvest; -// -//import java.util.List; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.state.IBlockState; -//import net.minecraft.entity.item.EntityItem; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import net.minecraft.util.BlockPos; -//import net.minecraft.world.World; -//import net.minecraftforge.common.IPlantable; -//import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; -//import cpw.mods.fml.common.registry.GameRegistry; -// -//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 int getHarvestMeta() -// { -// return harvestMeta; -// } -// -// @Override -// public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) -// { -// if (!this.canHandleBlock(block) || block.getMetaFromState(state) != this.getHarvestMeta()) -// { -// return false; -// } -// -// IPlantable seed = this.getSeedItem(block); -// -// if (seed == null) -// { -// world.destroyBlock(pos, true); -// -// return true; -// } else -// { -// int fortune = 0; -// -// List list = block.getDrops(world, pos, state, 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) -// { -// IBlockState plantState = seed.getPlant(world, pos); -// -// world.destroyBlock(pos, false); -// -// world.setBlockState(pos, plantState, 3); -// -// for (ItemStack stack : list) -// { -// EntityItem itemEnt = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack); -// -// world.spawnEntityInWorld(itemEnt); -// } -// } -// -// return false; -// } -// } -// -// public IPlantable getSeedItem(Block block) -// { -// return harvestSeed; -// } -//} +package WayofTime.alchemicalWizardry.common.harvest; + +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.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; + +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 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/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java index 911968d0..485005d4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java @@ -1,11 +1,9 @@ package WayofTime.alchemicalWizardry.common.harvest; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; 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 { @@ -15,13 +13,13 @@ public class GourdHarvestHandler implements IHarvestHandler } @Override - public boolean harvestAndPlant(World world, BlockPos pos, Block block, IBlockState state) + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) { if (!this.canHandleBlock(block)) { return false; } - world.destroyBlock(pos, true); + world.func_147480_a(xCoord, yCoord, zCoord, true); return true; } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java index d9b9244f..30b4df24 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/harvest/PamHarvestCompatRegistry.java @@ -1,125 +1,125 @@ -//package WayofTime.alchemicalWizardry.common.harvest; -// -//import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; -// -//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); -// -// 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); -// } -// } -//} +package WayofTime.alchemicalWizardry.common.harvest; + +import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; + +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); + + 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/src/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java new file mode 100644 index 00000000..2960e5ee --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java @@ -0,0 +1,45 @@ +package WayofTime.alchemicalWizardry.common.items; + +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 net.minecraft.util.StatCollector; + +import java.util.List; + +public class AWBaseItems extends Item +{ + public AWBaseItems() + { + super(); + setMaxStackSize(64); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + public void registerIcons(IIconRegister iconRegister) + { + if (this.equals(ModItems.blankSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSlate"); + } else if (this.equals(ModItems.reinforcedSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedSlate"); + } else if (this.equals(ModItems.imbuedSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InfusedSlate"); + } else if (this.equals(ModItems.demonicSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonSlate"); + } + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc1")); + par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc2")); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java index f38bce26..75354585 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java @@ -1,34 +1,51 @@ 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; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - import org.lwjgl.input.Keyboard; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import java.util.List; -public class ActivationCrystal extends BindableItems +public class ActivationCrystal extends EnergyItems { - private final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"weak", "awakened", "creative"}; + private static final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"Weak", "Awakened", "Creative"}; + + @SideOnly(Side.CLIENT) + private IIcon[] icons; public ActivationCrystal() { super(); this.maxStackSize = 1; setEnergyUsed(100); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.hasSubtypes = true; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + icons = new IIcon[ACTIVATION_CRYSTAL_NAMES.length]; + + for (int i = 0; i < ACTIVATION_CRYSTAL_NAMES.length; ++i) + { + icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "activationCrystal" + ACTIVATION_CRYSTAL_NAMES[i]); + } + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -85,7 +102,7 @@ public class ActivationCrystal extends BindableItems @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); return par1ItemStack; } @@ -99,7 +116,15 @@ public class ActivationCrystal extends BindableItems { //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, ACTIVATION_CRYSTAL_NAMES.length - 1); - return (getUnlocalizedName() + "_" + ACTIVATION_CRYSTAL_NAMES[meta]); + return ("" + "item.activationCrystal" + ACTIVATION_CRYSTAL_NAMES[meta]); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) + { + int j = MathHelper.clamp_int(meta, 0, ACTIVATION_CRYSTAL_NAMES.length - 1); + return icons[j]; } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java index 6934b94d..612ee865 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class AirScribeTool extends ScribeTool { public AirScribeTool() { super(4); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirScribeTool"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java index bef0d188..ac3aa56c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java @@ -1,10 +1,21 @@ package WayofTime.alchemicalWizardry.common.items; -public class ApprenticeBloodOrb extends Orb +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class ApprenticeBloodOrb extends EnergyBattery { public ApprenticeBloodOrb(int damage) { super(damage); orbLevel = 2; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ApprenticeBloodOrb"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java index 01a53cd3..065781e3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java @@ -1,10 +1,21 @@ package WayofTime.alchemicalWizardry.common.items; -public class ArchmageBloodOrb extends Orb +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class ArchmageBloodOrb extends EnergyBattery { public ArchmageBloodOrb(int damage) { super(damage); orbLevel = 5; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArchmageBloodOrb"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java index 5c9ffbd4..8c3fe83b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java @@ -1,98 +1,148 @@ 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.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -public class ArmourInhibitor extends BindableItems +import java.util.List; + +public class ArmourInhibitor extends EnergyItems { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + private int tickDelay = 200; + public ArmourInhibitor() { super(); this.maxStackSize = 1; setEnergyUsed(0); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1")); - list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2")); + par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1")); + par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2")); - if (!(stack.getTagCompound() == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (stack.getTagCompound().getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - list.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); + par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else { - list.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated")); + par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated")); } - list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName")); + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); } } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { - int tickDelay = 200; - - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) - { - return stack; - } + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated"); + } + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.getTagCompound() == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); if (tag.getBoolean("isActive")) { - stack.setItemDamage(1); - tag.setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % tickDelay); + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); } else { - stack.setItemDamage(stack.getMaxDamage()); + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); } - return stack; + return par1ItemStack; } @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (!(entity instanceof EntityPlayer)) + if (!(par3Entity instanceof EntityPlayer)) { return; } - EntityPlayer player = (EntityPlayer) entity; + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (stack.getTagCompound() == null) + if (par1ItemStack.getTagCompound() == null) { - stack.setTagCompound(new NBTTagCompound()); + par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (stack.getTagCompound().getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { -// if (world.getWorldTime() % tickDelay == stack.getTagCompound().getInteger("worldTimeDelay")) + if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) { } //TODO Do stuff - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0, true, false)); + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0)); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BaseItems.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BaseItems.java deleted file mode 100644 index 943734d1..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BaseItems.java +++ /dev/null @@ -1,23 +0,0 @@ -package WayofTime.alchemicalWizardry.common.items; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class BaseItems extends Item -{ - public BaseItems() - { - super(); - } - - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc1")); - par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc2")); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java index c0cbf1e6..885b7d07 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java @@ -1,89 +1,100 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellTable; +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; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -public class BlankSpell extends BindableItems +import java.util.List; + +public class BlankSpell extends EnergyItems { public BlankSpell() { super(); this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { - list.add(StatCollector.translateToLocal("tooltip.blankspell.desc")); + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSpell"); + } - if (!(stack.getTagCompound() == null)) + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add(StatCollector.translateToLocal("tooltip.blankspell.desc")); + + if (!(par1ItemStack.getTagCompound() == null)) { - NBTTagCompound itemTag = stack.getTagCompound(); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - if (!stack.getTagCompound().getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName")); + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); } - list.add(StatCollector.translateToLocal("tooltip.alchemy.coords") + " " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); - list.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(stack)); + par3List.add(StatCollector.translateToLocal("tooltip.alchemy.coords") + " " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack)); } } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!world.isRemote) + if (!par2World.isRemote) { - World newWorld = DimensionManager.getWorld(getDimensionID(stack)); + World world = DimensionManager.getWorld(getDimensionID(par1ItemStack)); - if (newWorld != null) + if (world != null) { - NBTTagCompound itemTag = stack.getTagCompound(); - TileEntity tileEntity = newWorld.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord"))); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); - if (tileEntity instanceof TESpellTable) + if (tileEntity instanceof TEHomHeart) { - TESpellTable homHeart = (TESpellTable) tileEntity; + TEHomHeart homHeart = (TEHomHeart) tileEntity; - if (homHeart.canCastSpell()) + if (homHeart.canCastSpell(par1ItemStack, par2World, par3EntityPlayer)) { - if(BindableItems.syphonBatteries(stack, player, homHeart.getCostForSpell())) + if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.getCostForSpell())) { - BindableItems.syphonBatteries(stack, player, homHeart.castSpell(stack, world, player)); + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.castSpell(par1ItemStack, par2World, par3EntityPlayer)); } } else { - return stack; + return par1ItemStack; } } else { - return stack; + return par1ItemStack; } } else { - return stack; + return par1ItemStack; } } else { - return stack; + return par1ItemStack; } - world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - return stack; + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + return par1ItemStack; } public int getDimensionID(ItemStack itemStack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java index 1c1adf9e..82d93df7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java @@ -1,17 +1,39 @@ package WayofTime.alchemicalWizardry.common.items; +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; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; public class BloodShard extends Item implements ArmourUpgrade { public BloodShard() { super(); + this.maxStackSize = 64; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + if (this.equals(ModItems.weakBloodShard)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBloodShard"); + return; + } + + if (this.equals(ModItems.demonBloodShard)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonBloodShard"); + } } public int getBloodShardLevel() @@ -28,7 +50,9 @@ public class BloodShard extends Item implements ArmourUpgrade } @Override - public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {} + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + } @Override public boolean isUpgrade() diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java index cbeefaef..bd32d14d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -1,10 +1,11 @@ package WayofTime.alchemicalWizardry.common.items; +import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -12,11 +13,11 @@ 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.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.common.ForgeHooks; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.common.ItemType; @@ -24,18 +25,26 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import com.google.common.collect.HashMultiset; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BoundAxe extends ItemAxe implements IBindable { public float efficiencyOnProperMaterial = 12.0F; public float damageVsEntity; + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int energyUsed; public BoundAxe() { super(AlchemicalWizardry.bloodBoundToolMaterial); - setMaxStackSize(1); + this.maxStackSize = 1; this.efficiencyOnProperMaterial = 12.0F; this.damageVsEntity = 5; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setEnergyUsed(5); } @@ -72,21 +81,54 @@ public class BoundAxe extends ItemAxe implements IBindable } @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World world, EntityPlayer par3EntityPlayer) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); - par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); return par1ItemStack; } - - if (world.isRemote) + + if (par2World.isRemote) { return par1ItemStack; } - if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(world, par3EntityPlayer)) + if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) + { + return par1ItemStack; + } + + if (AlchemicalWizardry.disableBoundToolsRightClick) { return par1ItemStack; } @@ -96,12 +138,15 @@ public class BoundAxe extends ItemAxe implements IBindable return par1ItemStack; } - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) { return par1ItemStack; } - BlockPos pos = par3EntityPlayer.getPosition(); + 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 fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); @@ -113,22 +158,21 @@ public class BoundAxe extends ItemAxe implements IBindable { for (int k = -5; k <= 5; k++) { - BlockPos newPos = pos.add(i, j, k); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = par2World.getBlock(posX + i, posY + j, posZ + k); + int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); if (block != null) { - float str = getStrVsBlock(par1ItemStack, block); + float str = func_150893_a(par1ItemStack, block); - if (str > 1.1f || block instanceof BlockLeavesBase && world.canMineBlockBody(par3EntityPlayer, newPos)) + if (str > 1.1f || block instanceof BlockLeavesBase && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) { - if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer)) + if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) { - dropMultiset.add(new ItemType(block, block.getMetaFromState(state))); + dropMultiset.add(new ItemType(block, meta)); } else { - List itemDropList = block.getDrops(world, newPos, state, fortuneLvl); + ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); if (itemDropList != null) { @@ -137,20 +181,20 @@ public class BoundAxe extends ItemAxe implements IBindable } } - world.setBlockToAir(newPos); + par2World.setBlockToAir(posX + i, posY + j, posZ + k); } } } } } - BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ()); + BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); return par1ItemStack; } @Override - public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { if (!(par3Entity instanceof EntityPlayer)) { @@ -163,11 +207,11 @@ public class BoundAxe extends ItemAxe implements IBindable { par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (world.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) { this.setActivated(par1ItemStack, false); } @@ -177,14 +221,28 @@ public class BoundAxe extends ItemAxe implements IBindable par1ItemStack.setItemDamage(0); } - public void setActivated(ItemStack stack, boolean newActivated) + public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - stack.setItemDamage(newActivated ? 1 : 0); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); } - public boolean getActivated(ItemStack stack) + public boolean getActivated(ItemStack par1ItemStack) { - return stack.getItemDamage() == 1; + if (!par1ItemStack.hasTagCompound()) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + return itemTag.getBoolean("isActive"); } /** @@ -192,17 +250,16 @@ public class BoundAxe extends ItemAxe implements IBindable * sword */ @Override - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { if (!getActivated(par1ItemStack)) { return 0.0F; } - return super.getStrVsBlock(par1ItemStack, par2Block); + return super.func_150893_a(par1ItemStack, par2Block); } - @Override /** * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * the damage on the stack. @@ -212,13 +269,13 @@ public class BoundAxe extends ItemAxe implements IBindable return getActivated(par1ItemStack); } - public boolean onBlockDestroyed(ItemStack par1ItemStack, World world, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { return true; } - @Override @SideOnly(Side.CLIENT) + /** * Returns True is the item is renderer in full 3D when hold. */ @@ -240,19 +297,19 @@ public class BoundAxe extends ItemAxe implements IBindable * FORGE: Overridden to allow custom tool effectiveness */ @Override - public float getDigSpeed(ItemStack stack, IBlockState state) + public float getDigSpeed(ItemStack stack, Block block, int meta) { if (!getActivated(stack)) { return 0.0F; } - for (String type : getToolClasses(stack)) + if (ForgeHooks.isToolEffective(stack, block, meta)) { - if (state.getBlock().isToolEffective(type, state)) - return efficiencyOnProperMaterial; + return efficiencyOnProperMaterial; } - return super.getDigSpeed(stack, state); + + return func_150893_a(stack, block); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java index 70d8bc36..cae100b1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -1,9 +1,10 @@ package WayofTime.alchemicalWizardry.common.items; +import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -12,11 +13,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.common.ForgeHooks; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.common.ItemType; @@ -25,19 +26,27 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BoundPickaxe extends ItemPickaxe implements IBindable { public float efficiencyOnProperMaterial = 12.0F; public float damageVsEntity; + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int energyUsed; public BoundPickaxe() { super(AlchemicalWizardry.bloodBoundToolMaterial); - setMaxStackSize(1); + this.maxStackSize = 1; this.efficiencyOnProperMaterial = 12.0F; this.damageVsEntity = 5; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setEnergyUsed(5); } @@ -52,14 +61,14 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable } @Override - public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc1")); par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc2")); - if (!(stack.getTagCompound() == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - if (stack.getTagCompound().getBoolean("isActive")) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -67,44 +76,80 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated")); } - if (!stack.getTagCompound().getString("ownerName").equals("")) + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) { - par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName")); + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); } } } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { - if (!BindableItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) { - this.setActivated(stack, !getActivated(stack)); - stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200); - return stack; - } - - if (world.isRemote) - { - return stack; + stack.setTagCompound(new NBTTagCompound()); } - if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer)) + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) { - return stack; + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + return par1ItemStack; + } + + if (par2World.isRemote) + { + return par1ItemStack; + } + + if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) + { + return par1ItemStack; + } + + if (AlchemicalWizardry.disableBoundToolsRightClick) + { + return par1ItemStack; } if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) { - return stack; + return par1ItemStack; } - if(!BindableItems.syphonBatteries(stack, par3EntityPlayer, 10000)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) { - return stack; + return par1ItemStack; } - BlockPos pos = par3EntityPlayer.getPosition(); + 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 fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); @@ -112,44 +157,43 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable for (int i = -5; i <= 5; i++) { - for (int j = 0; j <= 10; j++) + for (int j = -5; j <= 5; j++) { for (int k = -5; k <= 5; k++) { - BlockPos newPos = pos.add(i, j, k); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = par2World.getBlock(posX + i, posY + j, posZ + k); + int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); - if (block != null) + if (block != null && block.getBlockHardness(par2World, posX + i, posY + j, posZ + k) != -1) { - float str = getStrVsBlock(stack, block); + float str = func_150893_a(par1ItemStack, block); - if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos)) + if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) { - if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer)) + if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) { - dropMultiset.add(new ItemType(block, block.getMetaFromState(state))); + dropMultiset.add(new ItemType(block, meta)); } else { - List itemDropList = block.getDrops(world, newPos, state, fortuneLvl); + ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); if (itemDropList != null) { - for (ItemStack stacky : itemDropList) - dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize); + for (ItemStack stack : itemDropList) + dropMultiset.add(ItemType.fromStack(stack), stack.stackSize); } } - world.setBlockToAir(newPos); + par2World.setBlockToAir(posX + i, posY + j, posZ + k); } } } } } - BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ()); + dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); - return stack; + return par1ItemStack; } public static void dropMultisetStacks(Multiset dropMultiset, World world, double x, double y, double z) @@ -173,7 +217,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable } @Override - public void onUpdate(ItemStack stack, World world, Entity par3Entity, int par4, boolean par5) + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { if (!(par3Entity instanceof EntityPlayer)) { @@ -182,33 +226,47 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; - if (stack.getTagCompound() == null) + if (par1ItemStack.getTagCompound() == null) { - stack.setTagCompound(new NBTTagCompound()); + par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (world.getWorldTime() % 200 == stack.getTagCompound().getInteger("worldTimeDelay") && stack.getTagCompound().getBoolean("isActive")) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(stack, par3EntityPlayer, 20)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) { - this.setActivated(stack, false); + this.setActivated(par1ItemStack, false); } } } - stack.setItemDamage(0); + par1ItemStack.setItemDamage(0); } - public void setActivated(ItemStack stack, boolean newActivated) + public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - stack.setItemDamage(newActivated ? 1 : 0); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); } - public boolean getActivated(ItemStack stack) + public boolean getActivated(ItemStack par1ItemStack) { - return stack.getItemDamage() == 1; + if (!par1ItemStack.hasTagCompound()) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + return itemTag.getBoolean("isActive"); } /** @@ -216,23 +274,34 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable * sword */ @Override - public float getStrVsBlock(ItemStack stack, Block par2Block) //getStrVsBlock + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) //getStrVsBlock { - if (!getActivated(stack)) + if (!getActivated(par1ItemStack)) { return 0.0F; } - return super.getStrVsBlock(stack, par2Block); + return super.func_150893_a(par1ItemStack, par2Block); } /** * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * the damage on the stack. */ - public boolean hitEntity(ItemStack stack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { - return getActivated(stack); + return getActivated(par1ItemStack); + } + + @Override + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) + { + + if (par7EntityLivingBase instanceof EntityPlayer) + { + EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed()); + } + return true; } @SideOnly(Side.CLIENT) @@ -258,19 +327,19 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable * FORGE: Overridden to allow custom tool effectiveness */ @Override - public float getDigSpeed(ItemStack stack, IBlockState state) + public float getDigSpeed(ItemStack stack, Block block, int meta) { if (!getActivated(stack)) { return 0.0F; } - for (String type : getToolClasses(stack)) + if (ForgeHooks.isToolEffective(stack, block, meta)) { - if (state.getBlock().isToolEffective(type, state)) - return efficiencyOnProperMaterial; + return efficiencyOnProperMaterial; } - return super.getDigSpeed(stack, state); + + return func_150893_a(stack, block); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java index aaa46ea5..bd70d517 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -1,41 +1,54 @@ package WayofTime.alchemicalWizardry.common.items; +import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.common.ForgeHooks; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.common.ItemType; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import com.google.common.collect.HashMultiset; +import com.google.common.collect.Multimap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BoundShovel extends ItemSpade implements IBindable { public float efficiencyOnProperMaterial = 12.0F; public float damageVsEntity; + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + private int energyUsed; public BoundShovel() { super(AlchemicalWizardry.bloodBoundToolMaterial); - setMaxStackSize(1); + this.maxStackSize = 1; this.efficiencyOnProperMaterial = 12.0F; this.damageVsEntity = 5; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setEnergyUsed(5); } @@ -72,36 +85,72 @@ public class BoundShovel extends ItemSpade implements IBindable } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { - if (!BindableItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) { - this.setActivated(stack, !getActivated(stack)); - stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200); - return stack; - } - - if (world.isRemote) - { - return stack; + stack.setTagCompound(new NBTTagCompound()); } - if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer)) + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) { - return stack; + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + return par1ItemStack; + } + + if (par2World.isRemote) + { + return par1ItemStack; + } + + if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) + { + return par1ItemStack; + } + + if (AlchemicalWizardry.disableBoundToolsRightClick) + { + return par1ItemStack; } if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) { - return stack; + return par1ItemStack; } - if(!BindableItems.syphonBatteries(stack, par3EntityPlayer, 10000)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000)) { - return stack; + return par1ItemStack; } - BlockPos pos = par3EntityPlayer.getPosition(); + 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 fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer); @@ -113,40 +162,39 @@ public class BoundShovel extends ItemSpade implements IBindable { for (int k = -5; k <= 5; k++) { - BlockPos newPos = pos.add(i, j, k); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = par2World.getBlock(posX + i, posY + j, posZ + k); + int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); if (block != null) { - float str = getStrVsBlock(stack, block); + float str = func_150893_a(par1ItemStack, block); - if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos)) + if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) { - if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer)) + if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta)) { - dropMultiset.add(new ItemType(block, block.getMetaFromState(state))); + dropMultiset.add(new ItemType(block, meta)); } else { - List itemDropList = block.getDrops(world, newPos, state, fortuneLvl); + ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); if (itemDropList != null) { - for (ItemStack stacky : itemDropList) - dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize); + for (ItemStack stack : itemDropList) + dropMultiset.add(ItemType.fromStack(stack), stack.stackSize); } } - world.setBlockToAir(newPos); + par2World.setBlockToAir(posX + i, posY + j, posZ + k); } } } } } - BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ()); - - return stack; + BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ); + + return par1ItemStack; } @Override @@ -167,7 +215,7 @@ public class BoundShovel extends ItemSpade implements IBindable { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20)) { this.setActivated(par1ItemStack, false); } @@ -177,14 +225,28 @@ public class BoundShovel extends ItemSpade implements IBindable par1ItemStack.setItemDamage(0); } - public void setActivated(ItemStack stack, boolean newActivated) + public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - stack.setItemDamage(newActivated ? 1 : 0); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); } - public boolean getActivated(ItemStack stack) + public boolean getActivated(ItemStack par1ItemStack) { - return stack.getItemDamage() == 1; + if (!par1ItemStack.hasTagCompound()) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + return itemTag.getBoolean("isActive"); } /** @@ -192,14 +254,14 @@ public class BoundShovel extends ItemSpade implements IBindable * sword */ @Override - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { if (!getActivated(par1ItemStack)) { return 0.0F; } - return super.getStrVsBlock(par1ItemStack, par2Block); + return super.func_150893_a(par1ItemStack, par2Block); } /** @@ -234,23 +296,31 @@ public class BoundShovel extends ItemSpade implements IBindable return 30; } + @Override + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double) this.damageVsEntity, 0)); + return multimap; + } + /** * FORGE: Overridden to allow custom tool effectiveness */ @Override - public float getDigSpeed(ItemStack stack, IBlockState state) + public float getDigSpeed(ItemStack stack, Block block, int meta) { if (!getActivated(stack)) { return 0.0F; } - for (String type : getToolClasses(stack)) + if (ForgeHooks.isToolEffective(stack, block, meta)) { - if (state.getBlock().isToolEffective(type, state)) - return efficiencyOnProperMaterial; + return efficiencyOnProperMaterial; } - return super.getDigSpeed(stack, state); + + return func_150893_a(stack, block); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeOrb.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java similarity index 58% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeOrb.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java index 9fa2cb2c..29a842fa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeOrb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java @@ -1,27 +1,39 @@ 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.api.soulNetwork.SoulNetworkHandler; +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.EnumParticleTypes; +import net.minecraft.util.DamageSource; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; -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 CreativeOrb extends Item implements IBindable +import java.util.List; + +public class CheatyItem extends Item implements IBindable { - public CreativeOrb() + public CheatyItem() { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery"); } @Override @@ -41,7 +53,7 @@ public class CreativeOrb extends Item implements IBindable { World world = par3EntityPlayer.worldObj; - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer) { return par1ItemStack; } @@ -52,7 +64,7 @@ public class CreativeOrb extends Item implements IBindable double posY = par3EntityPlayer.posY; double posZ = par3EntityPlayer.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); - SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ); + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); } if (par3EntityPlayer.worldObj.isRemote) @@ -77,6 +89,54 @@ public class CreativeOrb extends Item implements IBindable return par1ItemStack; } + /* + * @return the damage that was not deducted + */ + public int damageItem(ItemStack par1ItemStack, int par2int) + { + if (par2int == 0) + { + return 0; + } + + int before = this.getDamage(par1ItemStack); + this.setDamage(par1ItemStack, this.getDamage(par1ItemStack) + par2int); + return par2int - (this.getDamage(par1ItemStack) - before); + } + + 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 = 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); + } + } + + if (!player.capabilities.isCreativeMode) + { + for (int i = 0; i < damage; i++) + { + player.setHealth((player.getHealth() - 1)); + } + } + + if (player.getHealth() <= 0) + { + player.inventory.dropAllItems(); + } + } + @Override public ItemStack getContainerItem(ItemStack itemStack) { @@ -113,6 +173,13 @@ public class CreativeOrb extends Item implements IBindable worldSave.setItemData(owner, data); } - return data.currentEssence; + int currentEssence = data.currentEssence; + return (currentEssence); + } + + @Override + public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) + { + return false; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java index f962d785..a3074d2a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java @@ -1,18 +1,17 @@ package WayofTime.alchemicalWizardry.common.items; +import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent; +import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler; import net.minecraft.entity.Entity; 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.BlockPos; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.FakePlayer; -import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent; -import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; @@ -21,7 +20,9 @@ public class CreativeDagger extends Item public CreativeDagger() { super(); + setTextureName("AlchemicalWizardry:SacrificialDagger"); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setFull3D(); } @@ -68,7 +69,7 @@ public class CreativeDagger extends Item for (int l = 0; l < 8; ++l) { - world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); } if (!world.isRemote && SpellHelper.isFakePlayer(world, player)) @@ -82,8 +83,10 @@ public class CreativeDagger extends Item public void findAndFillAltar(World world, EntityPlayer player, int amount) { - BlockPos pos = player.getPosition(); - IBloodAltar altarEntity = getAltar(world, pos); + int posX = (int) Math.round(player.posX - 0.5f); + int posY = (int) player.posY; + int posZ = (int) Math.round(player.posZ - 0.5f); + IBloodAltar altarEntity = getAltar(world, posX, posY, posZ); if (altarEntity == null) { @@ -94,7 +97,7 @@ public class CreativeDagger extends Item altarEntity.startCycle(); } - public IBloodAltar getAltar(World world, BlockPos pos) + public IBloodAltar getAltar(World world, int x, int y, int z) { TileEntity tileEntity; @@ -104,8 +107,7 @@ public class CreativeDagger extends Item { for (int k = -2; k <= 1; k++) { - BlockPos newPos = pos.add(i, j, k); - tileEntity = world.getTileEntity(newPos); + tileEntity = world.getTileEntity(i + x, k + y, j + z); if(tileEntity instanceof IBloodAltar) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java index 72140cd4..6e6c84d4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java @@ -1,10 +1,10 @@ package WayofTime.alchemicalWizardry.common.items; import java.util.List; -import java.util.UUID; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -17,28 +17,39 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.IDemon; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import com.google.common.collect.Multimap; -public class DaggerOfSacrifice extends BindableItems +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class DaggerOfSacrifice extends EnergyItems { public DaggerOfSacrifice() { super(); - setMaxStackSize(1); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setEnergyUsed(100); setFull3D(); setMaxDamage(100); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DaggerOfSacrifice"); + } + @Override public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { @@ -84,7 +95,7 @@ public class DaggerOfSacrifice extends BindableItems for (int i = 0; i < 8; i++) { - SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 1, posX, posY, posZ); + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ); } par2EntityLivingBase.setHealth(-1); @@ -107,7 +118,7 @@ public class DaggerOfSacrifice extends BindableItems } @Override - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { if (par2Block == Blocks.web) { @@ -126,17 +137,19 @@ public class DaggerOfSacrifice extends BindableItems } @Override - public Multimap getAttributeModifiers(ItemStack itemStack) + public Multimap getItemAttributeModifiers() { - Multimap multimap = super.getAttributeModifiers(itemStack); - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(4186465, 46565), "Tool modifier", 1.0d, 0)); + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", 1.0d, 0)); return multimap; } public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice) { - BlockPos pos = sacrifice.getPosition(); - IBloodAltar altarEntity = this.getAltar(world, pos); + int posX = (int) Math.round(sacrifice.posX - 0.5f); + int posY = (int) sacrifice.posY; + int posZ = (int) Math.round(sacrifice.posZ - 0.5f); + IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ); if (altarEntity == null) { @@ -150,8 +163,10 @@ public class DaggerOfSacrifice extends BindableItems public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount) { - BlockPos pos = sacrifice.getPosition(); - IBloodAltar altarEntity = this.getAltar(world, pos); + int posX = (int) Math.round(sacrifice.posX - 0.5f); + int posY = (int) sacrifice.posY; + int posZ = (int) Math.round(sacrifice.posZ - 0.5f); + IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ); if (altarEntity == null) { @@ -163,7 +178,7 @@ public class DaggerOfSacrifice extends BindableItems return true; } - public IBloodAltar getAltar(World world, BlockPos pos) + public IBloodAltar getAltar(World world, int x, int y, int z) { TileEntity tileEntity; @@ -173,8 +188,7 @@ public class DaggerOfSacrifice extends BindableItems { for (int k = -2; k <= 1; k++) { - BlockPos newPos = pos.add(i, j, k); - tileEntity = world.getTileEntity(newPos); + tileEntity = world.getTileEntity(i + x, k + y, j + z); if ((tileEntity instanceof IBloodAltar)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DawnScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DawnScribeTool.java index f54f5615..a0bda137 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DawnScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DawnScribeTool.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class DawnScribeTool extends ScribeTool { public DawnScribeTool() { super(6); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DawnScribeTool"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonCrystal.java deleted file mode 100644 index 504d7527..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonCrystal.java +++ /dev/null @@ -1,167 +0,0 @@ -package WayofTime.alchemicalWizardry.common.items; - -import java.util.List; - -import net.minecraft.block.BlockFence; -import net.minecraft.block.state.IBlockState; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; - -public class DemonCrystal extends Item -{ - public DemonCrystal() - { - super(); - this.setHasSubtypes(true); - this.setCreativeTab(CreativeTabs.tabMisc); - setMaxStackSize(1); - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) - { - if (world.isRemote) - { - return true; - } - else if (!playerIn.func_175151_a(pos.offset(side), side, stack)) - { - return false; - } - else - { - IBlockState iblockstate = world.getBlockState(pos); - - pos = pos.offset(side); - double d0 = 0.0D; - - if (side == EnumFacing.UP && iblockstate instanceof BlockFence) - { - d0 = 0.5D; - } - - String demonName = DemonCrystal.getDemonString(stack); - Entity entity = spawnCreature(world, demonName, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D, stack); - - if (entity != null) - { - if (entity instanceof EntityLivingBase && stack.hasDisplayName()) - { - entity.setCustomNameTag(stack.getDisplayName()); - } - - if (!playerIn.capabilities.isCreativeMode) - { - --stack.stackSize; - } - } - - return true; - } - } - - /** - * Spawns the creature specified by the egg's type in the location specified by the last three parameters. - * Parameters: world, entityID, x, y, z. - */ - public static Entity spawnCreature(World par0World, String par1, double par2, double par4, double par6, ItemStack itemStack) - { - Entity entity = null; - - for (int j = 0; j < 1; ++j) - { - entity = SummoningRegistry.getEntityWithID(par0World, par1); - - if (entity != null) - { - 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) - { - ((EntityDemon) entityliving).func_152115_b(DemonCrystal.getOwnerName(itemStack)); - - if (!DemonCrystal.getOwnerName(itemStack).equals("")) - { - ((EntityDemon) entityliving).setTamed(true); - } - } - - par0World.spawnEntityInWorld(entity); - entityliving.playLivingSound(); - } - } - return entity; - } - - public static void setOwnerName(ItemStack par1ItemStack, String ownerName) - { - if (par1ItemStack.getTagCompound() == null) - { - par1ItemStack.setTagCompound(new NBTTagCompound()); - } - - par1ItemStack.getTagCompound().setString("ownerName", ownerName); - } - - public static String getOwnerName(ItemStack par1ItemStack) - { - if (par1ItemStack.getTagCompound() == null) - { - par1ItemStack.setTagCompound(new NBTTagCompound()); - } - - return par1ItemStack.getTagCompound().getString("ownerName"); - } - - public static void setDemonString(ItemStack itemStack, String demonName) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - itemStack.getTagCompound().setString("demonName", demonName); - } - - public static String getDemonString(ItemStack itemStack) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - return itemStack.getTagCompound().getString("demonName"); - } - - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - par3List.add(StatCollector.translateToLocal("tooltip.demonplacer.desc")); - - if (!(par1ItemStack.getTagCompound() == null)) - { - if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) - { - par3List.add(StatCollector.translateToLocal("tooltip.owner.demonsowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); - } - } - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java new file mode 100644 index 00000000..eeafc65c --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java @@ -0,0 +1,247 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityList.EntityEggInfo; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class DemonPlacer extends Item +{ + public DemonPlacer() + { + super(); + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); + this.maxStackSize = 1; + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack par1ItemStack, int par2) + { + EntityEggInfo entityegginfo = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage())); + return entityegginfo != null ? (par2 == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + if (par3World.isRemote) + { + return true; + } else + { + Block i1 = par3World.getBlock(par4, par5, par6); + par4 += Facing.offsetsXForSide[par7]; + par5 += Facing.offsetsYForSide[par7]; + par6 += Facing.offsetsZForSide[par7]; + double d0 = 0.0D; + + if (par7 == 1 && i1 != null && i1.getRenderType() == 11) + { + d0 = 0.5D; + } + + String demonName = DemonPlacer.getDemonString(par1ItemStack); + Entity entity = spawnCreature(par3World, demonName, (double) par4 + 0.5D, (double) par5 + d0, (double) par6 + 0.5D, par1ItemStack); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) + { + ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName()); + } + + + + if (!par2EntityPlayer.capabilities.isCreativeMode) + { + --par1ItemStack.stackSize; + } + } + + return true; + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (par2World.isRemote) + { + return par1ItemStack; + } else + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); + + if (movingobjectposition == null) + { + return par1ItemStack; + } else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + if (par2World.getBlock(i, j, k).getMaterial() == Material.water) + { + String demonName = DemonPlacer.getDemonString(par1ItemStack); + Entity entity = spawnCreature(par2World, demonName, (double) i, (double) j, (double) k, par1ItemStack); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) + { + ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName()); + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + --par1ItemStack.stackSize; + } + } + } + } + + return par1ItemStack; + } + } + } + + /** + * Spawns the creature specified by the egg's type in the location specified by the last three parameters. + * Parameters: world, entityID, x, y, z. + */ + public static Entity spawnCreature(World par0World, String par1, double par2, double par4, double par6, ItemStack itemStack) + { + Entity entity = null; + + for (int j = 0; j < 1; ++j) + { + 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) + { + Entity owner = SpellHelper.getPlayerForUsername(DemonPlacer.getOwnerName(itemStack)); + if(owner != null) + { + ((EntityDemon) entityliving).func_152115_b(owner.getPersistentID().toString()); + + if (!DemonPlacer.getOwnerName(itemStack).equals("")) + { + ((EntityDemon) entityliving).setTamed(true); + } + } + } + + par0World.spawnEntityInWorld(entity); + entityliving.playLivingSound(); + } + } + return entity; + } + + public static void setOwnerName(ItemStack par1ItemStack, String ownerName) + { + if (par1ItemStack.getTagCompound() == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.getTagCompound().setString("ownerName", ownerName); + } + + public static String getOwnerName(ItemStack par1ItemStack) + { + if (par1ItemStack.getTagCompound() == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return par1ItemStack.getTagCompound().getString("ownerName"); + } + + public static void setDemonString(ItemStack itemStack, String demonName) + { + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.getTagCompound().setString("demonName", demonName); + } + + public static String getDemonString(ItemStack itemStack) + { + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return itemStack.getTagCompound().getString("demonName"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add(StatCollector.translateToLocal("tooltip.demonplacer.desc")); + + if (!(par1ItemStack.getTagCompound() == null)) + { + if (!par1ItemStack.getTagCompound().getString("ownerName").equals("")) + { + par3List.add(StatCollector.translateToLocal("tooltip.owner.demonsowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonPlacer"); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java index c4508bc1..799fc38e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java @@ -1,12 +1,15 @@ 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 net.minecraft.util.StatCollector; +import java.util.List; + public class DemonicTelepositionFocus extends TelepositionFocus { public DemonicTelepositionFocus() @@ -14,6 +17,13 @@ public class DemonicTelepositionFocus extends TelepositionFocus super(4); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonicTeleposerFocus"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java index 53db87f3..6de25769 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class DuskScribeTool extends ScribeTool { public DuskScribeTool() { super(5); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskScribeTool"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java index 9a33f1e8..824d3925 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class EarthScribeTool extends ScribeTool { public EarthScribeTool() { super(3); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthScribeTool"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/Orb.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java similarity index 83% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/Orb.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java index 42a6a3b1..3f12eb8e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/Orb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java @@ -1,35 +1,46 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - -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.EnumParticleTypes; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; 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.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.StatCollector; +import net.minecraft.world.World; -public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb +import java.util.List; + +public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBloodOrb { private int maxEssence; protected int orbLevel; - public Orb(int damage) + public EnergyBattery(int damage) { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); maxEssence = damage; orbLevel = 1; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -40,10 +51,9 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb } } - @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) { return par1ItemStack; } @@ -56,7 +66,7 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb double posY = par3EntityPlayer.posY; double posZ = par3EntityPlayer.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); - SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ); + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); } NBTTagCompound itemTag = par1ItemStack.getTagCompound(); @@ -81,7 +91,7 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb } SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence()); - BindableItems.hurtPlayer(par3EntityPlayer, 200); + EnergyItems.hurtPlayer(par3EntityPlayer, 200); return par1ItemStack; } @@ -115,7 +125,7 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb for (int l = 0; l < 8; ++l) { - world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); } } @@ -144,7 +154,9 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb } @Override - public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {} + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + } @Override public boolean isUpgrade() @@ -198,4 +210,10 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb return data.currentEssence; } + + @Override + public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) + { + return false; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java index 13b03ab3..c5fd3364 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java @@ -1,36 +1,74 @@ 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; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; -public class EnergyBazooka extends BindableItems +import java.util.List; + +public class EnergyBazooka extends EnergyItems { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int damage; public EnergyBazooka() { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setFull3D(); setMaxDamage(250); this.setEnergyUsed(20000); damage = 12; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { final int maxDelay = 150; - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); @@ -98,7 +136,7 @@ public class EnergyBazooka extends BindableItems { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50)) { this.setActivated(par1ItemStack, false); } @@ -130,14 +168,28 @@ public class EnergyBazooka extends BindableItems } } - public void setActivated(ItemStack stack, boolean newActivated) + public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - stack.setItemDamage(newActivated ? 1 : 0); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); } - public boolean getActivated(ItemStack stack) + public boolean getActivated(ItemStack par1ItemStack) { - return stack.getItemDamage() == 1; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); } public void setDelay(ItemStack par1ItemStack, int newDelay) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlaster.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java similarity index 67% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlaster.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java index 6f896545..03023a79 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlaster.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java @@ -1,35 +1,74 @@ 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; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; -public class EnergyBlaster extends BindableItems +import java.util.List; + +public class EnergyBlast extends EnergyItems { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int damage; - public EnergyBlaster() + public EnergyBlast() { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setUnlocalizedName("energyBlaster"); setFull3D(); setMaxDamage(250); this.setEnergyUsed(150); damage = 12; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { final int maxDelay = 15; - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); @@ -89,7 +128,7 @@ public class EnergyBlaster extends BindableItems { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50)) { this.setActivated(par1ItemStack, false); } @@ -123,14 +162,28 @@ public class EnergyBlaster extends BindableItems } } - public void setActivated(ItemStack stack, boolean newActivated) + public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - stack.setItemDamage(newActivated ? 1 : 0); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); } - public boolean getActivated(ItemStack stack) + public boolean getActivated(ItemStack par1ItemStack) { - return stack.getItemDamage() == 1; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); } public void setDelay(ItemStack par1ItemStack, int newDelay) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BindableItems.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java similarity index 87% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/BindableItems.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java index c0d1bcb8..4b0cecaa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BindableItems.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java @@ -1,5 +1,6 @@ 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; @@ -10,17 +11,16 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; -public class BindableItems extends Item implements IBindable +public class EnergyItems extends Item implements IBindable { private int energyUsed; - public BindableItems() + public EnergyItems() { super(); - setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } protected void setEnergyUsed(int par1int) @@ -47,7 +47,7 @@ public class BindableItems extends Item implements IBindable float f3 = f * f * 0.6F - 0.7F; for (int l = 0; l < 8; ++l) { - world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + 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++) @@ -76,7 +76,7 @@ public class BindableItems extends Item implements IBindable double posY = player.posY; double posZ = player.posZ; - SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ); + 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); } } @@ -115,7 +115,6 @@ public class BindableItems extends Item implements IBindable return false; } - @Deprecated public static boolean canSyphonInContainer(ItemStack ist, int damageToBeDone) { if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) @@ -174,7 +173,6 @@ public class BindableItems extends Item implements IBindable } } - @Deprecated public static boolean syphonAndDamageWhileInContainer(ItemStack ist, EntityPlayer player, int damageToBeDone) { if (!syphonWhileInContainer(ist, damageToBeDone)) @@ -224,6 +222,35 @@ public class BindableItems extends Item implements IBindable return item.getTagCompound().getString("ownerName"); } + @Deprecated + public static void drainPlayerNetwork(EntityPlayer player, int damageToBeDone) + { + String ownerName = SpellHelper.getUsername(player); + + if (MinecraftServer.getServer() == null) + { + return; + } + + 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 (data.currentEssence >= damageToBeDone) + { + data.currentEssence -= damageToBeDone; + data.markDirty(); + } else + { + hurtPlayer(player, damageToBeDone); + } + } + @Deprecated public static int getCurrentEssence(String ownerName) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundBlade.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java similarity index 67% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/BoundBlade.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java index 90ab85e9..65477341 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundBlade.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java @@ -4,6 +4,7 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -13,20 +14,28 @@ import net.minecraft.item.ItemSword; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class BoundBlade extends ItemSword +public class EnergySword extends ItemSword { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int energyUsed; - public BoundBlade() + public EnergySword() { super(AlchemicalWizardry.bloodBoundToolMaterial); - setMaxStackSize(1); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setEnergyUsed(50); setFull3D(); setMaxDamage(100); @@ -41,6 +50,34 @@ public class BoundBlade extends ItemSword { return this.energyUsed; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } private OmegaParadigm getOmegaParadigmOfWeilder(EntityPlayer player) { @@ -71,7 +108,7 @@ public class BoundBlade extends ItemSword { if (par3EntityLivingBase instanceof EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase) || !BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed())) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase) || !EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed())) { return false; } @@ -84,7 +121,8 @@ public class BoundBlade extends ItemSword @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer); + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); @@ -124,7 +162,7 @@ public class BoundBlade extends ItemSword { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50)) { this.setActivated(par1ItemStack, false); } @@ -134,14 +172,28 @@ public class BoundBlade extends ItemSword par1ItemStack.setItemDamage(0); } - public void setActivated(ItemStack stack, boolean newActivated) + public void setActivated(ItemStack par1ItemStack, boolean newActivated) { - stack.setItemDamage(newActivated ? 1 : 0); + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); } - public boolean getActivated(ItemStack stack) + public boolean getActivated(ItemStack par1ItemStack) { - return stack.getItemDamage() == 1; + NBTTagCompound itemTag = par1ItemStack.getTagCompound(); + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); } public float func_82803_g() @@ -173,7 +225,7 @@ public class BoundBlade extends ItemSword } @Override - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { if (par2Block == Blocks.web) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java index 2b4d1a42..165ecda3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java @@ -1,12 +1,15 @@ 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 net.minecraft.util.StatCollector; +import java.util.List; + public class EnhancedTelepositionFocus extends TelepositionFocus { public EnhancedTelepositionFocus() @@ -14,6 +17,13 @@ public class EnhancedTelepositionFocus extends TelepositionFocus super(2); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedTeleposerFocus"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java index 204cb63e..67420fc2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class FireScribeTool extends ScribeTool { public FireScribeTool() { super(2); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:FireScribeTool"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java index 92019075..bb60ec62 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemAlchemyBase.java @@ -1,32 +1,50 @@ 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; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - import org.lwjgl.input.Keyboard; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import java.util.List; public class ItemAlchemyBase extends Item { - private final String[] ITEM_NAMES = new String[]{"offensa", "praesidium", "orbis_terrae", "strengthened_catalyst", "concentrated_catalyst", "fractured_bone", "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; public ItemAlchemyBase() { super(); + this.maxStackSize = 64; + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.hasSubtypes = true; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + icons = new IIcon[ITEM_NAMES.length]; + + for (int i = 0; i < ITEM_NAMES.length; ++i) + { + icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseAlchemyItem" + ITEM_NAMES[i]); + } + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -64,7 +82,15 @@ public class ItemAlchemyBase extends Item public String getUnlocalizedName(ItemStack itemStack) { int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ITEM_NAMES.length - 1); - return (getUnlocalizedName() + "." + ITEM_NAMES[meta]); + return ("" + "item.bloodMagicAlchemyItem." + ITEM_NAMES[meta]); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) + { + int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1); + return icons[j]; } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java index 790362e5..b6452305 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBlockCrystalBelljar.java @@ -3,14 +3,11 @@ package WayofTime.alchemicalWizardry.common.items; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; @@ -27,7 +24,6 @@ public class ItemBlockCrystalBelljar extends ItemBlock this.setMaxStackSize(16); } - @Override public int getMetadata(int par1) { return par1; @@ -81,14 +77,17 @@ public class ItemBlockCrystalBelljar extends ItemBlock } @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { - if (!world.setBlockState(pos, newState, 3)) return false; - - IBlockState state = world.getBlockState(pos); - if (state.getBlock() == this.block) + if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) { - this.block.onBlockPlacedBy(world, pos, state, player, stack); + return false; + } + + if (world.getBlock(x, y, z) == field_150939_a) + { + field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack); + field_150939_a.onPostBlockPlaced(world, x, y, z, metadata); } return true; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java index fa709bfa..dc5354c8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodLetterPack.java @@ -2,23 +2,30 @@ package WayofTime.alchemicalWizardry.common.items; 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.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.IAltarManipulator; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAltarManipulator -{ +{ + @SideOnly(Side.CLIENT) + private IIcon plateIcon; + public int conversionRate = 100; //LP / half heart public float activationPoint = 0.5f; public int tickRate = 20; @@ -27,6 +34,14 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl public ItemBloodLetterPack() { super(ArmorMaterial.CHAIN, 0, 1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodPack"); } @Override @@ -39,6 +54,12 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl par3List.add(StatCollector.translateToLocal("tooltip.lp.storedlp") + " " + this.getStoredLP(par1ItemStack)); } } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + return this.plateIcon; + } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) @@ -63,9 +84,11 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos pos = movingobjectposition.func_178782_a(); + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - TileEntity tile = world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(x, y, z); if (!(tile instanceof TEAltar)) { @@ -83,7 +106,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl amount -= filledAmount; this.setStoredLP(itemStack, amount); - world.markBlockForUpdate(pos); + world.markBlockForUpdate(x, y, z); } } } @@ -138,7 +161,10 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl } @Override - public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {} + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + + } @Override public boolean isUpgrade() diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java index 00f46b90..7932014c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java @@ -10,9 +10,9 @@ public class ItemBloodRuneBlock extends ItemBlock { super(block); setHasSubtypes(true); + } - @Override public String getUnlocalizedName(ItemStack itemstack) { String name; @@ -20,12 +20,16 @@ public class ItemBloodRuneBlock extends ItemBlock switch (itemstack.getItemDamage()) { case 0: + { name = "blank"; break; + } case 1: + { name = "fill"; break; + } case 2: name = "empty"; @@ -50,7 +54,6 @@ public class ItemBloodRuneBlock extends ItemBlock return getUnlocalizedName() + "." + name; } - @Override public int getMetadata(int par1) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java index 81550c21..3798a1c7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java @@ -1,23 +1,34 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; +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.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.StatCollector; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; -public class ItemComplexSpellCrystal extends BindableItems +import java.util.List; + +public class ItemComplexSpellCrystal extends EnergyItems { public ItemComplexSpellCrystal() { super(); - setMaxStackSize(1); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ComplexCrystal"); } @Override @@ -42,7 +53,7 @@ public class ItemComplexSpellCrystal extends BindableItems @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -54,7 +65,7 @@ public class ItemComplexSpellCrystal extends BindableItems if (world != null) { NBTTagCompound itemTag = par1ItemStack.getTagCompound(); - TileEntity tileEntity = world.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord"))); + TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); if (tileEntity instanceof TESpellParadigmBlock) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComponents.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComponents.java index 78fd031c..4175c955 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComponents.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemComponents.java @@ -1,26 +1,46 @@ 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.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.List; public class ItemComponents extends Item { - private final String[] ITEM_NAMES = new String[]{"quartz_rod", "empty_core", "magicales_cable", "wood_brace", "stone_brace", "projectile_core", "self_core", "melee_core", "paradigm_back_plate", "output_cable", "flame_core", "icy_core", "gust_core", "earthen_core", "input_cable", "cracked_runic_plate", "runic_plate", "scribed_runic_plate", "default_core", "offensive_core", "defensive_core", "environmental_core", "power_core", "cost_core", "potency_core", "obsidian_brace", "tool_core", "ethereal_slate", "life_shard", "soul_shard", "soul_runic_plate", "life_brace", "ender_shard"}; + private static final String[] ITEM_NAMES = new String[]{"QuartzRod", "EmptyCore", "MagicalesCable", "WoodBrace", "StoneBrace", "ProjectileCore", "SelfCore", "MeleeCore", "ParadigmBackPlate", "OutputCable", "FlameCore", "IcyCore", "GustCore", "EarthenCore", "InputCable", "CrackedRunicPlate", "RunicPlate", "ScribedRunicPlate", "DefaultCore", "OffensiveCore", "DefensiveCore", "EnvironmentalCore", "PowerCore", "CostCore", "PotencyCore", "ObsidianBrace", "ToolCore", "EtherealSlate", "LifeShard", "SoulShard", "SoulRunicPlate", "LifeBrace", "EnderShard"}; + + @SideOnly(Side.CLIENT) + private IIcon[] icons; public ItemComponents() { super(); + this.maxStackSize = 64; + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.hasSubtypes = true; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + icons = new IIcon[ITEM_NAMES.length]; + + for (int i = 0; i < ITEM_NAMES.length; ++i) + { + icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseItem" + ITEM_NAMES[i]); + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { @@ -32,7 +52,15 @@ public class ItemComponents extends Item { //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 (getUnlocalizedName() + "." + ITEM_NAMES[meta]); + return ("" + "item.bloodMagicBaseItem." + ITEM_NAMES[meta]); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) + { + int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1); + return icons[j]; } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemCrystalBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemCrystalBlock.java index 8b496da3..75c7ae92 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemCrystalBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemCrystalBlock.java @@ -10,9 +10,9 @@ public class ItemCrystalBlock extends ItemBlock { super(par1); setHasSubtypes(true); + } - @Override public String getUnlocalizedName(ItemStack itemstack) { String name; @@ -20,12 +20,16 @@ public class ItemCrystalBlock extends ItemBlock switch (itemstack.getItemDamage()) { case 0: + { name = "fullCrystal"; break; + } case 1: + { name = "crystalBrick"; break; + } default: name = "broken"; @@ -34,7 +38,6 @@ public class ItemCrystalBlock extends ItemBlock return getUnlocalizedName() + "." + name; } - @Override public int getMetadata(int par1) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/KeyOfBinding.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java similarity index 76% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/KeyOfBinding.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java index 16c07641..3b9c33fb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/KeyOfBinding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java @@ -1,7 +1,12 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +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.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -11,22 +16,27 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -public class KeyOfBinding extends BindableItems +import java.util.List; + +public class ItemDiabloKey extends EnergyItems { - public KeyOfBinding() + public ItemDiabloKey() { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.setEnergyUsed(1000); this.hasSubtypes = true; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DiabloKey"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -40,7 +50,7 @@ public class KeyOfBinding extends BindableItems public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { World world = par3EntityPlayer.worldObj; - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP) { return par1ItemStack; } @@ -51,7 +61,7 @@ public class KeyOfBinding extends BindableItems double posY = par3EntityPlayer.posY; double posZ = par3EntityPlayer.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); - SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ); + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); } if (!par3EntityPlayer.worldObj.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class))) @@ -83,14 +93,14 @@ public class KeyOfBinding extends BindableItems Item item = itemStack.getItem(); - if (item instanceof KeyOfBinding) + if (item instanceof ItemDiabloKey) { continue; } if (item instanceof IBindable) { - BindableItems.checkAndSetItemOwner(itemStack, ownerName); + EnergyItems.checkAndSetItemOwner(itemStack, ownerName); } } @@ -103,7 +113,7 @@ public class KeyOfBinding extends BindableItems { list.add(new ItemStack(ModItems.itemKeyOfDiablo)); ItemStack boundKey = new ItemStack(ModItems.itemKeyOfDiablo); - BindableItems.checkAndSetItemOwner(boundKey, "Server-wide Soul Network"); + EnergyItems.checkAndSetItemOwner(boundKey, "Server-wide Soul Network"); list.add(boundKey); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java index 3b1063e1..4dfc459b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemEnchantmentGlyphBlock.java @@ -19,16 +19,16 @@ public class ItemEnchantmentGlyphBlock extends ItemBlock switch (itemstack.getItemDamage()) { - case 0: - name = "enchantability"; - break; + case 0: + name = "enchantability"; + break; - case 1: - name = "enchantmentLevel"; - break; + case 1: + name = "enchantmentLevel"; + break; - default: - name = "broken"; + default: + name = "broken"; } return getUnlocalizedName() + "." + name; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemIncense.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemIncense.java index 2e48ba20..f906c402 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemIncense.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemIncense.java @@ -2,32 +2,60 @@ package WayofTime.alchemicalWizardry.common.items; import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; -import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; import WayofTime.alchemicalWizardry.api.sacrifice.IIncense; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemIncense extends Item implements IIncense { - private final String[] ITEM_NAMES = new String[]{"wood_ash", "byrrus", "livens", "viridis", "purpura"}; + private static final String[] ITEM_NAMES = new String[]{"Woodash", "Byrrus", "Livens", "Viridis", "Purpura"}; + + @SideOnly(Side.CLIENT) + private IIcon[] icons; public ItemIncense() { super(); + this.maxStackSize = 64; + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.hasSubtypes = true; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + icons = new IIcon[ITEM_NAMES.length]; + + IIcon baseIcon = iconRegister.registerIcon("AlchemicalWizardry:" + "baseIncenseItem"); + + for (int i = 0; i < ITEM_NAMES.length; ++i) + { + if(this.doesIncenseHaveUniqueTexture(i)) + { + icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseIncenseItem" + ITEM_NAMES[i]); + }else + { + icons[i] = baseIcon; + } + } + } + @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { @@ -38,7 +66,15 @@ public class ItemIncense extends Item implements IIncense public String getUnlocalizedName(ItemStack itemStack) { int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ITEM_NAMES.length - 1); - return (getUnlocalizedName() + "." + ITEM_NAMES[meta]); + return ("" + "item.bloodMagicIncenseItem." + ITEM_NAMES[meta]); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) + { + int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1); + return icons[j]; } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemMailOrderCatalogue.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemMailOrderCatalogue.java index e2916f15..2e2e07e7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemMailOrderCatalogue.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemMailOrderCatalogue.java @@ -1,19 +1,30 @@ package WayofTime.alchemicalWizardry.common.items; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.entity.mob.MailOrderEntityItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemMailOrderCatalogue extends Item { public ItemMailOrderCatalogue() { super(); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MailOrder"); + } + @Override public boolean hasCustomEntity(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java index a62bb184..d1ca42ce 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java @@ -1,26 +1,37 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.Rituals; -import WayofTime.alchemicalWizardry.common.block.BlockRitualStone; +import WayofTime.alchemicalWizardry.common.block.RitualStone; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; -public class ItemRitualDismantler extends BindableItems +import java.util.List; + +public class ItemRitualDismantler extends EnergyItems { public ItemRitualDismantler() { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ritual_dismantler"); } @Override @@ -32,60 +43,48 @@ public class ItemRitualDismantler extends BindableItems } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { - return BindableItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, pos); + return EnergyItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, x, y, z); } - public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos) + public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z) { - ItemStack[] playerInventory = player.inventory.mainInventory; - TileEntity tileEntity = world.getTileEntity(pos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof TEMasterStone) { TEMasterStone masterStone = (TEMasterStone) tileEntity; int direction = masterStone.getDirection(); - int freeSpace = -1; - List ritualList = Rituals.getRitualList(masterStone.getCurrentRitual()); + String ritualName = Rituals.checkValidRitual(world, x, y, z); + List ritualList = Rituals.getRitualList(ritualName); if (ritualList == null) { return false; } - for (int i = 0; i < playerInventory.length; i++) - { - if (playerInventory[i] == null) - { - freeSpace = i; - break; - } - } - for (RitualComponent rc : ritualList) { - BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction)); - if (!world.isAirBlock(newPos) && world.getBlockState(newPos).getBlock() instanceof BlockRitualStone) + if (!world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) && world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) instanceof RitualStone) { - if (freeSpace >= 0) + if (EnergyItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode) { - if (BindableItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode) + world.setBlockToAir(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); + EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, new ItemStack(ModBlocks.ritualStone)); + if (world.isRemote) { - world.setBlockToAir(newPos); - player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.ritualStone)); - if (world.isRemote) - { - world.playAuxSFX(2005, pos.offsetUp(), 0); - - return true; - } + world.playAuxSFX(2005, x, y + 1, z, 0); + } + else + { + world.spawnEntityInWorld(entityItem); } - - return true; } } } + + return true; } return false; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java index f34e5283..4f6b419c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.items; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -12,18 +12,15 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.input.Keyboard; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.items.interfaces.IRitualDiviner; @@ -32,20 +29,30 @@ import WayofTime.alchemicalWizardry.api.rituals.IRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class ItemRitualDiviner extends BindableItems implements IRitualDiviner +public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner { private int maxMetaData; public ItemRitualDiviner() { super(); - setMaxStackSize(1); + this.maxStackSize = 1; setEnergyUsed(100); - setMaxDamage(4); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.maxMetaData = 4; this.hasSubtypes = true; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:RitualDiviner"); + } + @Override public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x) { @@ -159,15 +166,15 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { - if (!BindableItems.checkAndSetItemOwner(stack, player)) return false; + if (!EnergyItems.checkAndSetItemOwner(stack, player)) return false; - if(placeRitualStoneAtMasterStone(stack, player, world, pos)) + if(placeRitualStoneAtMasterStone(stack, player, world, x, y, z)) { - this.setStoredLocation(stack, new Int3(pos)); + this.setStoredLocation(stack, new Int3(x, y, z)); return true; - }else if(!(world.getBlockState(pos).getBlock() instanceof IRitualStone || world.getBlockState(pos).getBlock() instanceof IMasterRitualStone) && !player.isSneaking()) + }else if(!(world.getBlock(x, y, z) instanceof IRitualStone || world.getBlock(x, y, z) instanceof IMasterRitualStone) && !player.isSneaking()) { if(world.isRemote) { @@ -181,12 +188,12 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner return false; } - public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos) + public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z) { int direction = this.getDirection(stack); ItemStack[] playerInventory = player.inventory.mainInventory; - TileEntity tileEntity = world.getTileEntity(pos); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof TEMasterStone) { @@ -214,15 +221,13 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner for (RitualComponent rc : ritualList) { - BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction)); - - if (world.isAirBlock(newPos)) + if (world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction))) { if (playerInvRitualStoneLocation >= 0 || player.capabilities.isCreativeMode) { if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack)) { - world.playAuxSFX(200, newPos.offsetUp(), 0); + world.playAuxSFX(200, x, y + 1, z, 0); return true; } @@ -231,13 +236,13 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner player.inventory.decrStackSize(playerInvRitualStoneLocation, 1); } - if(BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { - world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3); + world.setBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), ModBlocks.ritualStone, rc.getStoneType(), 3); if (world.isRemote) { - world.playAuxSFX(2005, newPos.offsetUp(), 0); + world.playAuxSFX(2005, x, y + 1, z, 0); return true; } @@ -247,29 +252,29 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner } } else { - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); if (block == ModBlocks.ritualStone) { - int metadata = block.getMetaFromState(state); + int metadata = world.getBlockMetadata(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)); + if (metadata != rc.getStoneType()) { - if(BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack)) { - world.playAuxSFX(200, newPos.offsetUp(), 0); + world.playAuxSFX(200, x, y + 1, z, 0); return true; } - world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3); + world.setBlockMetadataWithNotify(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), rc.getStoneType(), 3); return true; } } } else { - world.playAuxSFX(0, newPos.offsetUp(), 0); + world.playAuxSFX(0, x, y + 1, z, 0); return true; } } @@ -290,7 +295,7 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner int y = loc.yCoord; int z = loc.zCoord; - if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, new BlockPos(x, y, z))) + if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, x, y, z)) { this.voidStoredLocation(stack); } @@ -359,7 +364,7 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner @Override public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(stack, par3EntityPlayer) && par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(stack, par3EntityPlayer) && par3EntityPlayer.isSneaking()) { rotateRituals(par2World,par3EntityPlayer, stack, true); } @@ -374,7 +379,7 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner { EntityPlayer player = (EntityPlayer) entityLiving; - if (!BindableItems.checkAndSetItemOwner(stack, player)) return true; + if (!EnergyItems.checkAndSetItemOwner(stack,player)) return true; if (!player.isSwingInProgress) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java index 8a33e9af..e9ec4502 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java @@ -12,7 +12,6 @@ public class ItemSpellEffectBlock extends ItemBlock setHasSubtypes(true); } - @Override public String getUnlocalizedName(ItemStack itemstack) { String name; @@ -20,12 +19,16 @@ public class ItemSpellEffectBlock extends ItemBlock switch (itemstack.getItemDamage()) { case 0: + { name = "fire"; break; + } case 1: + { name = "ice"; break; + } case 2: name = "wind"; @@ -42,7 +45,6 @@ public class ItemSpellEffectBlock extends ItemBlock return getUnlocalizedName() + "." + name; } - @Override public int getMetadata(int par1) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java index 0e121a16..5c515c3f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java @@ -10,9 +10,9 @@ public class ItemSpellEnhancementBlock extends ItemBlock { super(par1); setHasSubtypes(true); + } - @Override public String getUnlocalizedName(ItemStack itemstack) { String name; @@ -86,7 +86,6 @@ public class ItemSpellEnhancementBlock extends ItemBlock return getUnlocalizedName() + "." + name; } - @Override public int getMetadata(int par1) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java index 99cfebc6..44e02d7b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java @@ -10,9 +10,9 @@ public class ItemSpellModifierBlock extends ItemBlock { super(par1); setHasSubtypes(true); + } - @Override public String getUnlocalizedName(ItemStack itemstack) { String name; @@ -20,12 +20,16 @@ public class ItemSpellModifierBlock extends ItemBlock switch (itemstack.getItemDamage()) { case 0: + { name = "default"; break; + } case 1: + { name = "offensive"; break; + } case 2: name = "defensive"; @@ -42,7 +46,6 @@ public class ItemSpellModifierBlock extends ItemBlock return getUnlocalizedName() + "." + name; } - @Override public int getMetadata(int par1) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java index 1868c9dc..2984cdb7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java @@ -20,12 +20,16 @@ public class ItemSpellParadigmBlock extends ItemBlock switch (itemstack.getItemDamage()) { case 0: + { name = "projectile"; break; + } case 1: + { name = "self"; break; + } case 2: name = "melee"; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java index 45a0b90a..289fe3ec 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemStabilityGlyphBlock.java @@ -19,12 +19,12 @@ public class ItemStabilityGlyphBlock extends ItemBlock switch (itemstack.getItemDamage()) { - case 0: - name = "stability1"; - break; + case 0: + name = "stability1"; + break; - default: - name = "broken"; + default: + name = "broken"; } return getUnlocalizedName() + "." + name; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java index 5cac4a71..eec96479 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java @@ -2,44 +2,61 @@ 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.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import net.minecraft.world.WorldProvider; +import net.minecraftforge.common.DimensionManager; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class LavaCrystal extends BindableItems +public class LavaCrystal extends EnergyItems { public LavaCrystal() { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setUnlocalizedName("lavaCrystal"); setEnergyUsed(25); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaCrystal"); + } + /* * Used to have the item contain itself. */ @Override public ItemStack getContainerItem(ItemStack itemStack) { - SoulNetworkHandler.syphonFromNetwork(itemStack, this.getEnergyUsed()); - ItemStack copiedStack = itemStack.copy(); - copiedStack.setItemDamage(copiedStack.getItemDamage()); - copiedStack.stackSize = 1; - return copiedStack; + { + syphonWhileInContainer(itemStack, this.getEnergyUsed()); + ItemStack copiedStack = itemStack.copy(); + copiedStack.setItemDamage(copiedStack.getItemDamage()); + copiedStack.stackSize = 1; + return copiedStack; + } } @Override - public boolean hasContainerItem(ItemStack itemStack) + public boolean hasContainerItem() { return true; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); return par1ItemStack; } @@ -66,7 +83,22 @@ public class LavaCrystal extends BindableItems return false; } - if (SoulNetworkHandler.getCurrentEssence(ownerName) >= this.getEnergyUsed()) +// World world = MinecraftServer.getServer().worldServers[0]; + WorldProvider provider = DimensionManager.getProvider(0); + if(provider == null || provider.worldObj == null) + { + return false; + } + World world = provider.worldObj; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + if (data.currentEssence >= this.getEnergyUsed()) { return true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java index 7a19f8bd..daaec1d1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java @@ -1,6 +1,9 @@ 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; public class LifeBucket extends ItemBucket @@ -9,4 +12,11 @@ public class LifeBucket extends ItemBucket { super(block); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LifeBucket"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java index 26795324..737760e4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java @@ -1,10 +1,21 @@ package WayofTime.alchemicalWizardry.common.items; -public class MagicianBloodOrb extends Orb +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class MagicianBloodOrb extends EnergyBattery { public MagicianBloodOrb(int damage) { super(damage); orbLevel = 3; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MagicianBloodOrb"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java index f7b15ab0..e82a160d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java @@ -1,10 +1,21 @@ package WayofTime.alchemicalWizardry.common.items; -public class MasterBloodOrb extends Orb +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class MasterBloodOrb extends EnergyBattery { public MasterBloodOrb(int damage) { super(damage); orbLevel = 4; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterBloodOrb"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java new file mode 100644 index 00000000..4cd07069 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java @@ -0,0 +1,45 @@ +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; + +public class OrbOfTesting extends EnergyItems +{ + public OrbOfTesting() + { + super(); + setMaxStackSize(1); + setCreativeTab(CreativeTabs.tabMisc); + setUnlocalizedName("orbOfTesting"); + setMaxDamage(100); + setFull3D(); + this.setEnergyUsed(100); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Untitled"); + } + + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!par3EntityPlayer.shouldHeal()) + { + return par1ItemStack; + } + + if (syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed())) + { + par3EntityPlayer.heal(1); + } + + return par1ItemStack; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java index 90c5f01d..8d83eb3f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java @@ -1,12 +1,15 @@ 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 net.minecraft.util.StatCollector; +import java.util.List; + public class ReinforcedTelepositionFocus extends TelepositionFocus { public ReinforcedTelepositionFocus() @@ -14,6 +17,13 @@ public class ReinforcedTelepositionFocus extends TelepositionFocus super(3); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedTeleposerFocus"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java index 2ad4253e..b40ee311 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java @@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items; 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.EnumAction; @@ -9,30 +10,42 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent; import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class SacrificialDagger extends Item { public SacrificialDagger() { super(); - setMaxStackSize(1); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setFull3D(); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + if (AlchemicalWizardry.wimpySettings) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } else + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SacrificialDagger"); + } + } + @Override public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -72,7 +85,7 @@ public class SacrificialDagger extends Item @Override public EnumAction getItemUseAction(ItemStack stack) { - return EnumAction.BOW; + return EnumAction.bow; } @Override @@ -119,7 +132,7 @@ public class SacrificialDagger extends Item for (int l = 0; l < 8; ++l) { - world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); } if (!world.isRemote && SpellHelper.isFakePlayer(world, player)) @@ -145,8 +158,10 @@ public class SacrificialDagger extends Item public void findAndFillAltar(World world, EntityPlayer player, int amount) { - BlockPos pos = player.getPosition(); - IBloodAltar altarEntity = getAltar(world, pos); + int posX = (int) Math.round(player.posX - 0.5f); + int posY = (int) player.posY; + int posZ = (int) Math.round(player.posZ - 0.5f); + IBloodAltar altarEntity = getAltar(world, posX, posY, posZ); if (altarEntity == null) { @@ -157,7 +172,7 @@ public class SacrificialDagger extends Item altarEntity.startCycle(); } - public IBloodAltar getAltar(World world, BlockPos pos) + public IBloodAltar getAltar(World world, int x, int y, int z) { TileEntity tileEntity; @@ -167,8 +182,7 @@ public class SacrificialDagger extends Item { for (int k = -2; k <= 1; k++) { - BlockPos newPos = pos.add(i, j, k); - tileEntity = world.getTileEntity(newPos); + tileEntity = world.getTileEntity(i + x, k + y, j + z); if(tileEntity instanceof IBloodAltar) { @@ -226,8 +240,8 @@ public class SacrificialDagger extends Item @Override @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack stack) + public boolean hasEffect(ItemStack stack, int pass) { - return this.canUseForSacrifice(stack) || super.hasEffect(stack); + return this.canUseForSacrifice(stack) || super.hasEffect(stack, pass); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java index 57fd29fc..7714e676 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.items; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; @@ -7,7 +8,7 @@ import net.minecraft.world.World; import java.util.List; -public class ScribeTool extends BindableItems +public class ScribeTool extends EnergyItems { private int meta; @@ -15,6 +16,7 @@ public class ScribeTool extends BindableItems { super(); setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); setMaxDamage(10); setEnergyUsed(10); this.meta = inkType; @@ -34,7 +36,7 @@ public class ScribeTool extends BindableItems @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) { if (par1ItemStack.getItemDamage() > 0) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java index 503643e0..11fdbdf9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java @@ -1,17 +1,19 @@ 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.util.BlockPos; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -public class TelepositionFocus extends BindableItems +import java.util.List; + +public class TelepositionFocus extends EnergyItems { private int focusLevel; @@ -23,6 +25,13 @@ public class TelepositionFocus extends BindableItems this.focusLevel = focusLevel; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TeleposerFocus"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { @@ -45,7 +54,7 @@ public class TelepositionFocus extends BindableItems @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) { if (par3EntityPlayer.isSneaking()) { @@ -102,11 +111,6 @@ public class TelepositionFocus extends BindableItems return 0; } } - - public BlockPos getBlockPos(ItemStack stack) - { - return new BlockPos(xCoord(stack), yCoord(stack), zCoord(stack)); - } public int getFocusLevel() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/TranscendentBloodOrb.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/TranscendentBloodOrb.java index d8535662..ecab2b21 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/TranscendentBloodOrb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/TranscendentBloodOrb.java @@ -1,10 +1,21 @@ package WayofTime.alchemicalWizardry.common.items; -public class TranscendentBloodOrb extends Orb +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class TranscendentBloodOrb extends EnergyBattery { public TranscendentBloodOrb(int damage) { super(damage); orbLevel = 6; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TranscendentBloodOrb"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java index 06d18615..bec61005 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java @@ -1,9 +1,22 @@ package WayofTime.alchemicalWizardry.common.items; +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 { public WaterScribeTool() { super(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterScribeTool"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java index b26cccab..dd609433 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/BoundArmour.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.List; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -13,29 +14,40 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.potion.Potion; import net.minecraft.util.DamageSource; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fml.common.Optional; -import net.minecraftforge.fml.common.Optional.Interface; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +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.api.items.interfaces.ILPGauge; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination; 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, ILPGauge//, IRevealer, IGoggles, IRunicArmor +public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor, ILPGauge { private static int invSize = 9; @SideOnly(Side.CLIENT) + private IIcon helmetIcon; + @SideOnly(Side.CLIENT) + private IIcon plateIcon; + @SideOnly(Side.CLIENT) + private IIcon leggingsIcon; + @SideOnly(Side.CLIENT) + private IIcon bootsIcon; public static boolean tryComplexRendering = true; @@ -43,6 +55,13 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA { super(ItemArmor.ArmorMaterial.GOLD, 0, armorType); setMaxDamage(1000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public boolean isItemTool(ItemStack stack) + { + return false; } ModelBiped model1 = null; @@ -95,10 +114,10 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) { EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction(); - if (enumaction == EnumAction.BLOCK) + if (enumaction == EnumAction.block) { this.model.heldItemRight = 3; - } else if (enumaction == EnumAction.BOW) + } else if (enumaction == EnumAction.bow) { this.model.aimedBow = true; } @@ -114,6 +133,44 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundHelmet"); + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPlate"); + this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundLeggings"); + this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (this.equals(ModItems.boundHelmet)) + { + return this.helmetIcon; + } + + if (this.equals(ModItems.boundPlate)) + { + return this.plateIcon; + } + + if (this.equals(ModItems.boundLeggings)) + { + return this.leggingsIcon; + } + + if (this.equals(ModItems.boundBoots)) + { + return this.bootsIcon; + } + + return this.itemIcon; + } + @Override public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { @@ -138,7 +195,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - double armourReduction; + double armourReduction = 0.0; int f = 0; int h = 0; @@ -208,7 +265,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA return 3; } - if (armor.getItem() == ModItems.boundChestplate) + if (armor.getItem() == ModItems.boundPlate) { return 8; } @@ -231,7 +288,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA { if (entity instanceof EntityPlayer) { - BindableItems.checkAndSetItemOwner(stack, (EntityPlayer) entity); + EnergyItems.checkAndSetItemOwner(stack, (EntityPlayer) entity); if (((EntityPlayer) entity).capabilities.isCreativeMode) { @@ -283,7 +340,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA { if (this.getIsInvisible(stack)) { - if (this == ModItems.boundHelmet || this == ModItems.boundChestplate || this == ModItems.boundBoots) + if (this == ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots) { return "alchemicalwizardry:models/armor/boundArmour_invisible_layer_1.png"; } @@ -295,7 +352,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA } } - if (this == ModItems.boundHelmet || this == ModItems.boundChestplate || this == ModItems.boundBoots) + if (this == ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots) { return "alchemicalwizardry:models/armor/boundArmour_layer_1.png"; } @@ -312,7 +369,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer); } @@ -338,11 +395,11 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA { if (itemStack.getItemDamage() > 0) { - BindableItems.checkAndSetItemOwner(itemStack, player); + EnergyItems.checkAndSetItemOwner(itemStack, player); if (!player.capabilities.isCreativeMode) { - if(BindableItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75)) + if(EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75)) { itemStack.setItemDamage(0); } @@ -379,7 +436,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA { if (getUpgradeCostMultiplier(par1ItemStack) > 0.02f) { - BindableItems.syphonBatteries(par1ItemStack, par3Entity, (int) (((ArmourUpgrade) inv[i].getItem()).getEnergyForTenSeconds() * getUpgradeCostMultiplier(par1ItemStack))); + EnergyItems.syphonBatteries(par1ItemStack, par3Entity, (int) (((ArmourUpgrade) inv[i].getItem()).getEnergyForTenSeconds() * getUpgradeCostMultiplier(par1ItemStack))); } } } @@ -441,6 +498,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA if (nextItem == null) { candidateSlot = i; + continue; } } @@ -541,66 +599,66 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA return false; } -// @Optional.Method(modid = "Thaumcraft") -// public boolean hasIRevealer(ItemStack itemStack) -// { -// ItemStack[] inv = getInternalInventory(itemStack); -// -// if (inv == null) -// { -// return false; -// } -// -// for (ItemStack item : inv) -// { -// if (item == null) -// { -// continue; -// } -// -// if (item.getItem() instanceof IRevealer) -// { -// return true; -// } -// } -// -// return false; -// } -// -// @Optional.Method(modid = "Thaumcraft") -// public boolean hasIGoggles(ItemStack itemStack) -// { -// ItemStack[] inv = getInternalInventory(itemStack); -// -// if (inv == null) -// { -// return false; -// } -// -// int blood = getMaxBloodShardLevel(itemStack); -// -// for (ItemStack item : inv) -// { -// if (item == null) -// { -// continue; -// } -// if (item.getItem() instanceof ArmourUpgrade && blood > 0) -// { -// if (item.getItem() instanceof IGoggles) -// { -// return true; -// } -// -// if(((ArmourUpgrade)item.getItem()).isUpgrade()) -// { -// blood--; -// } -// } -// } -// -// return false; -// } + @Optional.Method(modid = "Thaumcraft") + public boolean hasIRevealer(ItemStack itemStack) + { + ItemStack[] inv = getInternalInventory(itemStack); + + if (inv == null) + { + return false; + } + + for (ItemStack item : inv) + { + if (item == null) + { + continue; + } + + if (item.getItem() instanceof IRevealer) + { + return true; + } + } + + return false; + } + + @Optional.Method(modid = "Thaumcraft") + public boolean hasIGoggles(ItemStack itemStack) + { + ItemStack[] inv = getInternalInventory(itemStack); + + if (inv == null) + { + return false; + } + + int blood = getMaxBloodShardLevel(itemStack); + + for (ItemStack item : inv) + { + if (item == null) + { + continue; + } + if (item.getItem() instanceof ArmourUpgrade && blood > 0) + { + if (item.getItem() instanceof IGoggles) + { + return true; + } + + if(((ArmourUpgrade)item.getItem()).isUpgrade()) + { + blood--; + } + } + } + + return false; + } @Override public boolean canSeeLPBar(ItemStack itemStack) @@ -730,75 +788,75 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA tag.setBoolean("invisible", invisible); } -// @Override -// @Optional.Method(modid = "Thaumcraft") -// public boolean showNodes(ItemStack itemstack, EntityLivingBase player) -// { -// return this.hasIRevealer(itemstack); -// } -// -// @Override -// @Optional.Method(modid = "Thaumcraft") -// public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) -// { -// 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 boolean showNodes(ItemStack itemstack, EntityLivingBase player) + { + return this.hasIRevealer(itemstack); + } + + @Override + @Optional.Method(modid = "Thaumcraft") + public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) + { + 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 public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java index 14d756b0..1b726b44 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmour.java @@ -20,16 +20,15 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class OmegaArmour extends BoundArmour { @@ -40,7 +39,7 @@ public abstract class OmegaArmour extends BoundArmour protected boolean storeYLevel = false; protected boolean storeSeesSky = false; - protected List illegalEnchantmentList = new LinkedList(); + protected List illegalEnchantmentList = new LinkedList(); public float reagentDrainPerDamage = 0.1f; @@ -91,9 +90,10 @@ public abstract class OmegaArmour extends BoundArmour { if(this.storeBiomeID()) { - BlockPos pos = player.getPosition(); + int xCoord = (int) Math.floor(player.posX); + int zCoord = (int) Math.floor(player.posZ); - BiomeGenBase biome = world.getBiomeGenForCoords(pos); + BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); if(biome != null) { this.setBiomeIDStored(itemStack, biome.biomeID); @@ -102,7 +102,7 @@ public abstract class OmegaArmour extends BoundArmour if(this.storeDimensionID()) { - this.setDimensionIDStored(itemStack, world.provider.getDimensionId()); + this.setDimensionIDStored(itemStack, world.provider.dimensionId); } if(this.storeYLevel()) @@ -129,7 +129,7 @@ public abstract class OmegaArmour extends BoundArmour { if (!player.capabilities.isCreativeMode) { - if(BindableItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75)) + if(EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75)) { float reagentAmount = APISpellHelper.getPlayerCurrentReagentAmount(player); @@ -176,7 +176,7 @@ public abstract class OmegaArmour extends BoundArmour } } - Map> map = new HashMap>(); + Map> map = new HashMap(); for(Object obj : enchantList) { @@ -184,7 +184,7 @@ public abstract class OmegaArmour extends BoundArmour if(!map.containsKey(enchantmentdata.enchantmentobj)) { - map.put(enchantmentdata.enchantmentobj, new HashMap()); + map.put(enchantmentdata.enchantmentobj, new HashMap()); } Map numMap = map.get(enchantmentdata.enchantmentobj); @@ -308,8 +308,9 @@ public abstract class OmegaArmour extends BoundArmour } NBTTagCompound tag = omegaTag.getCompoundTag("armour"); - - return ItemStack.loadItemStackFromNBT(tag); + ItemStack armourStack = ItemStack.loadItemStackFromNBT(tag); + + return armourStack; } @Override @@ -375,10 +376,10 @@ public abstract class OmegaArmour extends BoundArmour if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) { EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction(); - if (enumaction == EnumAction.BLOCK) + if (enumaction == EnumAction.block) { this.model.heldItemRight = 3; - } else if (enumaction == EnumAction.BOW) + } else if (enumaction == EnumAction.bow) { this.model.aimedBow = true; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java index 41545359..a60bd254 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourEarth.java @@ -3,19 +3,32 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.UUID; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraft.util.IIcon; +import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class OmegaArmourEarth extends OmegaArmour -{ +{ + @SideOnly(Side.CLIENT) + private IIcon helmetIcon; + @SideOnly(Side.CLIENT) + private IIcon plateIcon; + @SideOnly(Side.CLIENT) + private IIcon leggingsIcon; + @SideOnly(Side.CLIENT) + private IIcon bootsIcon; + public OmegaArmourEarth(int armorType) { super(armorType); @@ -42,6 +55,44 @@ public class OmegaArmourEarth extends OmegaArmour return new ModelOmegaEarth(0.5f, false, false, true, false); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_earth"); + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_earth"); + this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_earth"); + this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_earth"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (this.equals(ModItems.boundHelmetEarth)) + { + return this.helmetIcon; + } + + if (this.equals(ModItems.boundPlateEarth)) + { + return this.plateIcon; + } + + if (this.equals(ModItems.boundLeggingsEarth)) + { + return this.leggingsIcon; + } + + if (this.equals(ModItems.boundBootsEarth)) + { + return this.bootsIcon; + } + + return this.itemIcon; + } + @Override public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java index eabc089b..2f9d6825 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourFire.java @@ -2,22 +2,34 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.UUID; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class OmegaArmourFire extends OmegaArmour -{ +{ + @SideOnly(Side.CLIENT) + private IIcon helmetIcon; + @SideOnly(Side.CLIENT) + private IIcon plateIcon; + @SideOnly(Side.CLIENT) + private IIcon leggingsIcon; + @SideOnly(Side.CLIENT) + private IIcon bootsIcon; + public OmegaArmourFire(int armorType) { super(armorType); @@ -45,6 +57,44 @@ public class OmegaArmourFire extends OmegaArmour return new ModelOmegaFire(0.5f, false, false, true, false); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_fire"); + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_fire"); + this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_fire"); + this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_fire"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (this.equals(ModItems.boundHelmetFire)) + { + return this.helmetIcon; + } + + if (this.equals(ModItems.boundPlateFire)) + { + return this.plateIcon; + } + + if (this.equals(ModItems.boundLeggingsFire)) + { + return this.leggingsIcon; + } + + if (this.equals(ModItems.boundBootsFire)) + { + return this.bootsIcon; + } + + return this.itemIcon; + } + @Override public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java index 0ef14b4f..6afb527a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWater.java @@ -2,21 +2,33 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.UUID; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + +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; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWater; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; - public class OmegaArmourWater extends OmegaArmour -{ +{ + @SideOnly(Side.CLIENT) + private IIcon helmetIcon; + @SideOnly(Side.CLIENT) + private IIcon plateIcon; + @SideOnly(Side.CLIENT) + private IIcon leggingsIcon; + @SideOnly(Side.CLIENT) + private IIcon bootsIcon; + public OmegaArmourWater(int armorType) { super(armorType); @@ -43,6 +55,44 @@ public class OmegaArmourWater extends OmegaArmour return new ModelOmegaWater(0.5f, false, false, true, false); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_water"); + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_water"); + this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_water"); + this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_water"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (this.equals(ModItems.boundHelmetWater)) + { + return this.helmetIcon; + } + + if (this.equals(ModItems.boundPlateWater)) + { + return this.plateIcon; + } + + if (this.equals(ModItems.boundLeggingsWater)) + { + return this.leggingsIcon; + } + + if (this.equals(ModItems.boundBootsWater)) + { + return this.bootsIcon; + } + + return this.itemIcon; + } + @Override public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java index 47408e50..1048d1c4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/armour/OmegaArmourWind.java @@ -3,19 +3,32 @@ package WayofTime.alchemicalWizardry.common.items.armour; import java.util.UUID; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraft.util.IIcon; +import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class OmegaArmourWind extends OmegaArmour -{ +{ + @SideOnly(Side.CLIENT) + private IIcon helmetIcon; + @SideOnly(Side.CLIENT) + private IIcon plateIcon; + @SideOnly(Side.CLIENT) + private IIcon leggingsIcon; + @SideOnly(Side.CLIENT) + private IIcon bootsIcon; + public OmegaArmourWind(int armorType) { super(armorType); @@ -42,6 +55,44 @@ public class OmegaArmourWind extends OmegaArmour return new ModelOmegaWind(0.5f, false, false, true, false); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_wind"); + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_wind"); + this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_wind"); + this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_wind"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (this.equals(ModItems.boundHelmetWind)) + { + return this.helmetIcon; + } + + if (this.equals(ModItems.boundPlateWind)) + { + return this.plateIcon; + } + + if (this.equals(ModItems.boundLeggingsWind)) + { + return this.leggingsIcon; + } + + if (this.equals(ModItems.boundBootsWind)) + { + return this.bootsIcon; + } + + return this.itemIcon; + } + @Override public Multimap getAttributeModifiers(ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalRouter.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java similarity index 78% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalRouter.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java index eaa27a2b..a583a0ee 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalRouter.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java @@ -1,36 +1,42 @@ package WayofTime.alchemicalWizardry.common.items.energy; -import java.util.LinkedList; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.Int3; +import WayofTime.alchemicalWizardry.api.alchemy.energy.*; +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; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.Int3; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.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.tileEntity.TEReagentConduit; +import net.minecraftforge.common.util.ForgeDirection; -public class AlchemicalRouter extends Item implements IReagentManipulator +import java.util.LinkedList; +import java.util.List; + +public class ItemAttunedCrystal extends Item implements IReagentManipulator { - public AlchemicalRouter() + public static final int maxDistance = 6; + + public IIcon crystalBody; + public IIcon crystalLabel; + + public ItemAttunedCrystal() { super(); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.hasSubtypes = true; - setMaxStackSize(1); + this.maxStackSize = 1; } @Override @@ -72,6 +78,62 @@ public class AlchemicalRouter extends Item implements IReagentManipulator } } + @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 public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { @@ -95,9 +157,11 @@ public class AlchemicalRouter extends Item implements IReagentManipulator { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos pos = movingobjectposition.func_178782_a(); + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - TileEntity tile = world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(x, y, z); if (!(tile instanceof IReagentHandler)) { @@ -108,10 +172,10 @@ public class AlchemicalRouter extends Item implements IReagentManipulator if (player.isSneaking()) { - ReagentContainerInfo[] infos = relay.getContainerInfo(EnumFacing.UP); + ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN); if (infos != null) { - List reagentList = new LinkedList(); + List reagentList = new LinkedList(); for (ReagentContainerInfo info : infos) { if (info != null) @@ -159,15 +223,13 @@ public class AlchemicalRouter extends Item implements IReagentManipulator return itemStack; } - final int maxDistance = 6; - - if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - pos.getX()) > maxDistance || Math.abs(coords.yCoord - pos.getY()) > maxDistance || Math.abs(coords.zCoord - pos.getZ()) > maxDistance) + 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 ChatComponentTranslation("message.attunedcrystal.error.toofar")); return itemStack; } - TileEntity pastTile = world.getTileEntity(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord)); + TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); if (!(pastTile instanceof TEReagentConduit)) { player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind")); @@ -185,10 +247,10 @@ public class AlchemicalRouter extends Item implements IReagentManipulator if (player.isSneaking()) { - pastRelay.removeReagentDestinationViaActual(reagent, pos); + pastRelay.removeReagentDestinationViaActual(reagent, x, y, z); } else { - if (pastRelay.addReagentDestinationViaActual(reagent, pos)) + if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) { player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name)); } else @@ -196,13 +258,13 @@ public class AlchemicalRouter extends Item implements IReagentManipulator player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noconnections")); } } - world.markBlockForUpdate(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord)); + world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord); } else { - int dimension = world.provider.getDimensionId(); + int dimension = world.provider.dimensionId; this.setDimension(itemStack, dimension); - this.setCoordinates(itemStack, new Int3(pos)); + this.setCoordinates(itemStack, new Int3(x, y, z)); player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking")); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalCleanser.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java similarity index 69% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalCleanser.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java index 985a8f23..d4642a7f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalCleanser.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java @@ -1,25 +1,36 @@ 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; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator; -import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit; -public class AlchemicalCleanser extends Item implements IReagentManipulator +import java.util.List; + +public class ItemDestinationClearer extends Item implements IReagentManipulator { - public AlchemicalCleanser() + public ItemDestinationClearer() { super(); - setMaxStackSize(1); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.maxStackSize = 1; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TankClearer"); } @Override @@ -46,9 +57,11 @@ public class AlchemicalCleanser extends Item implements IReagentManipulator { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos pos = movingobjectposition.func_178782_a(); + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - TileEntity tile = world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(x, y, z); if (!(tile instanceof TEReagentConduit)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalSegmenter.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java similarity index 74% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalSegmenter.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java index fe20f238..83bbbd6b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/AlchemicalSegmenter.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemTankSegmenter.java @@ -1,33 +1,39 @@ 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; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -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 net.minecraftforge.common.util.ForgeDirection; -public class AlchemicalSegmenter extends Item implements IReagentManipulator +import java.util.LinkedList; +import java.util.List; + +public class ItemTankSegmenter extends Item implements IReagentManipulator { - public AlchemicalSegmenter() + @SideOnly(Side.CLIENT) + public IIcon crystalBody; + @SideOnly(Side.CLIENT) + public IIcon crystalLabel; + + public ItemTankSegmenter() { super(); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); this.hasSubtypes = true; - setMaxStackSize(1); + this.maxStackSize = 1; } @Override @@ -58,6 +64,62 @@ public class AlchemicalSegmenter extends Item implements IReagentManipulator } } + @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 public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { @@ -74,8 +136,10 @@ public class AlchemicalSegmenter extends Item implements IReagentManipulator { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos pos = movingobjectposition.func_178782_a(); - TileEntity tile = world.getTileEntity(pos); + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; + TileEntity tile = world.getTileEntity(x, y, z); if (!(tile instanceof ISegmentedReagentHandler)) { return itemStack; @@ -84,7 +148,7 @@ public class AlchemicalSegmenter extends Item implements IReagentManipulator if (player.isSneaking()) { - ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(EnumFacing.UP); + ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN); if (infos != null) { List reagentList = new LinkedList(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java index 8acc4636..1a10f2da 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java @@ -1,145 +1,145 @@ -//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.util.StatCollector; -//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 forestry.api.apiculture.IBee; -//import forestry.api.apiculture.IBeeGenome; -//import forestry.api.apiculture.IBeeHousing; -//import forestry.api.apiculture.IHiveFrame; -// -//public class ItemBloodFrame extends EnergyItems implements IHiveFrame -//{ -// public ItemBloodFrame() -// { -// super(); -// this.maxStackSize = 1; -// this.setMaxDamage(10); -// setEnergyUsed(1000); -// setCreativeTab(AlchemicalWizardry.tabBloodMagic); -// } -// -// @Override -// public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) -// { -// par3List.add(StatCollector.translateToLocal("tooltip.bloodframe.desc")); -// -// if (!(par1ItemStack.getTagCompound() == null)) -// { -// par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); -// } -// } -// -// @Override -// @SideOnly(Side.CLIENT) -// public void registerIcons(IIconRegister iconRegister) -// { -// this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame"); -// } -// -// @Override -// public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) -// { -// if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) -// { -// if (par1ItemStack.getItemDamage() > 0) -// { -// if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) -// { -// par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); -// } -// } -// } -// return par1ItemStack; -// } -// -// @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 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 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 boolean isSealed() -// { -// // 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 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; -// } -// -// } -// -// -// -//} +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.util.StatCollector; +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 forestry.api.apiculture.IBee; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IHiveFrame; + +public class ItemBloodFrame extends EnergyItems implements IHiveFrame +{ + public ItemBloodFrame() + { + super(); + this.maxStackSize = 1; + this.setMaxDamage(10); + setEnergyUsed(1000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add(StatCollector.translateToLocal("tooltip.bloodframe.desc")); + + if (!(par1ItemStack.getTagCompound() == null)) + { + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame"); + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) + { + if (par1ItemStack.getItemDamage() > 0) + { + if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); + } + } + } + return par1ItemStack; + } + + @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 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 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 boolean isSealed() + { + // 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 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; + } + + } + + + +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java index 013a085a..27ac77f7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java @@ -1,11 +1,11 @@ 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; import net.minecraft.entity.ai.attributes.IAttribute; @@ -23,24 +23,35 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper; -import com.google.common.collect.HashMultimap; +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 { public AlchemyFlask() { super(); - setMaxDamage(8); - setMaxStackSize(1); + this.setMaxDamage(8); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:PotionFlask"); } public static ArrayList getEffects(ItemStack par1ItemStack) { if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomFlaskEffects")) { - ArrayList arraylist = new ArrayList(); + ArrayList arraylist = new ArrayList(); NBTTagList nbttaglist = par1ItemStack.getTagCompound().getTagList("CustomFlaskEffects", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < nbttaglist.tagCount(); ++i) @@ -61,7 +72,7 @@ public class AlchemyFlask extends Item if (list != null) { - ArrayList newList = new ArrayList(); + ArrayList newList = new ArrayList(); for (AlchemyPotionHelper aph : list) { @@ -138,10 +149,10 @@ public class AlchemyFlask extends Item { if (this.isPotionThrowable(par1ItemStack)) { - return EnumAction.NONE; + return EnumAction.none; } - return EnumAction.DRINK; + return EnumAction.drink; } /** @@ -272,7 +283,7 @@ public class AlchemyFlask extends Item PotionEffect potioneffect = (PotionEffect) iterator.next(); String s = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; - Map map = potion.getAttributeModifierMap(); + Map map = potion.func_111186_k(); if (map != null && map.size() > 0) { @@ -282,7 +293,7 @@ public class AlchemyFlask extends Item { Entry entry = (Entry) iterator1.next(); AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); - AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.getAttributeModifierAmount(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation()); + AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.func_111183_a(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation()); hashmultimap.put(((IAttribute) entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1); } } @@ -334,11 +345,11 @@ public class AlchemyFlask extends Item if (d0 > 0.0D) { - par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); + par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); } else if (d0 < 0.0D) { d1 *= -1.0D; - par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); + par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java index fe205e3d..4f7caa72 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java @@ -1,23 +1,82 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +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.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; - import org.lwjgl.input.Keyboard; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import java.util.List; public class AlchemyReagent extends Item { public AlchemyReagent() { super(); - setMaxStackSize(64); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setMaxStackSize(64); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + if (this == ModItems.incendium) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Incendium"); + return; + } + if (this == ModItems.magicales) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Magicales"); + return; + } + if (this == ModItems.sanctus) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Sanctus"); + return; + } + if (this == ModItems.aether) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aether"); + return; + } + if (this == ModItems.simpleCatalyst) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleCatalyst"); + return; + } + if (this == ModItems.crepitous) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crepitous"); + return; + } + if (this == ModItems.crystallos) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crystallos"); + return; + } + if (this == ModItems.terrae) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Terrae"); + return; + } + if (this == ModItems.aquasalus) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aquasalus"); + return; + } + if (this == ModItems.tennebrae) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Tennebrae"); + } } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java index 594fce54..eb7885dd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class AverageLengtheningCatalyst extends LengtheningCatalyst { public AverageLengtheningCatalyst() { super(2); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AverageLengtheningCatalyst"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java index 8f6143b4..1fb50aec 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class AveragePowerCatalyst extends PowerCatalyst { public AveragePowerCatalyst() { super(2); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AveragePowerCatalyst"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java index d61144f7..071d7c9b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/CombinationalCatalyst.java @@ -1,12 +1,24 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import net.minecraft.item.Item; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.Item; public class CombinationalCatalyst extends Item implements ICombinationalCatalyst { public CombinationalCatalyst() { super(); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CombinationalCatalyst"); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java index 4a870991..b4026634 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java @@ -1,10 +1,16 @@ package WayofTime.alchemicalWizardry.common.items.potion; +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 EnhancedFillingAgent extends WeakFillingAgent { public EnhancedFillingAgent() { super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -35,4 +41,11 @@ public class EnhancedFillingAgent extends WeakFillingAgent } return 0; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedFillingAgent"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java index f0e63816..32d0e599 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class GreaterLengtheningCatalyst extends LengtheningCatalyst { public GreaterLengtheningCatalyst() { super(3); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterLengtheningCatalyst"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java index 779d4d76..56dbe73f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class GreaterPowerCatalyst extends PowerCatalyst { public GreaterPowerCatalyst() { super(3); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterPowerCatalyst"); + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java index 66bf2586..628ff26e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.common.ICatalyst; import net.minecraft.entity.player.EntityPlayer; @@ -18,6 +19,7 @@ public class LengtheningCatalyst extends Item implements ICatalyst public LengtheningCatalyst(int catalystStrength) { this.catalystStrength = catalystStrength; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java index aa78b151..581a4575 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class MundaneLengtheningCatalyst extends LengtheningCatalyst { public MundaneLengtheningCatalyst() { super(1); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundaneLengtheningCatalyst"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java index 958b0013..0a85efbe 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; + public class MundanePowerCatalyst extends PowerCatalyst { public MundanePowerCatalyst() { super(1); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundanePowerCatalyst"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java index 967a0d34..fc965408 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.items.potion; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.common.ICatalyst; import net.minecraft.entity.player.EntityPlayer; @@ -20,6 +21,7 @@ public class PowerCatalyst extends Item implements ICatalyst { super(); this.catalystStrength = catalystStrength; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java index 8e70f9ea..8c963024 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java @@ -1,23 +1,26 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import java.util.List; - +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 net.minecraft.util.StatCollector; - import org.lwjgl.input.Keyboard; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -import WayofTime.alchemicalWizardry.common.IBindingAgent; +import java.util.List; public class StandardBindingAgent extends Item implements IBindingAgent { public StandardBindingAgent() { super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -26,6 +29,13 @@ public class StandardBindingAgent extends Item implements IBindingAgent return (float) Math.pow(0.65, potions); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardBindingAgent"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java index 21854904..c0a93be4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java @@ -1,10 +1,16 @@ package WayofTime.alchemicalWizardry.common.items.potion; +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 { public StandardFillingAgent() { super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -22,4 +28,11 @@ public class StandardFillingAgent extends WeakFillingAgent return 0; } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardFillingAgent"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java index bc755dc1..86c941e5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java @@ -1,5 +1,9 @@ package WayofTime.alchemicalWizardry.common.items.potion; +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() @@ -12,4 +16,11 @@ public class WeakBindingAgent extends StandardBindingAgent { return (float) Math.pow(0.4, potions); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBindingAgent"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java index 8203572a..d65b9e1c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java @@ -1,24 +1,27 @@ package WayofTime.alchemicalWizardry.common.items.potion; -import java.util.List; -import java.util.Random; - +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 net.minecraft.util.StatCollector; - import org.lwjgl.input.Keyboard; -import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -import WayofTime.alchemicalWizardry.common.IFillingAgent; +import java.util.List; +import java.util.Random; public class WeakFillingAgent extends Item implements IFillingAgent { public WeakFillingAgent() { super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -45,6 +48,13 @@ public class WeakFillingAgent extends Item implements IFillingAgent return 0; } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakFillingAgent"); + } + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java index 74ce08b8..5e3250ff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/InputRoutingFocus.java @@ -1,9 +1,20 @@ package WayofTime.alchemicalWizardry.common.items.routing; +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class InputRoutingFocus extends RoutingFocus { public InputRoutingFocus() { super(); } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InputRoutingFocus"); + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java index b8a5f0fc..22965e3d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/OutputRoutingFocus.java @@ -2,23 +2,30 @@ package WayofTime.alchemicalWizardry.common.items.routing; import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; 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.util.IIcon; import net.minecraft.util.StatCollector; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitDefault; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitGlobal; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitIgnMeta; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitMatchNBT; import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitModItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingFocus -{ +{ + IIcon modItemIcon; + IIcon ignMetaIcon; + IIcon matchNBTIcon; + IIcon globalIcon; + public OutputRoutingFocus() { super(); @@ -39,28 +46,58 @@ public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingF } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocus"); + this.modItemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusModItems"); + this.ignMetaIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusIgnMeta"); + this.matchNBTIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusMatchNBT"); + this.globalIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusGlobal"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int damage) + { + switch(damage) + { + case 0: + return this.itemIcon; + case 1: + return this.modItemIcon; + case 2: + return this.ignMetaIcon; + case 3: + return this.matchNBTIcon; + case 4: + return this.globalIcon; + } + return this.itemIcon; + } + @Override public String getUnlocalizedName(ItemStack itemStack) { String addedString = ""; - switch (itemStack.getItemDamage()) + switch(itemStack.getItemDamage()) { - case 0: - addedString = "default"; - break; - case 1: - addedString = "modItem"; - break; - case 2: - addedString = "ignMeta"; - break; - case 3: - addedString = "matchNBT"; - break; - case 4: - addedString = "global"; - break; + case 0: + addedString = "default"; + break; + case 1: + addedString = "modItem"; + break; + case 2: + addedString = "ignMeta"; + break; + case 3: + addedString = "matchNBT"; + break; + case 4: + addedString = "global"; + break; } return super.getUnlocalizedName() + "." + addedString; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java index cdcc8f61..32e456a7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/routing/RoutingFocus.java @@ -8,11 +8,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; @@ -42,18 +41,18 @@ public class RoutingFocus extends Item // // public void cycleDirection(ItemStack itemStack) // { -// EnumFacing dir = this.getSetDirection(itemStack); +// ForgeDirection dir = this.getSetDirection(itemStack); // int direction = dir.ordinal(); // direction++; -// if(direction >= EnumFacing.VALID_DIRECTIONS.length) +// if(direction >= ForgeDirection.VALID_DIRECTIONS.length) // { // direction = 0; // } // -// this.setSetDirection(itemStack, EnumFacing.getOrientation(direction)); +// this.setSetDirection(itemStack, ForgeDirection.getOrientation(direction)); // } - public EnumFacing getSetDirection(ItemStack itemStack) + public ForgeDirection getSetDirection(ItemStack itemStack) { if(!itemStack.hasTagCompound()) { @@ -62,10 +61,10 @@ public class RoutingFocus extends Item NBTTagCompound tag = itemStack.getTagCompound(); - return EnumFacing.getFront(tag.getInteger("direction")); + return ForgeDirection.getOrientation(tag.getInteger("direction")); } - public void setSetDirection(ItemStack itemStack, EnumFacing dir) + public void setSetDirection(ItemStack itemStack, ForgeDirection dir) { if(!itemStack.hasTagCompound()) { @@ -97,14 +96,14 @@ public class RoutingFocus extends Item } @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if(world.isRemote) { return false; } - TileEntity tile = world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(x, y, z); if(tile instanceof IInventory) { if(player.isSneaking()) @@ -112,7 +111,7 @@ public class RoutingFocus extends Item if(this instanceof ILimitedRoutingFocus) { int pastAmount = ((ILimitedRoutingFocus)this).getRoutingFocusLimit(stack); - int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, side); + int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, ForgeDirection.getOrientation(side)); if(amount != pastAmount) { ((ILimitedRoutingFocus)this).setRoutingFocusLimit(stack, amount); @@ -121,8 +120,8 @@ public class RoutingFocus extends Item } } - this.setCoordinates(stack, pos); - this.setSetDirection(stack, side); + this.setCoordinates(stack, x, y, z); + this.setSetDirection(stack, ForgeDirection.getOrientation(side)); return true; } @@ -130,7 +129,7 @@ public class RoutingFocus extends Item return true; } - public void setCoordinates(ItemStack itemStack, BlockPos pos) + public void setCoordinates(ItemStack itemStack, int x, int y, int z) { if(!itemStack.hasTagCompound()) { @@ -139,9 +138,9 @@ public class RoutingFocus extends Item NBTTagCompound tag = itemStack.getTagCompound(); - tag.setInteger("xCoord", pos.getX()); - tag.setInteger("yCoord", pos.getY()); - tag.setInteger("zCoord", pos.getZ()); + tag.setInteger("xCoord", x); + tag.setInteger("yCoord", y); + tag.setInteger("zCoord", z); } public int xCoord(ItemStack itemStack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilAir.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilAir.java index a654b677..78f7b38d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilAir.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilAir.java @@ -2,6 +2,8 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import java.util.List; +import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -10,15 +12,19 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil +public class SigilAir extends EnergyItems implements ArmourUpgrade, ISigil { public SigilAir() { super(); + this.maxStackSize = 1; + //setMaxDamage(1000); setEnergyUsed(50); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -32,10 +38,17 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirSigil"); + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -62,7 +75,7 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { if(!par2World.isRemote) { @@ -108,7 +121,8 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil } @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.fallDistance = 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilBloodLight.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilBloodLight.java index 1d3e9845..eeb69c9e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilBloodLight.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilBloodLight.java @@ -3,105 +3,113 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import net.minecraft.block.state.IBlockState; +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.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilBloodLight extends BindableItems implements IHolding, ArmourUpgrade, ISigil +public class SigilBloodLight extends EnergyItems implements IHolding, ArmourUpgrade, ISigil { public SigilBloodLight() { super(); + this.maxStackSize = 1; setEnergyUsed(10); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override - public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(StatCollector.translateToLocal("tooltip.bloodlightsigil.desc")); - if (!(itemStack.getTagCompound() == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + itemStack.getTagCompound().getString("ownerName")); + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); } } @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { - if(!BindableItems.checkAndSetItemOwner(itemStack, player) || !BindableItems.syphonBatteries(itemStack, player, getEnergyUsed())) + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodLightSigil"); + } + + @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(!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer) || !EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed())) { return true; } - if (world.isRemote) + if (par3World.isRemote) { return true; } - IBlockState light = ModBlocks.blockBloodLight.getBlockState().getBaseState(); - - if (side.getIndex() == 0 && world.isAirBlock(blockPos.add(0, -1, 0))) + if (par7 == 0 && par3World.isAirBlock(par4, par5 - 1, par6)) { - world.setBlockState(blockPos.add(0, -1, 0), light); + par3World.setBlock(par4, par5 - 1, par6, ModBlocks.blockBloodLight); } - if (side.getIndex() == 1 && world.isAirBlock(blockPos.add(0, 1, 0))) + if (par7 == 1 && par3World.isAirBlock(par4, par5 + 1, par6)) { - world.setBlockState(blockPos.add(0, 1, 0), light); + par3World.setBlock(par4, par5 + 1, par6, ModBlocks.blockBloodLight); } - if (side.getIndex() == 2 && world.isAirBlock(blockPos.add(0, 0, -1))) + if (par7 == 2 && par3World.isAirBlock(par4, par5, par6 - 1)) { - world.setBlockState(blockPos.add(0, 0, -1), light); + par3World.setBlock(par4, par5, par6 - 1, ModBlocks.blockBloodLight); } - if (side.getIndex() == 3 && world.isAirBlock(blockPos.add(0, 0, 1))) + if (par7 == 3 && par3World.isAirBlock(par4, par5, par6 + 1)) { - world.setBlockState(blockPos.add(0, 0, 1), light); + par3World.setBlock(par4, par5, par6 + 1, ModBlocks.blockBloodLight); } - if (side.getIndex() == 4 && world.isAirBlock(blockPos.add(-1, 0, 0))) + if (par7 == 4 && par3World.isAirBlock(par4 - 1, par5, par6)) { - world.setBlockState(blockPos.add(-1, 0, 0), light); + par3World.setBlock(par4 - 1, par5, par6, ModBlocks.blockBloodLight); } - if (side.getIndex() == 5 && world.isAirBlock(blockPos.add(1, 0, 0))) + if (par7 == 5 && par3World.isAirBlock(par4 + 1, par5, par6)) { - world.setBlockState(blockPos.add(1, 0, 0), light); + par3World.setBlock(par4 + 1, par5, par6, ModBlocks.blockBloodLight); } return true; } @Override - public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer) + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(itemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return itemStack; + return par1ItemStack; } - if (itemStack.getTagCompound() == null) + if (par1ItemStack.getTagCompound() == null) { - itemStack.setTagCompound(new NBTTagCompound()); + par1ItemStack.setTagCompound(new NBTTagCompound()); } - if(!BindableItems.syphonBatteries(itemStack, par3EntityPlayer, getEnergyUsed() * 5)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed() * 5)) { - return itemStack; + return par1ItemStack; } if (!par2World.isRemote) @@ -109,13 +117,13 @@ public class SigilBloodLight extends BindableItems implements IHolding, ArmourUp par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 10)); } - return itemStack; + return par1ItemStack; } @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9, true, false)); + player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9, true)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilDivination.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilDivination.java index fdda6857..26f59fae 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilDivination.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilDivination.java @@ -4,28 +4,42 @@ import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +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.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; 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.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilDivination extends BindableItems implements ArmourUpgrade, IReagentManipulator, IBindable, ISigil +public class SigilDivination extends Item implements ArmourUpgrade, IReagentManipulator, IBindable, ISigil { public SigilDivination() { super(); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DivinationSigil"); } @Override @@ -43,14 +57,14 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) { return par1ItemStack; } - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 0)) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 0)) { return par1ItemStack; } @@ -75,7 +89,11 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - TileEntity tile = par2World.getTileEntity(movingobjectposition.func_178782_a()); + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; + + TileEntity tile = par2World.getTileEntity(x, y, z); if (!(tile instanceof IReagentHandler)) { @@ -86,7 +104,7 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe IReagentHandler relay = (IReagentHandler) tile; - ReagentContainerInfo[] infoList = relay.getContainerInfo(EnumFacing.DOWN); + ReagentContainerInfo[] infoList = relay.getContainerInfo(ForgeDirection.UNKNOWN); if (infoList != null) { for (ReagentContainerInfo info : infoList) @@ -104,7 +122,10 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe } @Override - public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {} + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + } + @Override public boolean isUpgrade() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilFluid.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilFluid.java index e15a5a4d..8dbc8541 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilFluid.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilFluid.java @@ -3,22 +3,28 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; import java.util.ArrayList; import java.util.List; -public class SigilFluid extends BindableItems implements IFluidContainerItem, ISigil +public class SigilFluid extends Item implements IFluidContainerItem, ISigil { private int capacity = 128 * 1000; private static final int STATE_SYPHON = 0; @@ -33,6 +39,8 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { super(); this.setMaxDamage(0); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -78,6 +86,13 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS } } + @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) { @@ -181,6 +196,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS } int range = 5; + float f = 1.0F; boolean flag = true; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); @@ -191,12 +207,16 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a())) + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; + + if (!world.canMineBlock(player, x, y, z)) { return container; } - if (!player.func_175151_a(movingobjectposition.func_178782_a(), movingobjectposition.field_178784_b, container)) + if (!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, container)) { return container; } @@ -214,11 +234,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS } } - List positionList = new ArrayList(); - - int x = movingobjectposition.func_178782_a().getX(); - int y = movingobjectposition.func_178782_a().getY(); - int z = movingobjectposition.func_178782_a().getZ(); + List positionList = new ArrayList(); boolList[range][range][range] = true; positionList.add(new Int3(range, range, range)); @@ -238,7 +254,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { if (i - 1 >= 0 && !boolList[i - 1][j][k]) { - Block block = world.getBlockState(new BlockPos(x - range + i - 1, y - range + j, z - range + k)).getBlock(); + Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k); Fluid fluid = FluidRegistry.lookupFluidForBlock(block); if (fluid != null) @@ -251,7 +267,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS if (j - 1 >= 0 && !boolList[i][j - 1][k]) { - Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j - 1, z - range + k)).getBlock(); + Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k); Fluid fluid = FluidRegistry.lookupFluidForBlock(block); if (fluid != null) @@ -264,7 +280,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS if (k - 1 >= 0 && !boolList[i][j][k - 1]) { - Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j, z - range + k - 1)).getBlock(); + Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1); Fluid fluid = FluidRegistry.lookupFluidForBlock(block); if (fluid != null) @@ -277,7 +293,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS if (i + 1 <= 2 * range && !boolList[i + 1][j][k]) { - Block block = world.getBlockState(new BlockPos(x - range + i + 1, y - range + j, z - range + k)).getBlock(); + Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k); Fluid fluid = FluidRegistry.lookupFluidForBlock(block); if (fluid != null) @@ -290,7 +306,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS if (j + 1 <= 2 * range && !boolList[i][j + 1][k]) { - Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j + 1, z - range + k)).getBlock(); + Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k); Fluid fluid = FluidRegistry.lookupFluidForBlock(block); if (fluid != null) @@ -303,7 +319,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS if (k + 1 <= 2 * range && !boolList[i][j][k + 1]) { - Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j, z - range + k + 1)).getBlock(); + Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1); Fluid fluid = FluidRegistry.lookupFluidForBlock(block); if (fluid != null) @@ -329,10 +345,10 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { continue; } - if (world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock() != null && world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock().getMaterial() instanceof MaterialLiquid) + 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.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock(); + Block block = world.getBlock(x + i - range, y + j - range, z + k - range); if (block == null) { continue; @@ -342,7 +358,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS AlchemicalWizardry.logger.info("x: " + (i - range) + " y: " + (j - range) + " z: " + (k - range)); - if (fluid == null || world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock().getMetaFromState(world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range))) != 0) + if (fluid == null || world.getBlockMetadata(x + i - range, y + j - range, z + k - range) != 0) { continue; } @@ -355,7 +371,8 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS if ((amount > 0 && forceFill) || (amount >= 1000 && !forceFill)) { { - world.setBlockToAir(new BlockPos(x + i - range, y + j - range, z + k - range)); + world.setBlockToAir(x + i - range, y + j - range, z + k - range); + } this.fill(container, new FluidStack(fluid, 1000), true); @@ -370,6 +387,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS public ItemStack fillItemFromWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill) { + float f = 1.0F; boolean flag = true; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag); @@ -380,19 +398,23 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a())) + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!world.canMineBlock(player, i, j, k)) { return container; } - if (!player.func_175151_a(movingobjectposition.func_178782_a(), movingobjectposition.field_178784_b, container)) + if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, container)) { return container; } - if (world.getBlockState(movingobjectposition.func_178782_a()).getBlock() != null && world.getBlockState(movingobjectposition.func_178782_a()).getBlock().getMaterial() instanceof MaterialLiquid) + if (world.getBlock(i, j, k) != null && world.getBlock(i, j, k).getMaterial() instanceof MaterialLiquid) { - Block block = world.getBlockState(movingobjectposition.func_178782_a()).getBlock(); + Block block = world.getBlock(i, j, k); Fluid fluid = FluidRegistry.lookupFluidForBlock(block); if (fluid == null) @@ -408,7 +430,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { if (!player.capabilities.isCreativeMode) { - world.setBlockToAir(movingobjectposition.func_178782_a()); + world.setBlockToAir(i, j, k); } this.fill(container, new FluidStack(fluid, 1000), true); @@ -433,6 +455,12 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS 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); @@ -443,56 +471,57 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a())) + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!world.canMineBlock(player, i, j, k)) { return container; } - - int i = movingobjectposition.func_178782_a().getX(); - int j = movingobjectposition.func_178782_a().getY(); - int k = movingobjectposition.func_178782_a().getZ(); - if (movingobjectposition.field_178784_b.getIndex() == 0) + if (movingobjectposition.sideHit == 0) { --j; } - if (movingobjectposition.field_178784_b.getIndex() == 1) + if (movingobjectposition.sideHit == 1) { ++j; } - if (movingobjectposition.field_178784_b.getIndex() == 2) + if (movingobjectposition.sideHit == 2) { --k; } - if (movingobjectposition.field_178784_b.getIndex() == 3) + if (movingobjectposition.sideHit == 3) { ++k; } - if (movingobjectposition.field_178784_b.getIndex() == 4) + if (movingobjectposition.sideHit == 4) { --i; } - if (movingobjectposition.field_178784_b.getIndex() == 5) + if (movingobjectposition.sideHit == 5) { ++i; } - if (!player.func_175151_a(new BlockPos(i, j, k), movingobjectposition.field_178784_b, container)) + if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, container)) { return container; } - if (this.tryPlaceContainedLiquid(world, new BlockPos(i, j, k)) && !player.capabilities.isCreativeMode) + if (this.tryPlaceContainedLiquid(world, fluidBlock, d0, d1, d2, i, j, k) && !player.capabilities.isCreativeMode) { this.drain(container, 1000, true); return container; } + } return container; @@ -502,28 +531,27 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS return container; } - public boolean tryPlaceContainedLiquid(World world, BlockPos blockPos) + public boolean tryPlaceContainedLiquid(World par1World, Block block, double par2, double par4, double par6, int par8, int par9, int par10) { - if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().isSolid()) //TODO Was func_149730_j() so check this! + if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).func_149730_j()) { return false; - } else if ((world.getBlockState(blockPos).getBlock().getMaterial() instanceof MaterialLiquid && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0)) + } else if ((par1World.getBlock(par8, par9, par10).getMaterial() instanceof MaterialLiquid && (par1World.getBlockMetadata(par8, par9, par10) == 0))) { return false; } else { - Block block = world.getBlockState(blockPos).getBlock(); - if ((block == Blocks.water || block == Blocks.flowing_water) && world.provider.func_177500_n()) + if ((block == Blocks.water || block == Blocks.flowing_water) && par1World.provider.isHellWorld) { - world.playSoundEffect(blockPos.getX() + 0.5D, blockPos.getY() + 0.5D, blockPos.getZ() + 0.5D, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + par1World.playSoundEffect(par2 + 0.5D, par4 + 0.5D, par6 + 0.5D, "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); for (int l = 0; l < 8; ++l) { - world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double) blockPos.getX() + Math.random(), (double) blockPos.getY() + Math.random(), (double) blockPos.getZ() + 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 { - world.setBlockState(blockPos, block.getBlockState().getBaseState()); + par1World.setBlock(par8, par9, par10, block, 0, 3); } return true; @@ -550,11 +578,15 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - TileEntity tile = world.getTileEntity(movingobjectposition.func_178782_a()); + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + TileEntity tile = world.getTileEntity(i, j, k); if (tile instanceof IFluidHandler) { - int amount = ((IFluidHandler) tile).fill(movingobjectposition.field_178784_b, fluid, true); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true); this.drain(container, amount, true); } @@ -577,17 +609,21 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - TileEntity tile = world.getTileEntity(movingobjectposition.func_178782_a()); + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + TileEntity tile = world.getTileEntity(i, j, k); if (tile instanceof IFluidHandler) { - FluidStack fluidAmount = ((IFluidHandler) tile).drain(movingobjectposition.field_178784_b, this.getCapacity(container), false); + 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(movingobjectposition.field_178784_b, this.getCapacity(container), true); + ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), true); this.fill(container, fluidAmount, true); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilHarvest.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilHarvest.java index 3699f4c0..08db2402 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilHarvest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilHarvest.java @@ -3,24 +3,35 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; +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.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpgrade, ISigil +public class SigilHarvest extends EnergyItems implements IHolding, ArmourUpgrade, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + public SigilHarvest() { super(); + this.maxStackSize = 1; setEnergyUsed(500); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -30,7 +41,7 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -42,10 +53,51 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -56,18 +108,18 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack)) + if (tag.getBoolean("isActive")) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + tag.setBoolean("isActive", false); } } } else @@ -93,7 +145,7 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { int range = 3; int verticalRange = 1; @@ -107,18 +159,18 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg { for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) { - HarvestRegistry.harvestBlock(par2World, new BlockPos(ix, iy, iz)); + HarvestRegistry.harvestBlock(par2World, ix, iy, iz); } } } } - if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack)) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -143,7 +195,7 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg { for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) { - HarvestRegistry.harvestBlock(world, new BlockPos(ix, iy, iz)); + HarvestRegistry.harvestBlock(world, ix, iy, iz); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilLava.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilLava.java index 58638712..cbc7dc86 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilLava.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilLava.java @@ -5,6 +5,7 @@ import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -13,16 +14,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; 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.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.Orb; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil { @@ -35,7 +38,16 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil public SigilLava() { super(Blocks.lava); + this.maxStackSize = 1; setEnergyUsed(1000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaSigil"); } @Override @@ -68,27 +80,27 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil } @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) { return false; } - if (!world.canMineBlockBody(player, blockPos)) + if (!world.canMineBlock(player, x, y, z)) { return false; } - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IFluidHandler) { FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000); - int amount = ((IFluidHandler) tile).fill(side, fluid, false); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, false); - if (amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if (amount > 0 && EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { - ((IFluidHandler) tile).fill(side, fluid, true); + ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, true); } return false; @@ -99,79 +111,74 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil } { - int x = blockPos.getX(); - int y = blockPos.getY(); - int z = blockPos.getZ(); - - if (side.getIndex() == 0) + if (side == 0) { --y; } - if (side.getIndex() == 1) + if (side == 1) { ++y; } - if (side.getIndex() == 2) + if (side == 2) { --z; } - if (side.getIndex() == 3) + if (side == 3) { ++z; } - if (side.getIndex() == 4) + if (side == 4) { --x; } - if (side.getIndex() == 5) + if (side == 5) { ++x; } - if (!player.func_175151_a(new BlockPos(x, y, z), side, stack)) + if (!player.canPlayerEdit(x, y, z, side, stack)) { return false; } - if(this.canPlaceContainedLiquid(world, new BlockPos(x, y, z)) && BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if(this.canPlaceContainedLiquid(world, x, y, z, x, y, z) && EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { - return this.func_180616_a(world, new BlockPos(x, y, z)); + return this.tryPlaceContainedLiquid(world, x, y, z, x, y, z); } } return false; } - @Override /** * Attempts to place the liquid contained inside the bucket. */ - public boolean func_180616_a(World par1World, BlockPos blockPos) + public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) { - if (!par1World.isAirBlock(blockPos) && par1World.getBlockState(blockPos).getBlock().getMaterial().isSolid()) + if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) { return false; - } else if ((par1World.getBlockState(blockPos).getBlock() == Blocks.lava || par1World.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && par1World.getBlockState(blockPos).getBlock().getMetaFromState(par1World.getBlockState(blockPos)) == 0) + } else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0) { return false; } else { - par1World.setBlockState(blockPos, this.isFull.getBlockState().getBaseState()); + par1World.setBlock(par8, par9, par10, this.isFull, 0, 3); return true; } } - public boolean canPlaceContainedLiquid(World par1World, BlockPos blockPos) + public boolean canPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) { - if (!par1World.isAirBlock(blockPos) && par1World.getBlockState(blockPos).getBlock().getMaterial().isSolid()) + if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) { return false; - } else if ((par1World.getBlockState(blockPos).getBlock() == Blocks.lava || par1World.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && par1World.getBlockState(blockPos).getBlock().getMetaFromState(par1World.getBlockState(blockPos)) == 0) + } else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0) { return false; } else @@ -205,7 +212,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil { continue; } - if (stack.getItem() instanceof Orb && !usedBattery) + if (stack.getItem() instanceof EnergyBattery && !usedBattery) { if (stack.getItemDamage() <= stack.getMaxDamage() - damageToBeDone) { @@ -225,7 +232,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9, true, false)); + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9, true)); player.extinguish(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java index 9882d773..7d636c01 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java @@ -1,24 +1,36 @@ package WayofTime.alchemicalWizardry.common.items.sigil; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class SigilOfElementalAffinity extends SigilToggleable implements ISigil +public class SigilOfElementalAffinity extends EnergyItems implements ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + public SigilOfElementalAffinity() { super(); + this.maxStackSize = 1; setEnergyUsed(200); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -29,7 +41,7 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -41,10 +53,51 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfTheFastMiner"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -55,14 +108,14 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false)); - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true)); } else { par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); @@ -86,20 +139,20 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3EntityPlayer.fallDistance = 0; - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false)); - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true)); } - if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack)) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfEnderSeverance.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfEnderSeverance.java index ffd3e7a5..5ed0ea63 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfEnderSeverance.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfEnderSeverance.java @@ -3,25 +3,36 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, ISigil +public class SigilOfEnderSeverance extends EnergyItems implements IHolding, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + public SigilOfEnderSeverance() { super(); + this.maxStackSize = 1; setEnergyUsed(200); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -31,7 +42,7 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -43,10 +54,51 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -57,18 +109,18 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack)) + if (tag.getBoolean("isActive")) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + tag.setBoolean("isActive", false); } } } else @@ -94,7 +146,7 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { List list = SpellHelper.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5); for (Entity entity : list) @@ -105,15 +157,17 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, } } } - if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack)) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } + + return; } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java index aefe2d9c..f888d5a2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java @@ -1,33 +1,43 @@ package WayofTime.alchemicalWizardry.common.items.sigil; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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.block.state.IBlockState; +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.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.BonemealEvent; -import net.minecraftforge.fml.common.eventhandler.Event; + import java.util.List; -public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISigil +public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int tickDelay = 100; public SigilOfGrowth() { super(); + this.maxStackSize = 1; setEnergyUsed(150); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -38,7 +48,7 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -51,17 +61,58 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { - if (BindableItems.checkAndSetItemOwner(stack, playerIn)) - { - if (applyBonemeal(stack, worldIn, pos, playerIn)) - { - BindableItems.syphonBatteries(stack, playerIn, getEnergyUsed()); + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated"); + } - if (worldIn.isRemote) + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @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 (EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) + { + if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) + { + EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); + + if (par3World.isRemote) { - worldIn.playAuxSFX(2005, pos, 0); + par3World.playAuxSFX(2005, par4, par5, par6, 0); return true; } @@ -74,7 +125,7 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -92,7 +143,7 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi NBTTagCompound tag = par1ItemStack.getTagCompound(); tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (tag.getBoolean("isActive") && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); @@ -117,13 +168,13 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) { - if(!BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) + if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } int range = 3; @@ -138,13 +189,14 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi { for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) { - IBlockState block = par2World.getBlockState(new BlockPos(ix, iy, iz)); + Block block = par2World.getBlock(ix, iy, iz); + if (block instanceof IPlantable || block instanceof IGrowable) { if (par2World.rand.nextInt(50) == 0) { - block.getBlock().updateTick(par2World, new BlockPos(ix, iy, iz), block, par2World.rand); + block.updateTick(par2World, ix, iy, iz, par2World.rand); } } } @@ -153,17 +205,17 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi } } - public static boolean applyBonemeal(ItemStack p_179234_0_, World world, BlockPos blockPos, EntityPlayer player) + public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player) { - IBlockState block = world.getBlockState(blockPos); + Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_); - BonemealEvent event = new BonemealEvent(player, world, blockPos, block); + BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_); if (MinecraftForge.EVENT_BUS.post(event)) { return false; } - if (event.getResult() == Event.Result.ALLOW) + if (event.getResult() == Result.ALLOW) { return true; } @@ -172,14 +224,16 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi { IGrowable igrowable = (IGrowable) block; - if (igrowable.isStillGrowing(world, blockPos, block, world.isRemote)) + if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote)) { - if (!world.isRemote) + if (!p_150919_1_.isRemote) { - if (igrowable.canUseBonemeal(world, world.rand, blockPos, block)) + if (igrowable.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_)) { - igrowable.grow(world, world.rand, blockPos, block); + igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_); } + + } return true; @@ -209,13 +263,13 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi { for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) { - IBlockState block = world.getBlockState(new BlockPos(ix, iy, iz)); + Block block = world.getBlock(ix, iy, iz); if (block instanceof IPlantable) { if (world.rand.nextInt(100) == 0) { - block.getBlock().updateTick(world, new BlockPos(ix, iy, iz), block, world.rand); + block.updateTick(world, ix, iy, iz, world.rand); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java index 8ed6ece0..12b772ca 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java @@ -3,23 +3,34 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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.potion.PotionEffect; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISigil +public class SigilOfHaste extends EnergyItems implements ArmourUpgrade, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + public SigilOfHaste() { super(); + this.maxStackSize = 1; setEnergyUsed(250); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -29,7 +40,7 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -41,10 +52,51 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -55,9 +107,9 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); @@ -85,18 +137,18 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true, false)); + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1)); } - if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack)) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -110,7 +162,7 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig itemStack.setTagCompound(new NBTTagCompound()); } - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true, false)); + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java index 737a6079..1e6aa7e4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; @@ -10,20 +11,30 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; 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.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, IHolding, ISigil +public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHolding, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int tickDelay = 300; public SigilOfMagnetism() { super(); + this.maxStackSize = 1; setEnergyUsed(50); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -33,7 +44,7 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -45,10 +56,51 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -59,9 +111,9 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); @@ -88,13 +140,13 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) { - if(!BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) + if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } @@ -103,8 +155,8 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, float posX = Math.round(par3Entity.posX); float posY = (float) (par3Entity.posY - par3Entity.getEyeHeight()); float posZ = Math.round(par3Entity.posZ); - List entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); - List xpOrbs = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + List entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + List xpOrbs = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); for (EntityItem entity : entities) { @@ -132,8 +184,8 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, float posX = Math.round(player.posX); float posY = (float) (player.posY - player.getEyeHeight()); float posZ = Math.round(player.posZ); - List entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); - List xpOrbs = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + List entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + List xpOrbs = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); for (EntityItem entity : entities) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfSupression.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfSupression.java index 24865997..370ef3af 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfSupression.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfSupression.java @@ -1,32 +1,42 @@ package WayofTime.alchemicalWizardry.common.items.sigil; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer; -import net.minecraft.block.state.IBlockState; +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; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; import net.minecraft.world.World; import java.util.List; -public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, ISigil +public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int radius = 5; private int refresh = 100; public SigilOfSupression() { super(); + this.maxStackSize = 1; setEnergyUsed(400); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -36,7 +46,7 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -48,12 +58,53 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_deactivated"); + activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_activated"); + passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return activeIcon; + } else + { + return passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return activeIcon; + } else + { + return passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { int tickDelay = 200; - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) { return par1ItemStack; } @@ -69,18 +120,18 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack)) + if (tag.getBoolean("isActive")) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + tag.setBoolean("isActive", false); } } } else @@ -111,9 +162,9 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack) && (!par2World.isRemote)) + if (par1ItemStack.getTagCompound().getBoolean("isActive") && (!par2World.isRemote)) { - Vec3 blockVec = new Vec3((int) Math.round(par3EntityPlayer.posX - 0.5F), par3EntityPlayer.posY, (int) Math.round(par3EntityPlayer.posZ - 0.5F)); + Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer); int x = (int) blockVec.xCoord; int y = (int) blockVec.yCoord; int z = (int) blockVec.zCoord; @@ -129,19 +180,18 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, continue; } - BlockPos blockPos = new BlockPos(x + i, y + j, z + k); - IBlockState block = par2World.getBlockState(blockPos); + Block block = par2World.getBlock(x + i, y + j, z + k); - if (SpellHelper.isBlockFluid(block.getBlock())) + if (SpellHelper.isBlockFluid(block)) { - if (par2World.getTileEntity(blockPos) != null) + if (par2World.getTileEntity(x + i, y + j, z + k) != null) { - par2World.setBlockToAir(blockPos); + par2World.setBlockToAir(x + i, y + j, z + k); } - TESpectralContainer.createSpectralBlockAtLocation(par2World, blockPos, refresh); + TESpectralContainer.createSpectralBlockAtLocation(par2World, x + i, y + j, z + k, refresh); } else { - TileEntity tile = par2World.getTileEntity(blockPos); + TileEntity tile = par2World.getTileEntity(x + i, y + j, z + k); if (tile instanceof TESpectralContainer) { ((TESpectralContainer) tile).resetDuration(refresh); @@ -152,13 +202,13 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, } } - if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack)) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -167,7 +217,7 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - Vec3 blockVec = new Vec3((int) Math.round(player.posX - 0.5F), player.posY, (int) Math.round(player.posZ - 0.5F)); + Vec3 blockVec = SpellHelper.getEntityBlockVector(player); int x = (int) blockVec.xCoord; int y = (int) blockVec.yCoord; int z = (int) blockVec.zCoord; @@ -183,19 +233,19 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, continue; } - BlockPos blockPos = new BlockPos(x + i, y + j, z + k); - IBlockState block = world.getBlockState(blockPos); + Block block = world.getBlock(x + i, y + j, z + k); - if (SpellHelper.isBlockFluid(block.getBlock())) + + if (SpellHelper.isBlockFluid(block)) { - if (world.getTileEntity(blockPos) != null) + if (world.getTileEntity(x + i, y + j, z + k) != null) { - world.setBlockToAir(blockPos); + world.setBlockToAir(x + i, y + j, z + k); } - TESpectralContainer.createSpectralBlockAtLocation(world, blockPos, refresh); + TESpectralContainer.createSpectralBlockAtLocation(world, x + i, y + j, z + k, refresh); } else { - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x + i, y + j, z + k); if (tile instanceof TESpectralContainer) { ((TESpectralContainer) tile).resetDuration(refresh); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheAssassin.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheAssassin.java index 7397efec..4bfa7e8d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheAssassin.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheAssassin.java @@ -3,30 +3,39 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import net.minecraft.block.state.IBlockState; +import net.minecraft.block.Block; +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.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.*; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, ISigil +public class SigilOfTheAssassin extends EnergyItems implements ArmourUpgrade, ISigil { public SigilOfTheAssassin() { super(); + this.maxStackSize = 1; setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -38,6 +47,13 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil"); + } + @Override public ItemStack getContainerItem(ItemStack itemStack) { @@ -58,16 +74,17 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, } } - @Override /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } + + float f = 10.0F; @@ -91,6 +108,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, if(hitEntity instanceof EntityLivingBase) { AlchemicalWizardry.logger.info("It's a living entity!"); + teleportTo(par3EntityPlayer, x, y, z, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ); } @@ -117,18 +135,17 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, int i = MathHelper.floor_double(entityLiving.posX); int j = MathHelper.floor_double(entityLiving.posY); int k = MathHelper.floor_double(entityLiving.posZ); - BlockPos blockPos = new BlockPos(i, j, k); - IBlockState l; + Block l; - if (!entityLiving.worldObj.isAirBlock(blockPos)) + if (entityLiving.worldObj.blockExists(i, j, k)) { boolean flag1 = false; while (!flag1 && j > 0) { - l = entityLiving.worldObj.getBlockState(blockPos); + l = entityLiving.worldObj.getBlock(i, j - 1, k); - if (l != null && l.getBlock().getMaterial().blocksMovement()) + if (l != null && l.getMaterial().blocksMovement()) { flag1 = true; } else @@ -142,7 +159,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, { SpellTeleport.moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ); - if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.getBoundingBox()).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.getBoundingBox())) + if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) { flag = true; } @@ -166,7 +183,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; - entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, (double) f, (double) f1, (double) f2); + entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2); } return true; } @@ -180,7 +197,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, double d0 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * (double)f; double d1 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * (double)f + (double)(p_77621_1_.isRemote ? p_77621_2_.getEyeHeight() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences double d2 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * (double)f; - Vec3 vec3 = new Vec3(d0, d1, d2); + Vec3 vec3 = SpellHelper.createVec3(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI); float f5 = -MathHelper.cos(-f1 * 0.017453292F); @@ -188,12 +205,12 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, float f7 = f4 * f5; float f8 = f3 * f5; double d3 = 500.0D; -// if (p_77621_2_ instanceof EntityPlayerMP) + if (p_77621_2_ instanceof EntityPlayerMP) { // d3 = ((EntityPlayerMP)p_77621_2_).theItemInWorldManager.getBlockReachDistance(); } Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); - return p_77621_1_.rayTraceBlocks(vec3, vec31, p_77621_3_, !p_77621_3_, false); + return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false); } // public MovingObjectPosition movingObjectPositiongdsa(WOrld worldObj, int posX, int posY, int posZ) @@ -252,7 +269,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true, false)); + player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java index 6b174bcf..00703db4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java @@ -1,30 +1,40 @@ package WayofTime.alchemicalWizardry.common.items.sigil; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock; -import net.minecraft.block.state.IBlockState; +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; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, ISigil +public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; private int tickDelay = 200; public SigilOfTheBridge() { super(); + this.maxStackSize = 1; setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -35,7 +45,7 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -47,10 +57,51 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -61,9 +112,9 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); @@ -90,16 +141,16 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay")) { - if(BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack))) + if(EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack))) { this.setLPUsed(par1ItemStack, 0); }else { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking()) @@ -130,13 +181,13 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, for (int iz = posZ - range; iz <= posZ + range; iz++) { { - IBlockState block = par2World.getBlockState(new BlockPos(ix, posY + verticalOffset, iz)); + Block block = par2World.getBlock(ix, posY + verticalOffset, iz); - if (par2World.isAirBlock(new BlockPos(ix, posY + verticalOffset, iz))) + if (par2World.isAirBlock(ix, posY + verticalOffset, iz)) { - par2World.setBlockState(new BlockPos(ix, posY + verticalOffset, iz), ModBlocks.spectralBlock.getDefaultState(), 3); + par2World.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3); - TileEntity tile = par2World.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz)); + TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz); if (tile instanceof TESpectralBlock) { ((TESpectralBlock) tile).setDuration(100); @@ -148,7 +199,7 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, } } else if (block == ModBlocks.spectralBlock) { - TileEntity tile = par2World.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz)); + TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz); if (tile instanceof TESpectralBlock) { ((TESpectralBlock) tile).setDuration(100); @@ -201,7 +252,7 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, } int range = 2; - int verticalOffset = -1; + int verticalOffset = -2; if (player.isSneaking()) { @@ -215,20 +266,20 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, { for (int iz = posZ - range; iz <= posZ + range; iz++) { - IBlockState block = world.getBlockState(new BlockPos(ix, posY + verticalOffset, iz)); + Block block = world.getBlock(ix, posY + verticalOffset, iz); - if (world.isAirBlock(new BlockPos(ix, posY + verticalOffset, iz))) + if (world.isAirBlock(ix, posY + verticalOffset, iz)) { - world.setBlockState(new BlockPos(ix, posY + verticalOffset, iz), ModBlocks.spectralBlock.getDefaultState(), 3); + world.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3); - TileEntity tile = world.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz)); + TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz); if (tile instanceof TESpectralBlock) { ((TESpectralBlock) tile).setDuration(100); } } else if (block == ModBlocks.spectralBlock) { - TileEntity tile = world.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz)); + TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz); if (tile instanceof TESpectralBlock) { ((TESpectralBlock) tile).setDuration(100); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java index bde22ef7..37755b9f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java @@ -1,25 +1,37 @@ package WayofTime.alchemicalWizardry.common.items.sigil; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class SigilOfTheFastMiner extends SigilToggleable implements ArmourUpgrade, ISigil +public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + public SigilOfTheFastMiner() { super(); + this.maxStackSize = 1; setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -29,7 +41,7 @@ public class SigilOfTheFastMiner extends SigilToggleable implements ArmourUpgrad if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -41,10 +53,51 @@ public class SigilOfTheFastMiner extends SigilToggleable implements ArmourUpgrad } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -55,13 +108,13 @@ public class SigilOfTheFastMiner extends SigilToggleable implements ArmourUpgrad } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true)); } else { par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); @@ -85,18 +138,18 @@ public class SigilOfTheFastMiner extends SigilToggleable implements ArmourUpgrad par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true, false)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true)); } - if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack)) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -110,7 +163,7 @@ public class SigilOfTheFastMiner extends SigilToggleable implements ArmourUpgrad itemStack.setTagCompound(new NBTTagCompound()); } - player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 3, 1, true, false)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 3, 1, true)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java index 84b21315..71f8cf0b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java @@ -1,25 +1,36 @@ package WayofTime.alchemicalWizardry.common.items.sigil; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; +import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; +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.potion.PotionEffect; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; -public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigil +import java.util.List; + +public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil { + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + public SigilOfWind() { super(); + this.maxStackSize = 1; setEnergyUsed(250); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -29,7 +40,7 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -41,10 +52,51 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -55,13 +107,13 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); - par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1, true, false)); + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1)); } else { par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); @@ -85,18 +137,18 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { - par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1, true, false)); + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1)); } if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } @@ -110,7 +162,7 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi itemStack.setTagCompound(new NBTTagCompound()); } - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 3, 1, true, false)); + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 3, 1)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilCompress.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilPackRat.java similarity index 60% rename from src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilCompress.java rename to src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilPackRat.java index 49fa6114..1014041e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilCompress.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilPackRat.java @@ -3,24 +3,36 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.compress.CompressionRegistry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilCompress extends SigilToggleable implements IHolding, ArmourUpgrade, ISigil +public class SigilPackRat extends EnergyItems implements IHolding, ArmourUpgrade, ISigil { - public SigilCompress() + @SideOnly(Side.CLIENT) + private IIcon activeIcon; + @SideOnly(Side.CLIENT) + private IIcon passiveIcon; + + public SigilPackRat() { super(); + this.maxStackSize = 1; setEnergyUsed(200); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -30,7 +42,7 @@ public class SigilCompress extends SigilToggleable implements IHolding, ArmourUp if (!(par1ItemStack.getTagCompound() == null)) { - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated")); } else @@ -42,10 +54,51 @@ public class SigilCompress extends SigilToggleable implements IHolding, ArmourUp } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CompressionSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:CompressionSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:CompressionSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.getTagCompound() == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.getTagCompound(); + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } @@ -56,18 +109,18 @@ public class SigilCompress extends SigilToggleable implements IHolding, ArmourUp } NBTTagCompound tag = par1ItemStack.getTagCompound(); - this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack))); + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); - if (this.getActivated(par1ItemStack)) + if (tag.getBoolean("isActive")) { par1ItemStack.setItemDamage(1); tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); if (!par3EntityPlayer.capabilities.isCreativeMode) { - if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + tag.setBoolean("isActive", false); } } } else @@ -93,7 +146,7 @@ public class SigilCompress extends SigilToggleable implements IHolding, ArmourUp par1ItemStack.setTagCompound(new NBTTagCompound()); } - if (this.getActivated(par1ItemStack)) + if (par1ItemStack.getTagCompound().getBoolean("isActive")) { ItemStack stack = CompressionRegistry.compressInventory(par3EntityPlayer.inventory.mainInventory, par2World); if(stack != null) @@ -102,13 +155,13 @@ public class SigilCompress extends SigilToggleable implements IHolding, ArmourUp par2World.spawnEntityInWorld(entityItem); } } - if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack)) + if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive")) { if (!par3EntityPlayer.capabilities.isCreativeMode) { - if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) { - this.setActivated(par1ItemStack, false); + par1ItemStack.getTagCompound().setBoolean("isActive", false); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilSeer.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilSeer.java index 66dd0fd4..cdca8941 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilSeer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilSeer.java @@ -1,9 +1,13 @@ package WayofTime.alchemicalWizardry.common.items.sigil; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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; @@ -18,7 +22,15 @@ public class SigilSeer extends Item implements IHolding, ArmourUpgrade, ISigil public SigilSeer() { super(); - setMaxStackSize(1); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SeerSigil"); } @Override @@ -35,7 +47,7 @@ public class SigilSeer extends Item implements IHolding, ArmourUpgrade, ISigil @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote) { return par1ItemStack; } @@ -51,7 +63,10 @@ public class SigilSeer extends Item implements IHolding, ArmourUpgrade, ISigil } @Override - public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {} + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + } + @Override public boolean isUpgrade() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilToggleable.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilToggleable.java deleted file mode 100644 index ae698659..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilToggleable.java +++ /dev/null @@ -1,17 +0,0 @@ -package WayofTime.alchemicalWizardry.common.items.sigil; - -import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.common.items.BindableItems; - -public class SigilToggleable extends BindableItems -{ - public void setActivated(ItemStack stack, boolean newActivated) - { - stack.setItemDamage(newActivated ? 1 : 0); - } - - public boolean getActivated(ItemStack stack) - { - return stack.getItemDamage() == 1; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilVoid.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilVoid.java index 2d9aee04..c62ee182 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilVoid.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilVoid.java @@ -3,28 +3,42 @@ package WayofTime.alchemicalWizardry.common.items.sigil; import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBucket; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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 SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil { + private int isFull; private int energyUsed; public SigilVoid() { super(null); + this.maxStackSize = 1; setEnergyUsed(50); + isFull = 0; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:VoidSigil"); } @Override @@ -63,74 +77,72 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil } @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) { return false; } - if (!world.canMineBlockBody(player, blockPos)) + float f = 1.0F; + + if (!world.canMineBlock(player, x, y, z)) { return false; } - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IFluidHandler) { - FluidStack amount = ((IFluidHandler) tile).drain(side, 1000, false); + FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, false); - if (amount != null && amount.amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if (amount != null && amount.amount > 0 && EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { - ((IFluidHandler) tile).drain(side, 1000, true); + ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, true); return true; } return false; } - int x = blockPos.getX(); - int y = blockPos.getY(); - int z = blockPos.getZ(); - - if (side.getIndex() == 0) + if (side == 0) { --y; } - if (side.getIndex() == 1) + if (side == 1) { ++y; } - if (side.getIndex() == 2) + if (side == 2) { --z; } - if (side.getIndex() == 3) + if (side == 3) { ++z; } - if (side.getIndex() == 4) + if (side == 4) { --x; } - if (side.getIndex() == 5) + if (side == 5) { ++x; } - if (!player.func_175151_a(new BlockPos(x, y, z), side, stack)) //was canPlayerEdit + if (!player.canPlayerEdit(x, y, z, side, stack)) { return false; } - if (SpellHelper.isBlockFluid(world.getBlockState(new BlockPos(x, y, z)).getBlock()) && BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if (SpellHelper.isBlockFluid(world.getBlock(x, y, z)) && EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { - world.setBlockToAir(new BlockPos(x, y, z)); + world.setBlockToAir(x, y, z); return true; } @@ -138,17 +150,18 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil return false; } - @Override /** * Attempts to place the liquid contained inside the bucket. */ - public boolean func_180616_a(World world, BlockPos blockPos) //was tryPlaceContainedLiquid + public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) { return false; } @Override - public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {} + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + } @Override public boolean isUpgrade() diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilWater.java index 4bf58364..d9bf86a6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilWater.java @@ -5,7 +5,7 @@ import java.util.List; import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; import net.minecraft.block.Block; -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.ItemBucket; @@ -14,16 +14,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.StatCollector; 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.items.interfaces.ArmourUpgrade; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil { @@ -33,7 +34,9 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil public SigilWater() { super(Blocks.water); + this.maxStackSize = 1; setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override @@ -45,6 +48,13 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil } } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil"); + } + @Override public ItemStack getContainerItem(ItemStack itemStack) { @@ -62,7 +72,6 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil } } - @Override /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ @@ -72,27 +81,27 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil } @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) { return false; } - if (!world.canMineBlockBody(player, blockPos)) + if (!world.canMineBlock(player, x, y, z)) { return false; } - TileEntity tile = world.getTileEntity(blockPos); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IFluidHandler) { FluidStack fluid = new FluidStack(FluidRegistry.WATER, 1000); - int amount = ((IFluidHandler) tile).fill(side, fluid, false); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, false); - if (amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if (amount > 0 && EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { - ((IFluidHandler) tile).fill(side, fluid, true); + ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, true); } return false; @@ -102,50 +111,48 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil return false; } - int x = blockPos.getX(); - int y = blockPos.getY(); - int z = blockPos.getZ(); { - if (side.getIndex() == 0) + if (side == 0) { --y; } - if (side.getIndex() == 1) + if (side == 1) { ++y; } - if (side.getIndex() == 2) + if (side == 2) { --z; } - if (side.getIndex() == 3) + if (side == 3) { ++z; } - if (side.getIndex() == 4) + if (side == 4) { --x; } - if (side.getIndex() == 5) + if (side == 5) { ++x; } - if (!player.func_175151_a(new BlockPos(x, y, z), side, stack)) // was canPlayerEdit + if (!player.canPlayerEdit(x, y, z, side, stack)) { return false; } - if(this.canPlaceContainedLiquid(world, new BlockPos(x, y, z)) && BindableItems.syphonBatteries(stack, player, getEnergyUsed())) + if(this.canPlaceContainedLiquid(world, x, y, z, x, y, z) && EnergyItems.syphonBatteries(stack, player, getEnergyUsed())) { - return this.func_180616_a(world, new BlockPos(x, y, z)); + return this.tryPlaceContainedLiquid(world, x, y, z, x, y, z); } } + return false; @@ -154,56 +161,40 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil /** * Attempts to place the liquid contained inside the bucket. */ - public boolean func_180616_a(World world, BlockPos blockPos) //was tryPlaceContainedLiquid + public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) { - if (this.isFull == Blocks.air) + if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) { return false; - } - else + } else if ((par1World.getBlock(par8, par9, par10) == Blocks.water || par1World.getBlock(par8, par9, par10) == Blocks.flowing_water) && par1World.getBlockMetadata(par8, par9, par10) == 0) { - Material material = world.getBlockState(blockPos).getBlock().getMaterial(); - boolean flag = !material.isSolid(); - - if (!world.isAirBlock(blockPos) && !flag) + return false; + } else + { + if (par1World.provider.isHellWorld) { - return false; - } - else + par1World.playSoundEffect(par2 + 0.5D, par4 + 0.5D, par6 + 0.5D, "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); + + 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); + } + } else { - if (world.provider.func_177500_n() && this.isFull == Blocks.flowing_water) - { - int i = blockPos.getX(); - int j = blockPos.getY(); - int k = blockPos.getZ(); - world.playSoundEffect((double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); - - for (int l = 0; l < 8; ++l) - { - world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)i + Math.random(), (double)j + Math.random(), (double)k + Math.random(), 0.0D, 0.0D, 0.0D, 0); - } - } - else - { - if (!world.isRemote && flag && !material.isLiquid()) - { - world.destroyBlock(blockPos, true); - } - - world.setBlockState(blockPos, this.isFull.getDefaultState(), 3); - } - - return true; + par1World.setBlock(par8, par9, par10, this.isFull, 0, 3); + par1World.markBlockForUpdate(par8, par9, par10); } + + return true; } } - public boolean canPlaceContainedLiquid(World world, BlockPos blockPos) + public boolean canPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) { - if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().isSolid()) + if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) { return false; - } else if ((world.getBlockState(blockPos).getBlock() == Blocks.water || world.getBlockState(blockPos).getBlock() == Blocks.flowing_water) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0) + } else if ((par1World.getBlock(par8, par9, par10) == Blocks.water || par1World.getBlock(par8, par9, par10) == Blocks.flowing_water) && par1World.getBlockMetadata(par8, par9, par10) == 0) { return false; } else @@ -225,7 +216,7 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil @Override public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { - player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9)); + player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ContainerHolding.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ContainerHolding.java index e4d3afc2..c3d0e651 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ContainerHolding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ContainerHolding.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding; +import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; +import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.FMLCommonHandler; -import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil; public class ContainerHolding extends Container { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/GuiHolding.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/GuiHolding.java index f47ee663..3abcf197 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/GuiHolding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/GuiHolding.java @@ -1,11 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketHandler.java index f6acf021..6da027bd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketHandler.java @@ -1,8 +1,8 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding; -import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import net.minecraftforge.fml.relauncher.Side; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.relauncher.Side; public class HoldingPacketHandler { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketProcessor.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketProcessor.java index dc82e3b1..ad44abdf 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketProcessor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/HoldingPacketProcessor.java @@ -1,10 +1,10 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class HoldingPacketProcessor implements IMessage, IMessageHandler { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/InventoryHolding.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/InventoryHolding.java index f894aad9..81d06ae9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/InventoryHolding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/InventoryHolding.java @@ -6,7 +6,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.IChatComponent; import java.util.UUID; @@ -137,13 +136,13 @@ public class InventoryHolding implements IInventory } @Override - public String getName() + public String getInventoryName() { return "SigilOfHolding"; } @Override - public boolean hasCustomName() + public boolean hasCustomInventoryName() { return false; } @@ -167,13 +166,13 @@ public class InventoryHolding implements IInventory } @Override - public void openInventory(EntityPlayer player) + public void openInventory() { // NOOP } @Override - public void closeInventory(EntityPlayer player) + public void closeInventory() { // NOOP } @@ -225,7 +224,7 @@ public class InventoryHolding implements IInventory public static boolean hasTag(ItemStack itemStack, String keyName) { - return itemStack != null && itemStack.getTagCompound() != null && itemStack.getTagCompound().hasKey(keyName); + return itemStack != null && itemStack.stackTagCompound != null && itemStack.stackTagCompound.hasKey(keyName); } public static boolean hasUUID(ItemStack itemStack) @@ -247,7 +246,7 @@ public class InventoryHolding implements IInventory private static void initNBTTagCompound(ItemStack itemStack) { - if (itemStack.getTagCompound() == null) + if (itemStack.stackTagCompound == null) { itemStack.setTagCompound(new NBTTagCompound()); } @@ -257,36 +256,6 @@ public class InventoryHolding implements IInventory { initNBTTagCompound(itemStack); - itemStack.getTagCompound().setLong(keyName, keyValue); + itemStack.stackTagCompound.setLong(keyName, keyValue); } - - @Override - public IChatComponent getDisplayName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getField(int id) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setField(int id, int value) { - // TODO Auto-generated method stub - - } - - @Override - public int getFieldCount() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void clear() { - // TODO Auto-generated method stub - - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ScrollHelper.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ScrollHelper.java index bb96bf84..f816f868 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ScrollHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/ScrollHelper.java @@ -1,14 +1,14 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.client.event.MouseEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ScrollHelper @@ -16,7 +16,7 @@ public class ScrollHelper @SubscribeEvent public void onMouseEvent(MouseEvent event) { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; if (event.dwheel != 0 && player != null && player.isSneaking()) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java index e0eeaecb..2ad813c0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/sigil/holding/SigilOfHolding.java @@ -2,20 +2,22 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding; 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.nbt.NBTTagList; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class SigilOfHolding extends BindableItems +public class SigilOfHolding extends EnergyItems { private static int invSize = 5; @@ -24,25 +26,56 @@ public class SigilOfHolding extends BindableItems public SigilOfHolding() { super(); - setMaxStackSize(1); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } @Override - public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean par4) + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfHolding"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (!(stack.getTagCompound() == null)) + { + ItemStack[] inv = getInternalInventory(stack); + + if (inv == null) + { + return this.itemIcon; + } + + ItemStack item = getCurrentSigil(stack); + + if (item != null) + { + return item.getIconIndex(); + } + } + + return this.itemIcon; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(StatCollector.translateToLocal("tooltip.sigilofholding.desc")); - if (!(stack.getTagCompound() == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName")); - ItemStack[] inv = getInternalInventory(stack); + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName")); + ItemStack[] inv = getInternalInventory(par1ItemStack); if (inv == null) { return; } - int currentSlot = getCurrentItem(stack); + int currentSlot = getCurrentItem(par1ItemStack); ItemStack item = inv[currentSlot]; if (item != null) @@ -61,11 +94,74 @@ public class SigilOfHolding extends BindableItems } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + if (checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) + { + int currentSlot = getCurrentItem(par1ItemStack); + ItemStack[] inv = getInternalInventory(par1ItemStack); + + if (inv == null) + { + return false; + } + + ItemStack itemUsed = inv[currentSlot]; + + if (itemUsed == null) + { + return false; + } + + boolean bool = itemUsed.getItem().onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + + saveInventory(par1ItemStack, inv); + + return bool; + } + + return false; + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) + { + if (par3EntityPlayer.isSneaking()) + { + InventoryHolding.setUUID(par1ItemStack); + par3EntityPlayer.openGui(AlchemicalWizardry.instance, 3, par3EntityPlayer.worldObj, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ); + return par1ItemStack; + } + + int currentSlot = getCurrentItem(par1ItemStack); + ItemStack[] inv = getInternalInventory(par1ItemStack); + + if (inv == null) + { + return par1ItemStack; + } + + ItemStack itemUsed = inv[currentSlot]; + + if (itemUsed == null) + { + return par1ItemStack; + } + + itemUsed.getItem().onItemRightClick(itemUsed, par2World, par3EntityPlayer); + saveInventory(par1ItemStack, inv); + } + return par1ItemStack; + } + + @Override + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (checkAndSetItemOwner(stack, player)) { - int currentSlot = getCurrentItem(stack); + int currentSlot = getCurrentItem(stack); ItemStack[] inv = getInternalInventory(stack); if (inv == null) @@ -80,7 +176,7 @@ public class SigilOfHolding extends BindableItems return false; } - boolean bool = itemUsed.getItem().onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ); + boolean bool = itemUsed.getItem().onItemUseFirst(stack, player, world, x, y, z, side, hitX, hitY, hitZ); saveInventory(stack, inv); @@ -90,44 +186,11 @@ public class SigilOfHolding extends BindableItems return false; } - @Override - public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) - { - if (checkAndSetItemOwner(stack, par3EntityPlayer)) - { - if (par3EntityPlayer.isSneaking()) - { - InventoryHolding.setUUID(stack); - par3EntityPlayer.openGui(AlchemicalWizardry.instance, 3, par3EntityPlayer.worldObj, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ); - return stack; - } - - int currentSlot = getCurrentItem(stack); - ItemStack[] inv = getInternalInventory(stack); - - if (inv == null) - { - return stack; - } - - ItemStack itemUsed = inv[currentSlot]; - - if (itemUsed == null) - { - return stack; - } - - itemUsed.getItem().onItemRightClick(itemUsed, par2World, par3EntityPlayer); - saveInventory(stack, inv); - } - return stack; - } - public static int next(int mode) { int index = mode + 1; - if (index >= invSize + 1) + if (index >= invSize) { index = 0; } @@ -149,10 +212,10 @@ public class SigilOfHolding extends BindableItems private static void initModeTag(ItemStack itemStack) { - if (itemStack.getTagCompound() == null) + if (itemStack.stackTagCompound == null) { - itemStack.setTagCompound(new NBTTagCompound()); - itemStack.getTagCompound().setInteger(NBT_CURRENT_SIGIL, invSize); + itemStack.stackTagCompound = new NBTTagCompound(); + itemStack.stackTagCompound.setInteger(NBT_CURRENT_SIGIL, invSize); } } @@ -176,7 +239,7 @@ public class SigilOfHolding extends BindableItems if (itemStack != null && itemStack.getItem() instanceof SigilOfHolding) { initModeTag(itemStack); - int currentSigil = itemStack.getTagCompound().getInteger(NBT_CURRENT_SIGIL); + int currentSigil = itemStack.stackTagCompound.getInteger(NBT_CURRENT_SIGIL); currentSigil = MathHelper.clamp_int(currentSigil, 0, invSize); return currentSigil; } @@ -246,22 +309,22 @@ public class SigilOfHolding extends BindableItems if (itemStack != null && itemStack.getItem() instanceof SigilOfHolding) { initModeTag(itemStack); - itemStack.getTagCompound().setInteger(NBT_CURRENT_SIGIL, mode); + itemStack.stackTagCompound.setInteger(NBT_CURRENT_SIGIL, mode); } } @Override - public void onUpdate(ItemStack stack, World par2World, Entity par3Entity, int par4, boolean par5) + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (!(stack.getTagCompound() == null)) + if (!(par1ItemStack.getTagCompound() == null)) { - this.tickInternalInventory(stack, par2World, par3Entity, par4, par5); + this.tickInternalInventory(par1ItemStack, par2World, par3Entity, par4, par5); } } - public void tickInternalInventory(ItemStack stack, World par2World, Entity par3Entity, int par4, boolean par5) + public void tickInternalInventory(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - ItemStack[] inv = getInternalInventory(stack); + ItemStack[] inv = getInternalInventory(par1ItemStack); if (inv == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java index f044912d..997740d9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java @@ -1,192 +1,192 @@ -//package WayofTime.alchemicalWizardry.common.items.thaumcraft; -// -//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.IIcon; -//import net.minecraft.util.StatCollector; -//import net.minecraft.world.World; -//import thaumcraft.api.IGoggles; -//import thaumcraft.api.IRepairable; -//import thaumcraft.api.IRunicArmor; -//import thaumcraft.api.IVisDiscountGear; -//import thaumcraft.api.aspects.Aspect; -//import thaumcraft.api.nodes.IRevealer; -// -//import java.util.List; -// -//public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable -//{ -// @SideOnly(Side.CLIENT) -// private IIcon helmetIcon; -// @SideOnly(Side.CLIENT) -// private IIcon plateIcon; -// @SideOnly(Side.CLIENT) -// private IIcon leggingsIcon; -// @SideOnly(Side.CLIENT) -// private IIcon bootsIcon; -// -// public ItemSanguineArmour(int armorType) -// { -// super(AlchemicalWizardry.sanguineArmourArmourMaterial, 0, armorType); -// setMaxDamage(1000); -// setCreativeTab(AlchemicalWizardry.tabBloodMagic); -// } -// -// @Override -// @SideOnly(Side.CLIENT) -// public void registerIcons(IIconRegister iconRegister) -// { -// this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); -// this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet"); -// this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguinePlate"); -// this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineLeggings"); -// this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineBoots"); -// } -// -// @SideOnly(Side.CLIENT) -// public IIcon getIconFromDamage(int par1) -// { -// if (this.equals(ModItems.sanguineHelmet)) -// { -// return this.helmetIcon; -// } -// -// if (this.equals(ModItems.sanguineRobe)) -// { -// return this.plateIcon; -// } -// -// if (this.equals(ModItems.sanguinePants)) -// { -// return this.leggingsIcon; -// } -// -// if (this.equals(ModItems.sanguineBoots)) -// { -// return this.bootsIcon; -// } -// -// return this.itemIcon; -// } -// -// @Override -// public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) -// { -// if (this == ModItems.sanguineHelmet) -// { -// return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png"; -// } -// -// if (this == ModItems.sanguineRobe || this == ModItems.sanguineBoots) -// { -// return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png"; -// } -// -// if (this == ModItems.sanguinePants) -// { -// return "alchemicalwizardry:models/armor/sanguineArmour_layer_2.png"; -// } else -// { -// return null; -// } -// } -// -// @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(StatCollector.translateToLocal("tooltip.sanguinearmor.desc1")); -// break; -// case 1: -// -// case 2: -// -// case 3: -// par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.desc2")); -// } -// -// par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.visdisc") + " " + discount + "%"); -// } -// -// @Override -// public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) -// { -// return; -// } -// -// @Override -// public boolean isUpgrade() -// { -// return true; -// } -// -// @Override -// public int getEnergyForTenSeconds() -// { -// return 0; -// } -// -// @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 boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) -// { -// return true; -// } -// -// @Override -// public int getRunicCharge(ItemStack itemstack) -// { -// return 0; -// } -//} \ No newline at end of file +package WayofTime.alchemicalWizardry.common.items.thaumcraft; + +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.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import thaumcraft.api.IGoggles; +import thaumcraft.api.IRepairable; +import thaumcraft.api.IRunicArmor; +import thaumcraft.api.IVisDiscountGear; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.nodes.IRevealer; + +import java.util.List; + +public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable +{ + @SideOnly(Side.CLIENT) + private IIcon helmetIcon; + @SideOnly(Side.CLIENT) + private IIcon plateIcon; + @SideOnly(Side.CLIENT) + private IIcon leggingsIcon; + @SideOnly(Side.CLIENT) + private IIcon bootsIcon; + + public ItemSanguineArmour(int armorType) + { + super(AlchemicalWizardry.sanguineArmourArmourMaterial, 0, armorType); + setMaxDamage(1000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet"); + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguinePlate"); + this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineLeggings"); + this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineBoots"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (this.equals(ModItems.sanguineHelmet)) + { + return this.helmetIcon; + } + + if (this.equals(ModItems.sanguineRobe)) + { + return this.plateIcon; + } + + if (this.equals(ModItems.sanguinePants)) + { + return this.leggingsIcon; + } + + if (this.equals(ModItems.sanguineBoots)) + { + return this.bootsIcon; + } + + return this.itemIcon; + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + if (this == ModItems.sanguineHelmet) + { + return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png"; + } + + if (this == ModItems.sanguineRobe || this == ModItems.sanguineBoots) + { + return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png"; + } + + if (this == ModItems.sanguinePants) + { + return "alchemicalwizardry:models/armor/sanguineArmour_layer_2.png"; + } else + { + return null; + } + } + + @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(StatCollector.translateToLocal("tooltip.sanguinearmor.desc1")); + break; + case 1: + + case 2: + + case 3: + par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.desc2")); + } + + par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.visdisc") + " " + discount + "%"); + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + return; + } + + @Override + public boolean isUpgrade() + { + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + return 0; + } + + @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 boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) + { + return true; + } + + @Override + public int getRunicCharge(ItemStack itemstack) + { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java index 06c4b2fc..5c189f92 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java @@ -1,11 +1,9 @@ package WayofTime.alchemicalWizardry.common.omega; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; public interface IEnchantmentGlyph extends IStabilityGlyph { - int getEnchantability(World world, BlockPos pos, int meta); - - int getEnchantmentLevel(World world, BlockPos pos, int meta); + public int getEnchantability(World world, int x, int y, int z, int meta); + public int getEnchantmentLevel(World world, int x, int y, int z, int meta); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java index 2b826b0f..50252a94 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java @@ -1,9 +1,8 @@ package WayofTime.alchemicalWizardry.common.omega; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; public interface IStabilityGlyph { - int getAdditionalStabilityForFaceCount(World world, BlockPos pos, int meta, int faceCount); + public int getAdditionalStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java index 3c93d301..c60b30d2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigm.java @@ -5,7 +5,6 @@ import java.util.Random; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; @@ -48,7 +47,7 @@ public class OmegaParadigm ItemStack leggingsStack = armours[1]; ItemStack bootsStack = armours[0]; - if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundChestplate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots) + if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundPlate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots) { long worldSeed = player.worldObj.getSeed(); Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z - 1623451*enchantability + 2 * enchantmentLevel); @@ -133,7 +132,7 @@ public class OmegaParadigm } - public boolean getBlockEffectWhileInside(Entity entity, BlockPos blockPos) + public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z) { return false; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java index bb021201..65283945 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmEarth.java @@ -1,5 +1,7 @@ package WayofTime.alchemicalWizardry.common.omega; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; @@ -33,16 +35,22 @@ public class OmegaParadigmEarth extends OmegaParadigm { if(player.posY < 50 && player.getHealth() < player.getMaxHealth()) { - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true, false)); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true)); } } if(player.posY > 100) { - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, 200, 0, true, false)); + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, 200, 0, true)); } } + @Override + public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z) + { + return true; + } + @Override public void onOmegaKeyPressed(EntityPlayer player, ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java index d4fd272a..4802841f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmFire.java @@ -1,6 +1,7 @@ package WayofTime.alchemicalWizardry.common.omega; import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; @@ -34,28 +35,34 @@ public class OmegaParadigmFire extends OmegaParadigm boolean isInLava = player.isInsideOfMaterial(Material.lava); if(player.isBurning() && player.getHealth() < player.getMaxHealth()) { - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, isInLava ? 1 : 0, true, false)); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, isInLava ? 1 : 0, true)); } if(player.isBurning()) { - player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, isInLava ? 400 : 200, isInLava ? 1 : 0, true, false)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, isInLava ? 400 : 200, isInLava ? 1 : 0, true)); } if(player.isInWater()) { - player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200, 2, true, false)); - player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2, true, false)); - player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 1, true, false)); + player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200, 2, true)); + player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2, true)); + player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 1, true)); } } if(player.isBurning()) { - player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 200, 0, true, false)); + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 200, 0, true)); } } + @Override + public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z) + { + return true; + } + @Override public void onOmegaKeyPressed(EntityPlayer player, ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java index 80fda3d3..941f82cd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWater.java @@ -7,7 +7,6 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; @@ -36,24 +35,24 @@ public class OmegaParadigmWater extends OmegaParadigm @Override public void onUpdate(World world, EntityPlayer player, ItemStack stack) { - player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 3, 0, true, false)); - player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionAmphibian.id, 3, 0, true, false)); + player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 3, 0, true)); + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionAmphibian.id, 3, 0, true)); if(world.getWorldTime() % 100 == 0 && !world.isRemote) { if(player.isInWater() && player.getHealth() < player.getMaxHealth()) { - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true, false)); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true)); } } } @Override - public boolean getBlockEffectWhileInside(Entity entity, BlockPos pos) + public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z) { if(entity instanceof EntityLivingBase) { - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 1, true, false)); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 1, true)); } return true; } @@ -75,7 +74,7 @@ public class OmegaParadigmWater extends OmegaParadigm { for(int k=-range; k<=range; k++) { - TEMimicBlock.createMimicBlockAtLocation(world, new BlockPos(x+i, y+j, z+k), 300, Blocks.water.getDefaultState(), ReagentRegistry.aquasalusReagent); + TEMimicBlock.createMimicBlockAtLocation(world, x+i, y+j, z+k, 300, Blocks.water, 0, ReagentRegistry.aquasalusReagent); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java index 67ad78c8..1276863c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaParadigmWind.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.omega; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; @@ -32,12 +33,18 @@ public class OmegaParadigmWind extends OmegaParadigm { if(world.getWorldTime() % 100 == 0 && !world.isRemote && player.posY > 128 && player.getHealth() < player.getMaxHealth()) { - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, player.posY > 128 + 64 ? 1 : 0, true, false)); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, player.posY > 128 + 64 ? 1 : 0, true)); } player.fallDistance = 0; } + @Override + public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z) + { + return true; + } + @Override public void onOmegaKeyPressed(EntityPlayer player, ItemStack stack) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java index 0f804337..d8106b55 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java @@ -9,7 +9,7 @@ import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; public class OmegaRegistry { - public static HashMap omegaList = new HashMap(); + public static HashMap omegaList = new HashMap(); public static void registerParadigm(Reagent reagent, OmegaParadigm parad) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java index 45561cf9..7289c491 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaStructureHandler.java @@ -1,9 +1,6 @@ package WayofTime.alchemicalWizardry.common.omega; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.Int3; @@ -17,7 +14,7 @@ public class OmegaStructureHandler return true; } - public static OmegaStructureParameters getStructureStabilityFactor(World world, BlockPos pos, int expLim, Int3 offset) + public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim, Int3 offset) { int range = expLim; @@ -49,33 +46,107 @@ public class OmegaStructureHandler { if (boolList[i][j][k] == 1) { - BlockPos position = pos.add(i - range, j - range, k - range); - - for(EnumFacing face : EnumFacing.VALUES) - { - int iP = i + face.getFrontOffsetX(); - int jP = j + face.getFrontOffsetY(); - int kP = k + face.getFrontOffsetZ(); - - if(iP >= 0 && iP <= 2 * range && jP >= 0 && jP <= 2 * range && kP >= 0 && kP <= 2 * range && !(boolList[iP][jP][kP] == 1 || boolList[iP][jP][kP] == -1)) - { - BlockPos newPos = position.add(face.getDirectionVec()); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - if (world.isAirBlock(newPos) || block == ModBlocks.blockSpectralContainer) - { - if(iP == 0 && iP == 2 * range && jP == 0 && jP == 2 * range && kP == 0 && kP == 2 * range) - { - return emptyParam; - } - boolList[iP][jP][kP] = 1; - isReady = false; - }else - { - boolList[iP][jP][kP] = -1; - } - } - } + if (i - 1 >= 0 && !(boolList[i - 1][j][k] == 1 || boolList[i - 1][j][k] == -1)) + { + 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(i - 1 == 0) //One of the found air blocks is at the range boundary, and thus the container is incomplete + { + return emptyParam; + } + boolList[i - 1][j][k] = 1; + isReady = false; + }else + { + boolList[i - 1][j][k] = -1; + } + } + + if (j - 1 >= 0 && !(boolList[i][j - 1][k] == 1 || boolList[i][j - 1][k] == -1)) + { + 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(j - 1 == 0) + { + return emptyParam; + } + boolList[i][j - 1][k] = 1; + isReady = false; + }else + { + boolList[i][j - 1][k] = -1; + } + } + + if (k - 1 >= 0 && !(boolList[i][j][k - 1] == 1 || boolList[i][j][k - 1] == -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) + { + if(k - 1 == 0) + { + return emptyParam; + } + boolList[i][j][k - 1] = 1; + isReady = false; + }else + { + boolList[i][j][k - 1] = -1; + } + } + + if (i + 1 <= 2 * range && !(boolList[i + 1][j][k] == 1 || boolList[i + 1][j][k] == -1)) + { + 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(i + 1 == range * 2) + { + return emptyParam; + } + boolList[i + 1][j][k] = 1; + isReady = false; + }else + { + boolList[i + 1][j][k] = -1; + } + } + + if (j + 1 <= 2 * range && !(boolList[i][j + 1][k] == 1 || boolList[i][j + 1][k] == -1)) + { + 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(j + 1 == range * 2) + { + return emptyParam; + } + boolList[i][j + 1][k] = 1; + isReady = false; + }else + { + boolList[i][j + 1][k] = -1; + } + } + + if (k + 1 <= 2 * range && !(boolList[i][j][k + 1] == 1 || boolList[i][j][k + 1] == -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) + { + if(k + 1 == range * 2) + { + return emptyParam; + } + boolList[i][j][k + 1] = 1; + isReady = false; + }else + { + boolList[i][j][k + 1] = -1; + } + } } } } @@ -129,20 +200,17 @@ public class OmegaStructureHandler indTally++; } - BlockPos newPos = pos.add(i - range, j - range, k - range); - - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - int meta = block.getMetaFromState(state); + Block block = world.getBlock(x - range + i, y - range + j, z - range + k); + int meta = world.getBlockMetadata(x - range + i, y - range + j, z - range + k); if(block instanceof IEnchantmentGlyph) { - tally += ((IEnchantmentGlyph)block).getAdditionalStabilityForFaceCount(world, newPos, meta, indTally); - enchantability += ((IEnchantmentGlyph)block).getEnchantability(world, newPos, meta); - enchantmentLevel += ((IEnchantmentGlyph)block).getEnchantmentLevel(world, newPos, meta); + tally += ((IEnchantmentGlyph)block).getAdditionalStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally); + enchantability += ((IEnchantmentGlyph)block).getEnchantability(world, x-range+i, y-range+j, z-range+k, meta); + enchantmentLevel += ((IEnchantmentGlyph)block).getEnchantmentLevel(world, x-range+i, y-range+j, z-range+k, meta); }else if(block instanceof IStabilityGlyph) { - tally += ((IStabilityGlyph)block).getAdditionalStabilityForFaceCount(world, newPos, meta, indTally); + tally += ((IStabilityGlyph)block).getAdditionalStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally); }else { tally += indTally; @@ -154,8 +222,8 @@ public class OmegaStructureHandler return new OmegaStructureParameters(tally, enchantability, enchantmentLevel); } - public static OmegaStructureParameters getStructureStabilityFactor(World world, BlockPos pos, int expLim) + public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim) { - return getStructureStabilityFactor(world, pos, expLim, new Int3(0, 0, 0)); + return getStructureStabilityFactor(world, x, y, z, expLim, new Int3(0, 0, 0)); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionBloodMagic.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionAmphibian.java similarity index 53% rename from src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionBloodMagic.java rename to src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionAmphibian.java index 4b86628d..1e3afb29 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionBloodMagic.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionAmphibian.java @@ -1,13 +1,12 @@ package WayofTime.alchemicalWizardry.common.potion; import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -public class PotionBloodMagic extends Potion +public class PotionAmphibian extends Potion { - public PotionBloodMagic(int par1, boolean par2, int par3) + public PotionAmphibian(int par1, boolean par2, int par3) { - super(par1, new ResourceLocation("speed"),par2, par3); + super(par1, par2, par3); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionBoost.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionBoost.java new file mode 100644 index 00000000..132205bb --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionBoost.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionBoost extends Potion +{ + public PotionBoost(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDeaf.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDeaf.java new file mode 100644 index 00000000..fc46e77b --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDeaf.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionDeaf extends Potion +{ + public PotionDeaf(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDemonCloak.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDemonCloak.java new file mode 100644 index 00000000..ea2045f4 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDemonCloak.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionDemonCloak extends Potion +{ + public PotionDemonCloak(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDrowning.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDrowning.java new file mode 100644 index 00000000..87558f26 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionDrowning.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionDrowning extends Potion +{ + public PotionDrowning(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFeatherFall.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFeatherFall.java new file mode 100644 index 00000000..0c35263b --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFeatherFall.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionFeatherFall extends Potion +{ + public PotionFeatherFall(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFireFuse.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFireFuse.java new file mode 100644 index 00000000..8fe5d527 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFireFuse.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionFireFuse extends Potion +{ + public PotionFireFuse(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java new file mode 100644 index 00000000..46363b11 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlameCloak.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionFlameCloak extends Potion +{ + public PotionFlameCloak(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlight.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlight.java new file mode 100644 index 00000000..23e93e57 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionFlight.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionFlight extends Potion +{ + public PotionFlight(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionHeavyHeart.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionHeavyHeart.java new file mode 100644 index 00000000..952fb59c --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionHeavyHeart.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionHeavyHeart extends Potion +{ + public PotionHeavyHeart(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java new file mode 100644 index 00000000..c2ba716a --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionIceCloak.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionIceCloak extends Potion +{ + public PotionIceCloak(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionInhibit.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionInhibit.java new file mode 100644 index 00000000..2214e105 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionInhibit.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionInhibit extends Potion +{ + public PotionInhibit(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionPlanarBinding.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionPlanarBinding.java new file mode 100644 index 00000000..54d6cd72 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionPlanarBinding.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionPlanarBinding extends Potion +{ + public PotionPlanarBinding(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionProjectileProtect.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionProjectileProtect.java new file mode 100644 index 00000000..317edd54 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionProjectileProtect.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionProjectileProtect extends Potion +{ + public PotionProjectileProtect(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionReciprocation.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionReciprocation.java new file mode 100644 index 00000000..ddceed0b --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionReciprocation.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionReciprocation extends Potion +{ + public PotionReciprocation(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java new file mode 100644 index 00000000..304b0307 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java @@ -0,0 +1,34 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; + +import java.util.ArrayList; + +public class PotionSoulFray extends Potion +{ + public PotionSoulFray(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } + + @Override + public void performEffect(EntityLivingBase entityLivingBase, int level) + { + entityLivingBase.getActivePotionEffect(this).setCurativeItems(new ArrayList()); + } + + @Override + public boolean isReady(int duration, int level) + { + return true; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulHarden.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulHarden.java new file mode 100644 index 00000000..0ac24694 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulHarden.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common.potion; + +import net.minecraft.potion.Potion; + +public class PotionSoulHarden extends Potion +{ + public PotionSoulHarden(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java index 29185083..d58f5581 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.renderer; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -47,34 +47,36 @@ public class AlchemyCircleRenderer extends MRSRenderer } GL11.glPushMatrix(); - Tessellator tessellator = Tessellator.getInstance(); + 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); - WorldRenderer wr = tessellator.getWorldRenderer(); - wr.startDrawingQuads(); - wr.func_178961_b(colourRed, colourGreen, colourBlue, colourIntensity); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); GL11.glTranslated(x + 0.5 + xOffset, y + 0.5 + (yOffset - initialY) * (tile.getRunningTime() / 100d) + initialY, z + 0.5 + zOffset); float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); GL11.glRotatef(rotationAngle, 0F, 1F, 0F); //Rotate on planar axis -// tessellator.setBrightness(240); + tessellator.setBrightness(240); double finalRadius = (radius) * (tile.getRunningTime() / 100d); - wr.addVertexWithUV(-finalRadius, 0, -finalRadius, 0.0d, 0.0d); - wr.addVertexWithUV(finalRadius, 0, -finalRadius, 1.0d, 0.0d); - wr.addVertexWithUV(finalRadius, 0, finalRadius, 1.0d, 1.0d); - wr.addVertexWithUV(-finalRadius, 0, finalRadius, 0.0d, 1.0d); + 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(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java new file mode 100644 index 00000000..06ddafd3 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java @@ -0,0 +1,146 @@ +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; + +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; + } + + 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; + } + + public void setSize(double size) + { + this.size = size; + } + + protected static void bindTexture(ResourceLocation p_147499_1_) + { + TextureManager texturemanager = TileEntityRendererDispatcher.instance.field_147553_e; + + if (texturemanager != null) + { + 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); + + + 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/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java new file mode 100644 index 00000000..26ace13d --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java @@ -0,0 +1,420 @@ +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; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +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.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.opengl.GL11; + +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() + { + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TEAlchemicCalcinator) + { + TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity; + + 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); + this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(1) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1)); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1)); + float displacement = 0.2F; + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + 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.glScalef(scaleFactor, scaleFactor, scaleFactor); + + if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) + { + GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F); + } + + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); + } + + + GL11.glPopMatrix(); + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(0) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); + float displacement = -0.5F; + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + 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.glScalef(scaleFactor, scaleFactor, scaleFactor); + + if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) + { + GL11.glRotatef(90f, 1.0f, 0.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); + } + } + } + } + + private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) + { + GL11.glPushMatrix(); + 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); + 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 = -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; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) + { + case 1: + return 0.90F * scaleFactor; + + case 2: + return 0.90F * scaleFactor; + + case 3: + return 0.90F * scaleFactor; + + case 4: + return 0.90F * scaleFactor; + + case 5: + return 0.80F * scaleFactor; + + default: + return 0.90F * scaleFactor; + } + } else + { + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) + { + case 1: + return 0.65F * scaleFactor; + + case 2: + return 0.65F * scaleFactor; + + case 3: + return 0.65F * scaleFactor; + + case 4: + return 0.65F * scaleFactor; + + default: + return 0.65F * scaleFactor; + } + } + } + + return scaleFactor; + } + + private float getXDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.0f; + + case 1: + return -0.375f; + + case 2: + return -0.125f; + + case 3: + return 0.3125f; + + case 4: + return 0.3125f; + + case 5: + return -0.125f; + + default: + return 0.0f; + } + } + + private float getYDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.4f; + + case 1: + return -0.35f; + + case 6: + return 0.4f; + + default: + return -0.35f; + } + } + + private float getZDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.0f; + + case 1: + return 0.0f; + + case 2: + return 0.375f; + + case 3: + return 0.25f; + + case 4: + return -0.25f; + + case 5: + return -0.375f; + + default: + return 0.0f; + } + } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicalCalcinator.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicalCalcinator.java deleted file mode 100644 index defed192..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicalCalcinator.java +++ /dev/null @@ -1,201 +0,0 @@ -package WayofTime.alchemicalWizardry.common.renderer.block; - -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicalCalcinator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -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.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -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; - -public class RenderAlchemicalCalcinator extends TileEntitySpecialRenderer -{ - private final RenderItem customRenderItem; - private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator(); - - private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png"); - - public RenderAlchemicalCalcinator() - { - customRenderItem = Minecraft.getMinecraft().getRenderItem(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) - { - if (tileEntity instanceof TEAlchemicalCalcinator) - { - TEAlchemicalCalcinator tileAltar = (TEAlchemicalCalcinator) tileEntity; - - 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); - this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - - if (tileAltar.getStackInSlot(1) != null) - { - float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1)); - EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); - ghostEntityItem.hoverStart = 0.0F; - ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1)); - float displacement = 0.2F; - - if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) - { - 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.glScalef(scaleFactor, scaleFactor, scaleFactor); - - if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) - { - GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F); - } - - customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel - } - - - GL11.glPopMatrix(); - GL11.glPushMatrix(); - - if (tileAltar.getStackInSlot(0) != null) - { - float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); - EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); - ghostEntityItem.hoverStart = 0.0F; - ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); - float displacement = -0.5F; - - if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) - { - 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.glScalef(scaleFactor, scaleFactor, scaleFactor); - - if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) - { - GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F); - } - - customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel - } - - GL11.glPopMatrix(); - - - ReagentContainerInfo[] info = tileAltar.getContainerInfo(EnumFacing.UP); - 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); - } - } - } - } - - private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) - { - GL11.glPushMatrix(); - Tessellator tessellator = Tessellator.getInstance(); - 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); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glDepthMask(false); - - WorldRenderer wr = tessellator.getWorldRenderer(); - wr.startDrawingQuads(); - wr.func_178961_b(colourRed, colourGreen, colourBlue, colourIntensity); //setCoulourRGBA - GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); - wr.func_178963_b(240); //setBrightness - - 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; - - wr.addVertexWithUV(x1, y1, z1, resx1, resy1); - wr.addVertexWithUV(x2, y1, z1, resx2, resy1); - wr.addVertexWithUV(x2, y2, z1, resx2, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y1, z1, resx1, resy1); - wr.addVertexWithUV(x1, y1, z2, resx2, resy1); - wr.addVertexWithUV(x1, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y1, z2, resx1, resy1); - wr.addVertexWithUV(x2, y1, z2, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z2, resx1, resy2); - wr.addVertexWithUV(x2, y1, z1, resx1, resy1); - wr.addVertexWithUV(x2, y1, z2, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.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; - - if (itemStack != null) - { - if (itemStack.getItem() instanceof ItemBlock) - { - return 0.90F * scaleFactor; - } else - { - return 0.65F * scaleFactor; - } - } - - return scaleFactor; - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAltar.java deleted file mode 100644 index 6f1294a2..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAltar.java +++ /dev/null @@ -1,80 +0,0 @@ -package WayofTime.alchemicalWizardry.common.renderer.block; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -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.EnumFacing; - -import org.lwjgl.opengl.GL11; - -import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; - -public class RenderAltar extends TileEntitySpecialRenderer -{ - private ModelBloodAltar modelBloodAltar = new ModelBloodAltar(); - private final RenderItem customRenderItem; - - public RenderAltar() - { - customRenderItem = Minecraft.getMinecraft().getRenderItem(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) - { - modelBloodAltar.renderBloodAltar((TEAltar) tileEntity, d0, d1, d2); - modelBloodAltar.renderBloodLevel((TEAltar) tileEntity, d0, d1, d2); - - if (tileEntity instanceof TEAltar) - { - TEAltar tileAltar = (TEAltar) tileEntity; - GL11.glPushMatrix(); - - if (tileAltar.getStackInSlot(0) != null) - { - float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); - float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; - EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); - ghostEntityItem.hoverStart = 0.0F; - ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); - float displacement = 0.2F; - - if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) - { - 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 + 0.6F, (float) d2 + 0.5F); - } - GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); - GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); - customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel - } - - GL11.glPopMatrix(); - } - } - - private float getGhostItemScaleFactor(ItemStack itemStack) - { - float scaleFactor = 1.0F; - - if (itemStack != null) - { - if (itemStack.getItem() instanceof ItemBlock) - { - return 0.9f; - } else - { - return 0.65f; - } - } - - return scaleFactor; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderChemistrySet.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderChemistrySet.java deleted file mode 100644 index cc3aa790..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderChemistrySet.java +++ /dev/null @@ -1,166 +0,0 @@ -package WayofTime.alchemicalWizardry.common.renderer.block; - -import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -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.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -import org.lwjgl.opengl.GL11; - -import WayofTime.alchemicalWizardry.common.renderer.model.ModelChemistrySet; - -public class RenderChemistrySet extends TileEntitySpecialRenderer -{ - private ModelChemistrySet modelChemistrySet = new ModelChemistrySet(); - private final RenderItem customRenderItem; - - public RenderChemistrySet() - { - customRenderItem = Minecraft.getMinecraft().getRenderItem(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int a) - { - if (tileEntity instanceof TEChemistrySet) - { - TEChemistrySet tileAltar = (TEChemistrySet) tileEntity; - GL11.glDisable(GL11.GL_LIGHTING); - 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); - this.modelChemistrySet.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - - for (int i = 1; i <= 6; i++) - { - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_LIGHTING); - if (tileAltar.getStackInSlot(i) != null) - { - float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i)); - float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; - EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); - ghostEntityItem.hoverStart = 0.0F; - ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i)); - 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.glScalef(scaleFactor, scaleFactor, scaleFactor); - GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); - customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel - } - - GL11.glPopMatrix(); - } - } - } - - private float getGhostItemScaleFactor(ItemStack itemStack) - { - float scaleFactor = 0.8F; - - if (itemStack != null) - { - if (itemStack.getItem() instanceof ItemBlock) - { - return 0.9f * scaleFactor; - } else - { - return 0.65F * scaleFactor; - } - } - - return scaleFactor; - } - - private float getXDisplacementForSlot(int slot) - { - switch (slot) - { - case 0: - return 0.0f; - - case 1: - return -0.375f; - - case 2: - return -0.125f; - - case 3: - return 0.3125f; - - case 4: - return 0.3125f; - - case 5: - return -0.125f; - - default: - return 0.0f; - } - } - - private float getYDisplacementForSlot(int slot) - { - switch (slot) - { - case 0: - return 0.4f; - - case 1: - return -0.35f; - - case 6: - return 0.4f; - - default: - return -0.35f; - } - } - - private float getZDisplacementForSlot(int slot) - { - switch (slot) - { - case 0: - return 0.0f; - - case 1: - return 0.0f; - - case 2: - return 0.375f; - - case 3: - return 0.25f; - - case 4: - return -0.25f; - - case 5: - return -0.375f; - - default: - return 0.0f; - } - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java index 2eb6d20a..07a1ffd8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java @@ -1,21 +1,20 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit; import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; +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 RenderConduit extends TileEntitySpecialRenderer { private ModelConduit modelConduit = new ModelConduit(); @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TEConduit) { @@ -26,7 +25,7 @@ public class RenderConduit extends TileEntitySpecialRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection()); + this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection()); GL11.glPopMatrix(); GL11.glPopMatrix(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java index 2330212b..b37b9391 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java @@ -1,20 +1,18 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -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 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.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 { @@ -22,12 +20,13 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png"); + @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { - if (tileEntity instanceof TEBelljar) + if (tileEntity instanceof TEBellJar) { - TEBelljar tileAltar = (TEBelljar) tileEntity; + TEBellJar tileAltar = (TEBellJar) tileEntity; 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"); @@ -38,7 +37,7 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer GL11.glPopMatrix(); GL11.glPopMatrix(); - ReagentContainerInfo[] info = tileAltar.getContainerInfo(EnumFacing.UP); + ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN); if (info.length >= 1 && info[0] != null) { ReagentStack reagentStack = info[0].reagent; @@ -55,20 +54,22 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) { GL11.glPushMatrix(); - Tessellator tessellator = Tessellator.getInstance(); + 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); - WorldRenderer wr = tessellator.getWorldRenderer(); - wr.startDrawingQuads(); - wr.func_178961_b(colourRed, colourGreen, colourBlue, colourIntensity); //setColourRGBA + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); - wr.func_178963_b(240); //setBrightness + tessellator.setBrightness(240); double x1 = -4d / 16d; double x2 = 4d / 16d; @@ -82,26 +83,26 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer double resy1 = 1.0d; double resy2 = 1.0d; - wr.addVertexWithUV(x1, y1, z1, resx1, resy1); - wr.addVertexWithUV(x2, y1, z1, resx2, resy1); - wr.addVertexWithUV(x2, y2, z1, resx2, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y1, z1, resx1, resy1); - wr.addVertexWithUV(x1, y1, z2, resx2, resy1); - wr.addVertexWithUV(x1, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y1, z2, resx1, resy1); - wr.addVertexWithUV(x2, y1, z2, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z2, resx1, resy2); - wr.addVertexWithUV(x2, y1, z1, resx1, resy1); - wr.addVertexWithUV(x2, y1, z2, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.addVertexWithUV(x2, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy1); - wr.addVertexWithUV(x2, y2, z1, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z2, resx1, resy2); + 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); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java index 8ef4f8ff..968ddf3e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderMasterStone.java @@ -1,15 +1,15 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; import WayofTime.alchemicalWizardry.api.renderer.MRSRenderer; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; public class RenderMasterStone extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TEMasterStone) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java index 21e05777..b5319f98 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java @@ -1,20 +1,19 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.Minecraft; +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; 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.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; - public class RenderPedestal extends TileEntitySpecialRenderer { private ModelPedestal modelPedestal = new ModelPedestal(); @@ -22,11 +21,19 @@ public class RenderPedestal extends TileEntitySpecialRenderer public RenderPedestal() { - customRenderItem = Minecraft.getMinecraft().getRenderItem(); + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); } @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TEPedestal) { @@ -46,7 +53,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer { float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); - EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); float displacement = 0.2F; @@ -60,7 +67,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer } GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); - customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); } GL11.glPopMatrix(); @@ -85,13 +92,156 @@ public class RenderPedestal extends TileEntitySpecialRenderer { if (itemStack.getItem() instanceof ItemBlock) { - return 0.9f; + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) + { + case 1: + return 0.90F; + + case 2: + return 0.90F; + + case 3: + return 0.90F; + + case 4: + return 0.90F; + + case 5: + return 0.80F; + + default: + return 0.90F; + } } else { - return 0.65f; + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) + { + case 1: + return 0.65F; + + case 2: + return 0.65F; + + case 3: + return 0.65F; + + case 4: + return 0.65F; + + default: + return 0.65F; + } } } return scaleFactor; } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } + } + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java index 759c6e97..a8a867e4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java @@ -1,20 +1,19 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.Minecraft; +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; 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.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth; -import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; - public class RenderPlinth extends TileEntitySpecialRenderer { private ModelPlinth modelPlinth = new ModelPlinth(); @@ -22,11 +21,19 @@ public class RenderPlinth extends TileEntitySpecialRenderer public RenderPlinth() { - customRenderItem = Minecraft.getMinecraft().getRenderItem(); + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); } @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TEPlinth) { @@ -45,7 +52,7 @@ public class RenderPlinth extends TileEntitySpecialRenderer if (tileAltar.getStackInSlot(0) != null) { float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); - EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); ghostEntityItem.hoverStart = 0.0F; ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); float displacement = 0.2F; @@ -64,7 +71,7 @@ public class RenderPlinth extends TileEntitySpecialRenderer GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F); } - customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); } GL11.glPopMatrix(); @@ -79,13 +86,156 @@ public class RenderPlinth extends TileEntitySpecialRenderer { if (itemStack.getItem() instanceof ItemBlock) { - return 0.9f * scaleFactor; + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) + { + case 1: + return 0.90F * scaleFactor / 2; + + case 2: + return 0.90F * scaleFactor / 2; + + case 3: + return 0.90F * scaleFactor / 2; + + case 4: + return 0.90F * scaleFactor / 2; + + case 5: + return 0.80F * scaleFactor / 2; + + default: + return 0.90F * scaleFactor / 2; + } } else { - return 0.65f * scaleFactor; + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) + { + case 1: + return 0.65F * scaleFactor; + + case 2: + return 0.65F * scaleFactor; + + case 3: + return 0.65F * scaleFactor; + + case 4: + return 0.65F * scaleFactor; + + default: + return 0.65F * scaleFactor; + } } } return scaleFactor; } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } + } + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java index 6fbd6266..3ab80b7e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderReagentConduit.java @@ -1,34 +1,29 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - import WayofTime.alchemicalWizardry.api.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.ResourceLocation; + +import org.lwjgl.opengl.GL11; public class RenderReagentConduit extends TileEntitySpecialRenderer { private static final ResourceLocation field_110629_a = new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"); @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TEReagentConduit) { int renderCount = ((TEReagentConduit) tileEntity).renderCount; - BlockPos pos = tileEntity.getPos(); - float key1 = (pos.getX() * 54f - pos.getY() * 38.72f + pos.getZ() * 10.432f); - float key2 = (pos.getX() * 21.43f - pos.getY() * 9.96f + pos.getZ() * 12.8f); + 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(); - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer wr = tessellator.getWorldRenderer(); + 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); @@ -37,17 +32,17 @@ public class RenderReagentConduit extends TileEntitySpecialRenderer GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDepthMask(false); - wr.startDrawingQuads(); - wr.func_178961_b(colourMap.xCoord, colourMap.yCoord, colourMap.zCoord, 200); + 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.getWorld().getWorldTime() / 3.0f, 0F, 1F, 0F); //Rotate on planar axis + 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 - wr.func_178963_b(240); - wr.addVertexWithUV(-0.5d, 0, -0.5d, 0.0d, 0.0d); - wr.addVertexWithUV(0.5d, 0, -0.5d, 1.0d, 0.0d); - wr.addVertexWithUV(0.5d, 0, 0.5d, 1.0d, 1.0d); - wr.addVertexWithUV(-0.5d, 0, 0.5d, 0.0d, 1.0d); + 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); tessellator.draw(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java index e1209166..555fb5f7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java @@ -1,21 +1,19 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -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.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellEffectBlock extends TileEntitySpecialRenderer { private ModelSpellEffectBlock modelSpellEffectBlock = new ModelSpellEffectBlock(); @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TESpellEffectBlock) { @@ -23,7 +21,7 @@ public class RenderSpellEffectBlock extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test; - int meta = tileEntity.getBlockMetadata(); + int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java index d07bf185..2f2d0ff3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEnhancementBlock.java @@ -1,21 +1,19 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -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.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer { private ModelSpellEnhancementBlock modelSpellEnhancementBlock = new ModelSpellEnhancementBlock(); @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TESpellEnhancementBlock) { @@ -23,7 +21,7 @@ public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test; - int meta = tileEntity.getBlockMetadata(); + int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java index 84264019..0a972266 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellModifierBlock.java @@ -1,21 +1,19 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -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.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellModifierBlock extends TileEntitySpecialRenderer { private ModelSpellModifierBlock modelSpellModifierBlock = new ModelSpellModifierBlock(); @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TESpellModifierBlock) { @@ -23,7 +21,7 @@ public class RenderSpellModifierBlock extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test; - int meta = tileEntity.getBlockMetadata(); + int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java index df39cd1e..ca0f9336 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java @@ -1,21 +1,19 @@ package WayofTime.alchemicalWizardry.common.renderer.block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; - -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.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer { private ModelSpellParadigmBlock modelSpellParadigmBlock = new ModelSpellParadigmBlock(); @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof TESpellParadigmBlock) { @@ -23,7 +21,7 @@ public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test; - int meta = tileEntity.getBlockMetadata(); + int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); String resource = tileSpellBlock.getResourceLocationForMeta(meta); test = new ResourceLocation(resource); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java new file mode 100644 index 00000000..c9f36674 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java @@ -0,0 +1,318 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +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.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +public class RenderWritingTable extends TileEntitySpecialRenderer +{ + private ModelWritingTable modelWritingTable = new ModelWritingTable(); + private final RenderItem customRenderItem; + + public RenderWritingTable() + { + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TEWritingTable) + { + TEWritingTable tileAltar = (TEWritingTable) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + 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); + this.modelWritingTable.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + + for (int i = 1; i <= 6; i++) + { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + if (tileAltar.getStackInSlot(i) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i)); + float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i)); + 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.glScalef(scaleFactor, scaleFactor, scaleFactor); + GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); + } + + GL11.glPopMatrix(); + } + } + } + + private float getGhostItemScaleFactor(ItemStack itemStack) + { + float scaleFactor = 0.8F; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) + { + case 1: + return 0.90F * scaleFactor; + + case 2: + return 0.90F * scaleFactor; + + case 3: + return 0.90F * scaleFactor; + + case 4: + return 0.90F * scaleFactor; + + case 5: + return 0.80F * scaleFactor; + + default: + return 0.90F * scaleFactor; + } + } else + { + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) + { + case 1: + return 0.65F * scaleFactor; + + case 2: + return 0.65F * scaleFactor; + + case 3: + return 0.65F * scaleFactor; + + case 4: + return 0.65F * scaleFactor; + + default: + return 0.65F * scaleFactor; + } + } + } + + return scaleFactor; + } + + private float getXDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.0f; + + case 1: + return -0.375f; + + case 2: + return -0.125f; + + case 3: + return 0.3125f; + + case 4: + return 0.3125f; + + case 5: + return -0.125f; + + default: + return 0.0f; + } + } + + private float getYDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.4f; + + case 1: + return -0.35f; + + case 6: + return 0.4f; + + default: + return -0.35f; + } + } + + private float getZDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.0f; + + case 1: + return 0.0f; + + case 2: + return 0.375f; + + case 3: + return 0.25f; + + case 4: + return -0.25f; + + case 5: + return -0.375f; + + default: + return 0.0f; + } + } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + + } + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java new file mode 100644 index 00000000..054e1201 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java @@ -0,0 +1,232 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; +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(); + private final RenderItem customRenderItem; + + public TEAltarRenderer() + { + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + modelBloodAltar.renderBloodAltar((TEAltar) tileEntity, d0, d1, d2); + modelBloodAltar.renderBloodLevel((TEAltar) tileEntity, d0, d1, d2); + + if (tileEntity instanceof TEAltar) + { + TEAltar tileAltar = (TEAltar) tileEntity; + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(0) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); + float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); + float displacement = 0.2F; + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + 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 + 0.6F, (float) d2 + 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(); + } + } + + private float getGhostItemScaleFactor(ItemStack itemStack) + { + float scaleFactor = 1.0F; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) + { + case 1: + return 0.90F; + + case 2: + return 0.90F; + + case 3: + return 0.90F; + + case 4: + return 0.90F; + + case 5: + return 0.80F; + + default: + return 0.90F; + } + } else + { + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) + { + case 1: + return 0.65F; + + case 2: + return 0.65F; + + case 3: + return 0.65F; + + case 4: + return 0.65F; + + default: + return 0.65F; + } + } + } + + return scaleFactor; + } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java index 48ec3a48..22c6c645 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAlchemicalCalcinatorItemRenderer.java @@ -1,19 +1,21 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator; +import cpw.mods.fml.client.FMLClientHandler; public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer { private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator(); - private void renderConduitItem(ItemStack item, float translateX, float translateY, float translateZ) + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); GL11.glTranslatef(translateX + 0.5F, translateY + 1.5F, translateZ + 0.5F); @@ -26,6 +28,7 @@ public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer GL11.glPopMatrix(); } + /** * IItemRenderer implementation * */ @@ -61,16 +64,16 @@ public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; case EQUIPPED: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case EQUIPPED_FIRST_PERSON: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case INVENTORY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; default: } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java index dd3385fe..df81d2d7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java @@ -1,14 +1,13 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; - public class TEAltarItemRenderer implements IItemRenderer { private ModelBloodAltar modelBloodAltar; @@ -37,16 +36,16 @@ public class TEAltarItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderBloodAltar(item, 0, 0, 0, scale); + renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale); break; case EQUIPPED: - renderBloodAltar(item, 0, 0, 0.5f, scale); + renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0.5f, scale); break; case EQUIPPED_FIRST_PERSON: - renderBloodAltar(item, +0.5f, 0.5f, +0.5f, scale); + renderBloodAltar((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale); break; case INVENTORY: - renderBloodAltar(item, -0.5f, -0.75f, -0.5f, scale); + renderBloodAltar((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale); break; default: @@ -54,7 +53,7 @@ public class TEAltarItemRenderer implements IItemRenderer } } - private void renderBloodAltar(ItemStack item, float x, float y, float z, float scale) + private void renderBloodAltar(RenderBlocks render, ItemStack item, float x, float y, float z, float scale) { GL11.glPushMatrix(); GL11.glTranslatef(x, y, z); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java index 4c35bb2c..b9826145 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEBellJarItemRenderer.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; import org.lwjgl.opengl.GL11; @@ -14,15 +14,17 @@ 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 WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; +import cpw.mods.fml.client.FMLClientHandler; public class TEBellJarItemRenderer implements IItemRenderer { + 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(ItemStack item, float translateX, float translateY, float translateZ) + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); @@ -33,7 +35,7 @@ public class TEBellJarItemRenderer implements IItemRenderer GL11.glPopMatrix(); GL11.glPopMatrix(); - ReagentContainerInfo[] info = TEBelljar.getContainerInfoFromItem(item); + ReagentContainerInfo[] info = TEBellJar.getContainerInfoFromItem(item); if (info.length >= 1 && info[0] != null) { ReagentStack reagentStack = info[0].reagent; @@ -65,7 +67,7 @@ public class TEBellJarItemRenderer implements IItemRenderer private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) { GL11.glPushMatrix(); - Tessellator tessellator = Tessellator.getInstance(); + 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); @@ -77,13 +79,12 @@ public class TEBellJarItemRenderer implements IItemRenderer GL11.glDepthMask(false); - WorldRenderer wr = tessellator.getWorldRenderer(); - wr.startDrawingQuads(); - wr.func_178961_b(colourRed, colourGreen, colourBlue, colourIntensity); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity); GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); - wr.func_178963_b(240); + tessellator.setBrightness(240); double x1 = -4d / 16d; double x2 = 4d / 16d; @@ -97,26 +98,26 @@ public class TEBellJarItemRenderer implements IItemRenderer double resy1 = 1.0d; double resy2 = 1.0d; - wr.addVertexWithUV(x1, y1, z1, resx1, resy1); - wr.addVertexWithUV(x2, y1, z1, resx2, resy1); - wr.addVertexWithUV(x2, y2, z1, resx2, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y1, z1, resx1, resy1); - wr.addVertexWithUV(x1, y1, z2, resx2, resy1); - wr.addVertexWithUV(x1, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y1, z2, resx1, resy1); - wr.addVertexWithUV(x2, y1, z2, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z2, resx1, resy2); - wr.addVertexWithUV(x2, y1, z1, resx1, resy1); - wr.addVertexWithUV(x2, y1, z2, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.addVertexWithUV(x2, y2, z1, resx1, resy2); - wr.addVertexWithUV(x1, y2, z1, resx1, resy1); - wr.addVertexWithUV(x2, y2, z1, resx2, resy1); - wr.addVertexWithUV(x2, y2, z2, resx2, resy2); - wr.addVertexWithUV(x1, y2, z2, resx1, resy2); + 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); @@ -163,16 +164,16 @@ public class TEBellJarItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; case EQUIPPED: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case EQUIPPED_FIRST_PERSON: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case INVENTORY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; default: } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java index 6044f3dd..e0e4a79d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java @@ -1,22 +1,22 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit; +import cpw.mods.fml.client.FMLClientHandler; -@SuppressWarnings("deprecation") public class TEConduitItemRenderer implements IItemRenderer { private ModelConduit modelConduit = new ModelConduit(); - private void renderConduitItem(ItemStack item, float translateX, float translateY, float translateZ) + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); @@ -24,7 +24,7 @@ public class TEConduitItemRenderer implements IItemRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, EnumFacing.DOWN, EnumFacing.UP); + this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); GL11.glPopMatrix(); GL11.glPopMatrix(); } @@ -65,16 +65,16 @@ public class TEConduitItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; case EQUIPPED: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case EQUIPPED_FIRST_PERSON: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case INVENTORY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; default: } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java index a6d25c4a..9f481de1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java @@ -1,21 +1,22 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; +import cpw.mods.fml.client.FMLClientHandler; public class TESpellEffectBlockItemRenderer implements IItemRenderer { private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock(); - private void renderConduitItem(ItemStack item, float translateX, float translateY, float translateZ) + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); @@ -24,7 +25,7 @@ public class TESpellEffectBlockItemRenderer implements IItemRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, EnumFacing.DOWN, EnumFacing.UP); + this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); GL11.glPopMatrix(); GL11.glPopMatrix(); } @@ -65,16 +66,16 @@ public class TESpellEffectBlockItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; case EQUIPPED: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case EQUIPPED_FIRST_PERSON: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case INVENTORY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; default: } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java index c0c48ed0..0fbd6e01 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEnhancementBlockItemRenderer.java @@ -1,21 +1,22 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock; +import cpw.mods.fml.client.FMLClientHandler; public class TESpellEnhancementBlockItemRenderer implements IItemRenderer { private ModelSpellEnhancementBlock modelSpellBlock = new ModelSpellEnhancementBlock(); - private void renderConduitItem(ItemStack item, float translateX, float translateY, float translateZ) + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); @@ -24,7 +25,7 @@ public class TESpellEnhancementBlockItemRenderer implements IItemRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, EnumFacing.DOWN, EnumFacing.UP); + this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); GL11.glPopMatrix(); GL11.glPopMatrix(); } @@ -65,16 +66,16 @@ public class TESpellEnhancementBlockItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; case EQUIPPED: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case EQUIPPED_FIRST_PERSON: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case INVENTORY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; default: } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java index 3ea9c791..7fc7dc63 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellModifierBlockItemRenderer.java @@ -1,21 +1,22 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock; +import cpw.mods.fml.client.FMLClientHandler; public class TESpellModifierBlockItemRenderer implements IItemRenderer { private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock(); - private void renderConduitItem(ItemStack item, float translateX, float translateY, float translateZ) + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); @@ -24,7 +25,7 @@ public class TESpellModifierBlockItemRenderer implements IItemRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, EnumFacing.DOWN, EnumFacing.UP); + this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); GL11.glPopMatrix(); GL11.glPopMatrix(); } @@ -65,16 +66,16 @@ public class TESpellModifierBlockItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; case EQUIPPED: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case EQUIPPED_FIRST_PERSON: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case INVENTORY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; default: } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java index 2dc201ba..8bf4da84 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellParadigmBlockItemRenderer.java @@ -1,21 +1,22 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock; +import cpw.mods.fml.client.FMLClientHandler; public class TESpellParadigmBlockItemRenderer implements IItemRenderer { private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock(); - private void renderConduitItem(ItemStack item, float translateX, float translateY, float translateZ) + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); @@ -23,7 +24,7 @@ public class TESpellParadigmBlockItemRenderer implements IItemRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, EnumFacing.DOWN, EnumFacing.UP); + this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); GL11.glPopMatrix(); GL11.glPopMatrix(); } @@ -64,16 +65,16 @@ public class TESpellParadigmBlockItemRenderer implements IItemRenderer switch (type) { case ENTITY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; case EQUIPPED: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case EQUIPPED_FIRST_PERSON: - renderConduitItem(item, -0.4f, 0.50f, 0.35f); + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); break; case INVENTORY: - renderConduitItem(item, -0.5f, -0.5f, -0.5f); + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); break; default: } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEChemistrySetItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java similarity index 85% rename from src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEChemistrySetItemRenderer.java rename to src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java index 2292f83b..b618b248 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEChemistrySetItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java @@ -1,22 +1,20 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; +import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fml.client.FMLClientHandler; - import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelChemistrySet; - -public class TEChemistrySetItemRenderer implements IItemRenderer +public class TEWritingTableItemRenderer implements IItemRenderer { - private ModelChemistrySet model; + private ModelWritingTable model; - public TEChemistrySetItemRenderer() + public TEWritingTableItemRenderer() { - model = new ModelChemistrySet(); + model = new ModelWritingTable(); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java index a44fb4c3..6e7674a3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -13,7 +12,7 @@ public class RenderBileDemon extends RenderLiving public RenderBileDemon(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityBileDemon par1EntityBileDemon) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java index 4b3f1691..8ff9516f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -13,7 +12,7 @@ public class RenderBoulderFist extends RenderLiving public RenderBoulderFist(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityBoulderFist par1EntityBoulderFist) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java index 82ae9f1a..91d92f8d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; import WayofTime.alchemicalWizardry.common.entity.mob.*; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -18,7 +17,7 @@ public class RenderElemental extends RenderLiving public RenderElemental(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityElemental par1EntityElemental) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java index adc58c3d..24c69cf9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java @@ -1,13 +1,12 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; -import net.minecraft.client.Minecraft; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; @SideOnly(Side.CLIENT) public class RenderFallenAngel extends RenderLiving @@ -16,7 +15,7 @@ public class RenderFallenAngel extends RenderLiving public RenderFallenAngel(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityFallenAngel par1EntityFallenAngel) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java index 92ea947a..4b36e492 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java @@ -1,11 +1,10 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; -import net.minecraft.client.Minecraft; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; public class RenderIceDemon extends RenderLiving { @@ -13,7 +12,7 @@ public class RenderIceDemon extends RenderLiving public RenderIceDemon(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityIceDemon par1EntityIceDemon) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java index 7407e47f..a1c39675 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java @@ -1,11 +1,10 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; -import net.minecraft.client.Minecraft; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; -import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; public class RenderLowerGuardian extends RenderLiving { @@ -13,7 +12,7 @@ public class RenderLowerGuardian extends RenderLiving public RenderLowerGuardian(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityLowerGuardian par1EntityLowerGuardian) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGrunt.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGrunt.java index e975edee..284f6f4d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGrunt.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGrunt.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -21,7 +20,7 @@ public class RenderMinorDemonGrunt extends RenderLiving public RenderMinorDemonGrunt(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityMinorDemonGrunt entity) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGruntGuardian.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGruntGuardian.java index ba52f114..a2a70bb3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGruntGuardian.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderMinorDemonGruntGuardian.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -21,7 +20,7 @@ public class RenderMinorDemonGruntGuardian extends RenderLiving public RenderMinorDemonGruntGuardian(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityMinorDemonGruntGuardian entity) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java index b3d4a844..afd4f230 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -13,7 +12,7 @@ public class RenderShade extends RenderLiving public RenderShade(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityShade par1EntityShade) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java index 42b70f01..3e87ac76 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -13,7 +12,7 @@ public class RenderSmallEarthGolem extends RenderLiving public RenderSmallEarthGolem(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntitySmallEarthGolem par1EntitySmallEarthGolem) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java index af809551..8a385f76 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.mob; import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; @@ -13,7 +12,7 @@ public class RenderWingedFireDemon extends RenderLiving public RenderWingedFireDemon(ModelBase par1ModelBase, float par2) { - super(Minecraft.getMinecraft().getRenderManager(), par1ModelBase, par2); + super(par1ModelBase, par2); } public ResourceLocation func_110832_a(EntityWingedFireDemon par1EntityWingedFireDemon) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java index 82a9d3b7..b8a1679f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java @@ -2,31 +2,32 @@ package WayofTime.alchemicalWizardry.common.renderer.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.client.FMLClientHandler; public class ModelBloodAltar extends ModelBase { private static final ResourceLocation altar_texture = new ResourceLocation("alchemicalwizardry:textures/models/altar.png"); -// private IModelCustom modelBloodAltar; + private IModelCustom modelBloodAltar; public ModelBloodAltar() { -// modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj")); + modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj")); } public void renderBloodAltar() { -// modelBloodAltar.renderAll(); + modelBloodAltar.renderAll(); } public void renderBloodAltar(TEAltar altar, double x, double y, double z) @@ -56,22 +57,21 @@ public class ModelBloodAltar extends ModelBase GL11.glPopMatrix(); } - public void renderBloodLevel(TextureAtlasSprite icon) + public void renderBloodLevel(IIcon icon) { - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer wr = tessellator.getWorldRenderer(); + Tessellator tessellator = Tessellator.instance; double minU = (double) icon.getInterpolatedU(0); double maxU = (double) icon.getInterpolatedU(16); double minV = (double) icon.getInterpolatedV(0); double maxV = (double) icon.getInterpolatedV(16); - wr.startDrawingQuads(); - wr.func_178980_d(0, 1, 0); //setNormal - wr.addVertexWithUV(1, 0, 1, maxU, maxV); - wr.addVertexWithUV(1, 0, 0, maxU, minV); - wr.addVertexWithUV(0, 0, 0, minU, minV); - wr.addVertexWithUV(0, 0, 1, minU, maxV); + tessellator.startDrawingQuads(); + tessellator.setNormal(0, 1, 0); + tessellator.addVertexWithUV(1, 0, 1, maxU, maxV); + tessellator.addVertexWithUV(1, 0, 0, maxU, minV); + tessellator.addVertexWithUV(0, 0, 0, minU, minV); + tessellator.addVertexWithUV(0, 0, 1, minU, maxV); tessellator.draw(); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelConduit.java index 83f3ddc8..a6a510c4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelConduit.java @@ -9,7 +9,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public class ModelConduit extends ModelBase { @@ -147,7 +147,7 @@ public class ModelConduit extends ModelBase setRotation(spacer8, 0F, 0F, 0F); } - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output) + 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); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelElemental.java index 25cb2814..10ce54be 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelElemental.java @@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.renderer.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.world.World; public class ModelElemental extends ModelBase @@ -71,11 +70,10 @@ public class ModelElemental extends ModelBase return; } - int ratio = 20; - float rot = (entity.worldObj.getWorldTime() % ratio) / ratio; - Shape1.rotateAngleX = f / 5; - Shape2.rotateAngleZ = f / 5; - Shape3.rotateAngleY = f / 5; - EntityBlaze d; + float ratio = 0.1f; + float rot = (entity.worldObj.getWorldTime() + f) * ratio; + Shape1.rotateAngleX = rot; + Shape2.rotateAngleZ = rot; + Shape3.rotateAngleY = rot; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java index fcf03321..d816ae3d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellEffectBlock extends ModelBase { @@ -184,7 +184,7 @@ public class ModelSpellEffectBlock extends ModelBase setRotation(outputSpacer4, 0F, 0F, 0F); } - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output) + 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); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java index 19e20c45..e83b4084 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEnhancementBlock.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellEnhancementBlock extends ModelBase @@ -185,7 +185,7 @@ public class ModelSpellEnhancementBlock extends ModelBase setRotation(outputSecond, 0F, 0F, 0F); } - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output) + 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); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java index 28faaf7e..a879889b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellModifierBlock.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellModifierBlock extends ModelBase { @@ -149,7 +149,7 @@ public class ModelSpellModifierBlock extends ModelBase setRotation(output4, 0F, 0F, 0F); } - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output) + 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); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java index 4053b60b..9fd4d551 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellParadigmBlock.java @@ -10,7 +10,7 @@ package WayofTime.alchemicalWizardry.common.renderer.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; public class ModelSpellParadigmBlock extends ModelBase { @@ -100,7 +100,7 @@ public class ModelSpellParadigmBlock extends ModelBase setRotation(Shape5, 0F, 0F, 0F); } - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, EnumFacing input, EnumFacing output) + 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); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelChemistrySet.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java similarity index 98% rename from src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelChemistrySet.java rename to src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java index 2dfc6c8f..15dede34 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelChemistrySet.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java @@ -4,7 +4,7 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -public class ModelChemistrySet extends ModelBase +public class ModelWritingTable extends ModelBase { //fields ModelRenderer base; @@ -21,7 +21,7 @@ public class ModelChemistrySet extends ModelBase ModelRenderer input3; ModelRenderer Shape1; - public ModelChemistrySet() + public ModelWritingTable() { textureWidth = 64; textureHeight = 64; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java index 826cec70..fce17323 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java @@ -1,30 +1,22 @@ package WayofTime.alchemicalWizardry.common.renderer.projectile; -import net.minecraft.client.Minecraft; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelEnergyBazookaMainProjectile; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelEnergyBazookaMainProjectile; - public class RenderEnergyBazookaMainProjectile extends Render { - public RenderEnergyBazookaMainProjectile() - { - super(Minecraft.getMinecraft().getRenderManager()); - } - - public ModelBase model = new ModelEnergyBazookaMainProjectile(); + public ModelBase model = new ModelEnergyBazookaMainProjectile(); private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/EnergyBazookaMainProjectile.png"); + private float scale = 1.0f; @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { - float scale = 1.0f; GL11.glPushMatrix(); GL11.glTranslatef((float) d0, (float) d1, (float) d2); GL11.glEnable(GL12.GL_RESCALE_NORMAL); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java index 53228e59..d0e067e1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java @@ -1,52 +1,35 @@ package WayofTime.alchemicalWizardry.common.renderer.projectile; -import net.minecraft.client.Minecraft; +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.WorldRenderer; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.entity.IProjectile; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - 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; - @SideOnly(Side.CLIENT) public class RenderEnergyBlastProjectile extends Render { - public RenderEnergyBlastProjectile() - { - super(Minecraft.getMinecraft().getRenderManager()); - } - - public void doRenderEnergyBlastProjectile(Entity entityShot, double par2, double par4, double par6, float par8, float par9) + public void doRenderEnergyBlastProjectile(Entity entityShot, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix(); GL11.glTranslatef((float) par2, (float) par4, (float) par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.1F, 0.1F, 0.1F); this.bindTexture(this.getEntityTexture(entityShot)); - Tessellator var12 = Tessellator.getInstance(); + Tessellator var12 = Tessellator.instance; GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - WorldRenderer wr = var12.getWorldRenderer(); - wr.startDrawingQuads(); - wr.func_178980_d(0.0F, 1.0F, 0.0F); //SetNormal - wr.addVertexWithUV(-0.5F, -0.25F, 0.0D, 0, 1); - wr.addVertexWithUV(0.5F, -0.25F, 0.0D, 1, 1); - wr.addVertexWithUV(0.5F, 0.75F, 0.0D, 1, 0); - wr.addVertexWithUV(-0.5F, 0.75F, 0.0D, 0, 0); + var12.startDrawingQuads(); + var12.setNormal(0.0F, 1.0F, 0.0F); + var12.addVertexWithUV(-0.5F, -0.25F, 0.0D, 0, 1); + var12.addVertexWithUV(0.5F, -0.25F, 0.0D, 1, 1); + var12.addVertexWithUV(0.5F, 0.75F, 0.0D, 1, 0); + var12.addVertexWithUV(-0.5F, 0.75F, 0.0D, 0, 0); var12.draw(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderFireProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderFireProjectile.java new file mode 100644 index 00000000..cda739fe --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderFireProjectile.java @@ -0,0 +1,41 @@ +package WayofTime.alchemicalWizardry.common.renderer.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class RenderFireProjectile +{ +// public void doRenderProjectile(FireProjectile entityShot, double par2, double par4, double par6, float par8, float par9) +// { +// GL11.glPushMatrix(); +// GL11.glTranslatef((float)par2, (float)par4, (float)par6); +// GL11.glEnable(GL12.GL_RESCALE_NORMAL); +// GL11.glScalef(0.1F, 0.1F, 0.1F); +// this.func_110776_a(this.func_110775_a(entityShot)); +// Tessellator var12 = Tessellator.instance; +// GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); +// GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); +// var12.startDrawingQuads(); +// var12.setNormal(0.0F, 1.0F, 0.0F); +// var12.addVertexWithUV(-0.5F, -0.25F, 0.0D, 0, 1); +// var12.addVertexWithUV(0.5F, -0.25F, 0.0D, 1, 1); +// var12.addVertexWithUV(0.5F, 0.75F, 0.0D, 1, 0); +// var12.addVertexWithUV(-0.5F, 0.75F, 0.0D, 0, 0); +// var12.draw(); +// GL11.glDisable(GL12.GL_RESCALE_NORMAL); +// GL11.glPopMatrix(); +// } +// +// @Override +// public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) +// { +// this.doRenderProjectile((FireProjectile)par1Entity, par2, par4, par6, par8, par9); +// } +// +// @Override +// protected ResourceLocation func_110775_a(Entity entity) +// { +// return new ResourceLocation("alchemicalwizardry:/textures/entities/fireProjectile.png"); +// } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java index f33d1178..95c6bd49 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java @@ -1,31 +1,22 @@ package WayofTime.alchemicalWizardry.common.renderer.projectile; -import net.minecraft.client.Minecraft; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelMeteor; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelMeteor; - public class RenderMeteor extends Render { - public RenderMeteor() - { - super(Minecraft.getMinecraft().getRenderManager()); - // TODO Auto-generated constructor stub - } - - public ModelBase model = new ModelMeteor(); + public ModelBase model = new ModelMeteor(); private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/Meteor.png"); + private float scale = 1.0f; @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { - float scale = 1.0f; GL11.glPushMatrix(); GL11.glTranslatef((float) d0, (float) d1, (float) d2); GL11.glEnable(GL12.GL_RESCALE_NORMAL); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java index a63baace..2c762aa9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/LocalStorageAlphaPact.java @@ -1,25 +1,25 @@ -//package WayofTime.alchemicalWizardry.common.rituals; -// -//import java.util.HashSet; -//import java.util.Set; -// -//import WayofTime.alchemicalWizardry.api.Int3; -//import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; -//import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; -// -//public class LocalStorageAlphaPact extends LocalRitualStorage -//{ -// public static Set hoardList = new HashSet(); -// -// public void thrallDemon(IHoardDemon demon) -// { -// if(demon instanceof IHoardDemon) -// { -// boolean enthrall = ((IHoardDemon) demon).thrallDemon(new Int3(this.xCoord, this.yCoord, this.zCoord)); -// if(enthrall) -// { -// this.hoardList.add((IHoardDemon)demon); -// } -// } -// } -//} +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.HashSet; +import java.util.Set; + +import WayofTime.alchemicalWizardry.api.Int3; +import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; +import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; + +public class LocalStorageAlphaPact extends LocalRitualStorage +{ + public static Set hoardList = new HashSet(); + + public void thrallDemon(IHoardDemon demon) + { + if(demon instanceof IHoardDemon) + { + boolean enthrall = ((IHoardDemon) demon).thrallDemon(new Int3(this.xCoord, this.yCoord, this.zCoord)); + if(enthrall) + { + this.hoardList.add((IHoardDemon)demon); + } + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java index 6fafc94c..4ce93209 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAlphaPact.java @@ -1,178 +1,179 @@ -//package WayofTime.alchemicalWizardry.common.rituals; -// -//import java.util.ArrayList; -//import java.util.List; -//import java.util.Random; -// -//import net.minecraft.block.Block; -//import net.minecraft.entity.EntityLivingBase; -//import net.minecraft.util.BlockPos; -//import net.minecraft.util.MathHelper; -//import net.minecraft.world.World; -//import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; -//import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; -//import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; -//import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -//import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -//import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt; -//import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; -// -//public class RitualEffectAlphaPact extends RitualEffect -//{ -// Random rand = new Random(); -// -// @Override -// public void performEffect(IMasterRitualStone ritualStone) -// { -// String owner = ritualStone.getOwner(); -// -// int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); -// World world = ritualStone.getWorldObj(); -// BlockPos pos = ritualStone.getPosition(); -// -// if (world.getWorldTime() % 20 != 0) -// { -// return; -// } -// -// LocalRitualStorage stor = ritualStone.getLocalStorage(); -// if(stor instanceof LocalStorageAlphaPact) -// { -// LocalStorageAlphaPact storage = (LocalStorageAlphaPact)stor; -// -// Object[] demonList = storage.hoardList.toArray(); -// -// for(Object demon : demonList) -// { -// if(demon instanceof EntityLivingBase) -// { -// if(!((EntityLivingBase) demon).isEntityAlive()) -// { -// System.out.println(storage.hoardList.remove(demon)); -// } -// } -// } -// -// System.out.println("Hi!"); -// -// int summons = 0; -// -// int horizontalRange = 25; -// int verticalRange = 20; -// -// if(storage.hoardList.isEmpty()) -// { -// IHoardDemon demon = this.getRandomDemonForStage(world, x, y, z, horizontalRange, verticalRange); -// if(demon instanceof EntityLivingBase) -// { -// world.spawnEntityInWorld((EntityLivingBase)demon); -// storage.thrallDemon(demon); -// } -// }else -// { -// } -// } -// } -// -// public IHoardDemon getRandomDemonForStage(World world, int x, int y, int z, int horizontalRange, int verticalRange) -// { -// EntityLivingBase entityLiving = new EntityMinorDemonGrunt(world); -// -// boolean isGood = false; -// for(int n=0; n<100; n++) -// { -// double newX = x + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5; -// double newY = y + (double) (rand.nextInt((int) verticalRange)); -// double newZ = z + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5; -// -// entityLiving.posX = newX; -// entityLiving.posY = newY; -// entityLiving.posZ = newZ; -// -// int i = MathHelper.floor_double(entityLiving.posX); -// int j = MathHelper.floor_double(entityLiving.posY); -// int k = MathHelper.floor_double(entityLiving.posZ); -// Block l; -// -// if (entityLiving.worldObj.blockExists(i, j, k)) -// { -// boolean flag1 = false; -// -// while (!flag1 && j > 0) -// { -// l = entityLiving.worldObj.getBlock(i, j - 1, k); -// -// if (l != null && l.getMaterial().blocksMovement()) -// { -// flag1 = true; -// } else -// { -// --entityLiving.posY; -// --j; -// } -// } -// } -// -// if(entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) -// { -// entityLiving.setPositionAndUpdate(newX, newY, newZ); -// isGood = true; -// } -// } -// -// if(isGood = false) -// { -// return null; -// } -// -// return (IHoardDemon)entityLiving; -// } -// -// public int spawnMoreDemons(LocalStorageAlphaPact storage) -// { -// return 5; -// } -// -// @Override -// public int getCostPerRefresh() -// { -// return 1; -// } -// -// public LocalRitualStorage getNewLocalStorage() -// { -// return new LocalStorageAlphaPact(); -// } -// -// @Override -// public List getRitualComponentList() -// { -// ArrayList omegaRitual = new ArrayList(); -// -// this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.BLANK); -// this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.FIRE); -// this.addParallelRunes(omegaRitual, 4, 0, RitualComponent.WATER); -// this.addParallelRunes(omegaRitual, 5, 0, RitualComponent.EARTH); -// this.addCornerRunes(omegaRitual, 4, 0, RitualComponent.AIR); -// this.addOffsetRunes(omegaRitual, 3, 4, 0, RitualComponent.AIR); -// this.addParallelRunes(omegaRitual, 5, 1, RitualComponent.WATER); -// this.addParallelRunes(omegaRitual, 5, 2, RitualComponent.EARTH); -// this.addParallelRunes(omegaRitual, 4, 3, RitualComponent.WATER); -// this.addParallelRunes(omegaRitual, 4, 4, RitualComponent.WATER); -// this.addParallelRunes(omegaRitual, 3, 5, RitualComponent.BLANK); -// this.addParallelRunes(omegaRitual, 2, 5, RitualComponent.FIRE); -// this.addParallelRunes(omegaRitual, 1, 5, RitualComponent.DUSK); -// this.addOffsetRunes(omegaRitual, 5, 3, 1, RitualComponent.WATER); -// this.addOffsetRunes(omegaRitual, 6, 3, 1, RitualComponent.DUSK); -// this.addOffsetRunes(omegaRitual, 6, 4, 1, RitualComponent.FIRE); -// this.addOffsetRunes(omegaRitual, 6, 5, 1, RitualComponent.BLANK); -// this.addCornerRunes(omegaRitual, 4, 2, RitualComponent.FIRE); -// this.addCornerRunes(omegaRitual, 4, 3, RitualComponent.AIR); -// this.addCornerRunes(omegaRitual, 4, 4, RitualComponent.AIR); -// this.addOffsetRunes(omegaRitual, 4, 3, 2, RitualComponent.BLANK); -// this.addCornerRunes(omegaRitual, 3, 5, RitualComponent.EARTH); -// this.addOffsetRunes(omegaRitual, 2, 3, 5, RitualComponent.AIR); -// -// return omegaRitual; -// } -//} +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.LocalRitualStorage; +import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; +import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt; +import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon; + +public class RitualEffectAlphaPact extends RitualEffect +{ + Random rand = new Random(); + + @Override + public void performEffect(IMasterRitualStone ritualStone) + { + String owner = ritualStone.getOwner(); + + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + + if (world.getWorldTime() % 20 != 0) + { + return; + } + + LocalRitualStorage stor = ritualStone.getLocalStorage(); + if(stor instanceof LocalStorageAlphaPact) + { + LocalStorageAlphaPact storage = (LocalStorageAlphaPact)stor; + + Object[] demonList = storage.hoardList.toArray(); + + for(Object demon : demonList) + { + if(demon instanceof EntityLivingBase) + { + if(!((EntityLivingBase) demon).isEntityAlive()) + { + System.out.println(storage.hoardList.remove(demon)); + } + } + } + + System.out.println("Hi!"); + + int summons = 0; + + int horizontalRange = 25; + int verticalRange = 20; + + if(storage.hoardList.isEmpty()) + { + IHoardDemon demon = this.getRandomDemonForStage(world, x, y, z, horizontalRange, verticalRange); + if(demon instanceof EntityLivingBase) + { + world.spawnEntityInWorld((EntityLivingBase)demon); + storage.thrallDemon(demon); + } + }else + { + } + } + } + + public IHoardDemon getRandomDemonForStage(World world, int x, int y, int z, int horizontalRange, int verticalRange) + { + EntityLivingBase entityLiving = new EntityMinorDemonGrunt(world); + + boolean isGood = false; + for(int n=0; n<100; n++) + { + double newX = x + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5; + double newY = y + (double) (rand.nextInt((int) verticalRange)); + double newZ = z + (rand.nextInt(horizontalRange) - horizontalRange) + 0.5; + + entityLiving.posX = newX; + entityLiving.posY = newY; + entityLiving.posZ = newZ; + + int i = MathHelper.floor_double(entityLiving.posX); + int j = MathHelper.floor_double(entityLiving.posY); + int k = MathHelper.floor_double(entityLiving.posZ); + Block l; + + if (entityLiving.worldObj.blockExists(i, j, k)) + { + boolean flag1 = false; + + while (!flag1 && j > 0) + { + l = entityLiving.worldObj.getBlock(i, j - 1, k); + + if (l != null && l.getMaterial().blocksMovement()) + { + flag1 = true; + } else + { + --entityLiving.posY; + --j; + } + } + } + + if(entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) + { + entityLiving.setPositionAndUpdate(newX, newY, newZ); + isGood = true; + } + } + + if(isGood = false) + { + return null; + } + + return (IHoardDemon)entityLiving; + } + + public int spawnMoreDemons(LocalStorageAlphaPact storage) + { + return 5; + } + + @Override + public int getCostPerRefresh() + { + return 1; + } + + public LocalRitualStorage getNewLocalStorage() + { + return new LocalStorageAlphaPact(); + } + + @Override + public List getRitualComponentList() + { + ArrayList omegaRitual = new ArrayList(); + + this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.BLANK); + this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.FIRE); + this.addParallelRunes(omegaRitual, 4, 0, RitualComponent.WATER); + this.addParallelRunes(omegaRitual, 5, 0, RitualComponent.EARTH); + this.addCornerRunes(omegaRitual, 4, 0, RitualComponent.AIR); + this.addOffsetRunes(omegaRitual, 3, 4, 0, RitualComponent.AIR); + this.addParallelRunes(omegaRitual, 5, 1, RitualComponent.WATER); + this.addParallelRunes(omegaRitual, 5, 2, RitualComponent.EARTH); + this.addParallelRunes(omegaRitual, 4, 3, RitualComponent.WATER); + this.addParallelRunes(omegaRitual, 4, 4, RitualComponent.WATER); + this.addParallelRunes(omegaRitual, 3, 5, RitualComponent.BLANK); + this.addParallelRunes(omegaRitual, 2, 5, RitualComponent.FIRE); + this.addParallelRunes(omegaRitual, 1, 5, RitualComponent.DUSK); + this.addOffsetRunes(omegaRitual, 5, 3, 1, RitualComponent.WATER); + this.addOffsetRunes(omegaRitual, 6, 3, 1, RitualComponent.DUSK); + this.addOffsetRunes(omegaRitual, 6, 4, 1, RitualComponent.FIRE); + this.addOffsetRunes(omegaRitual, 6, 5, 1, RitualComponent.BLANK); + this.addCornerRunes(omegaRitual, 4, 2, RitualComponent.FIRE); + this.addCornerRunes(omegaRitual, 4, 3, RitualComponent.AIR); + this.addCornerRunes(omegaRitual, 4, 4, RitualComponent.AIR); + this.addOffsetRunes(omegaRitual, 4, 3, 2, RitualComponent.BLANK); + this.addCornerRunes(omegaRitual, 3, 5, RitualComponent.EARTH); + this.addOffsetRunes(omegaRitual, 2, 3, 5, RitualComponent.AIR); + + return omegaRitual; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java index a9068614..865a5f14 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java @@ -1,21 +1,20 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - +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 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.util.BlockPos; 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.SoulNetworkHandler; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectAnimalGrowth extends RitualEffect { @@ -29,8 +28,10 @@ public class RitualEffectAnimalGrowth extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (world.getWorldTime() % 20 != 0) { @@ -39,7 +40,7 @@ public class RitualEffectAnimalGrowth extends RitualEffect double range = 2; - AxisAlignedBB axisalignedbb = new AxisAlignedBB(pos.offsetUp(), pos.add(1, 3, 1)).expand(range, 0, range); + 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); int entityCount = 0; @@ -79,14 +80,14 @@ public class RitualEffectAnimalGrowth extends RitualEffect if (hasVirtus && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, breedingCost)) { List animalList = world.getEntitiesWithinAABB(EntityAnimal.class, axisalignedbb); - TileEntity tile = world.getTileEntity(pos.offsetUp()); + TileEntity tile = world.getTileEntity(x, y + 1, z); IInventory inventory = null; if (tile instanceof IInventory) { inventory = (IInventory) tile; } else { - tile = world.getTileEntity(pos.offsetDown()); + tile = world.getTileEntity(x, y - 1, z); if (tile instanceof IInventory) { inventory = (IInventory) tile; @@ -112,7 +113,7 @@ public class RitualEffectAnimalGrowth extends RitualEffect if (stack != null && entityAnimal.isBreedingItem(stack)) { inventory.decrStackSize(i, 1); - entityAnimal.setInLove(null); + entityAnimal.func_146082_f(null); this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); SoulNetworkHandler.syphonFromNetwork(owner, breedingCost); break; @@ -133,7 +134,7 @@ public class RitualEffectAnimalGrowth extends RitualEffect @Override public List getRitualComponentList() { - ArrayList animalGrowthRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java index f1878498..f222840d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java @@ -1,19 +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.util.BlockPos; -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 { @@ -31,8 +30,10 @@ public class RitualEffectApiaryOverclock extends RitualEffect } int currentEssence = data.currentEssence; - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) @@ -57,7 +58,7 @@ public class RitualEffectApiaryOverclock extends RitualEffect @Override public List getRitualComponentList() { - ArrayList apiaryRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java index c8406e13..e3581192 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java @@ -7,9 +7,8 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; @@ -18,7 +17,7 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; public class RitualEffectAutoAlchemy extends RitualEffect { @@ -32,8 +31,10 @@ public class RitualEffectAutoAlchemy extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh() * 6) { @@ -44,8 +45,8 @@ public class RitualEffectAutoAlchemy extends RitualEffect int flag = 0; - TileEntity topEntity = world.getTileEntity(pos.offsetUp()); - if (!(topEntity instanceof IBloodAltar)) + TileEntity topEntity = world.getTileEntity(x, y + 1, z); + if (!(topEntity instanceof IBloodAltar) || !(topEntity instanceof IBloodAltar)) { return; } @@ -60,73 +61,73 @@ public class RitualEffectAutoAlchemy extends RitualEffect ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(targetStack); if (recipe != null) { - TEChemistrySet alchemyEntity; + TEWritingTable alchemyEntity; IInventory outputInv = null; IInventory inputInv1 = null; IInventory inputInv2 = null; - TileEntity northEntity = world.getTileEntity(pos.offsetNorth()); - TileEntity southEntity = world.getTileEntity(pos.offsetSouth()); - TileEntity eastEntity = world.getTileEntity(pos.offsetEast()); - TileEntity westEntity = world.getTileEntity(pos.offsetWest()); + 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 TEChemistrySet) + if (northEntity instanceof TEWritingTable) { - alchemyEntity = (TEChemistrySet) northEntity; - if (southEntity instanceof IInventory && !(southEntity instanceof TEChemistrySet)) + alchemyEntity = (TEWritingTable) northEntity; + if (southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable)) { outputInv = (IInventory) southEntity; } - if (eastEntity instanceof IInventory && !(eastEntity instanceof TEChemistrySet)) + if (eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable)) { inputInv1 = (IInventory) eastEntity; } - if (westEntity instanceof IInventory && !(westEntity instanceof TEChemistrySet)) + if (westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable)) { inputInv2 = (IInventory) westEntity; } - } else if (southEntity instanceof TEChemistrySet) + } else if (southEntity instanceof TEWritingTable) { - alchemyEntity = (TEChemistrySet) southEntity; - if (northEntity instanceof IInventory) + alchemyEntity = (TEWritingTable) southEntity; + if (northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable)) { outputInv = (IInventory) northEntity; } - if (eastEntity instanceof IInventory && !(eastEntity instanceof TEChemistrySet)) + if (eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable)) { inputInv1 = (IInventory) eastEntity; } - if (westEntity instanceof IInventory && !(westEntity instanceof TEChemistrySet)) + if (westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable)) { inputInv2 = (IInventory) westEntity; } - } else if (eastEntity instanceof TEChemistrySet) + } else if (eastEntity instanceof TEWritingTable) { - alchemyEntity = (TEChemistrySet) eastEntity; - if (westEntity instanceof IInventory && !(westEntity instanceof TEChemistrySet)) + alchemyEntity = (TEWritingTable) eastEntity; + if (westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable)) { outputInv = (IInventory) westEntity; } - if (northEntity instanceof IInventory) + if (northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable)) { inputInv1 = (IInventory) northEntity; } - if (southEntity instanceof IInventory) + if (southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable)) { inputInv2 = (IInventory) southEntity; } - } else if (westEntity instanceof TEChemistrySet) + } else if (westEntity instanceof TEWritingTable) { - alchemyEntity = (TEChemistrySet) westEntity; - if (eastEntity instanceof IInventory) + alchemyEntity = (TEWritingTable) westEntity; + if (eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable)) { outputInv = (IInventory) eastEntity; } - if (northEntity instanceof IInventory) + if (northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable)) { inputInv1 = (IInventory) northEntity; } - if (southEntity instanceof IInventory) + if (southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable)) { inputInv2 = (IInventory) southEntity; } @@ -135,7 +136,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect return; } - if (hasPotentia) + if (alchemyEntity != null && hasPotentia) { alchemyEntity.setAccelerationTime(5); if (alchemyEntity.isWorking()) @@ -239,6 +240,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect break; } } + continue; } } @@ -270,7 +272,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect continue; } - if(!inputInv1.isItemValidForSlot(j, curItem) || (inputInv1 instanceof ISidedInventory && !((ISidedInventory) inputInv1).canExtractItem(j, curItem, EnumFacing.DOWN))) + if(!inputInv1.isItemValidForSlot(j, curItem) || (inputInv1 instanceof ISidedInventory && !((ISidedInventory) inputInv1).canExtractItem(j, curItem, ForgeDirection.DOWN.ordinal()))) { continue; } @@ -384,11 +386,10 @@ public class RitualEffectAutoAlchemy extends RitualEffect if (flag > 0) { - for(EnumFacing face : EnumFacing.HORIZONTALS) - { - world.markBlockForUpdate(pos.offset(face)); - } - + 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); } } @@ -403,7 +404,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect @Override public List getRitualComponentList() { - ArrayList autoAlchemyRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java index 5416441b..afa50b54 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java @@ -1,9 +1,11 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - +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.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; @@ -11,14 +13,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; 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.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; public class RitualEffectBinding extends RitualEffect { @@ -28,8 +27,10 @@ public class RitualEffectBinding extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -46,7 +47,7 @@ public class RitualEffectBinding extends RitualEffect if (ritualStone.getVar1() == 0) { int d0 = 0; - AxisAlignedBB axisalignedbb = new AxisAlignedBB(pos.offsetUp(), pos.add(1, 2, 1)).expand(d0, d0, d0); + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, d0, d0); List list = world.getEntitiesWithinAABB(EntityItem.class, axisalignedbb); Iterator iterator = list.iterator(); EntityItem item; @@ -66,7 +67,7 @@ public class RitualEffectBinding extends RitualEffect { ritualStone.setVar1(BindingRegistry.getIndexForItem(itemStack) + 1); itemStack.stackSize--; - world.addWeatherEffect(new EntityLightningBolt(world, pos.getX(), pos.getY() + 1, pos.getZ())); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); ritualStone.setCooldown(ritualStone.getCooldown() - 1); if(itemStack.stackSize <= 0) { @@ -77,7 +78,7 @@ public class RitualEffectBinding extends RitualEffect if (world.rand.nextInt(10) == 0) { - SpellHelper.sendIndexedParticleToAllAround(world, pos, 20, world.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 1, x, y, z); } } @@ -90,8 +91,40 @@ public class RitualEffectBinding extends RitualEffect { int lightningPoint = world.rand.nextInt(8); - BlockPos newPos = getPositionForLightning(pos, lightningPoint); - world.addWeatherEffect(new EntityLightningBolt(world, newPos.getX(), newPos.getY(), newPos.getZ())); + switch (lightningPoint) + { + case 0: + world.addWeatherEffect(new EntityLightningBolt(world, x + 4, y + 3, z)); + break; + + case 1: + world.addWeatherEffect(new EntityLightningBolt(world, x - 4, y + 3, z)); + break; + + case 2: + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 3, z + 4)); + break; + + case 3: + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 3, z - 4)); + break; + + case 4: + world.addWeatherEffect(new EntityLightningBolt(world, x + 3, y + 3, z + 3)); + break; + + case 5: + world.addWeatherEffect(new EntityLightningBolt(world, x - 3, y + 3, z + 3)); + break; + + case 6: + world.addWeatherEffect(new EntityLightningBolt(world, x + 3, y + 3, z - 3)); + break; + + case 7: + world.addWeatherEffect(new EntityLightningBolt(world, x - 3, y + 3, z - 3)); + break; + } } if (ritualStone.getCooldown() <= 0) @@ -101,7 +134,7 @@ public class RitualEffectBinding extends RitualEffect if (spawnedItem != null) { - EntityItem newItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, spawnedItem.copy()); + EntityItem newItem = new EntityItem(world, x + 0.5, y + 1, z + 0.5, spawnedItem.copy()); world.spawnEntityInWorld(newItem); } @@ -111,39 +144,6 @@ public class RitualEffectBinding extends RitualEffect } } - public BlockPos getPositionForLightning(BlockPos pos, int lightning) - { - switch (lightning) - { - case 0: - return pos.add(4, 3, 0); - - case 1: - return pos.add(-4, 3, 0); - - case 2: - return pos.add(0, 3, 4); - - case 3: - return pos.add(0, 3, -4); - - case 4: - return pos.add(3, 3, 3); - - case 5: - return pos.add(-3, 3, 3); - - case 6: - return pos.add(-3, 3, -3); - - case 7: - return pos.add(3, 3, -3); - - default: - return pos.add(0, 3, 0); - } - } - @Override public int getCostPerRefresh() { @@ -159,7 +159,7 @@ public class RitualEffectBinding extends RitualEffect @Override public List getRitualComponentList() { - ArrayList boundSoulRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java index a113d896..399ee3e5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java @@ -1,10 +1,13 @@ 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.block.state.IBlockState; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -15,18 +18,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; 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.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 { @@ -36,16 +33,17 @@ public class RitualEffectBiomeChanger extends RitualEffect String owner = ritualStone.getOwner(); int cooldown = ritualStone.getCooldown(); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); - + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (cooldown > 0) { ritualStone.setCooldown(cooldown - 1); if (world.rand.nextInt(15) == 0) { - world.addWeatherEffect(new EntityLightningBolt(world, pos.getX() - 1 + world.rand.nextInt(3), pos.getY() + 1, pos.getZ() - 1 + world.rand.nextInt(3))); + world.addWeatherEffect(new EntityLightningBolt(world, x - 1 + world.rand.nextInt(3), y + 1, z - 1 + world.rand.nextInt(3))); } return; @@ -91,25 +89,49 @@ public class RitualEffectBiomeChanger extends RitualEffect { if (boolList[i][j]) { - BlockPos position = pos.add(i - range, 1, j - range); - - for(EnumFacing face : EnumFacing.HORIZONTALS) - { - int iP = i + face.getFrontOffsetX(); - int jP = j + face.getFrontOffsetY(); - - if(iP >= 0 && iP <= 2 * range && jP >= 0 && jP <= 2 * range && !boolList[iP][jP]) - { - BlockPos newPos = position.add(face.getDirectionVec()); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) - { - boolList[iP][jP] = true; - isReady = false; - } - } - } + if (i - 1 >= 0 && !boolList[i - 1][j]) + { + Block block = world.getBlock(x - range + i - 1, y + 1, z - range + j); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i - 1][j] = true; + isReady = false; + } + } + + if (j - 1 >= 0 && !boolList[i][j - 1]) + { + Block block = world.getBlock(x - range + i, y + 1, z - range + j - 1); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i][j - 1] = true; + isReady = false; + } + } + + if (i + 1 <= 2 * range && !boolList[i + 1][j]) + { + Block block = world.getBlock(x - range + i + 1, y + 1, z - range + j); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i + 1][j] = true; + isReady = false; + } + } + + if (j + 1 <= 2 * range && !boolList[i][j + 1]) + { + Block block = world.getBlock(x - range + i, y + 1, z - range + j + 1); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i][j + 1] = true; + isReady = false; + } + } } } } @@ -129,8 +151,7 @@ public class RitualEffectBiomeChanger extends RitualEffect } boolean isItemConsumed = false; - BlockPos newPos = pos.add(i, 0, j); - TileEntity tileEntity = world.getTileEntity(newPos); + TileEntity tileEntity = world.getTileEntity(x + i, y, z + j); if (!(tileEntity instanceof TEPlinth)) { @@ -148,7 +169,7 @@ public class RitualEffectBiomeChanger extends RitualEffect { if (itemTest instanceof ItemBlock) { - Block item = ((ItemBlock) itemTest).getBlock(); + Block item = ((ItemBlock) itemTest).field_150939_a; if (item == (Blocks.sand)) { humidity -= 0.1f; @@ -209,12 +230,14 @@ public class RitualEffectBiomeChanger extends RitualEffect if (isItemConsumed) { tilePlinth.setInventorySlotContents(0, null); - world.markBlockForUpdate(newPos); - world.addWeatherEffect(new EntityLightningBolt(world, newPos.getX(), newPos.getY() + 1, newPos.getZ())); + world.markBlockForUpdate(x + i, y, z + j); + world.addWeatherEffect(new EntityLightningBolt(world, x + i, y + 1, z + j)); } } } + boolean wantsSnow = false; + boolean wantsRain = true; int biomeID = 1; BiomeGenBase[] biomeList = BiomeGenBase.getBiomeGenArray(); int iteration = 0; @@ -246,11 +269,10 @@ public class RitualEffectBiomeChanger extends RitualEffect { if (boolList[i][j]) { - BlockPos newPos = pos.add(i - range, 0, j - range); - Chunk chunk = world.getChunkFromBlockCoords(newPos); + Chunk chunk = world.getChunkFromBlockCoords(x - range + i, z - range + j); byte[] byteArray = chunk.getBiomeArray(); - int moduX = (newPos.getX()) % 16; - int moduZ = (newPos.getZ()) % 16; + int moduX = (x - range + i) % 16; + int moduZ = (z - range + j) % 16; if (moduX < 0) { @@ -288,7 +310,7 @@ public class RitualEffectBiomeChanger extends RitualEffect @Override public List getRitualComponentList() { - ArrayList biomeChangerRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java index bdd237f6..1a6b225a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java @@ -1,16 +1,5 @@ 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.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.ReflectionHelper; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; @@ -18,6 +7,16 @@ 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 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 { @@ -32,8 +31,10 @@ public class RitualEffectContainment extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -41,9 +42,10 @@ public class RitualEffectContainment extends RitualEffect } else { int d0 = 5; - List entityList = SpellHelper.getEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 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) @@ -61,9 +63,9 @@ public class RitualEffectContainment extends RitualEffect } - double xDif = livingEntity.posX - (pos.getX() + 0.5); - double yDif = livingEntity.posY - (pos.getY() + 3); - double zDif = livingEntity.posZ - (pos.getZ() + 0.5); + double xDif = livingEntity.posX - (x + 0.5); + double yDif = livingEntity.posY - (y + 3); + double zDif = livingEntity.posZ - (z + 0.5); livingEntity.motionX = -0.05 * xDif; livingEntity.motionY = -0.05 * yDif; livingEntity.motionZ = -0.05 * zDif; @@ -107,7 +109,7 @@ public class RitualEffectContainment extends RitualEffect @Override public List getRitualComponentList() { - ArrayList containmentRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java index 5b5a623b..889bed90 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java @@ -15,9 +15,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; @@ -41,8 +40,10 @@ public class RitualEffectCrafting extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + 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); @@ -92,13 +93,13 @@ public class RitualEffectCrafting extends RitualEffect { int gridSpace = (i+1)*3 + (j+1); - Int3 position = this.getSlotPositionForDirection(gridSpace, direction); - TileEntity inv = world.getTileEntity(pos.add(position.xCoord, position.yCoord, position.zCoord)); + Int3 pos = this.getSlotPositionForDirection(gridSpace, direction); + TileEntity inv = world.getTileEntity(x + pos.xCoord, y + pos.yCoord, z + pos.zCoord); if(inv instanceof IInventory) { if(((IInventory) inv).getSizeInventory() <= slotDesignation || !((IInventory) inv).isItemValidForSlot(slotDesignation, ((IInventory) inv).getStackInSlot(slotDesignation))) { - + continue; }else { ItemStack invStack = ((IInventory) inv).getStackInSlot(slotDesignation); @@ -131,12 +132,12 @@ public class RitualEffectCrafting extends RitualEffect IInventory outputInv = null; - List invList = new ArrayList(); + List invList = new ArrayList(); - TileEntity northEntity = world.getTileEntity(pos.add(0, -1, -2)); - TileEntity southEntity = world.getTileEntity(pos.add(0, -1, 2)); - TileEntity eastEntity = world.getTileEntity(pos.add(2, -1, 0)); - TileEntity westEntity = world.getTileEntity(pos.add(-2, -1, 0)); + TileEntity northEntity = world.getTileEntity(x, y-1, z - 2); + TileEntity southEntity = world.getTileEntity(x, y-1, z + 2); + TileEntity eastEntity = world.getTileEntity(x + 2, y-1, z); + TileEntity westEntity = world.getTileEntity(x - 2, y-1, z); switch(direction) { @@ -239,7 +240,7 @@ public class RitualEffectCrafting extends RitualEffect if (outputInv != null) { - if(!(!limitToSingleStack ? SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, EnumFacing.DOWN) : SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, EnumFacing.DOWN, true, returnStack.getMaxStackSize()))) + if(!(!limitToSingleStack ? SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN) : SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN, true, returnStack.getMaxStackSize()))) { tag.setBoolean("didLastCraftFail", true); return; @@ -250,7 +251,7 @@ public class RitualEffectCrafting extends RitualEffect invList.add(outputInv); } - Map> syphonMap = new HashMap>(); //Inventory, Slot, how much claimed + Map> syphonMap = new HashMap(); //Inventory, Slot, how much claimed for(int n = 0; n < recipe.length; n++) //Look for the correct items { @@ -299,7 +300,7 @@ public class RitualEffectCrafting extends RitualEffect Map slotMap = syphonMap.get(i); if(slotMap == null) { - slotMap = new HashMap(); + slotMap = new HashMap(); syphonMap.put(i, slotMap); } @@ -331,7 +332,7 @@ public class RitualEffectCrafting extends RitualEffect /* The recipe is valid and the items have been found */ - SpellHelper.insertStackIntoInventory(CraftingManager.getInstance().findMatchingRecipe(inventory, world), outputInv, EnumFacing.DOWN); + SpellHelper.insertStackIntoInventory(CraftingManager.getInstance().findMatchingRecipe(inventory, world), outputInv, ForgeDirection.DOWN); for(Entry> entry1 : syphonMap.entrySet()) { @@ -366,10 +367,10 @@ public class RitualEffectCrafting extends RitualEffect this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); } - world.markBlockForUpdate(pos.add(0, 1, 2)); - world.markBlockForUpdate(pos.add(0, 1, -2)); - world.markBlockForUpdate(pos.add(2, 1, 0)); - world.markBlockForUpdate(pos.add(-2, 1, 0)); + world.markBlockForUpdate(x, y-1, z + 2); + world.markBlockForUpdate(x, y-1, z - 2); + world.markBlockForUpdate(x + 2, y-1, z); + world.markBlockForUpdate(x - 2, y-1, z); // long endTime = System.nanoTime(); // @@ -389,7 +390,7 @@ public class RitualEffectCrafting extends RitualEffect @Override public List getRitualComponentList() { - ArrayList autoCraftingRitual = new ArrayList(); + ArrayList autoCraftingRitual = new ArrayList(); this.addCornerRunes(autoCraftingRitual, 1, 1, RitualComponent.EARTH); this.addParallelRunes(autoCraftingRitual, 1, 1, RitualComponent.EARTH); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java index 7d461d57..9440dc1d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -12,9 +11,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; @@ -37,15 +35,17 @@ public class RitualEffectCrushing extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); if (world.getWorldTime() % 10 != 5) { return; } - TileEntity tile = world.getTileEntity(pos.offsetUp()); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + TileEntity tile = world.getTileEntity(x, y + 1, z); IInventory tileEntity; if (tile instanceof IInventory) @@ -82,6 +82,7 @@ public class RitualEffectCrushing extends RitualEffect boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); boolean hasIncendium = this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, false); + boolean isSilkTouch = hasCrystallos; int fortuneLevel = 0; if (hasOrbisTerrae) { @@ -107,32 +108,30 @@ public class RitualEffectCrushing extends RitualEffect { for (int k = -1; k <= 1; k++) { - BlockPos newPos = pos.add(i, j, k); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - - if(block.getBlockHardness(world, newPos) == -1) + Block block = world.getBlock(x + i, y + j, z + k); + int meta = world.getBlockMetadata(x + i, y + j, z + k); + if(block.getBlockHardness(world, x + i, y + j, z + k) == -1) { continue; } - if (!world.isAirBlock(newPos)) + if (block != null && !world.isAirBlock(x + i, y + j, z + k)) { if ((block.equals(ModBlocks.ritualStone) || block.equals(ModBlocks.blockMasterStone)) || SpellHelper.isBlockFluid(block)) { continue; } - if (hasCrystallos && block.canSilkHarvest(world, newPos, state, null)) + if (isSilkTouch && block.canSilkHarvest(world, null, x + i, y + j, z + k, meta)) { - ItemStack item = new ItemStack(block, 1, block.getMetaFromState(state)); - ItemStack copyStack = ItemStack.copyItemStack(item); + ItemStack item = new ItemStack(block, 1, meta); + ItemStack copyStack = item.copyItemStack(item); - SpellHelper.insertStackIntoInventory(copyStack, tileEntity, EnumFacing.DOWN); + SpellHelper.insertStackIntoInventory(copyStack, tileEntity, ForgeDirection.DOWN); if (copyStack.stackSize > 0) { - world.spawnEntityInWorld(new EntityItem(world, pos.getX() + 0.5, pos.getY() + 2, pos.getZ() + 0.5, copyStack)); + world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); } if (hasCrystallos) @@ -141,7 +140,7 @@ public class RitualEffectCrushing extends RitualEffect } } else { - List itemDropList = block.getDrops(world, newPos, state, fortuneLevel); + ArrayList itemDropList = block.getDrops(world, x + i, y + j, z + k, meta, fortuneLevel); if (itemDropList != null) { @@ -150,7 +149,7 @@ public class RitualEffectCrushing extends RitualEffect for (ItemStack item : itemDropList) { hasIncendium = hasIncendium && this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, false); - ItemStack copyStack = ItemStack.copyItemStack(item); + ItemStack copyStack = item.copyItemStack(item); if (this.usesIncendium(copyStack)) { @@ -158,10 +157,10 @@ public class RitualEffectCrushing extends RitualEffect this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, true); } - SpellHelper.insertStackIntoInventory(copyStack, tileEntity, EnumFacing.DOWN); + SpellHelper.insertStackIntoInventory(copyStack, tileEntity, ForgeDirection.DOWN); if (copyStack.stackSize > 0) { - world.spawnEntityInWorld(new EntityItem(world, pos.getX() + 0.5, pos.getY() + 2, pos.getZ() + 0.5, copyStack)); + world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); } } @@ -179,8 +178,8 @@ public class RitualEffectCrushing extends RitualEffect } } } - world.setBlockToAir(newPos); - world.playSoundEffect(newPos.getX(), newPos.getY(), newPos.getZ(), "mob.endermen.portal", 1.0F, 1.0F); + 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()); @@ -199,12 +198,15 @@ public class RitualEffectCrushing extends RitualEffect Item item = stack.getItem(); if (item instanceof ItemBlock) { - Block block = ((ItemBlock) item).getBlock(); + Block block = ((ItemBlock) item).field_150939_a; if (block == Blocks.cobblestone || block == Blocks.stone) { return true; } + } else + { + } } return false; @@ -220,7 +222,7 @@ public class RitualEffectCrushing extends RitualEffect Item item = stack.getItem(); if (item instanceof ItemBlock) { - Block block = ((ItemBlock) item).getBlock(); + Block block = ((ItemBlock) item).field_150939_a; if (hasIncendium) { @@ -229,6 +231,9 @@ public class RitualEffectCrushing extends RitualEffect copyStack = new ItemStack(Blocks.netherrack, stackSize, 0); } } + } else + { + } return copyStack; @@ -236,6 +241,65 @@ public class RitualEffectCrushing extends RitualEffect 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) + { + index++; + } + } + } + } + + 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) + { + index++; + } + } + } + } + + if (index >= 12) + { + return 3; + } else if (index >= 8) + { + return 2; + } else if (index >= 4) + { + return 1; + } + + return 0; + } + @Override public int getCostPerRefresh() { @@ -245,7 +309,7 @@ public class RitualEffectCrushing extends RitualEffect @Override public List getRitualComponentList() { - ArrayList crushingRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java index 2674b0ce..c083863d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java @@ -4,12 +4,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModBlocks; @@ -22,6 +20,7 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; public class RitualEffectDemonPortal extends RitualEffect { @@ -37,8 +36,10 @@ public class RitualEffectDemonPortal extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -67,7 +68,7 @@ public class RitualEffectDemonPortal extends RitualEffect { if(rand.nextInt(10) == 0) { - this.createRandomLightning(world, pos.getX(), pos.getY(), pos.getZ()); + this.createRandomLightning(world, x, y, z); } reagentAmount += drainAmount; @@ -81,9 +82,9 @@ public class RitualEffectDemonPortal extends RitualEffect if(reagentsFulfilled && checkCreatePortal(ritualStone)) { - world.setBlockState(pos.offsetUp(), ModBlocks.blockDemonPortal.getDefaultState()); + world.setBlock(x, y+1, z, ModBlocks.blockDemonPortal); - TEDemonPortal portal = (TEDemonPortal) world.getTileEntity(pos.offsetUp()); + TEDemonPortal portal = (TEDemonPortal) world.getTileEntity(x, y + 1, z); portal.start(); ritualStone.setActive(false); @@ -95,12 +96,11 @@ public class RitualEffectDemonPortal extends RitualEffect public boolean checkCreatePortal(IMasterRitualStone ritualStone) { - BlockPos pos = ritualStone.getPosition(); - TileEntity entity = ritualStone.getWorldObj().getTileEntity(pos.offsetUp()); + TileEntity entity = ritualStone.getWorld().getTileEntity(ritualStone.getXCoord(), ritualStone.getYCoord() + 1, ritualStone.getZCoord()); if(entity instanceof IBloodAltar) { IBloodAltar altar = (IBloodAltar)entity; - if(altar.hasDemonBlood() && ritualStone.getWorldObj().isAirBlock(pos.offsetUp(2))) + if(altar.hasDemonBlood() && ritualStone.getWorld().isAirBlock(ritualStone.getXCoord(), ritualStone.getYCoord() + 2, ritualStone.getZCoord())) { return true; } @@ -132,11 +132,13 @@ public class RitualEffectDemonPortal extends RitualEffect public boolean checkJars(IMasterRitualStone ritualStone) { - BlockPos position = ritualStone.getPosition(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); for(Int3 pos : jarLocations) { - if(!(ritualStone.getWorldObj().getTileEntity(position.add(pos.xCoord, pos.yCoord, pos.zCoord)) instanceof TEBelljar)) + if(!(ritualStone.getWorld().getTileEntity(x + pos.xCoord, y + pos.yCoord, z + pos.zCoord) instanceof TEBellJar)) { return false; } @@ -148,7 +150,7 @@ public class RitualEffectDemonPortal extends RitualEffect @Override public List getRitualComponentList() { - ArrayList demonRitual = new ArrayList(); + ArrayList demonRitual = new ArrayList(); this.addParallelRunes(demonRitual, 3, 0, RitualComponent.FIRE); this.addParallelRunes(demonRitual, 5, 0, RitualComponent.FIRE); this.addCornerRunes(demonRitual, 2, 0, RitualComponent.AIR); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java index bdb47c52..5e82d851 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java @@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.rituals; import java.util.ArrayList; import java.util.List; -import net.minecraft.block.state.IBlockState; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemBlock; @@ -12,8 +12,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; @@ -30,10 +28,12 @@ public class RitualEffectEllipsoid extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); - TileEntity tile = world.getTileEntity(pos.offsetUp()); + TileEntity tile = world.getTileEntity(x, y + 1, z); if (!(tile instanceof IInventory) || ((IInventory) tile).getSizeInventory() < 3) { @@ -62,7 +62,7 @@ public class RitualEffectEllipsoid extends RitualEffect entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); } else { - tile = world.getTileEntity(pos.offsetDown()); + tile = world.getTileEntity(x, y-1, z); if(!(tile instanceof IInventory)) { return; @@ -115,7 +115,7 @@ public class RitualEffectEllipsoid extends RitualEffect while(j <= ySize) { - if(pos.getY() + j < 0) + if(y + j < 0) { j++; continue; @@ -144,29 +144,36 @@ public class RitualEffectEllipsoid extends RitualEffect count--; - BlockPos newPos = pos.add(i, j, k); - - if (!world.isAirBlock(newPos)) + Block block = world.getBlock(x + i, y + j, z + k); + + if (!block.isAir(world, x + i, y + j, z + k)) { k++; continue; } else { //This is pulled from the ItemBlock's placing calls - int newState = placedBlock.getMetadata(stack.getMetadata()); - IBlockState iblockstate1 = placedBlock.block.onBlockPlaced(world, newPos, EnumFacing.UP, 0, 0, 0, newState, null); + int i1 = placedBlock.getMetadata(stack.getItemDamage()); + int j1 = placedBlock.field_150939_a.onBlockPlaced(world, x + i, y + j, z + k, 0, 0, 0, 0, i1); - if (placedBlock.placeBlockAt(stack, null, world, pos, EnumFacing.UP, 0, 0, 0, iblockstate1)) + if (placedBlock.placeBlockAt(stack, null, world, x + i, y + j, z + k, 0, 0, 0, 0, j1)) { - world.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), placedBlock.block.stepSound.getPlaceSound(), (placedBlock.block.stepSound.getVolume() + 1.0F) / 2.0F, placedBlock.block.stepSound.getFrequency() * 0.8F); + world.playSoundEffect((double)(x + i + 0.5F), (double)(y + j + 0.5F), (double)(z + k + 0.5F), placedBlock.field_150939_a.stepSound.func_150496_b(), (placedBlock.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F, placedBlock.field_150939_a.stepSound.getPitch() * 0.8F); --stack.stackSize; + if(stack.stackSize <= 0) + { + inv.setInventorySlotContents(slot, null); + } + + this.setLastPosition(ritualStone.getCustomRitualTag(), new Int3(i, j, k)); + + incrementNext = true; + SoulNetworkHandler.syphonFromNetwork(owner, cost); + } - this.setLastPosition(ritualStone.getCustomRitualTag(), new Int3(i, j, k)); - - incrementNext = true; - SoulNetworkHandler.syphonFromNetwork(owner, cost); - +// world.setBlock(x + i, y + j, z + k, Blocks.stone); + k++; } } @@ -192,7 +199,7 @@ public class RitualEffectEllipsoid extends RitualEffect @Override public List getRitualComponentList() { - ArrayList ellipsoidRitual = new ArrayList(); + ArrayList ellipsoidRitual = new ArrayList(); ellipsoidRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); ellipsoidRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java index 53c81bba..5c447a02 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java @@ -1,23 +1,20 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; 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 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 { @@ -27,8 +24,10 @@ public class RitualEffectEvaporation extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < 0) { @@ -42,8 +41,7 @@ public class RitualEffectEvaporation extends RitualEffect entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); } else { - IBlockState state1 = world.getBlockState(pos.offsetDown()); - Block block1 = state1.getBlock(); + 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]; @@ -74,26 +72,65 @@ public class RitualEffectEvaporation extends RitualEffect { if (boolList[i][j][k]) { - BlockPos position = pos.add(i - range, j - range, k - range); - - for(EnumFacing face : EnumFacing.VALUES) - { - int iP = i + face.getFrontOffsetX(); - int jP = j + face.getFrontOffsetY(); - int kP = k + face.getFrontOffsetZ(); - - if(iP >= 0 && iP <= 2 * range && jP >= 0 && jP <= 2 * range && kP >= 0 && kP <= 2 * range && !boolList[iP][jP][kP]) - { - BlockPos newPos = position.add(face.getDirectionVec()); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - if (world.isAirBlock(newPos) || block == ModBlocks.blockSpectralContainer) - { - boolList[iP][jP][kP] = true; - isReady = false; - } - } - } + 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) + { + boolList[i - 1][j][k] = true; + 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); + 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]) + { + 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; + } + } + + 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) + { + boolList[i + 1][j][k] = true; + 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); + 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]) + { + 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; + } + } } } } @@ -111,13 +148,11 @@ public class RitualEffectEvaporation extends RitualEffect continue; } - BlockPos newPos = pos.add(i - range, j - range, k - range); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(x + i - range, y + j - range, z + k - range); if (block == ModBlocks.blockSpectralContainer) { - world.setBlockToAir(newPos); + world.setBlockToAir(x + i - range, y + j - range, z + k - range); } } } @@ -138,7 +173,7 @@ public class RitualEffectEvaporation extends RitualEffect @Override public List getRitualComponentList() { - ArrayList ellipsoidRitual = new ArrayList(); + ArrayList ellipsoidRitual = new ArrayList(); ellipsoidRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); ellipsoidRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java index 0ee1c57e..0452a29e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java @@ -1,32 +1,30 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.EntityLivingBase; -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.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumParticleTypes; -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.SoulNetworkHandler; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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; +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.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 java.util.ArrayList; +import java.util.List; +import java.util.Random; public class RitualEffectExpulsion extends RitualEffect { @@ -40,8 +38,10 @@ public class RitualEffectExpulsion extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -53,10 +53,10 @@ public class RitualEffectExpulsion extends RitualEffect int teleportDistance = hasVirtus ? 300 : 100; int range = hasPotentia ? 50 : 25; - List playerList = SpellHelper.getPlayersInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, range, range); + List playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); boolean flag = false; - TileEntity tile = world.getTileEntity(pos.offsetUp()); + TileEntity tile = world.getTileEntity(x, y + 1, z); IInventory inventoryTile = null; if (tile instanceof IInventory) { @@ -78,7 +78,7 @@ public class RitualEffectExpulsion extends RitualEffect for (int i = 0; i < inventoryTile.getSizeInventory(); i++) { ItemStack stack = inventoryTile.getStackInSlot(i); - if (stack != null && stack.getItem() instanceof IBindable && BindableItems.getOwnerName(stack).equals(playerString)) + if (stack != null && stack.getItem() instanceof IBindable && EnergyItems.getOwnerName(stack).equals(playerString)) { test = true; } @@ -117,7 +117,7 @@ public class RitualEffectExpulsion extends RitualEffect int teleportDistance = hasVirtus ? 300 : 100; int range = hasPotentia ? 50 : 25; - List livingList = SpellHelper.getLivingEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, range, range); + List livingList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); boolean flag = false; for (EntityLivingBase livingEntity : livingList) @@ -162,14 +162,14 @@ public class RitualEffectExpulsion extends RitualEffect double z = entityLiving.posZ; Random rand = new Random(); double d0 = x + (rand.nextDouble() - 0.5D) * distance; - double d1 = y + (rand.nextInt((int) distance) - (distance) / 2); + double d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); double d2 = z + (rand.nextDouble() - 0.5D) * distance; int i = 0; while (!teleportTo(entityLiving, d0, d1, d2, x, y, z) && i < 100) { d0 = x + (rand.nextDouble() - 0.5D) * distance; - d1 = y + (rand.nextInt((int) distance) - (distance) / 2); + d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); d2 = z + (rand.nextDouble() - 0.5D) * distance; i++; } @@ -191,24 +191,23 @@ public class RitualEffectExpulsion extends RitualEffect return false; } + double d3 = lastX; + double d4 = lastY; + double d5 = lastZ; SpellTeleport.moveEntityViaTeleport(entityLiving, event.targetX, event.targetY, event.targetZ); boolean flag = false; - - int i = MathHelper.floor_double(entityLiving.posX); int j = MathHelper.floor_double(entityLiving.posY); int k = MathHelper.floor_double(entityLiving.posZ); int l; -// if (entityLiving.worldObj.blockExists(i, j, k)) + if (entityLiving.worldObj.blockExists(i, j, k)) { boolean flag1 = false; while (!flag1 && j > 0) { - BlockPos newPos = new BlockPos(i, j - 1, k); - IBlockState state = entityLiving.worldObj.getBlockState(newPos); - Block block = state.getBlock(); + Block block = entityLiving.worldObj.getBlock(i, j - 1, k); if (block != null && block.getMaterial().blocksMovement()) { @@ -224,7 +223,7 @@ public class RitualEffectExpulsion extends RitualEffect { SpellTeleport.moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ); - if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.getBoundingBox()).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.getBoundingBox())) + if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) { flag = true; } @@ -233,7 +232,7 @@ public class RitualEffectExpulsion extends RitualEffect if (!flag) { - SpellTeleport.moveEntityViaTeleport(entityLiving, lastX, lastY, lastZ); + SpellTeleport.moveEntityViaTeleport(entityLiving, d3, d4, d5); return false; } else { @@ -245,10 +244,10 @@ public class RitualEffectExpulsion extends RitualEffect float f = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; float f1 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; float f2 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; - double d7 = lastX + (entityLiving.posX - lastX) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; - double d8 = lastY + (entityLiving.posY - lastY) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; - double d9 = lastZ + (entityLiving.posZ - lastZ) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; - entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, (double) f, (double) f1, (double) f2); + double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; + 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); } return true; } @@ -258,7 +257,7 @@ public class RitualEffectExpulsion extends RitualEffect { if (entityLiving instanceof EntityPlayer) { - if (entityLiving instanceof EntityPlayerMP) + if (entityLiving != null && entityLiving instanceof EntityPlayerMP) { EntityPlayerMP entityplayermp = (EntityPlayerMP) entityLiving; @@ -270,7 +269,7 @@ public class RitualEffectExpulsion extends RitualEffect { if (entityLiving.isRiding()) { - entityLiving.mountEntity(null); + entityLiving.mountEntity((Entity) null); } entityLiving.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); } @@ -285,7 +284,7 @@ public class RitualEffectExpulsion extends RitualEffect @Override public List getRitualComponentList() { - ArrayList expulsionRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java index 6b8faa20..a72bc0af 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java @@ -1,18 +1,17 @@ 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.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -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.SoulNetworkHandler; +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 { @@ -28,15 +27,13 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (ritualStone.getCooldown() > 0) { - int x = pos.getX(); - int y = pos.getY(); - int z = pos.getZ(); - world.addWeatherEffect(new EntityLightningBolt(world, x + 4, y + 5, z + 4)); world.addWeatherEffect(new EntityLightningBolt(world, x + 4, y + 5, z - 4)); world.addWeatherEffect(new EntityLightningBolt(world, x - 4, y + 5, z - 4)); @@ -50,11 +47,14 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal int range = this.getHorizontalRangeForReagent(hasTerrae, hasOrbisTerrae); int verticalRange = hasAether ? 60 : 30; - List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)).expand(range, verticalRange, range)); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(range, verticalRange, range)); int entityCount = 0; boolean flag = false; - entityCount += entities.size(); + for (EntityLivingBase entity : entities) + { + entityCount++; + } if (currentEssence < this.getCostPerRefresh() * entityCount) { @@ -102,7 +102,7 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal @Override public List getRitualComponentList() { - ArrayList featheredEarthRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java index 39c0e4e7..35df70c8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java @@ -8,7 +8,6 @@ import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -29,8 +28,10 @@ public class RitualEffectFeatheredKnife extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + 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); @@ -50,10 +51,9 @@ public class RitualEffectFeatheredKnife extends RitualEffect { for (int k = -10; k <= 10; k++) { - BlockPos newPos = pos.add(i, k, j); - if (world.getTileEntity(newPos) instanceof IBloodAltar) + if (world.getTileEntity(x + i, y + k, z + j) instanceof IBloodAltar) { - tileAltar = (IBloodAltar) world.getTileEntity(newPos); + tileAltar = (IBloodAltar) world.getTileEntity(x + i, y + k, z + j); testFlag = true; } } @@ -69,9 +69,10 @@ public class RitualEffectFeatheredKnife extends RitualEffect double range = hasReductus ? 8 : 15; double vertRange = hasReductus ? 8 : 20; - List list = SpellHelper.getPlayersInRange(world, pos.getX(), pos.getY(), pos.getZ(), 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()) { @@ -135,7 +136,7 @@ public class RitualEffectFeatheredKnife extends RitualEffect @Override public List getRitualComponentList() { - ArrayList featheredKnifeRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java index 177d7a7e..705eaf1d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java @@ -10,7 +10,6 @@ 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.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -28,14 +27,16 @@ public class RitualEffectFlight extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); int range = 20; - int verticalRange = 70; - AxisAlignedBB axis = new AxisAlignedBB(pos, pos.add(1, 1, 1)).expand(range, verticalRange, range); -// axis.maxY = 256; -// axis.minY = 0; + int verticalRange = 30; + AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(range, verticalRange, range); + axis.maxY = 256; + axis.minY = 0; List entities = world.getEntitiesWithinAABB(EntityPlayer.class, axis); int entityCount = 0; @@ -95,7 +96,7 @@ public class RitualEffectFlight extends RitualEffect @Override public List getRitualComponentList() { - ArrayList flightRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java index 2d967606..84bfdd01 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java @@ -9,7 +9,6 @@ import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.FoodStats; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; @@ -27,8 +26,10 @@ public class RitualEffectFullStomach extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (world.getWorldTime() % 20 != 0) { @@ -38,7 +39,7 @@ public class RitualEffectFullStomach extends RitualEffect double horizRange = 16; double vertRange = 16; - List playerList = SpellHelper.getPlayersInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, horizRange, vertRange); + List playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, horizRange, vertRange); if (playerList == null) { @@ -50,14 +51,14 @@ public class RitualEffectFullStomach extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - TileEntity tile = world.getTileEntity(pos.offsetUp()); + TileEntity tile = world.getTileEntity(x, y + 1, z); IInventory inventory = null; if (tile instanceof IInventory) { inventory = (IInventory) tile; } else { - tile = world.getTileEntity(pos.offsetDown()); + tile = world.getTileEntity(x, y - 1, z); if (tile instanceof IInventory) { inventory = (IInventory) tile; @@ -81,8 +82,8 @@ public class RitualEffectFullStomach extends RitualEffect { ItemFood foodItem = (ItemFood) stack.getItem(); - int regularHeal = foodItem.getHealAmount(stack); - float saturatedHeal = foodItem.getSaturationModifier(stack) * regularHeal * 2.0f; + int regularHeal = foodItem.func_150905_g(stack); + float saturatedHeal = foodItem.func_150906_h(stack) * regularHeal * 2.0f; if (saturatedHeal + satLevel <= 20) { @@ -113,7 +114,7 @@ public class RitualEffectFullStomach extends RitualEffect @Override public List getRitualComponentList() { - ArrayList fullRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java index 3ec289cd..58288c92 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java @@ -1,20 +1,18 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.IGrowable; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; -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.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 net.minecraft.block.IGrowable; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectGrowth extends RitualEffect { @@ -29,8 +27,10 @@ public class RitualEffectGrowth extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh() * 9) { @@ -56,8 +56,7 @@ public class RitualEffectGrowth extends RitualEffect { if (this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, false)) { - BlockPos newPos = pos.add(i, 1, j); - if (SpellHelper.hydrateSoil(world, newPos)) + if (SpellHelper.hydrateSoil(world, x + i, y + 1, z + j)) { this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); } @@ -73,15 +72,13 @@ public class RitualEffectGrowth extends RitualEffect { for (int j = -range; j <= range; j++) { - BlockPos newPos = pos.add(i, 2, j); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(x + i, y + 2, z + j); if (block instanceof IPlantable || block instanceof IGrowable) { { - SpellHelper.sendIndexedParticleToAllAround(world, pos, 20, world.provider.getDimensionId(), 3, pos); - block.updateTick(world, newPos, state, world.rand); + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z); + block.updateTick(world, x + i, y + 2, z + j, world.rand); flag++; } } @@ -111,7 +108,7 @@ public class RitualEffectGrowth extends RitualEffect @Override public List getRitualComponentList() { - ArrayList growthRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java index 55307e88..02803953 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java @@ -1,22 +1,20 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; 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.world.World; + +import java.util.ArrayList; +import java.util.List; public class RitualEffectHarvest extends RitualEffect { @@ -26,9 +24,10 @@ public class RitualEffectHarvest extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); - + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); int maxCount = 100; if (currentEssence < this.getCostPerRefresh() * maxCount) @@ -48,8 +47,7 @@ public class RitualEffectHarvest extends RitualEffect return; } - IBlockState state = world.getBlockState(pos.offsetDown()); - Block block = state.getBlock(); + Block block = world.getBlock(x, y - 1, z); int flag = 0; int range = this.getRadiusForModifierBlock(block); int vertRange = 4; @@ -60,7 +58,7 @@ public class RitualEffectHarvest extends RitualEffect { for (int k = -range; k <= range; k++) { - if (HarvestRegistry.harvestBlock(world, pos.add(i, j, k)) && flag < maxCount) + if (HarvestRegistry.harvestBlock(world, x + i, y + j, z + k) && flag < maxCount) { flag++; } @@ -109,7 +107,7 @@ public class RitualEffectHarvest extends RitualEffect @Override public List getRitualComponentList() { - ArrayList harvestRitual = new ArrayList(); + ArrayList harvestRitual = new ArrayList(); harvestRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); harvestRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java index 8a39075a..c8e45fbe 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java @@ -1,20 +1,19 @@ 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.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.BlockPos; -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.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 { @@ -28,8 +27,10 @@ public class RitualEffectHealing extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); int timeDelay = 50; @@ -43,8 +44,9 @@ public class RitualEffectHealing extends RitualEffect int range = 15 * (hasPraesidium ? 3 : 1); int vertRange = 15 * (hasPraesidium ? 3 : 1); - List list = SpellHelper.getLivingEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 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) { @@ -82,7 +84,7 @@ public class RitualEffectHealing extends RitualEffect if (livingEntity.getHealth() + 0.1f < livingEntity.getMaxHealth()) { PotionEffect effect = livingEntity.getActivePotionEffect(Potion.regeneration); - if (effect == null || (effect.getAmplifier() <= potency && effect.getDuration() <= timeDelay)) + if (effect == null || (effect != null && effect.getAmplifier() <= potency && effect.getDuration() <= timeDelay)) { if (!hasVirtus || (this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false))) { @@ -128,7 +130,7 @@ public class RitualEffectHealing extends RitualEffect @Override public List getRitualComponentList() { - ArrayList healingRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java index 6a6253dd..0a1b9711 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java @@ -10,7 +10,6 @@ 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.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -27,8 +26,10 @@ public class RitualEffectInterdiction extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -37,7 +38,7 @@ public class RitualEffectInterdiction extends RitualEffect { int d0 = 5; - List list = SpellHelper.getLivingEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 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); @@ -47,9 +48,9 @@ public class RitualEffectInterdiction extends RitualEffect { if (!((!hasOffensa && entityLiving instanceof EntityPlayer) && (SpellHelper.getUsername((EntityPlayer) entityLiving).equals(owner)))) { - double xDif = entityLiving.posX - (pos.getX() - 0.5); - double yDif = entityLiving.posY - ((pos.getY() - 0.5) + 1); - double zDif = entityLiving.posZ - (pos.getZ() - 0.5); + double xDif = entityLiving.posX - x; + double yDif = entityLiving.posY - (y + 1); + double zDif = entityLiving.posZ - z; entityLiving.motionX = 0.1 * xDif; entityLiving.motionY = 0.1 * yDif; entityLiving.motionZ = 0.1 * zDif; @@ -77,7 +78,7 @@ public class RitualEffectInterdiction extends RitualEffect int horizontalRadius = 5; int verticalRadius = 5; - List itemList = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)).expand(horizontalRadius, verticalRadius, horizontalRadius)); + List itemList = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(horizontalRadius, verticalRadius, horizontalRadius)); if (itemList != null) { @@ -85,9 +86,9 @@ public class RitualEffectInterdiction extends RitualEffect for (EntityItem entity : itemList) { - double xDif = entity.posX - (pos.getX() - 0.5); - double yDif = entity.posY - ((pos.getY() - 0.5) + 1); - double zDif = entity.posZ - (pos.getZ() - 0.5); + 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; @@ -123,7 +124,7 @@ public class RitualEffectInterdiction extends RitualEffect @Override public List getRitualComponentList() { - ArrayList interdictionRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java index ab737d9b..f8dca42f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java @@ -1,46 +1,55 @@ package WayofTime.alchemicalWizardry.common.rituals; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Random; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.RoutingFocusParadigm; import WayofTime.alchemicalWizardry.api.RoutingFocusPosAndFacing; 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.routing.InputRoutingFocus; import WayofTime.alchemicalWizardry.common.items.routing.OutputRoutingFocus; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class RitualEffectItemRouting extends RitualEffect { + Random rand = new Random(); + @Override public void performEffect(IMasterRitualStone ritualStone) { String owner = ritualStone.getOwner(); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (world.getWorldTime() % 20 != 0) { return; } - List outputList = new ArrayList(); + Map tileMap = new HashMap(); + + List outputList = new ArrayList(); for(int i=0; i<4; i++) //Check output foci chests, return if none available { Int3 outputFocusChest = this.getOutputBufferChestLocation(i); - BlockPos newPos = pos.add(outputFocusChest.xCoord, outputFocusChest.yCoord, outputFocusChest.zCoord); - TileEntity outputFocusInv = world.getTileEntity(newPos); + TileEntity outputFocusInv = world.getTileEntity(x + outputFocusChest.xCoord, y + outputFocusChest.yCoord, z + outputFocusChest.zCoord); if(outputFocusInv instanceof IInventory) { outputList.add((IInventory)outputFocusInv); @@ -55,12 +64,12 @@ public class RitualEffectItemRouting extends RitualEffect for(IInventory outputFocusInventory : outputList) { { - OutputRoutingFocus outputFocus; + OutputRoutingFocus outputFocus;; RoutingFocusParadigm parad = new RoutingFocusParadigm(); TileEntity outputChest = null; //Destination - EnumFacing inputDirection; + ForgeDirection inputDirection; { IInventory outputChestInventory = null; @@ -100,9 +109,9 @@ public class RitualEffectItemRouting extends RitualEffect continue; } inputDirection = posAndFacing.facing; - if(outputChest == null || !posAndFacing.location.equals(new Int3(outputChest.getPos()))) + if(outputChest == null || !posAndFacing.location.equals(new Int3(outputChest.xCoord, outputChest.yCoord, outputChest.zCoord))) { - outputChest = world.getTileEntity(new BlockPos(posAndFacing.location.xCoord, posAndFacing.location.yCoord, posAndFacing.location.zCoord)); + outputChest = world.getTileEntity(posAndFacing.location.xCoord, posAndFacing.location.yCoord, posAndFacing.location.zCoord); if(outputChest instanceof IInventory) { outputChestInventory = (IInventory)outputChest; @@ -115,7 +124,7 @@ public class RitualEffectItemRouting extends RitualEffect for(int i=0; i<4; i++) { Int3 inputFocusChest = this.getInputBufferChestLocation(i); - TileEntity inputFocusInv = world.getTileEntity(pos.add(inputFocusChest.xCoord, inputFocusChest.yCoord, inputFocusChest.zCoord)); + TileEntity inputFocusInv = world.getTileEntity(x + inputFocusChest.xCoord, y + inputFocusChest.yCoord, z + inputFocusChest.zCoord); if(inputFocusInv instanceof IInventory) { for(int ji=0; ji<((IInventory) inputFocusInv).getSizeInventory(); ji++) //Iterate through foci inventory @@ -124,15 +133,15 @@ public class RitualEffectItemRouting extends RitualEffect if(inputFocusStack != null && inputFocusStack.getItem() instanceof InputRoutingFocus) { InputRoutingFocus inputFocus = (InputRoutingFocus)inputFocusStack.getItem(); - TileEntity inputChest = world.getTileEntity(new BlockPos(inputFocus.xCoord(inputFocusStack), inputFocus.yCoord(inputFocusStack), inputFocus.zCoord(inputFocusStack))); + TileEntity inputChest = world.getTileEntity(inputFocus.xCoord(inputFocusStack), inputFocus.yCoord(inputFocusStack), inputFocus.zCoord(inputFocusStack)); if(inputChest instanceof IInventory) { IInventory inputChestInventory = (IInventory)inputChest; - EnumFacing syphonDirection = inputFocus.getSetDirection(inputFocusStack); + ForgeDirection syphonDirection = inputFocus.getSetDirection(inputFocusStack); boolean[] canSyphonList = new boolean[inputChestInventory.getSizeInventory()]; if(inputChest instanceof ISidedInventory) { - int[] validSlots = ((ISidedInventory) inputChest).getSlotsForFace(syphonDirection); + int[] validSlots = ((ISidedInventory) inputChest).getAccessibleSlotsFromSide(syphonDirection.ordinal()); for(int in : validSlots) { canSyphonList[in] = true; @@ -150,7 +159,7 @@ public class RitualEffectItemRouting extends RitualEffect if(canSyphonList[ni]) { ItemStack syphonedStack = inputChestInventory.getStackInSlot(ni); //Has a syphoned item linked, next need to find a destination - if(syphonedStack == null || (inputChestInventory instanceof ISidedInventory && !((ISidedInventory)inputChestInventory).canExtractItem(ni, syphonedStack, syphonDirection))) + if(syphonedStack == null || (inputChestInventory instanceof ISidedInventory && !((ISidedInventory)inputChestInventory).canExtractItem(ni, syphonedStack, syphonDirection.ordinal()))) { continue; } @@ -159,7 +168,7 @@ public class RitualEffectItemRouting extends RitualEffect if(parad.doesItemMatch(keyStack, syphonedStack)) { - ItemStack newStack; + ItemStack newStack = null; if(parad.maximumAmount <= 0) { newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection); @@ -172,7 +181,9 @@ public class RitualEffectItemRouting extends RitualEffect continue; } - if(newStack.stackSize <= 0) + int numberSyphoned = size - newStack.stackSize; + + if(newStack != null && newStack.stackSize <= 0) { size = newStack.stackSize; newStack = null; @@ -235,7 +246,7 @@ public class RitualEffectItemRouting extends RitualEffect @Override public List getRitualComponentList() { - ArrayList omegaRitual = new ArrayList(); + ArrayList omegaRitual = new ArrayList(); this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.BLANK); this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.FIRE); @@ -245,4 +256,6 @@ public class RitualEffectItemRouting extends RitualEffect return omegaRitual; } + + } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java index 0e5112be..5f0c57cf 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java @@ -7,9 +7,8 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; @@ -21,16 +20,20 @@ public class RitualEffectItemSuction extends RitualEffect { 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.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); - - TileEntity tile = world.getTileEntity(pos.offsetUp()); + World world = ritualStone.getWorld(); + + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + TileEntity tile = world.getTileEntity(x, y + 1, z); IInventory tileEntity; if (tile instanceof IInventory) @@ -51,7 +54,7 @@ public class RitualEffectItemSuction extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - List itemDropList = SpellHelper.getItemsInRange(world, pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 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); @@ -59,17 +62,20 @@ public class RitualEffectItemSuction extends RitualEffect 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; -// } + 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; - ItemStack newStack = SpellHelper.insertStackIntoInventory(copyStack, tileEntity, EnumFacing.DOWN); + ItemStack newStack = SpellHelper.insertStackIntoInventory(copyStack, tileEntity, ForgeDirection.DOWN); if (newStack != null && newStack.stackSize < pastAmount) { @@ -95,6 +101,7 @@ public class RitualEffectItemSuction extends RitualEffect if (count > 0) { SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * Math.min(count, 100)); + return; } } } @@ -108,7 +115,7 @@ public class RitualEffectItemSuction extends RitualEffect @Override public List getRitualComponentList() { - ArrayList suctionRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java index bd77b632..4c6dc431 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java @@ -10,7 +10,6 @@ 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.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -18,8 +17,8 @@ import java.util.List; public class RitualEffectJumping extends RitualEffect { - public final int aetherDrain = 10; - public final int terraeDrain = 10; + public static final int aetherDrain = 10; + public static final int terraeDrain = 10; @Override public void performEffect(IMasterRitualStone ritualStone) @@ -27,11 +26,13 @@ public class RitualEffectJumping extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); double range = 0.5; - List livingList = SpellHelper.getLivingEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, range, range); + List livingList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 1.5, z + 0.5, range, range); if (currentEssence < this.getCostPerRefresh() * livingList.size()) { @@ -98,7 +99,7 @@ public class RitualEffectJumping extends RitualEffect @Override public List getRitualComponentList() { - ArrayList jumpingRitual = new ArrayList(); + ArrayList jumpingRitual = new ArrayList(); for (int i = -1; i <= 1; i++) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java index 030ab73a..8826b267 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java @@ -1,21 +1,5 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.potion.PotionEffect; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -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; @@ -24,6 +8,20 @@ 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.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 java.util.ArrayList; +import java.util.List; public class RitualEffectLava extends RitualEffect { @@ -39,8 +37,11 @@ public class RitualEffectLava extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + if (this.canDrainReagent(ritualStone, ReagentRegistry.offensaReagent, offensaDrain, false) && SoulNetworkHandler.canSyphonFromOnlyNetwork(owner, fireFuseCost)) { @@ -48,7 +49,7 @@ public class RitualEffectLava extends RitualEffect boolean drainReductus = world.getWorldTime() % 100 == 0; int range = 5; - List entityList = SpellHelper.getLivingEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, range, range); + 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) @@ -75,11 +76,9 @@ public class RitualEffectLava extends RitualEffect } } - BlockPos newPos = pos.offsetUp(); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(x, y + 1, z); - if (world.isAirBlock(newPos) && !(block instanceof BlockSpectralContainer)) + if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) { if (currentEssence < this.getCostPerRefresh()) { @@ -88,10 +87,10 @@ public class RitualEffectLava extends RitualEffect { for (int i = 0; i < 10; i++) { - SpellHelper.sendIndexedParticleToAllAround(world, pos, 20, world.provider.getDimensionId(), 3, pos); + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z); } - world.setBlockState(newPos, Blocks.lava.getDefaultState()); + world.setBlock(x, y + 1, z, Blocks.lava, 0, 3); SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } } else @@ -101,13 +100,13 @@ public class RitualEffectLava extends RitualEffect { return; } - TileEntity tile = world.getTileEntity(newPos); + TileEntity tile = world.getTileEntity(x, y + 1, z); if (tile instanceof IFluidHandler) { - int amount = ((IFluidHandler) tile).fill(EnumFacing.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), false); if (amount >= 1000) { - ((IFluidHandler) tile).fill(EnumFacing.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true); + ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.LAVA, 1000), true); this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); @@ -115,6 +114,8 @@ public class RitualEffectLava extends RitualEffect } } } + + } @Override @@ -126,7 +127,7 @@ public class RitualEffectLava extends RitualEffect @Override public List getRitualComponentList() { - ArrayList lavaRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java index 2774c4fb..baa711cd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java @@ -10,7 +10,6 @@ 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.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -30,12 +29,14 @@ public class RitualEffectLeap extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); double range = 2.0; - List livingList = SpellHelper.getLivingEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, range, range); + List livingList = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); if (livingList == null) { @@ -208,7 +209,7 @@ public class RitualEffectLeap extends RitualEffect @Override public List getRitualComponentList() { - ArrayList leapingRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java index da3b7397..23f39955 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java @@ -4,9 +4,8 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; import WayofTime.alchemicalWizardry.AlchemicalWizardry; @@ -25,8 +24,10 @@ public class RitualEffectLifeConduit extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); IBloodAltar tileAltar = null; boolean testFlag = false; @@ -37,10 +38,9 @@ public class RitualEffectLifeConduit extends RitualEffect { for (int k = -10; k <= 10; k++) { - BlockPos newPos = pos.add(i, j, k); - if (world.getTileEntity(newPos) instanceof IBloodAltar) + if (world.getTileEntity(x + i, y + k, z + j) instanceof IBloodAltar) { - tileAltar = (IBloodAltar) world.getTileEntity(newPos); + tileAltar = (IBloodAltar) world.getTileEntity(x + i, y + k, z + j); testFlag = true; } } @@ -61,7 +61,7 @@ public class RitualEffectLifeConduit extends RitualEffect int vertRange = 20; EntityPlayer entityOwner = null; - List list = SpellHelper.getPlayersInRange(world, pos.getX(), pos.getY(), pos.getZ(), d0, vertRange); + List list = SpellHelper.getPlayersInRange(world, x, y, z, d0, vertRange); for (EntityPlayer player : list) { @@ -76,10 +76,10 @@ public class RitualEffectLifeConduit extends RitualEffect return; } - int fillAmount = Math.min(currentEssence / 2, ((IFluidHandler)tileAltar).fill(EnumFacing.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 10000), false)); + int fillAmount = Math.min(currentEssence / 2, ((IFluidHandler)tileAltar).fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 10000), false)); { - ((IFluidHandler)tileAltar).fill(EnumFacing.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, fillAmount), true); + ((IFluidHandler)tileAltar).fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid, fillAmount), true); if (entityOwner.getHealth() > 2.0f && fillAmount != 0) { entityOwner.setHealth(2.0f); @@ -97,7 +97,7 @@ public class RitualEffectLifeConduit extends RitualEffect @Override public List getRitualComponentList() { - ArrayList conduitRitual = new ArrayList(); + ArrayList conduitRitual = new ArrayList(); conduitRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.FIRE)); conduitRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.FIRE)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java index 8aed0a4c..dd099f52 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java @@ -8,11 +8,9 @@ import java.util.Map; import net.minecraft.block.Block; import net.minecraft.block.BlockOre; import net.minecraft.block.BlockRedstoneOre; -import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.api.Int3; @@ -68,8 +66,10 @@ public class RitualEffectMagnetic extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + 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); @@ -88,7 +88,9 @@ public class RitualEffectMagnetic extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - BlockPos posRep = null; + int xRep = 0; + int yRep = 0; + int zRep = 0; boolean replace = false; outer: @@ -98,10 +100,11 @@ public class RitualEffectMagnetic extends RitualEffect { for (int k = -1; k <= 1; k++) { - BlockPos newPos = pos.add(i, j, k); - if ((!replace) && world.isAirBlock(newPos)) + if ((!replace) && world.isAirBlock(x + i, y + j, z + k)) { - posRep = newPos; + xRep = x + i; + yRep = y + j; + zRep = z + k; replace = true; break outer; } @@ -113,7 +116,7 @@ public class RitualEffectMagnetic extends RitualEffect { Int3 lastPos = this.getLastPosition(ritualStone.getCustomRitualTag()); - int j = pos.getY() - 1; + int j = y - 1; int i = 0; int k = 0; @@ -130,14 +133,13 @@ public class RitualEffectMagnetic extends RitualEffect { while(k <= radius) { - BlockPos newPos = new BlockPos(pos.getX() + i, j, pos.getZ() + k); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(x + i, j, z + k); + int meta = world.getBlockMetadata(x + i, j, z + k); - if (isBlockOre(block, block.getMetaFromState(state))) + if (isBlockOre(block, meta)) { //Allow swapping code. This means the searched block is an ore. - BlockTeleposer.swapBlocks(this, world, world, newPos, posRep); + BlockTeleposer.swapBlocks(this, world, world, x + i, j, z + k, xRep, yRep, zRep); SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); if (hasPotentia) @@ -170,8 +172,9 @@ public class RitualEffectMagnetic extends RitualEffect return; } - j = pos.getY() - 1; + j = y - 1; this.setLastPosition(ritualStone.getCustomRitualTag(), new Int3(i, j, k)); + return; } } } @@ -203,7 +206,7 @@ public class RitualEffectMagnetic extends RitualEffect @Override public List getRitualComponentList() { - ArrayList magneticRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java index 363e5d6f..15abe3e3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java @@ -6,7 +6,6 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityBeacon; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; @@ -26,24 +25,26 @@ public class RitualEffectOmegaStalling extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (world.getWorldTime() % 20 != 0) { return; } - TileEntity tile = world.getTileEntity(pos.offsetUp(5)); + TileEntity tile = world.getTileEntity(x, y + 5, z); if(tile instanceof TileEntityBeacon) { - int levels = ((TileEntityBeacon) tile).getField(0); + int levels = ((TileEntityBeacon) tile).getLevels(); if(levels >= 4) { int horizontalRadius = 100; int verticalRadius = 100; - List playerList = SpellHelper.getPlayersInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, horizontalRadius, verticalRadius); + List playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, horizontalRadius, verticalRadius); for(EntityPlayer player : playerList) { @@ -72,7 +73,7 @@ public class RitualEffectOmegaStalling extends RitualEffect @Override public List getRitualComponentList() { - ArrayList omegaRitual = new ArrayList(); + ArrayList omegaRitual = new ArrayList(); this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.FIRE); this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.DUSK); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java index 1092ad61..2fe3fd4f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java @@ -10,9 +10,8 @@ import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; @@ -41,15 +40,17 @@ public class RitualEffectOmegaTest extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (world.getWorldTime() % 200 != 0) { return; } - OmegaStructureParameters param = OmegaStructureHandler.getStructureStabilityFactor(world, pos, 5, new Int3(0,1,0)); + OmegaStructureParameters param = OmegaStructureHandler.getStructureStabilityFactor(world, x, y, z, 5, new Int3(0,1,0)); int stab = param.stability; int enchantability = param.enchantability; int enchantmentLevel = param.enchantmentLevel; @@ -63,20 +64,19 @@ public class RitualEffectOmegaTest extends RitualEffect double range = 0.5; - List playerList = SpellHelper.getPlayersInRange(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, range, range); + List playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 1.5, z + 0.5, range, range); Reagent reagent = null; - Map reagentMap = new HashMap(); + Map reagentMap = new HashMap(); for(int i=0; i<4; i++) { Int3 jarLoc = this.getJarLocation(i); - BlockPos newPos = pos.add(jarLoc.xCoord, jarLoc.yCoord, jarLoc.zCoord); - TileEntity tile = world.getTileEntity(newPos); + TileEntity tile = world.getTileEntity(x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord); if(tile instanceof IReagentHandler) { IReagentHandler container = (IReagentHandler)tile; - ReagentContainerInfo[] containerInfoArray = container.getContainerInfo(EnumFacing.UP); + ReagentContainerInfo[] containerInfoArray = container.getContainerInfo(ForgeDirection.UP); if(containerInfoArray == null) { continue; @@ -123,7 +123,7 @@ public class RitualEffectOmegaTest extends RitualEffect for(EntityPlayer player : playerList) { OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(reagent); - if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, pos.getX(), pos.getY(), pos.getZ(), stab, affinity, enchantability, enchantmentLevel)) + if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, x, y, z, stab, affinity, enchantability, enchantmentLevel)) { APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration); APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration); @@ -133,7 +133,7 @@ public class RitualEffectOmegaTest extends RitualEffect if(!isTesting) { - int drainLeft = drainTotal; + int drainLeft = this.drainTotal; for(int i = 0; i < 4; i++) { if(drainLeft <= 0) @@ -141,17 +141,16 @@ public class RitualEffectOmegaTest extends RitualEffect break; } Int3 jarLoc = this.getJarLocation(i); - BlockPos newPos = pos.add(jarLoc.xCoord, jarLoc.yCoord, jarLoc.zCoord); - TileEntity tile = world.getTileEntity(newPos); + TileEntity tile = world.getTileEntity(x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord); if(tile instanceof IReagentHandler) { IReagentHandler container = (IReagentHandler)tile; - ReagentStack drained = container.drain(EnumFacing.UP, new ReagentStack(reagent, drainLeft), true); + ReagentStack drained = container.drain(ForgeDirection.UP, new ReagentStack(reagent, drainLeft), true); if(drained != null) { drainLeft -= drained.amount; - world.markBlockForUpdate(newPos); - world.addWeatherEffect(new EntityLightningBolt(world, newPos.getX(), newPos.getY(), newPos.getZ())); + world.markBlockForUpdate(x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord); + world.addWeatherEffect(new EntityLightningBolt(world, x + jarLoc.xCoord, y + jarLoc.yCoord, z + jarLoc.zCoord)); } } } @@ -173,7 +172,7 @@ public class RitualEffectOmegaTest extends RitualEffect @Override public List getRitualComponentList() { - ArrayList omegaRitual = new ArrayList(); + ArrayList omegaRitual = new ArrayList(); this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.DUSK); this.addCornerRunes(omegaRitual, 2, 0, RitualComponent.DUSK); this.addCornerRunes(omegaRitual, 3, 0, RitualComponent.BLANK); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java index 5cb2deda..396b7779 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java @@ -1,17 +1,16 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.util.BlockPos; -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.AlchemicalWizardryEventHooks; import WayofTime.alchemicalWizardry.common.CoordAndRange; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; public class RitualEffectSpawnWard extends RitualEffect { @@ -21,8 +20,10 @@ public class RitualEffectSpawnWard extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -32,38 +33,42 @@ public class RitualEffectSpawnWard extends RitualEffect int horizRange = 32; int vertRange = 32; - int dimension = world.provider.getDimensionId(); + int dimension = world.provider.dimensionId; - if (AlchemicalWizardryEventHooks.respawnMap.containsKey(dimension)) + if (AlchemicalWizardryEventHooks.respawnMap.containsKey(new Integer(dimension))) { - List list = AlchemicalWizardryEventHooks.respawnMap.get(dimension); + List list = AlchemicalWizardryEventHooks.respawnMap.get(new Integer(dimension)); if (list != null) { - if (!list.contains(new CoordAndRange(pos, horizRange, vertRange))) + if (!list.contains(new CoordAndRange(x, y, z, horizRange, vertRange))) { + boolean hasFoundAndRemoved = false; for (CoordAndRange coords : list) { - BlockPos locationPos = coords.getPos(); + int xLocation = coords.xCoord; + int yLocation = coords.yCoord; + int zLocation = coords.zCoord; - if (locationPos.equals(pos)) + if (xLocation == x && yLocation == y && zLocation == z) { list.remove(coords); + hasFoundAndRemoved = true; break; } } - list.add(new CoordAndRange(pos, horizRange, vertRange)); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); } } else { - list = new LinkedList(); - list.add(new CoordAndRange(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.respawnMap.put(dimension, list); + 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(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.respawnMap.put(dimension, list); + List list = new LinkedList(); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + AlchemicalWizardryEventHooks.respawnMap.put(new Integer(dimension), list); } @@ -80,7 +85,7 @@ public class RitualEffectSpawnWard extends RitualEffect @Override public List getRitualComponentList() { - ArrayList wardRitualRitual = new ArrayList(); + ArrayList wardRitualRitual = new ArrayList(); for (int i = 2; i <= 4; i++) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java index 49d79db6..7761f005 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java @@ -4,13 +4,11 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; @@ -33,8 +31,10 @@ public class RitualEffectSphereCreator extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + 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); @@ -48,7 +48,7 @@ public class RitualEffectSphereCreator extends RitualEffect SoulNetworkHandler.causeNauseaToPlayer(owner); } else { - TileEntity tile = world.getTileEntity(pos.offsetUp()); + TileEntity tile = world.getTileEntity(x, y+1, z); if(!(tile instanceof IInventory)) { return; @@ -107,8 +107,8 @@ public class RitualEffectSphereCreator extends RitualEffect k = Math.min(radius, Math.max(-radius, lastPos.zCoord)); } - int yP = negYOffset; - int yN = -negYOffset; + int yP = y + negYOffset; + int yN = y - negYOffset; boolean incrementNext = false; @@ -131,25 +131,21 @@ public class RitualEffectSphereCreator extends RitualEffect return; } - BlockPos pPos = pos.add(i, j + yP, k); - BlockPos nPos = pos.add(i, j + yN, k); - - IBlockState state = world.getBlockState(pPos); - Block blk = state.getBlock(); + Block blk = world.getBlock(x + i, yP + j, z + k); - if (world.isAirBlock(nPos) || (!world.isAirBlock(pPos) && !SpellHelper.isBlockFluid(blk))) + if (world.isAirBlock(x + i, yN + j, z + k) || (!world.isAirBlock(x + i, yP + j, z + k) && !SpellHelper.isBlockFluid(blk))) { k++; continue; } - if(BlockTeleposer.swapBlocks(this, world, world, nPos, pPos, false, 2)) + if(BlockTeleposer.swapBlocks(this, world, world, x + i, yN + j, z + k, x + i, yP + j, z + k, false, 2)) { SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); if(this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, true)) { - world.setBlockState(nPos, Blocks.dirt.getDefaultState(), 2); + world.setBlock(x + i, yN + j, z + k, Blocks.dirt, 0, 2); } } @@ -170,6 +166,8 @@ public class RitualEffectSphereCreator extends RitualEffect ritualStone.setActive(false); this.setLastPosition(ritualStone.getCustomRitualTag(), new Int3(i, j, k)); + return; + } } @@ -201,7 +199,7 @@ public class RitualEffectSphereCreator extends RitualEffect @Override public List getRitualComponentList() { - ArrayList magneticRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java index 48969c77..94f769d6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java @@ -13,7 +13,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -27,8 +26,10 @@ public class RitualEffectSummonMeteor extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (ritualStone.getCooldown() > 0) { @@ -47,7 +48,7 @@ public class RitualEffectSummonMeteor extends RitualEffect entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); } else { - List entities = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.offsetUp(), pos.add(1, 2, 1))); + List entities = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1)); if (entities == null) { @@ -59,7 +60,7 @@ public class RitualEffectSummonMeteor extends RitualEffect if (entityItem != null && MeteorRegistry.isValidParadigmItem(entityItem.getEntityItem())) { int meteorID = MeteorRegistry.getParadigmIDForItem(entityItem.getEntityItem()); - EntityMeteor meteor = new EntityMeteor(world, pos.getX() + 0.5f, 257, pos.getZ() + 0.5f, meteorID); + 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)) @@ -103,7 +104,7 @@ public class RitualEffectSummonMeteor extends RitualEffect @Override public List getRitualComponentList() { - ArrayList meteorRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java index dc3150e8..c04b4a2a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java @@ -1,16 +1,5 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; @@ -18,6 +7,15 @@ 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.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 { @@ -30,11 +28,12 @@ public class RitualEffectSupression extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); - IBlockState stateish = world.getBlockState(pos.offsetDown()); - Block blockish = stateish.getBlock(); + 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); @@ -75,19 +74,16 @@ public class RitualEffectSupression extends RitualEffect { continue; } - - BlockPos newPos = pos.add(i, j, k); - IBlockState state = world.getBlockState(newPos); - - Block block = state.getBlock(); + + Block block = world.getBlock(x + i, y + j, z + k); if (SpellHelper.isBlockFluid(block)) { - TESpectralContainer.createSpectralBlockAtLocation(world, newPos, 3 * masterRadius); + TESpectralContainer.createSpectralBlockAtLocation(world, x + i, y + j, z + k, 3 * masterRadius); } else { - TileEntity tile = world.getTileEntity(newPos); + TileEntity tile = world.getTileEntity(x + i, y + j, z + k); if (tile instanceof TESpectralContainer) { ((TESpectralContainer) tile).resetDuration(3 * masterRadius); @@ -123,7 +119,7 @@ public class RitualEffectSupression extends RitualEffect @Override public List getRitualComponentList() { - ArrayList supressionRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java index 18badc5d..8193dbf4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java @@ -9,14 +9,13 @@ 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.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour; 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.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -33,8 +32,10 @@ public class RitualEffectUnbinding extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -42,17 +43,13 @@ public class RitualEffectUnbinding extends RitualEffect } else { int d0 = 0; - AxisAlignedBB axisalignedbb = new AxisAlignedBB(pos, pos.add(1, 1, 1)).expand(d0, d0, d0); + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, d0, d0); List list = world.getEntitiesWithinAABB(EntityItem.class, axisalignedbb); Iterator iterator = list.iterator(); EntityItem item; boolean drain = false; - int x = pos.getX(); - int y = pos.getY(); - int z = pos.getZ(); - while (iterator.hasNext()) { item = (EntityItem) iterator.next(); @@ -66,14 +63,14 @@ public class RitualEffectUnbinding extends RitualEffect boolean hasSanctus = this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, false); if (hasSanctus) { - if (itemStack.getItem() instanceof IBindable && !BindableItems.getOwnerName(itemStack).equals("")) + 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)); - BindableItems.setItemOwner(itemStack, ""); + EnergyItems.setItemOwner(itemStack, ""); this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); drain = true; ritualStone.setActive(false); @@ -84,7 +81,7 @@ public class RitualEffectUnbinding extends RitualEffect if (itemStack.getItem() == ModItems.boundHelmet) { ritualStone.setVar1(5); - } else if (itemStack.getItem() == ModItems.boundChestplate) + } else if (itemStack.getItem() == ModItems.boundPlate) { ritualStone.setVar1(8); } else if (itemStack.getItem() == ModItems.boundLeggings) @@ -145,7 +142,7 @@ public class RitualEffectUnbinding extends RitualEffect if (world.rand.nextInt(10) == 0) { - SpellHelper.sendIndexedParticleToAllAround(world, pos, 20, world.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 1, x, y, z); } } @@ -166,7 +163,7 @@ public class RitualEffectUnbinding extends RitualEffect @Override public List getRitualComponentList() { - ArrayList unbindingRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java index b1efd0e2..f8dc5c70 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java @@ -6,7 +6,6 @@ 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.util.BlockPos; import net.minecraft.world.World; import java.util.ArrayList; @@ -21,8 +20,10 @@ public class RitualEffectVeilOfEvil extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); if (currentEssence < this.getCostPerRefresh()) { @@ -32,40 +33,42 @@ public class RitualEffectVeilOfEvil extends RitualEffect int horizRange = 32; int vertRange = 32; - int dimension = world.provider.getDimensionId(); + int dimension = world.provider.dimensionId; - if (AlchemicalWizardryEventHooks.forceSpawnMap.containsKey(dimension)) + if (AlchemicalWizardryEventHooks.forceSpawnMap.containsKey(new Integer(dimension))) { - List list = AlchemicalWizardryEventHooks.forceSpawnMap.get(dimension); + List list = AlchemicalWizardryEventHooks.forceSpawnMap.get(new Integer(dimension)); if (list != null) { - if (!list.contains(new CoordAndRange(pos, horizRange, vertRange))) + if (!list.contains(new CoordAndRange(x, y, z, horizRange, vertRange))) { boolean hasFoundAndRemoved = false; for (CoordAndRange coords : list) { - BlockPos locationPos = coords.getPos(); + int xLocation = coords.xCoord; + int yLocation = coords.yCoord; + int zLocation = coords.zCoord; - if (locationPos.equals(pos)) + if (xLocation == x && yLocation == y && zLocation == z) { list.remove(coords); hasFoundAndRemoved = true; break; } } - list.add(new CoordAndRange(pos, horizRange, vertRange)); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); } } else { - list = new LinkedList(); - list.add(new CoordAndRange(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.forceSpawnMap.put(dimension, list); + 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(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.forceSpawnMap.put(dimension, list); + List list = new LinkedList(); + list.add(new CoordAndRange(x, y, z, horizRange, vertRange)); + AlchemicalWizardryEventHooks.forceSpawnMap.put(new Integer(dimension), list); } @@ -82,7 +85,7 @@ public class RitualEffectVeilOfEvil extends RitualEffect @Override public List getRitualComponentList() { - ArrayList veilRitual = new ArrayList(); + ArrayList veilRitual = new ArrayList(); veilRitual.add(new RitualComponent(1, 0, 2, RitualComponent.DUSK)); veilRitual.add(new RitualComponent(2, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java index 87e19084..95e68c3e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java @@ -1,22 +1,5 @@ package WayofTime.alchemicalWizardry.common.rituals; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -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.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -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; @@ -25,6 +8,21 @@ 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.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 java.util.ArrayList; +import java.util.List; public class RitualEffectWater extends RitualEffect { @@ -39,8 +37,10 @@ public class RitualEffectWater extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + 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); @@ -57,8 +57,7 @@ public class RitualEffectWater extends RitualEffect { for (int k = -hydrationRange; k <= hydrationRange; k++) { - BlockPos newPos = pos.add(i, j, k); - if (SpellHelper.hydrateSoil(world, newPos)) + if (SpellHelper.hydrateSoil(world, x + i, y + j, z + k)) { this.canDrainReagent(ritualStone, ReagentRegistry.aquasalusReagent, aquasalusDrain, true); } @@ -73,7 +72,7 @@ public class RitualEffectWater extends RitualEffect boolean drainReductus = world.getWorldTime() % 100 == 0; int range = 10; - List list = SpellHelper.getEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, range, range); + List list = SpellHelper.getEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); for (Entity entity : list) { if (entity instanceof EntityLivingBase) @@ -107,11 +106,9 @@ public class RitualEffectWater extends RitualEffect } } - BlockPos newPos = pos.offsetUp(); - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(x, y + 1, z); - if (world.isAirBlock(newPos) && !(block instanceof BlockSpectralContainer)) + if (world.isAirBlock(x, y + 1, z) && !(block instanceof BlockSpectralContainer)) { if (currentEssence < this.getCostPerRefresh()) { @@ -120,10 +117,10 @@ public class RitualEffectWater extends RitualEffect { for (int i = 0; i < 10; i++) { - SpellHelper.sendIndexedParticleToAllAround(world, pos, 20, world.provider.getDimensionId(), 3, pos); + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z); } - world.setBlockState(newPos, Blocks.water.getDefaultState()); + world.setBlock(x, y + 1, z, Blocks.water, 0, 3); SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh()); } } else @@ -133,13 +130,13 @@ public class RitualEffectWater extends RitualEffect { return; } - TileEntity tile = world.getTileEntity(newPos); + TileEntity tile = world.getTileEntity(x, y + 1, z); if (tile instanceof IFluidHandler) { - int amount = ((IFluidHandler) tile).fill(EnumFacing.DOWN, new FluidStack(FluidRegistry.WATER, 1000), false); + int amount = ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), false); if (amount >= 1000) { - ((IFluidHandler) tile).fill(EnumFacing.DOWN, new FluidStack(FluidRegistry.WATER, 1000), true); + ((IFluidHandler) tile).fill(ForgeDirection.DOWN, new FluidStack(FluidRegistry.WATER, 1000), true); this.canDrainReagent(ritualStone, ReagentRegistry.sanctusReagent, sanctusDrain, true); @@ -162,13 +159,12 @@ public class RitualEffectWater extends RitualEffect if (hasCrystallos) { boolean success = false; - newPos = pos.add(i, j, k); - if (!world.isAirBlock(newPos) && SpellHelper.freezeWaterBlock(world, newPos)) + 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(newPos, EnumFacing.UP)) + if (world.rand.nextInt(100) == 0 && world.isSideSolid(x + i, y + j - 1, z + k, ForgeDirection.UP)) { success = true; } @@ -193,7 +189,7 @@ public class RitualEffectWater extends RitualEffect @Override public List getRitualComponentList() { - ArrayList waterRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java index 365e40b7..f7ef0e5b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java @@ -1,14 +1,5 @@ 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.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; @@ -16,6 +7,14 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; +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 { @@ -32,10 +31,12 @@ public class RitualEffectWellOfSuffering extends RitualEffect String owner = ritualStone.getOwner(); int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); - World world = ritualStone.getWorldObj(); - BlockPos pos = ritualStone.getPosition(); + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); - if (world.getWorldTime() % timeDelay != 0) + if (world.getWorldTime() % this.timeDelay != 0) { return; } @@ -49,10 +50,9 @@ public class RitualEffectWellOfSuffering extends RitualEffect { for (int k = -10; k <= 10; k++) { - BlockPos newPos = pos.add(i, j, k); - if (world.getTileEntity(newPos) instanceof IBloodAltar) + if (world.getTileEntity(x + i, y + k, z + j) instanceof IBloodAltar) { - tileAltar = (IBloodAltar) world.getTileEntity(newPos); + tileAltar = (IBloodAltar) world.getTileEntity(x + i, y + k, z + j); testFlag = true; } } @@ -68,7 +68,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect int d0 = 10; int vertRange = hasPotentia ? 20 : 10; - AxisAlignedBB axisalignedbb = new AxisAlignedBB(pos, pos.add(1, 1, 1)).expand(d0, vertRange, d0); + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(d0, vertRange, d0); List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); int entityCount = 0; @@ -95,7 +95,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect entityCount++; - tileAltar.sacrificialDaggerCall(amount * (hasTennebrae ? 2 : 1) * (hasOffensa ? 2 : 1), true); + tileAltar.sacrificialDaggerCall(this.amount * (hasTennebrae ? 2 : 1) * (hasOffensa ? 2 : 1), true); } } @@ -117,7 +117,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect @Override public List getRitualComponentList() { - ArrayList wellOfSufferingRitual = new ArrayList(); + 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)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java index 2dd2077b..7fb2f489 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java @@ -8,6 +8,6 @@ public class RoutingFocusLogicIgnMeta extends RoutingFocusLogic @Override public boolean getDefaultMatch(ItemStack keyStack, ItemStack checkedStack) { - return keyStack != null && checkedStack != null && keyStack.getItem() == checkedStack.getItem(); + return (keyStack != null ? checkedStack != null && keyStack.getItem() == checkedStack.getItem() : false); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java index ad1aed90..26fb3495 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java @@ -5,7 +5,6 @@ import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; public class RoutingFocusLogicLimit extends RoutingFocusLogic implements ILimitingLogic { - @Override public int getRoutingLimit() { return 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicModItems.java b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicModItems.java index c5f9d035..dd37a1ac 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicModItems.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicModItems.java @@ -2,8 +2,8 @@ package WayofTime.alchemicalWizardry.common.routing; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.registry.GameData; import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; +import cpw.mods.fml.common.registry.GameData; public class RoutingFocusLogicModItems extends RoutingFocusLogic { @@ -22,7 +22,7 @@ public class RoutingFocusLogicModItems extends RoutingFocusLogic public String getModID(Item itm) { - String str = (String) GameData.getItemRegistry().getNameForObject(itm); + String str = GameData.getItemRegistry().getNameForObject(itm); if(!str.isEmpty()) { String[] strs = str.split(":"); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java deleted file mode 100644 index 36754656..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java +++ /dev/null @@ -1,21 +0,0 @@ -package WayofTime.alchemicalWizardry.common.spell.complex; - -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; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java deleted file mode 100644 index 771ca1ce..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java +++ /dev/null @@ -1,9 +0,0 @@ -package WayofTime.alchemicalWizardry.common.spell.complex; - -public class SpellModifierDefault extends SpellModifier -{ - public SpellModifierDefault() - { - super(SpellModifier.DEFAULT); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java deleted file mode 100644 index 29d89007..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java +++ /dev/null @@ -1,9 +0,0 @@ -package WayofTime.alchemicalWizardry.common.spell.complex; - -public class SpellModifierDefensive extends SpellModifier -{ - public SpellModifierDefensive() - { - super(SpellModifier.DEFENSIVE); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java deleted file mode 100644 index f805dfca..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java +++ /dev/null @@ -1,9 +0,0 @@ -package WayofTime.alchemicalWizardry.common.spell.complex; - -public class SpellModifierEnvironmental extends SpellModifier -{ - public SpellModifierEnvironmental() - { - super(SpellModifier.ENVIRONMENTAL); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java deleted file mode 100644 index 5d956e3f..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java +++ /dev/null @@ -1,9 +0,0 @@ -package WayofTime.alchemicalWizardry.common.spell.complex; - -public class SpellModifierOffensive extends SpellModifier -{ - public SpellModifierOffensive() - { - super(SpellModifier.OFFENSIVE); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java index 7e040efe..e11b898e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; @@ -7,7 +8,6 @@ import java.util.regex.Pattern; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; -import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentProtection; import net.minecraft.entity.Entity; @@ -34,16 +34,14 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.server.MinecraftServer; import net.minecraft.server.management.ServerConfigurationManager; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; @@ -53,34 +51,39 @@ import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination; +import cpw.mods.fml.common.FMLCommonHandler; -public class SpellHelper extends APISpellHelper +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(new Vec3(entity.posX, entity.posY, entity.posZ), new Vec3(entity2.posX, entity2.posY, entity2.posZ), false) == null; + return entity.worldObj.rayTraceBlocks(SpellHelper.createVec3(entity.posX, entity.posY, entity.posZ), SpellHelper.createVec3(entity2.posX, entity2.posY, entity2.posZ), false) == null; + } + + public static Vec3 createVec3(double x, double y, double z) + { + return APISpellHelper.createVec3(x, y, z); } - public static void smeltBlockInWorld(World world, BlockPos pos) + public static void smeltBlockInWorld(World world, int posX, int posY, int posZ) { - FurnaceRecipes recipes = FurnaceRecipes.instance(); + FurnaceRecipes recipes = FurnaceRecipes.smelting(); - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); + Block block = world.getBlock(posX, posY, posZ); if (block == null) { return; } - int meta = block.getMetaFromState(state); - + int meta = world.getBlockMetadata(posX, posY, posZ); + ItemStack smeltedStack = recipes.getSmeltingResult(new ItemStack(block, 1, meta)); if (smeltedStack != null && smeltedStack.getItem() instanceof ItemBlock) { - world.setBlockState(pos, ((ItemBlock) (smeltedStack.getItem())).block.getStateFromMeta(smeltedStack.getItemDamage()), 3); + world.setBlock(posX, posY, posZ, ((ItemBlock) (smeltedStack.getItem())).field_150939_a, smeltedStack.getItemDamage(), 3); } } @@ -139,22 +142,22 @@ public class SpellHelper extends APISpellHelper public static List getEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) { - return world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + 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, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + 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, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + 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, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + 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) @@ -162,54 +165,62 @@ public class SpellHelper extends APISpellHelper return d * ((rand.nextFloat() - 0.5D)); } - public static EnumFacing getDirectionForLookVector(Vec3 lookVec) + 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 EnumFacing.UP; + return ForgeDirection.UP; } if (lookVec.yCoord < distance * -0.9) { - return EnumFacing.DOWN; + return ForgeDirection.DOWN; } return getCompassDirectionForLookVector(lookVec); } - public static EnumFacing getCompassDirectionForLookVector(Vec3 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 EnumFacing.SOUTH; + return ForgeDirection.SOUTH; } if (lookVec.zCoord < -radius * 1 / root2) { - return EnumFacing.NORTH; + return ForgeDirection.NORTH; } if (lookVec.xCoord > radius * 1 / root2) { - return EnumFacing.EAST; + return ForgeDirection.EAST; } if (lookVec.xCoord < -radius * 1 / root2) { - return EnumFacing.WEST; + return ForgeDirection.WEST; } - return EnumFacing.EAST; + return ForgeDirection.EAST; } - public static boolean freezeWaterBlock(World world, BlockPos pos) + public static boolean freezeWaterBlock(World world, int posX, int posY, int posZ) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); + Block block = world.getBlock(posX, posY, posZ); if (block == Blocks.water || block == Blocks.flowing_water) { - world.setBlockState(pos, Blocks.ice.getDefaultState()); + world.setBlock(posX, posY, posZ, Blocks.ice); return true; } @@ -226,11 +237,11 @@ public class SpellHelper extends APISpellHelper return SoulNetworkHandler.getPlayerForUsername(str); } - public static void sendParticleToPlayer(EntityPlayer player, EnumParticleTypes type, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) + 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(type, xCoord, yCoord, zCoord, xVel, yVel, zVel), (EntityPlayerMP) player); + NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getParticlePacket(str, xCoord, yCoord, zCoord, xVel, yVel, zVel), (EntityPlayerMP) player); } } @@ -239,13 +250,13 @@ public class SpellHelper extends APISpellHelper switch (index) { case 1: - SpellHelper.sendParticleToPlayer(player, EnumParticleTypes.SPELL_MOB, xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D); + 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, EnumParticleTypes.REDSTONE, xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D); + 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, EnumParticleTypes.SPELL_MOB, xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D); + 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 = 1.0F; @@ -255,13 +266,13 @@ public class SpellHelper extends APISpellHelper for (int l = 0; l < 8; ++l) { - SpellHelper.sendParticleToPlayer(player, EnumParticleTypes.REDSTONE, xCoord + Math.random() - Math.random(), yCoord + Math.random() - Math.random(), zCoord + Math.random() - Math.random(), f1, f2, f3); + 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, EnumParticleTypes type, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) + 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); @@ -272,7 +283,7 @@ public class SpellHelper extends APISpellHelper for (EntityPlayer player : entities) { - SpellHelper.sendParticleToPlayer(player, type, xCoord, yCoord, zCoord, xVel, yVel, zVel); + SpellHelper.sendParticleToPlayer(player, str, xCoord, yCoord, zCoord, xVel, yVel, zVel); } } @@ -290,12 +301,7 @@ public class SpellHelper extends APISpellHelper SpellHelper.sendIndexedParticleToPlayer(player, index, xCoord, yCoord, zCoord); } } - - public static void sendIndexedParticleToAllAround(World world, BlockPos pos1, int radius, int dimension, int index, BlockPos coordPos) - { - sendIndexedParticleToAllAround(world, pos1.getX(), pos1.getY(), pos1.getZ(), radius, dimension, index, coordPos.getX(), coordPos.getY(), coordPos.getZ()); - } - + public static void setPlayerSpeedFromServer(EntityPlayer player, double motionX, double motionY, double motionZ) { if (player instanceof EntityPlayerMP) @@ -315,20 +321,19 @@ public class SpellHelper extends APISpellHelper return player instanceof FakePlayer || FAKE_PLAYER_PATTERN.matcher(SpellHelper.getUsername(player)).matches(); } - public static void smashBlock(World world, BlockPos pos) + public static void smashBlock(World world, int posX, int posY, int posZ) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); + Block block = world.getBlock(posX, posY, posZ); if (block == Blocks.stone) { - world.setBlockState(pos, Blocks.cobblestone.getDefaultState()); + world.setBlock(posX, posY, posZ, Blocks.cobblestone); } else if (block == Blocks.cobblestone) { - world.setBlockState(pos, Blocks.gravel.getDefaultState()); + world.setBlock(posX, posY, posZ, Blocks.gravel); } else if (block == Blocks.gravel) { - world.setBlockState(pos, Blocks.sand.getDefaultState()); + world.setBlock(posX, posY, posZ, Blocks.sand); } } @@ -337,60 +342,69 @@ public class SpellHelper extends APISpellHelper return block instanceof IFluidBlock || block instanceof BlockLiquid; } - public static void evaporateWaterBlock(World world, BlockPos pos) + public static void evaporateWaterBlock(World world, int posX, int posY, int posZ) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); + Block block = world.getBlock(posX, posY, posZ); if (block == Blocks.water || block == Blocks.flowing_water) { - world.setBlockToAir(pos); + world.setBlockToAir(posX, posY, posZ); } } public static ItemStack getDustForOre(ItemStack item) { - int [] oreIds = OreDictionary.getOreIDs(item); - - for(int id : oreIds) - { - String oreName = OreDictionary.getOreName(id); - - if (oreName.contains("ore")) + String oreName = OreDictionary.getOreName(OreDictionary.getOreID(item)); + + if (oreName.contains("ore")) + { + String lowercaseOre = oreName.toLowerCase(); + boolean isAllowed = false; + + for (String str : AlchemicalWizardry.allowedCrushedOresArray) { - String lowercaseOre = oreName.toLowerCase(); - boolean isAllowed = false; + String testStr = str.toLowerCase(); - for (String str : AlchemicalWizardry.allowedCrushedOresArray) + if (lowercaseOre.contains(testStr)) { - String testStr = str.toLowerCase(); - - if (lowercaseOre.contains(testStr)) - { - isAllowed = true; - break; - } - } - - if (!isAllowed) - { - return null; - } - - String dustName = oreName.replace("ore", "dust"); - - List items = OreDictionary.getOres(dustName); - - if (items != null && items.size() >= 1) - { - return (items.get(0).copy()); + 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) + { + return APISpellHelper.getItemsFromBlock(world, block, x, y, z, meta, silkTouch, fortune); + } + + public static void spawnItemListInWorld(List items, World world, float x, float y, float z) + { + APISpellHelper.spawnItemListInWorld(items, world, x, y, z); + } + + public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range) + { + return APISpellHelper.raytraceFromEntity(world, player, par3, range); + } + public static String getNumeralForInt(int num) { switch (num) @@ -509,7 +523,7 @@ public class SpellHelper extends APISpellHelper return returned; } - public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory, EnumFacing dir) + public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir) { if (stack == null) { @@ -520,10 +534,10 @@ public class SpellHelper extends APISpellHelper if(inventory instanceof ISidedInventory) { - int[] array = ((ISidedInventory)inventory).getSlotsForFace(dir); + int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal()); for(int in : array) { - canBeInserted[in] = inventory.isItemValidForSlot(in, stack) && ((ISidedInventory)inventory).canInsertItem(in, stack, dir); + canBeInserted[in] = inventory.isItemValidForSlot(in, stack) && ((ISidedInventory)inventory).canInsertItem(in, stack, dir.ordinal()); } }else { @@ -554,12 +568,12 @@ public class SpellHelper extends APISpellHelper } - public static boolean canInsertStackFullyIntoInventory(ItemStack stack, IInventory inventory, EnumFacing dir) + public static boolean canInsertStackFullyIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir) { return canInsertStackFullyIntoInventory(stack, inventory, dir, false, 0); } - public static boolean canInsertStackFullyIntoInventory(ItemStack stack, IInventory inventory, EnumFacing dir, boolean fillToLimit, int limit) + public static boolean canInsertStackFullyIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir, boolean fillToLimit, int limit) { if (stack == null) { @@ -572,10 +586,10 @@ public class SpellHelper extends APISpellHelper if(inventory instanceof ISidedInventory) { - int[] array = ((ISidedInventory)inventory).getSlotsForFace(dir); + int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal()); for(int in : array) { - canBeInserted[in] = inventory.isItemValidForSlot(in, stack) && ((ISidedInventory)inventory).canInsertItem(in, stack, dir); + canBeInserted[in] = inventory.isItemValidForSlot(in, stack) && ((ISidedInventory)inventory).canInsertItem(in, stack, dir.ordinal()); } }else { @@ -639,7 +653,7 @@ public class SpellHelper extends APISpellHelper return false; } - public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory, EnumFacing dir, int limit) + public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir, int limit) { if (stack == null) { @@ -650,10 +664,10 @@ public class SpellHelper extends APISpellHelper if(inventory instanceof ISidedInventory) { - int[] array = ((ISidedInventory)inventory).getSlotsForFace(dir); + int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal()); for(int in : array) { - canBeInserted[in] = ((ISidedInventory)inventory).canInsertItem(in, stack, dir); + canBeInserted[in] = ((ISidedInventory)inventory).canInsertItem(in, stack, dir.ordinal()); } }else { @@ -711,13 +725,13 @@ public class SpellHelper extends APISpellHelper return stack; } - public static int getNumberOfItemsInInventory(IInventory inventory, EnumFacing dir) + public static int getNumberOfItemsInInventory(IInventory inventory, ForgeDirection dir) { boolean[] canBeInserted = new boolean[inventory.getSizeInventory()]; if(inventory instanceof ISidedInventory) { - int[] array = ((ISidedInventory)inventory).getSlotsForFace(dir); + int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal()); for(int in : array) { canBeInserted[in] = true; @@ -748,13 +762,12 @@ public class SpellHelper extends APISpellHelper return amountOfItems; } - public static boolean hydrateSoil(World world, BlockPos pos) + public static boolean hydrateSoil(World world, int x, int y, int z) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); - if (block == Blocks.dirt || block == Blocks.grass || (block == Blocks.farmland && block.getMetaFromState(state) == 0)) + Block block = world.getBlock(x, y, z); + if (block == Blocks.dirt || block == Blocks.grass || (block == Blocks.farmland && world.getBlockMetadata(x, y, z) == 0)) { - world.setBlockState(pos, Blocks.farmland.getStateFromMeta(7), 2); + world.setBlock(x, y, z, Blocks.farmland, 15, 2); return true; } @@ -813,8 +826,8 @@ public class SpellHelper extends APISpellHelper ServerConfigurationManager config = player.mcServer.getConfigurationManager(); oldWorld.playSoundEffect(player.posX, player.posY, player.posZ, "mob.endermen.portal", 1.0F, 1.0F); player.closeScreen(); - player.dimension = newWorldServer.provider.getDimensionId(); - player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.getDifficulty(), newWorldServer.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType())); + player.dimension = newWorldServer.provider.dimensionId; + player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, newWorldServer.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType())); oldWorldServer.removeEntity(player); player.isDead = false; player.setLocationAndAngles(d, e, f, player.rotationYaw, player.rotationPitch); @@ -834,7 +847,7 @@ public class SpellHelper extends APISpellHelper player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potion.next())); } player.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); - FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldWorldServer.provider.getDimensionId(), player.dimension); + FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldWorldServer.provider.dimensionId, player.dimension); player.timeUntilPortal = 150; } player.worldObj.theProfiler.endSection(); @@ -914,7 +927,7 @@ public class SpellHelper extends APISpellHelper public static float applySpecialProtection(EntityLivingBase entity, DamageSource source, float damage) { - ItemStack[] armour = entity.getInventory(); + ItemStack[] armour = entity.getLastActiveItems(); if(armour == null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefaultEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefaultEarth.java index fca0705a..81f24122 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefaultEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefaultEarth.java @@ -17,7 +17,6 @@ public class CSEMeleeDefaultEarth extends ComplexSpellEffect public CSEMeleeDefaultEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefensiveEarth.java index c9e0954d..53aae894 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeDefensiveEarth.java @@ -17,7 +17,6 @@ public class CSEMeleeDefensiveEarth extends ComplexSpellEffect public CSEMeleeDefensiveEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeEnvironmentalEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeEnvironmentalEarth.java index 35a00764..dc558fb7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeEnvironmentalEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeEnvironmentalEarth.java @@ -17,7 +17,6 @@ public class CSEMeleeEnvironmentalEarth extends ComplexSpellEffect public CSEMeleeEnvironmentalEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeOffensiveEarth.java index 9e294bb3..9b9b2409 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEMeleeOffensiveEarth.java @@ -17,7 +17,6 @@ public class CSEMeleeOffensiveEarth extends ComplexSpellEffect public CSEMeleeOffensiveEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileDefaultEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileDefaultEarth.java index 3f99eea3..60226c72 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileDefaultEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileDefaultEarth.java @@ -17,7 +17,6 @@ public class CSEProjectileDefaultEarth extends ComplexSpellEffect public CSEProjectileDefaultEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileEnvironmentalEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileEnvironmentalEarth.java index cec867cd..ec1362a6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileEnvironmentalEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileEnvironmentalEarth.java @@ -17,7 +17,6 @@ public class CSEProjectileEnvironmentalEarth extends ComplexSpellEffect public CSEProjectileEnvironmentalEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileOffensiveEarth.java index 139c88bb..6ff81d50 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEProjectileOffensiveEarth.java @@ -17,7 +17,6 @@ public class CSEProjectileOffensiveEarth extends ComplexSpellEffect public CSEProjectileOffensiveEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefaultEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefaultEarth.java index fd767c1b..424be92e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefaultEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefaultEarth.java @@ -17,7 +17,6 @@ public class CSESelfDefaultEarth extends ComplexSpellEffect public CSESelfDefaultEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefensiveEarth.java index 64700185..90794fc8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfDefensiveEarth.java @@ -17,7 +17,6 @@ public class CSESelfDefensiveEarth extends ComplexSpellEffect public CSESelfDefensiveEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfOffensiveEarth.java index 3eb7bf79..51312610 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSESelfOffensiveEarth.java @@ -17,7 +17,6 @@ public class CSESelfOffensiveEarth extends ComplexSpellEffect public CSESelfOffensiveEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolDefaultEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolDefaultEarth.java index 0b38fa7b..ef1dd1b4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolDefaultEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolDefaultEarth.java @@ -29,10 +29,8 @@ public class CSEToolDefaultEarth extends ComplexSpellEffect { String toolClass = "pickaxe"; - float digSpeed = 7.0f; - switch (this.powerEnhancement) { case 1: @@ -52,10 +50,8 @@ public class CSEToolDefaultEarth extends ComplexSpellEffect break; } - ((SpellParadigmTool)parad).setDigSpeed(toolClass, digSpeed); - int hlvl = this.potencyEnhancement + 2; ((SpellParadigmTool)parad).setHarvestLevel(toolClass, hlvl); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolEnvironmentalEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolEnvironmentalEarth.java index 376db588..1536fbff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolEnvironmentalEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolEnvironmentalEarth.java @@ -17,7 +17,6 @@ public class CSEToolEnvironmentalEarth extends ComplexSpellEffect public CSEToolEnvironmentalEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolOffensiveEarth.java index 02f1cf6b..9b7e0c84 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/earth/CSEToolOffensiveEarth.java @@ -17,7 +17,6 @@ public class CSEToolOffensiveEarth extends ComplexSpellEffect public CSEToolOffensiveEarth(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/ice/CSEMeleeEnvironmentalIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/ice/CSEMeleeEnvironmentalIce.java index c1ff2fe0..807d79f8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/ice/CSEMeleeEnvironmentalIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/ice/CSEMeleeEnvironmentalIce.java @@ -41,6 +41,6 @@ public class CSEMeleeEnvironmentalIce extends ComplexSpellEffect @Override public int getCostOfEffect() { - return (int) (20 * (0.5 * potencyEnhancement + 1) * (0 * powerEnhancement + 1) * Math.pow(0.85, costEnhancement)); + return (int) (20 * (0.5 * potencyEnhancement + 1) * 1 * Math.pow(0.85, costEnhancement)); //where the lone 1 is: (0 * potencyEnhancement + 1) } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEMeleeDefaultWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEMeleeDefaultWind.java index f47960e9..e39030de 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEMeleeDefaultWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEMeleeDefaultWind.java @@ -17,7 +17,6 @@ public class CSEMeleeDefaultWind extends ComplexSpellEffect public CSEMeleeDefaultWind(int power, int cost, int potency) { this(); - this.powerEnhancement = power; this.costEnhancement = cost; this.potencyEnhancement = potency; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEProjectileDefensiveWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEProjectileDefensiveWind.java index 2381fda5..15f1be6e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEProjectileDefensiveWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/cse/wind/CSEProjectileDefensiveWind.java @@ -40,6 +40,6 @@ public class CSEProjectileDefensiveWind extends ComplexSpellEffect @Override public int getCostOfEffect() { - return (int) (100 * (this.potencyEnhancement + 1)); + return (100 * (this.potencyEnhancement + 1)); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java index cf4ed985..7ca0d401 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java @@ -1,12 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; +import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityFallingBlock; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; public class MeleeDefaultEarth extends MeleeSpellCenteredWorldEffect { @@ -17,7 +15,7 @@ public class MeleeDefaultEarth extends MeleeSpellCenteredWorldEffect } @Override - public void onCenteredWorldEffect(EntityPlayer player, World world, BlockPos pos) + public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) { int radius = this.potencyUpgrades; @@ -27,18 +25,17 @@ public class MeleeDefaultEarth extends MeleeSpellCenteredWorldEffect { for (int k = -radius; k <= radius; k++) { - BlockPos newPos = pos.add(i, j, k); - if (!world.isAirBlock(newPos) && world.getTileEntity(newPos) == null) + if (!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getTileEntity(posX + i, posY + j, posZ + k) == null) { - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); + Block block = world.getBlock(posX + i, posY + j, posZ + k); - if (block.getBlockHardness(world, newPos) == -1) + if (block.getBlockHardness(world, posX + i, posY + j, posZ + k) == -1) { continue; } + int meta = world.getBlockMetadata(posX + i, posY + j, posZ + k); - EntityFallingBlock entity = new EntityFallingBlock(world, newPos.getX() + 0.5f, newPos.getY() + 0.5f, newPos.getZ() + 0.5f, state); + EntityFallingBlock entity = new EntityFallingBlock(world, posX + i + 0.5f, posY + j + 0.5f, posZ + k + 0.5f, block, meta); world.spawnEntityInWorld(entity); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefensiveEarth.java index e470be7c..d82ca011 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefensiveEarth.java @@ -1,12 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class MeleeDefensiveEarth extends MeleeSpellCenteredWorldEffect { @@ -17,21 +16,21 @@ public class MeleeDefensiveEarth extends MeleeSpellCenteredWorldEffect } @Override - public void onCenteredWorldEffect(EntityPlayer player, World world, BlockPos pos) + public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) { - EnumFacing dir = SpellHelper.getDirectionForLookVector(player.getLook(1)); + ForgeDirection dir = SpellHelper.getDirectionForLookVector(player.getLook(1)); int vertRadius = (int) (2 + 1.0f / 2.0f * Math.pow(this.potencyUpgrades, 2) + 1.0f / 2.0f * this.potencyUpgrades); int horizRadius = this.potencyUpgrades + 1; - int xOff = dir.getFrontOffsetX(); - int zOff = dir.getFrontOffsetZ(); + int xOff = dir.offsetX; + int zOff = dir.offsetZ; for (int i = -horizRadius; i <= horizRadius; i++) { for (int j = 0; j < vertRadius; j++) { - BlockTeleposer.swapBlocks(this, world, world, pos.add(i * zOff, j, i * xOff), pos.add(i * zOff, j - vertRadius, i * xOff)); + BlockTeleposer.swapBlocks(this, world, world, posX + i * zOff, posY + j, posZ + i * xOff, posX + i * zOff, posY + j - vertRadius, posZ + i * xOff); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeEnvironmentalEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeEnvironmentalEarth.java index f80a0e70..32291181 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeEnvironmentalEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeEnvironmentalEarth.java @@ -1,14 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; +import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class MeleeEnvironmentalEarth extends MeleeSpellCenteredWorldEffect { @@ -19,7 +16,7 @@ public class MeleeEnvironmentalEarth extends MeleeSpellCenteredWorldEffect } @Override - public void onCenteredWorldEffect(EntityPlayer player, World world, BlockPos pos) + public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) { int radius = this.potencyUpgrades; @@ -29,21 +26,18 @@ public class MeleeEnvironmentalEarth extends MeleeSpellCenteredWorldEffect { for (int k = -radius; k <= radius; k++) { - BlockPos newPos = pos.add(i, j, k); - if (!world.isAirBlock(newPos) && world.getTileEntity(newPos) == null) + if (!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getTileEntity(posX + i, posY + j, posZ + k) == null) { - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - ItemStack stack = new ItemStack(block, 1, block.getMetaFromState(state)); + ItemStack stack = new ItemStack(world.getBlock(posX + i, posY + j, posZ + k), 1, world.getBlockMetadata(posX + i, posY + j, posZ + k)); ItemStack dustStack = SpellHelper.getDustForOre(stack); if (dustStack != null) { - dustStack.stackSize = 3; - world.spawnEntityInWorld(new EntityItem(world, newPos.getX() + 0.5, newPos.getY() + 0.5, newPos.getZ() + 0.5, dustStack)); + dustStack.stackSize *= 3; + world.spawnEntityInWorld(new EntityItem(world, posX, posY, posZ, dustStack)); - world.setBlockToAir(newPos); + world.setBlockToAir(posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeOffensiveEarth.java index 990a81fd..d13ab19c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeOffensiveEarth.java @@ -1,10 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; public class MeleeOffensiveEarth extends MeleeSpellCenteredWorldEffect { @@ -15,7 +14,7 @@ public class MeleeOffensiveEarth extends MeleeSpellCenteredWorldEffect } @Override - public void onCenteredWorldEffect(EntityPlayer player, World world, BlockPos pos) + public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) { int radius = this.potencyUpgrades; @@ -25,8 +24,7 @@ public class MeleeOffensiveEarth extends MeleeSpellCenteredWorldEffect { for (int k = -radius; k <= radius; k++) { - BlockPos newPos = pos.add(i, j, k); - SpellHelper.smashBlock(world, newPos); + SpellHelper.smashBlock(world, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefaultEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefaultEarth.java index d28c5343..8437f6d8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefaultEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefaultEarth.java @@ -1,13 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; public class ProjectileDefaultEarth extends ProjectileImpactEffect { @@ -24,32 +22,34 @@ public class ProjectileDefaultEarth extends ProjectileImpactEffect @Override public void onTileImpact(World world, MovingObjectPosition mop) { - BlockPos pos = mop.func_178782_a(); - int horizRange = (int) (0.5 * (this.powerUpgrades) + 1); int vertRange = (int) (0.5 * (this.powerUpgrades) + 1); + 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++) { - BlockPos newPos = pos.add(i, j, k); - if (!world.isAirBlock(newPos)) + if (!world.isAirBlock(posX + i, posY + j, posZ + k)) { - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - if (block == null || block.getBlockHardness(world, newPos) == -1 || SpellHelper.isBlockFluid(block)) + Block block = world.getBlock(posX + i, posY + j, posZ + k); + if (block == null || block.getBlockHardness(world, posX + i, posY + j, posZ + k) == -1 || SpellHelper.isBlockFluid(block)) { 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); - world.destroyBlock(newPos, false); + world.func_147480_a(posX + i, posY + j, posZ + k, false); } } } } + } + } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefensiveEarth.java index 1c888f85..e2d53a60 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileDefensiveEarth.java @@ -1,13 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; public class ProjectileDefensiveEarth extends ProjectileImpactEffect { @@ -24,10 +22,12 @@ public class ProjectileDefensiveEarth extends ProjectileImpactEffect @Override public void onTileImpact(World world, MovingObjectPosition mop) { - BlockPos pos = mop.func_178782_a(); + int horizRange = this.powerUpgrades; + int vertRange = this.potencyUpgrades; - 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++) { @@ -35,12 +35,10 @@ public class ProjectileDefensiveEarth extends ProjectileImpactEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - if (!world.isAirBlock(newPos)) + if (!world.isAirBlock(posX + i, posY + j, posZ + k)) { - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - if (block == null || block.getBlockHardness(world, newPos) == -1) + Block block = world.getBlock(posX + i, posY + j, posZ + k); + if (block == null || block.getBlockHardness(world, posX + i, posY + j, posZ + k) == -1) { continue; } @@ -48,7 +46,7 @@ public class ProjectileDefensiveEarth extends ProjectileImpactEffect //world.destroyBlock(posX+i, posY+j, posZ+k, true); if (world.rand.nextFloat() < 0.6f) { - SpellHelper.smashBlock(world, newPos); + SpellHelper.smashBlock(world, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileEnvironmentalEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileEnvironmentalEarth.java index 7a28612c..721edd40 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileEnvironmentalEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileEnvironmentalEarth.java @@ -1,15 +1,14 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile; import WayofTime.alchemicalWizardry.api.spell.ProjectileUpdateEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect { @@ -21,12 +20,16 @@ public class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect @Override public void onUpdateEffect(Entity projectile) { - BlockPos pos = projectile.getPosition(); + Vec3 posVec = SpellHelper.getEntityBlockVector(projectile); int horizRange = this.powerUpgrades + 1; int vertRange = (int) (0.5 * (this.powerUpgrades + 1)); int maxBlocks = (int) (2 * Math.pow(3.47, this.potencyUpgrades)); + int posX = (int) (posVec.xCoord); + int posY = (int) (posVec.yCoord); + int posZ = (int) (posVec.zCoord); + World worldObj = projectile.worldObj; if (projectile instanceof EntitySpellProjectile) @@ -44,25 +47,24 @@ public class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - if (!worldObj.isAirBlock(newPos) && blocksBroken < maxBlocks) + if (!worldObj.isAirBlock(posX + i, posY + j, posZ + k) && blocksBroken < maxBlocks) { - IBlockState state = worldObj.getBlockState(newPos); - Block block = state.getBlock(); - if (block == null || block.getBlockHardness(worldObj, newPos) == -1 || SpellHelper.isBlockFluid(block)) + 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, newPos, state, ((EntitySpellProjectile) projectile).shootingEntity)) + if (((EntitySpellProjectile) projectile).getIsSilkTouch() && block.canSilkHarvest(worldObj, ((EntitySpellProjectile) projectile).shootingEntity, posX + i, posY + j, posZ + k, meta)) { - ItemStack stack = new ItemStack(block, 1, block.getMetaFromState(state)); - EntityItem itemEntity = new EntityItem(worldObj, newPos.getX() + 0.5, newPos.getY() + 0.5, newPos.getZ() + 0.5, stack); + 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(newPos); + worldObj.setBlockToAir(posX + i, posY + j, posZ + k); } else { - worldObj.destroyBlock(newPos, true); + worldObj.func_147480_a(posX + i, posY + j, posZ + k, true); } blocksBroken++; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java index 8693f628..67b2d424 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileOffensiveEarth.java @@ -1,13 +1,13 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; +import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; public class ProjectileOffensiveEarth extends ProjectileImpactEffect { @@ -19,10 +19,14 @@ public class ProjectileOffensiveEarth extends ProjectileImpactEffect @Override public void onEntityImpact(Entity mop, Entity proj) { - int horizRange = (int) (this.powerUpgrades); - int vertDepth = (int) (3 * this.potencyUpgrades + 1); + int horizRange = this.powerUpgrades; + int vertDepth = 3 * this.potencyUpgrades + 1; - BlockPos pos = proj.getPosition(); + Vec3 blockVector = SpellHelper.getEntityBlockVector(mop); + + int posX = (int) (blockVector.xCoord); + int posY = (int) (blockVector.yCoord); + int posZ = (int) (blockVector.zCoord); World world = mop.worldObj; @@ -32,18 +36,16 @@ public class ProjectileOffensiveEarth extends ProjectileImpactEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - if (!world.isAirBlock(newPos)) + if (!world.isAirBlock(posX + i, posY + j, posZ + k)) { - IBlockState state = world.getBlockState(newPos); - Block block = state.getBlock(); - if (block == null || block.getBlockHardness(world, newPos) == -1) + 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(newPos); + world.setBlockToAir(posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java index 78396edb..53b038c0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefaultEarth.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.SelfSpellEffect; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class SelfDefaultEarth extends SelfSpellEffect { @@ -21,24 +21,26 @@ public class SelfDefaultEarth extends SelfSpellEffect int horizRadius = this.powerUpgrades; int vertRange = 5 + 10 * this.potencyUpgrades; - BlockPos pos = player.getPosition().offsetDown(); + 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++) { - BlockPos newPos = pos.add(i, 0, k); - if (!world.isAirBlock(newPos)) + if (!world.isAirBlock(posX + i, posY, posZ + k)) { continue; } for (int j = -1; j >= -vertRange; j--) { - BlockPos newNewPos = newPos.add(0, j, 0); - if (!world.isAirBlock(newNewPos) && !SpellHelper.isBlockFluid(world.getBlockState(newNewPos).getBlock())) + if (!world.isAirBlock(posX + i, posY + j, posZ + k) && !SpellHelper.isBlockFluid(world.getBlock(posX + i, posY + j, posZ + k))) { - BlockTeleposer.swapBlocks(this, world, world,newPos, newNewPos); + BlockTeleposer.swapBlocks(this, world, world, posX + i, posY, posZ + k, posX + i, posY + j, posZ + k); break; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java index 9b71bef4..cc3892b1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfDefensiveEarth.java @@ -21,7 +21,7 @@ public class SelfDefensiveEarth extends SelfSpellEffect int pot = 2 * this.potencyUpgrades + 1; int duration = 20 * 60 * (this.powerUpgrades + 1); - player.addPotionEffect(new PotionEffect(Potion.field_180152_w.id, duration, pot)); + player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration, pot)); player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, duration, pot)); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java index fc3397d2..c43ed78b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/SelfOffensiveEarth.java @@ -1,14 +1,13 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.SelfSpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class SelfOffensiveEarth extends SelfSpellEffect { - public SelfOffensiveEarth(int power, int potency, int cost) { super(power, potency, cost); @@ -20,7 +19,11 @@ public class SelfOffensiveEarth extends SelfSpellEffect int horizRadius = this.powerUpgrades; int vertRadius = this.potencyUpgrades + 1; - BlockPos pos = player.getPosition(); + 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++) { @@ -28,10 +31,9 @@ public class SelfOffensiveEarth extends SelfSpellEffect { for (int k = -horizRadius; k <= horizRadius; k++) { - BlockPos newPos = pos.add(i, j, k); if (world.rand.nextFloat() < 0.7f) { - SpellHelper.smashBlock(world, newPos); + SpellHelper.smashBlock(world, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java index e7a34b6b..cd62fd34 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolEnvironmentalEarth.java @@ -1,13 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.items.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; public class ToolEnvironmentalEarth extends DigAreaEffect { @@ -24,11 +23,13 @@ public class ToolEnvironmentalEarth extends DigAreaEffect return 0; } - BlockPos pos = blockPos.func_178782_a(); - EnumFacing sidehit = blockPos.field_178784_b; + int x = blockPos.blockX; + int y = blockPos.blockY; + int z = blockPos.blockZ; + ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); - int radius = 2; - int depth = 5; + int radius = this.powerUpgrades; + int depth = 2 * this.potencyUpgrades + 1; depth--; @@ -69,14 +70,13 @@ public class ToolEnvironmentalEarth extends DigAreaEffect default: } - for (int i = -negX; i <= posX; i++) + for (int xPos = x - negX; xPos <= x + posX; xPos++) { - for (int j = -negY; j <= posY; j++) + for (int yPos = y - negY; yPos <= y + posY; yPos++) { - for (int k = -negZ; k <= posZ; k++) + for (int zPos = z - negZ; zPos <= z + posZ; zPos++) { - BlockPos newPos = pos.add(i, j, k); - itemTool.onBlockStartBreak(container, newPos, player); + this.breakBlock(container, world, player, blockHardness, xPos, yPos, zPos, itemTool); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java index 61130c47..7ad0c879 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ToolOffensiveEarth.java @@ -1,6 +1,5 @@ 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; @@ -10,18 +9,15 @@ import net.minecraft.item.ItemStack; import java.util.LinkedList; import java.util.List; - public class ToolOffensiveEarth extends ItemManipulator { 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); } - @Override public List handleItemsOnBlockBroken(ItemStack toolStack, List itemList) { @@ -29,7 +25,7 @@ public class ToolOffensiveEarth extends ItemManipulator for (ItemStack stack : itemList) { - if (stack != null && stack.getItem() instanceof ItemBlock && !this.isMundaneBlock(((ItemBlock) stack.getItem()).getBlock())) + if (stack != null && stack.getItem() instanceof ItemBlock && !this.isMundaneBlock(((ItemBlock) stack.getItem()).field_150939_a)) { newList.add(stack); } @@ -49,7 +45,6 @@ public class ToolOffensiveEarth extends ItemManipulator } } - return false; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java index 873c2998..30ae1449 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeDefensiveFire.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.MeleeSpellWorldEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +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; public class MeleeDefensiveFire extends MeleeSpellWorldEffect { @@ -18,15 +18,19 @@ public class MeleeDefensiveFire extends MeleeSpellWorldEffect @Override public void onWorldEffect(World world, EntityPlayer entityPlayer) { - EnumFacing look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec()); + ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec()); int width = this.potencyUpgrades + 1; int length = 5 * this.powerUpgrades + 3; - int xOffset = look.getFrontOffsetX(); - int zOffset = look.getFrontOffsetZ(); + int xOffset = look.offsetX; + int zOffset = look.offsetZ; - BlockPos pos = entityPlayer.getPosition().add(look.getDirectionVec()); + 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++) { @@ -34,10 +38,9 @@ public class MeleeDefensiveFire extends MeleeSpellWorldEffect { for (int k = 0; k < 3; k++) { - BlockPos newPos = pos.add(i * (zOffset) + j * (xOffset), k, i * (xOffset) + j * (zOffset)); - if (world.isAirBlock(newPos)) + if (world.isAirBlock(xStart + i * (zOffset) + j * (xOffset), yStart + k, zStart + i * (xOffset) + j * (zOffset))) { - world.setBlockState(newPos, Blocks.fire.getDefaultState()); + world.setBlock(xStart + i * (zOffset) + j * (xOffset), yStart + k, zStart + i * (xOffset) + j * (zOffset), Blocks.fire); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeEnvironmentalFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeEnvironmentalFire.java index 865b33c1..9ef25810 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeEnvironmentalFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/MeleeEnvironmentalFire.java @@ -1,10 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; public class MeleeEnvironmentalFire extends MeleeSpellCenteredWorldEffect { @@ -15,7 +14,7 @@ public class MeleeEnvironmentalFire extends MeleeSpellCenteredWorldEffect } @Override - public void onCenteredWorldEffect(EntityPlayer player, World world, BlockPos pos) + public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) { int radius = this.potencyUpgrades; @@ -25,8 +24,7 @@ public class MeleeEnvironmentalFire extends MeleeSpellCenteredWorldEffect { for (int k = -radius; k <= radius; k++) { - BlockPos newPos = pos.add(i, j, k); - SpellHelper.evaporateWaterBlock(world, newPos); + SpellHelper.evaporateWaterBlock(world, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefaultFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefaultFire.java index a9e6800d..0f1316a3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefaultFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefaultFire.java @@ -1,11 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; +import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; public class ProjectileDefaultFire extends ProjectileImpactEffect { @@ -17,8 +18,11 @@ public class ProjectileDefaultFire extends ProjectileImpactEffect @Override public void onEntityImpact(Entity mop, Entity proj) { - BlockPos pos = proj.getPosition(); - + Vec3 blockVec = SpellHelper.getEntityBlockVector(mop); + + int x = (int) (blockVec.xCoord); + int y = (int) (blockVec.yCoord); + int z = (int) (blockVec.zCoord); World world = mop.worldObj; int horizRange = 0; @@ -30,11 +34,9 @@ public class ProjectileDefaultFire extends ProjectileImpactEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - - if (world.isAirBlock(newPos)) + if (world.isAirBlock(x + i, y + j, z + k)) { - world.setBlockState(newPos, Blocks.fire.getDefaultState()); + world.setBlock(x + i, y + j, z + k, Blocks.fire); } } } @@ -44,8 +46,10 @@ public class ProjectileDefaultFire extends ProjectileImpactEffect @Override public void onTileImpact(World world, MovingObjectPosition mop) { - BlockPos pos = mop.func_178782_a(); - + int x = mop.blockX; + int y = mop.blockY; + int z = mop.blockZ; + int horizRange = 0; int vertRange = 0; @@ -55,11 +59,9 @@ public class ProjectileDefaultFire extends ProjectileImpactEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - - if (world.isAirBlock(newPos)) + if (world.isAirBlock(x + i, y + j, z + k)) { - world.setBlockState(newPos, Blocks.fire.getDefaultState()); + world.setBlock(x + i, y + j, z + k, Blocks.fire); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefensiveFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefensiveFire.java index d727b1ac..ddaa2fcf 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefensiveFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefensiveFire.java @@ -1,11 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; -import net.minecraft.entity.Entity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.Entity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; public class ProjectileDefensiveFire extends ProjectileImpactEffect { @@ -23,10 +22,12 @@ public class ProjectileDefensiveFire extends ProjectileImpactEffect @Override public void onTileImpact(World world, MovingObjectPosition mop) { - int horizRange = (int) ((this.powerUpgrades)); - int vertRange = (int) ((this.powerUpgrades)); + int horizRange = this.powerUpgrades; + int vertRange = this.powerUpgrades; - BlockPos pos = mop.func_178782_a(); + int posX = mop.blockX; + int posY = mop.blockY; + int posZ = mop.blockZ; for (int i = -horizRange; i <= horizRange; i++) { @@ -34,11 +35,9 @@ public class ProjectileDefensiveFire extends ProjectileImpactEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - - if (!world.isAirBlock(newPos)) + if (!world.isAirBlock(posX + i, posY + j, posZ + k)) { - SpellHelper.smeltBlockInWorld(world, newPos); + SpellHelper.smeltBlockInWorld(world, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileEnvironmentalFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileEnvironmentalFire.java index d4eb74d9..dea915b5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileEnvironmentalFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileEnvironmentalFire.java @@ -1,10 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; -import net.minecraft.entity.Entity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.ProjectileUpdateEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class ProjectileEnvironmentalFire extends ProjectileUpdateEffect { @@ -16,11 +16,15 @@ public class ProjectileEnvironmentalFire extends ProjectileUpdateEffect @Override public void onUpdateEffect(Entity projectile) { - BlockPos pos = projectile.getPosition(); + Vec3 posVec = SpellHelper.getEntityBlockVector(projectile); int horizRange = this.powerUpgrades + 1; int vertRange = (int) (0.5 * (this.powerUpgrades + 1)); + int posX = (int) (posVec.xCoord); + int posY = (int) (posVec.yCoord); + int posZ = (int) (posVec.zCoord); + World worldObj = projectile.worldObj; for (int i = -horizRange; i <= horizRange; i++) @@ -29,11 +33,9 @@ public class ProjectileEnvironmentalFire extends ProjectileUpdateEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - - if (!worldObj.isAirBlock(newPos)) + if (!worldObj.isAirBlock(posX + i, posY + j, posZ + k)) { - SpellHelper.evaporateWaterBlock(worldObj, newPos); + SpellHelper.evaporateWaterBlock(worldObj, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileOffensiveFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileOffensiveFire.java index e3525364..ed95e428 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileOffensiveFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileOffensiveFire.java @@ -1,11 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; +import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; public class ProjectileOffensiveFire extends ProjectileImpactEffect { @@ -17,10 +18,14 @@ public class ProjectileOffensiveFire extends ProjectileImpactEffect @Override public void onEntityImpact(Entity mop, Entity proj) { - int horizRange = (int) (this.powerUpgrades); - int vertDepth = (int) (3 * this.potencyUpgrades + 1); + int horizRange = this.powerUpgrades; + int vertDepth = 3 * this.potencyUpgrades + 1; - BlockPos pos = proj.getPosition(); + Vec3 blockVector = SpellHelper.getEntityBlockVector(mop); + + int posX = (int) (blockVector.xCoord); + int posY = (int) (blockVector.yCoord); + int posZ = (int) (blockVector.zCoord); World world = mop.worldObj; @@ -30,10 +35,9 @@ public class ProjectileOffensiveFire extends ProjectileImpactEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - if (world.isAirBlock(newPos)) + if (world.isAirBlock(posX + i, posY + j, posZ + k)) { - world.setBlockState(newPos, Blocks.flowing_lava.getStateFromMeta(7)); + world.setBlock(posX + i, posY + j, posZ + k, Blocks.flowing_lava, 7, 3); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfDefensiveFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfDefensiveFire.java index 4a10521d..f0826849 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfDefensiveFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfDefensiveFire.java @@ -1,10 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; +import WayofTime.alchemicalWizardry.api.spell.SelfSpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.SelfSpellEffect; public class SelfDefensiveFire extends SelfSpellEffect { @@ -17,10 +18,14 @@ public class SelfDefensiveFire extends SelfSpellEffect @Override public void onSelfUse(World world, EntityPlayer player) { - int horizRange = (int) (this.powerUpgrades); - int vertDepth = (int) (3 * this.potencyUpgrades + 1); + int horizRange = this.powerUpgrades; + int vertDepth = 3 * this.potencyUpgrades + 1; - BlockPos pos = player.getPosition(); + Vec3 blockVector = SpellHelper.getEntityBlockVector(player); + + int posX = (int) (blockVector.xCoord); + int posY = (int) (blockVector.yCoord); + int posZ = (int) (blockVector.zCoord); for (int i = -horizRange; i <= horizRange; i++) { @@ -28,11 +33,9 @@ public class SelfDefensiveFire extends SelfSpellEffect { for (int k = -horizRange; k <= horizRange; k++) { - BlockPos newPos = pos.add(i, j, k); - - if (world.isAirBlock(newPos)) + if (world.isAirBlock(posX + i, posY + j, posZ + k)) { - world.setBlockState(newPos, Blocks.flowing_lava.getStateFromMeta(7)); + world.setBlock(posX + i, posY + j, posZ + k, Blocks.flowing_lava, 7, 3); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfEnvironmentalFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfEnvironmentalFire.java index 004548f8..e933e17d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfEnvironmentalFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/SelfEnvironmentalFire.java @@ -1,11 +1,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.SelfSpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; public class SelfEnvironmentalFire extends SelfSpellEffect { @@ -17,7 +16,9 @@ public class SelfEnvironmentalFire extends SelfSpellEffect @Override public void onSelfUse(World world, EntityPlayer player) { - BlockPos pos = player.getPosition(); + int posX = (int) Math.round(player.posX - 0.5f); + int posY = (int) player.posY; + int posZ = (int) Math.round(player.posZ - 0.5f); int powRadius = this.powerUpgrades; int potRadius = this.potencyUpgrades - 1; @@ -28,11 +29,9 @@ public class SelfEnvironmentalFire extends SelfSpellEffect { for (int k = -powRadius; k <= powRadius; k++) { - BlockPos newPos = pos.add(i, j, k); - - if (world.isAirBlock(newPos)) + if (world.isAirBlock(posX + i, posY + j, posZ + k)) { - world.setBlockState(newPos, Blocks.fire.getDefaultState()); + world.setBlock(posX + i, posY + j, posZ + k, Blocks.fire); } } @@ -45,11 +44,9 @@ public class SelfEnvironmentalFire extends SelfSpellEffect { for (int k = -potRadius; k <= potRadius; k++) { - BlockPos newPos = pos.add(i, j, k); - - if (!world.isAirBlock(newPos)) + if (!world.isAirBlock(posX + i, posY + j, posZ + k)) { - SpellHelper.smeltBlockInWorld(world, newPos); + SpellHelper.smeltBlockInWorld(world, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolDefaultFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolDefaultFire.java index fbae06d1..c6d7478b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolDefaultFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolDefaultFire.java @@ -20,7 +20,7 @@ public class ToolDefaultFire extends ItemManipulator LinkedList newList = new LinkedList(); for (ItemStack item : itemList) { - ItemStack newItem = FurnaceRecipes.instance().getSmeltingResult(item); + ItemStack newItem = FurnaceRecipes.smelting().getSmeltingResult(item); if (newItem != null) { newList.add(newItem); @@ -32,4 +32,5 @@ public class ToolDefaultFire extends ItemManipulator return newList; } + } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java index 68d1dd9c..518ccc2d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java @@ -1,16 +1,14 @@ 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.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.Random; public class ToolEnvironmentalFire extends OnBreakBlockEffect { @@ -20,7 +18,7 @@ public class ToolEnvironmentalFire extends OnBreakBlockEffect } @Override - public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, IBlockState state, BlockPos pos, EnumFacing sideBroken) + 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)); @@ -33,13 +31,11 @@ public class ToolEnvironmentalFire extends OnBreakBlockEffect { for (int k = -radius; k <= radius; k++) { - BlockPos newPos = pos.add(i - sideBroken.getFrontOffsetX(), j, k - sideBroken.getFrontOffsetZ()); - IBlockState newState = world.getBlockState(newPos); - Block blockAffected = newState.getBlock(); + 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.setBlockState(newPos, Blocks.lava.getDefaultState()); + world.setBlock(x + i - sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ, Blocks.lava); amount += cost; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java index b375331a..cd546753 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefaultIce.java @@ -7,7 +7,6 @@ import net.minecraft.world.World; public class MeleeDefaultIce extends ExtrapolatedMeleeEntityEffect { - public MeleeDefaultIce(int power, int potency, int cost) { super(power, potency, cost); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java index a581cf56..0eb02f85 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.MeleeSpellWorldEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +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; public class MeleeDefensiveIce extends MeleeSpellWorldEffect { @@ -18,30 +18,29 @@ public class MeleeDefensiveIce extends MeleeSpellWorldEffect @Override public void onWorldEffect(World world, EntityPlayer entityPlayer) { - EnumFacing look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec()); + ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec()); int width = this.powerUpgrades; int height = this.powerUpgrades + 2; - int xOffset = look.getFrontOffsetX(); - int zOffset = look.getFrontOffsetZ(); + int xOffset = look.offsetX; + int zOffset = look.offsetZ; int range = this.potencyUpgrades + 1; - BlockPos pos = entityPlayer.getPosition(); + Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer); - int xStart = pos.getX() + range * xOffset; - int zStart = pos.getZ() + range * zOffset; - int yStart = pos.getY(); + 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 < height; j++) { - BlockPos newPos = new BlockPos(xStart + i * (zOffset), yStart + j, zStart + i * (xOffset)); - if (world.isAirBlock(newPos)) + if (world.isAirBlock(xStart + i * (zOffset), yStart + j, zStart + i * (xOffset))) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + world.setBlock(xStart + i * (zOffset), yStart + j, zStart + i * (xOffset), Blocks.ice); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeOffensiveIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeOffensiveIce.java index c8e99587..3245ba16 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeOffensiveIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeOffensiveIce.java @@ -1,11 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; +import WayofTime.alchemicalWizardry.api.spell.ExtrapolatedMeleeEntityEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.ExtrapolatedMeleeEntityEffect; public class MeleeOffensiveIce extends ExtrapolatedMeleeEntityEffect { @@ -20,19 +21,19 @@ public class MeleeOffensiveIce extends ExtrapolatedMeleeEntityEffect @Override protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer) { - BlockPos pos = entityPlayer.getPosition(); + Vec3 blockVector = SpellHelper.getEntityBlockVector(entity); + int posX = (int) (blockVector.xCoord); + int posY = (int) (blockVector.yCoord); + int posZ = (int) (blockVector.zCoord); - double yVel = 1 * (0.3 * this.powerUpgrades + 0.90); - - entity.motionY = yVel; + entity.motionY = 1 * (0.3 * this.powerUpgrades + 0.90); for (int i = 0; i < 2; i++) { - BlockPos newPos = pos.offsetUp(i); - if (world.isAirBlock(newPos)) + if (world.isAirBlock(posX, posY + i, posZ)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + world.setBlock(posX, posY + i, posZ, Blocks.ice); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefaultIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefaultIce.java index cf730254..1f4c7831 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefaultIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefaultIce.java @@ -1,12 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; +import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; +import net.minecraftforge.common.util.ForgeDirection; public class ProjectileDefaultIce extends ProjectileImpactEffect { @@ -18,21 +17,21 @@ public class ProjectileDefaultIce extends ProjectileImpactEffect @Override public void onEntityImpact(Entity mop, Entity proj) { - return; + } @Override public void onTileImpact(World world, MovingObjectPosition mop) { - int horizRadius = this.powerUpgrades + 1; - int vertRadius = this.potencyUpgrades; + ForgeDirection sideHit = ForgeDirection.getOrientation(mop.sideHit); - EnumFacing sideHit = mop.field_178784_b; + int posX = mop.blockX + sideHit.offsetX; + int posY = mop.blockY + sideHit.offsetY; + int posZ = mop.blockZ + sideHit.offsetZ; - BlockPos newPos = mop.func_178782_a().add(sideHit.getDirectionVec()); - if (world.isAirBlock(newPos)) + if (world.isAirBlock(posX, posY, posZ)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + world.setBlock(posX, posY, posZ, Blocks.ice); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefensiveIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefensiveIce.java index 5c51fe35..655439e3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefensiveIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileDefensiveIce.java @@ -4,7 +4,6 @@ import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -18,7 +17,7 @@ public class ProjectileDefensiveIce extends ProjectileImpactEffect @Override public void onEntityImpact(Entity mop, Entity proj) { - return; + } @Override @@ -26,8 +25,10 @@ public class ProjectileDefensiveIce extends ProjectileImpactEffect { int horizRadius = this.powerUpgrades + 1; int vertRadius = this.potencyUpgrades; - - BlockPos pos = mop.func_178782_a(); + + int posX = mop.blockX; + int posY = mop.blockY; + int posZ = mop.blockZ; for (int i = -horizRadius; i <= horizRadius; i++) { @@ -35,12 +36,11 @@ public class ProjectileDefensiveIce extends ProjectileImpactEffect { for (int j = -vertRadius; j <= vertRadius; j++) { - BlockPos newPos = pos.add(i, j, k); - SpellHelper.freezeWaterBlock(world, newPos); + SpellHelper.freezeWaterBlock(world, posX + i, posY + j, posZ + k); - if (world.isAirBlock(newPos) && !world.isAirBlock(newPos.offsetDown())) + if (world.isAirBlock(posX + i, posY + j, posZ + k) && !world.isAirBlock(posX + i, posY + j - 1, posZ + k)) { - world.setBlockState(newPos, Blocks.snow.getDefaultState()); + world.setBlock(posX + i, posY + j, posZ + k, Blocks.snow); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileEnvironmentalIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileEnvironmentalIce.java index 1b689f0b..ad7a3ab6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileEnvironmentalIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileEnvironmentalIce.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; -import net.minecraft.entity.Entity; -import net.minecraft.util.BlockPos; import WayofTime.alchemicalWizardry.api.spell.ProjectileUpdateEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; public class ProjectileEnvironmentalIce extends ProjectileUpdateEffect { @@ -16,18 +16,22 @@ public class ProjectileEnvironmentalIce extends ProjectileUpdateEffect @Override public void onUpdateEffect(Entity projectile) { - BlockPos pos = projectile.getPosition(); - + Vec3 posVec = SpellHelper.getEntityBlockVector(projectile); + int horizRange = this.powerUpgrades + 1; int vertRange = this.potencyUpgrades + 1; + int posX = (int) (posVec.xCoord); + int posY = (int) (posVec.yCoord); + int posZ = (int) (posVec.zCoord); + for (int i = -horizRange; i <= horizRange; i++) { for (int j = -vertRange; j <= vertRange; j++) { for (int k = -horizRange; k <= horizRange; k++) { - SpellHelper.freezeWaterBlock(projectile.worldObj, pos.add(i, j, k)); + SpellHelper.freezeWaterBlock(projectile.worldObj, posX + i, posY + j, posZ + k); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileOffensiveIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileOffensiveIce.java index 97d47967..ce770091 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileOffensiveIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ProjectileOffensiveIce.java @@ -27,6 +27,6 @@ public class ProjectileOffensiveIce extends ProjectileImpactEffect @Override public void onTileImpact(World world, MovingObjectPosition mop) { - return; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfDefaultIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfDefaultIce.java index 7861cc43..8361a4f0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfDefaultIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfDefaultIce.java @@ -1,11 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.SelfSpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; public class SelfDefaultIce extends SelfSpellEffect { @@ -17,17 +17,20 @@ public class SelfDefaultIce extends SelfSpellEffect @Override public void onSelfUse(World world, EntityPlayer player) { - BlockPos pos = player.getPosition(); + Vec3 blockVector = SpellHelper.getEntityBlockVector(player); + + int posX = (int) (blockVector.xCoord); + int posY = (int) (blockVector.yCoord); + int posZ = (int) (blockVector.zCoord); double yVel = 1 * (0.4 * this.powerUpgrades + 0.75); SpellHelper.setPlayerSpeedFromServer(player, player.motionX, yVel, player.motionZ); for (int i = 0; i < 2; i++) { - BlockPos newPos = pos.add(0, i, 0); - if (world.isAirBlock(newPos)) + if (world.isAirBlock(posX, posY + i, posZ)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + world.setBlock(posX, posY + i, posZ, Blocks.ice); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfEnvironmentalIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfEnvironmentalIce.java index 2e73b07e..871fbc0a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfEnvironmentalIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/SelfEnvironmentalIce.java @@ -1,12 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.api.spell.SelfSpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +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; public class SelfEnvironmentalIce extends SelfSpellEffect { @@ -18,24 +18,27 @@ public class SelfEnvironmentalIce extends SelfSpellEffect @Override public void onSelfUse(World world, EntityPlayer player) { - EnumFacing look = SpellHelper.getCompassDirectionForLookVector(player.getLookVec()); + ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(player.getLookVec()); int width = this.potencyUpgrades + 1; int length = 5 * this.powerUpgrades + 3; - int xOffset = look.getFrontOffsetX(); - int zOffset = look.getFrontOffsetZ(); + int xOffset = look.offsetX; + int zOffset = look.offsetZ; - BlockPos pos = player.getPosition(); + Vec3 lookVec = SpellHelper.getEntityBlockVector(player); + + int xStart = (int) (lookVec.xCoord); + int zStart = (int) (lookVec.zCoord); + int yStart = (int) (lookVec.yCoord) - 1; for (int i = -width; i <= width; i++) { for (int j = 0; j < length; j++) { - BlockPos newPos = pos.add(i * (zOffset) + j * (xOffset), 0, i * (xOffset) + j * (zOffset)); - if (world.isAirBlock(newPos)) + if (world.isAirBlock(xStart + i * (zOffset) + j * (xOffset), yStart, zStart + i * (xOffset) + j * (zOffset))) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + world.setBlock(xStart + i * (zOffset) + j * (xOffset), yStart, zStart + i * (xOffset) + j * (zOffset), Blocks.ice); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java index e9eeb811..a4aa47e7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefaultIce.java @@ -1,13 +1,11 @@ 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; - public class ToolDefaultIce extends LeftClickEffect { public ToolDefaultIce(int power, int potency, int cost) @@ -15,16 +13,13 @@ public class ToolDefaultIce extends LeftClickEffect super(power, potency, cost); } - @Override public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) { int duration = 200; - attacked.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration, this.powerUpgrades)); - return 0; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java index 7c4edbfe..37070d7c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/ToolDefensiveIce.java @@ -1,18 +1,18 @@ 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; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +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.tool.SummonToolEffect; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.List; public class ToolDefensiveIce extends SummonToolEffect { @@ -36,19 +36,22 @@ public class ToolDefensiveIce extends SummonToolEffect } } - BlockPos pos = entity.getPosition(); + Vec3 blockVec = SpellHelper.getEntityBlockVector(entity); - for (int x = -horizRadius; x <= horizRadius; x++) + 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 y = -vertRadius; y <= vertRadius; y++) + for (int posY = y - vertRadius; posY <= y + vertRadius; posY++) { - for (int z = -horizRadius; z <= horizRadius; z++) + for (int posZ = z - horizRadius; posZ <= z + horizRadius; posZ++) { - BlockPos newPos = pos.add(x, y, z); - SpellHelper.freezeWaterBlock(world, newPos); - if (world.isSideSolid(newPos, EnumFacing.UP) && world.isAirBlock(newPos.offsetUp())) + SpellHelper.freezeWaterBlock(world, posX, posY, posZ); + if (world.isSideSolid(posX, posY, posZ, ForgeDirection.UP) && world.isAirBlock(posX, posY + 1, posZ)) { - world.setBlockState(newPos.offsetUp(), Blocks.snow_layer.getDefaultState()); + world.setBlock(posX, posY + 1, posZ, Blocks.snow_layer); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java index 39f11169..eac176c4 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java @@ -1,14 +1,17 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool; import WayofTime.alchemicalWizardry.api.spell.IDigAreaEffect; +import WayofTime.alchemicalWizardry.api.spell.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 java.util.List; public class DigAreaEffect implements IDigAreaEffect { @@ -31,10 +34,9 @@ public class DigAreaEffect implements IDigAreaEffect return 0; } - int x = blockPos.func_178782_a().getX(); //BlockPos - int y = blockPos.func_178782_a().getY(); - int z = blockPos.func_178782_a().getZ(); - EnumFacing sidehit = blockPos.field_178784_b; + int x = blockPos.blockX; + int y = blockPos.blockY; + int z = blockPos.blockZ; for (int xPos = x - 1; xPos <= x + 1; xPos++) { @@ -42,15 +44,85 @@ public class DigAreaEffect implements IDigAreaEffect { for (int zPos = z - 1; zPos <= z + 1; zPos++) { - BlockPos newPos = new BlockPos(xPos, yPos, zPos); - ModItems.customTool.onBlockStartBreak(container, newPos, player); + 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; + + if (!cancelHarvest) + { + if (localBlock != null && !(localHardness < 0)) + { + boolean isEffective = false; + + String localToolClass = itemTool.getToolClassForMaterial(localBlock.getMaterial()); + + if (localToolClass != null && itemTool.getHarvestLevel(container, toolClass) >= localBlock.getHarvestLevel(localMeta)) + { + isEffective = true; + } + + if (localBlock.getMaterial().isToolNotRequired()) + { + isEffective = true; + } + + if (!player.capabilities.isCreativeMode) + { + if (isEffective) + { + if (localBlock.removedByPlayer(world, player, x, y, z)) + { + localBlock.onBlockDestroyedByPlayer(world, x, y, z, localMeta); + } + localBlock.onBlockHarvested(world, x, y, z, localMeta, player); + if (localHardness > 0f) + 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) + { + 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); + } + } + } + } + } + public float getHardnessDifference() { return 1.5f; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java index a946d755..ce304d09 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaTunnel.java @@ -6,14 +6,13 @@ import java.util.Random; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class DigAreaTunnel extends DigAreaEffect { @@ -34,17 +33,19 @@ public class DigAreaTunnel extends DigAreaEffect List vectorLine = new LinkedList(); - double initialX = blockPos.func_178782_a().getX(); - double initialY = blockPos.func_178782_a().getY(); - double initialZ = blockPos.func_178782_a().getZ(); - EnumFacing sidehit = blockPos.field_178784_b; - EnumFacing opposite = sidehit.getOpposite(); + double initialX = blockPos.blockX; + double initialY = blockPos.blockY; + double initialZ = blockPos.blockZ; + ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit); + ForgeDirection opposite = sidehit.getOpposite(); + + AlchemicalWizardry.logger.info(opposite.toString()); double initialLength = this.getRandomVectorLength(); - Vec3 initialVector = new Vec3(opposite.getFrontOffsetX() * initialLength, opposite.getFrontOffsetY() * initialLength, opposite.getFrontOffsetZ() * initialLength); + Vec3 initialVector = SpellHelper.createVec3(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength); - Vec3 lastVec = new Vec3(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); + Vec3 lastVec = SpellHelper.createVec3(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); vectorLine.add(initialVector); double currentLength = lastVec.lengthVector(); @@ -64,7 +65,9 @@ public class DigAreaTunnel extends DigAreaEffect double length = Math.min(this.getRandomVectorLength(), totalLength - currentLength); - tempVec = new Vec3(tempVec.xCoord * length, tempVec.yCoord * length, tempVec.zCoord * length); + tempVec.xCoord = tempVec.xCoord * length; + tempVec.yCoord = tempVec.yCoord * length; + tempVec.zCoord = tempVec.zCoord * length; vectorLine.add(tempVec); @@ -119,7 +122,6 @@ public class DigAreaTunnel extends DigAreaEffect public void destroySphereOfMundane(World world, double x, double y, double z, int radius) { - BlockPos pos = new BlockPos(MathHelper.floor_double(x), MathHelper.floor_double(y), MathHelper.floor_double(z)); for (int i = -radius; i <= radius; i++) { for (int j = -radius; j <= radius; j++) @@ -131,27 +133,29 @@ public class DigAreaTunnel extends DigAreaEffect continue; } - BlockPos newPos = pos.add(i, j, k); + int newX = (int) (i + x + 0.5); + int newY = (int) (j + y + 0.5); + int newZ = (int) (k + z + 0.5); - this.destroyMunadeAt(world, newPos); + this.destroyMunadeAt(world, newX, newY, newZ); } } } } - public void destroyMunadeAt(World world, BlockPos pos) + public void destroyMunadeAt(World world, int x, int y, int z) { - world.setBlockToAir(pos); + world.setBlockToAir(x, y, z); } public void travelVector(Vec3 vector, World world, double x, double y, double z) { double vecLength = vector.lengthVector(); AlchemicalWizardry.logger.info(vecLength); - Vec3 normVec = new Vec3(vector.xCoord, vector.yCoord, vector.zCoord); + Vec3 normVec = SpellHelper.createVec3(vector.xCoord, vector.yCoord, vector.zCoord); normVec = normVec.normalize(); - Vec3 prevVec = new Vec3(0, 0, 0); + Vec3 prevVec = SpellHelper.createVec3(0, 0, 0); double distanceTravelled = 0; while (distanceTravelled < vecLength) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java index 8051d264..6d53b912 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/RightClickTunnel.java @@ -6,12 +6,11 @@ import java.util.Random; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; 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.spell.complex.effect.SpellHelper; public class RightClickTunnel extends RightClickEffect { @@ -36,17 +35,17 @@ public class RightClickTunnel extends RightClickEffect List vectorLine = new LinkedList(); - double initialX = mop.func_178782_a().getX(); - double initialY = mop.func_178782_a().getY(); - double initialZ = mop.func_178782_a().getZ(); - EnumFacing sidehit = mop.field_178784_b; - EnumFacing opposite = sidehit.getOpposite(); + 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 = new Vec3(opposite.getFrontOffsetX() * initialLength, opposite.getFrontOffsetY() * initialLength, opposite.getFrontOffsetZ() * initialLength); + Vec3 initialVector = SpellHelper.createVec3(opposite.offsetX * initialLength, opposite.offsetY * initialLength, opposite.offsetZ * initialLength); - Vec3 lastVec = new Vec3(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); + Vec3 lastVec = SpellHelper.createVec3(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord); vectorLine.add(initialVector); double currentLength = lastVec.lengthVector(); @@ -65,8 +64,10 @@ public class RightClickTunnel extends RightClickEffect tempVec = tempVec.normalize(); double length = Math.min(this.getRandomVectorLength(), totalLength - currentLength); - - tempVec = new Vec3(tempVec.xCoord * length, tempVec.yCoord * length, tempVec.zCoord * length); + + tempVec.xCoord = tempVec.xCoord * length; + tempVec.yCoord = tempVec.yCoord * length; + tempVec.zCoord = tempVec.zCoord * length; vectorLine.add(tempVec); @@ -127,7 +128,6 @@ public class RightClickTunnel extends RightClickEffect public void destroySphereOfMundane(World world, double x, double y, double z, int radius) { - BlockPos pos = new BlockPos(MathHelper.floor_double(x), MathHelper.floor_double(y), MathHelper.floor_double(z)); for (int i = -radius; i <= radius; i++) { for (int j = -radius; j <= radius; j++) @@ -139,27 +139,29 @@ public class RightClickTunnel extends RightClickEffect continue; } - BlockPos newPos = pos.add(i, j, k); + int newX = (int) (i + x + 0.5); + int newY = (int) (j + y + 0.5); + int newZ = (int) (k + z + 0.5); - this.destroyMunadeAt(world, newPos); + this.destroyMunadeAt(world, newX, newY, newZ); } } } } - public void destroyMunadeAt(World world, BlockPos pos) + public void destroyMunadeAt(World world, int x, int y, int z) { - world.setBlockToAir(pos); + world.setBlockToAir(x, y, z); } public void travelVector(Vec3 vector, World world, double x, double y, double z) { double vecLength = vector.lengthVector(); - Vec3 normVec = new Vec3(vector.xCoord, vector.yCoord, vector.zCoord); + Vec3 normVec = SpellHelper.createVec3(vector.xCoord, vector.yCoord, vector.zCoord); normVec = normVec.normalize(); - Vec3 prevVec = new Vec3(0, 0, 0); + Vec3 prevVec = SpellHelper.createVec3(0, 0, 0); double distanceTravelled = 0; while (distanceTravelled < vecLength) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java index 36d9c5c6..ddd90274 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/MeleeEnvironmentalWind.java @@ -1,14 +1,13 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.api.spell.MeleeSpellCenteredWorldEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.List; public class MeleeEnvironmentalWind extends MeleeSpellCenteredWorldEffect { @@ -19,18 +18,18 @@ public class MeleeEnvironmentalWind extends MeleeSpellCenteredWorldEffect } @Override - public void onCenteredWorldEffect(EntityPlayer player, World world, BlockPos pos) + public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ) { int radius = 5 * this.potencyUpgrades + 3; - List entities = SpellHelper.getEntitiesInRange(world, pos.getX(), pos.getY(), pos.getZ(), radius, radius); + List entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius); for (Entity entity : entities) { if (entity instanceof EntityItem) { - ((EntityItem) entity).setPickupDelay(0); - entity.onCollideWithPlayer((EntityPlayer) player); + ((EntityItem) entity).delayBeforeCanPickup = 0; + entity.onCollideWithPlayer(player); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java index 862b7193..111028dd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileDefaultWind.java @@ -15,16 +15,13 @@ public class ProjectileDefaultWind extends ProjectileImpactEffect @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 onTileImpact(World world, MovingObjectPosition mop) { - return; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java index a647f34c..e9d53d3d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileEnvironmentalWind.java @@ -1,14 +1,14 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; -import java.util.List; - +import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile; +import WayofTime.alchemicalWizardry.api.spell.ProjectileUpdateEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; 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.api.spell.EntitySpellProjectile; -import WayofTime.alchemicalWizardry.api.spell.ProjectileUpdateEffect; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.List; public class ProjectileEnvironmentalWind extends ProjectileUpdateEffect { @@ -37,12 +37,14 @@ public class ProjectileEnvironmentalWind extends ProjectileUpdateEffect { if (entity instanceof EntityItem) { - ((EntityItem) entity).setPickupDelay(0); + ((EntityItem) entity).delayBeforeCanPickup = 0; entity.onCollideWithPlayer((EntityPlayer) shooter); } } } } } + + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java index 35f1aaf4..691f8cdd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ProjectileOffensiveWind.java @@ -1,6 +1,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.PotionEffect; import net.minecraft.util.MovingObjectPosition; @@ -10,7 +11,6 @@ import WayofTime.alchemicalWizardry.api.spell.ProjectileImpactEffect; public class ProjectileOffensiveWind extends ProjectileImpactEffect { - public ProjectileOffensiveWind(int power, int potency, int cost) { super(power, potency, cost); @@ -21,13 +21,13 @@ public class ProjectileOffensiveWind extends ProjectileImpactEffect { if (mop instanceof EntityLivingBase) { - ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, (int) (100 * (2 * this.powerUpgrades + 1) * (1 / (this.potencyUpgrades + 1))), this.potencyUpgrades)); + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, (100 * (2 * this.powerUpgrades + 1) * (1 / (this.potencyUpgrades + 1))), this.potencyUpgrades)); } } @Override public void onTileImpact(World world, MovingObjectPosition mop) { - return; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java index 15745deb..261209b5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolDefensiveWind.java @@ -7,7 +7,6 @@ import net.minecraft.util.Vec3; public class ToolDefensiveWind extends LeftClickEffect { - public ToolDefensiveWind(int power, int potency, int cost) { super(power, potency, cost); @@ -17,8 +16,8 @@ public class ToolDefensiveWind extends LeftClickEffect public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder) { Vec3 vec = weilder.getLookVec(); - vec = vec.subtract(0, vec.yCoord, 0); - vec = vec.normalize(); + vec.yCoord = 0; + vec.normalize(); float velocity = 0.5f * (1 + this.powerUpgrades * 0.8f); float ratio = 0.1f + 0.3f * this.potencyUpgrades; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java index 7a1d461a..b325fc36 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolEnvironmentalWind.java @@ -1,17 +1,15 @@ 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.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.List; public class ToolEnvironmentalWind extends OnBreakBlockEffect { @@ -21,23 +19,21 @@ public class ToolEnvironmentalWind extends OnBreakBlockEffect } @Override - public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, IBlockState state, BlockPos pos, EnumFacing sideBroken) + 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, pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f, horizRange, vertRange); + List itemList = SpellHelper.getItemsInRange(world, x + 0.5f, y + 0.5f, z + 0.5f, vertRange, vertRange); for (EntityItem entity : itemList) { if (!world.isRemote) { - entity.setPickupDelay(0); + entity.delayBeforeCanPickup = 0; entity.onCollideWithPlayer(player); } } return 0; } - } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java index 07be3f79..df508e7d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/ToolOffensiveWind.java @@ -16,7 +16,7 @@ public class ToolOffensiveWind extends LeftClickEffect @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)); + attacked.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, (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/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellComponent.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellComponent.java index 41cfcaab..d4b7e0bb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellComponent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellComponent.java @@ -6,7 +6,6 @@ public class HomSpellComponent { public HomSpell spell; public ItemStack item; - public int blockID; public HomSpellComponent(ItemStack item, HomSpell spell) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/ISimpleSpell.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/ISimpleSpell.java index 77a8799d..01c70978 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/ISimpleSpell.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/ISimpleSpell.java @@ -6,11 +6,11 @@ import net.minecraft.world.World; public interface ISimpleSpell { - public abstract ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); - public abstract ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); - public abstract ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); - public abstract ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java index e4c6f282..94d6bf35 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java @@ -1,18 +1,15 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Random; - -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import net.minecraft.block.state.IBlockState; +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.util.BlockPos; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +import java.util.Random; public class SpellEarthBender extends HomSpell { @@ -25,132 +22,133 @@ public class SpellEarthBender extends HomSpell } @Override - public ItemStack onOffensiveRangedRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } - world.spawnEntityInWorld(new MudProjectile(world, player, 8, false)); - world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - return stack; + par2World.spawnEntityInWorld(new MudProjectile(par2World, par3EntityPlayer, 8, false)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + return par1ItemStack; } @Override - public ItemStack onOffensiveMeleeRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } - if (!world.isRemote) + if (!par2World.isRemote) { for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { - world.spawnEntityInWorld(new MudProjectile(world, player, 3, 3, player.posX, player.posY + player.getEyeHeight(), player.posZ, player.rotationYaw + i * 10F, player.rotationPitch + j * 5F, true)); + par2World.spawnEntityInWorld(new MudProjectile(par2World, par3EntityPlayer, 3, 3, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw + i * 10F, par3EntityPlayer.rotationPitch + j * 5F, true)); } } } - return stack; + return par1ItemStack; } @Override - public ItemStack onDefensiveRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - SoulNetworkHandler.syphonAndDamageFromNetwork(stack, player, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } - double xCoord = player.posX; - double yCoord = player.posY; - double zCoord = player.posZ; + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; int posX = (int) xCoord; int posY = (int) yCoord; int posZ = (int) zCoord; - BlockPos pos = player.getPosition(); - IBlockState blockID = Blocks.stone.getDefaultState(); + Block blockID = Blocks.stone; - if (world.isAirBlock(pos.offsetUp(3))) + if (par2World.isAirBlock(posX, posY + 3, posZ)) { - world.setBlockState(pos.offsetUp(3), Blocks.glass.getDefaultState()); + par2World.setBlock(posX, posY + 3, posZ, Blocks.glass); } for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { - if (world.isAirBlock(new BlockPos(posX + i - 1, posY + j, posZ - 2))) + if (par2World.isAirBlock(posX + i - 1, posY + j, posZ - 2)) { - world.setBlockState(new BlockPos(posX + i - 1, posY + j, posZ - 2), blockID); + par2World.setBlock(posX + i - 1, posY + j, posZ - 2, blockID); } - if (world.isAirBlock(new BlockPos(posX + 2, posY + j, posZ - 1 + i))) + if (par2World.isAirBlock(posX + 2, posY + j, posZ - 1 + i)) { - world.setBlockState(new BlockPos(posX + 2, posY + j, posZ - 1 + i), blockID); + par2World.setBlock(posX + 2, posY + j, posZ - 1 + i, blockID); } - if (world.isAirBlock(new BlockPos(posX - i + 1, posY + j, posZ + 2))) + if (par2World.isAirBlock(posX - i + 1, posY + j, posZ + 2)) { - world.setBlockState(new BlockPos(posX - i + 1, posY + j, posZ + 2), blockID); + par2World.setBlock(posX - i + 1, posY + j, posZ + 2, blockID); } - if (world.isAirBlock(new BlockPos(posX - 2, posY + j, posZ + 1 - i))) + if (par2World.isAirBlock(posX - 2, posY + j, posZ + 1 - i)) { - world.setBlockState(new BlockPos(posX - 2, posY + j, posZ + 1 - i), blockID); + par2World.setBlock(posX - 2, posY + j, posZ + 1 - i, blockID); } - if (world.isAirBlock(new BlockPos(posX - 1 + i, posY + 3, posZ - 1 + j))) { - world.setBlockState(new BlockPos(posX - 1 + i, posY + 3, posZ - 1 + j), blockID); + if (par2World.isAirBlock(posX - 1 + i, posY + 3, posZ - 1 + j)) + { + par2World.setBlock(posX - 1 + i, posY + 3, posZ - 1 + j, blockID); + } } } } for (int i = 0; i < 20; i++) { - SpellHelper.sendParticleToAllAround(world, xCoord, yCoord, zCoord, 30, world.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } - return stack; + return par1ItemStack; } @Override - public ItemStack onEnvironmentalRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - SoulNetworkHandler.syphonAndDamageFromNetwork(stack, player, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } int range = 3; - if (!world.isRemote) + if (!par2World.isRemote) { for (int i = -range; i <= range; i++) { @@ -158,17 +156,16 @@ public class SpellEarthBender extends HomSpell { for (int k = -range; k <= range; k++) { - BlockPos pos = player.getPosition().add(i, j, k); - if (world.getBlockState(pos).getBlock() == Blocks.water || world.getBlockState(pos).getBlock() == Blocks.flowing_water) + if (par2World.getBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k) == Blocks.water || par2World.getBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k) == Blocks.flowing_water) { - int x = world.rand.nextInt(2); + int x = par2World.rand.nextInt(2); if (x == 0) { - world.setBlockState(pos, Blocks.sand.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.sand); } else { - world.setBlockState(pos, Blocks.dirt.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.dirt); } } } @@ -176,15 +173,15 @@ public class SpellEarthBender extends HomSpell } } - double xCoord = player.posX; - double yCoord = player.posY; - double zCoord = player.posZ; + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; for (int i = 0; i < 16; i++) { - SpellHelper.sendParticleToAllAround(world, xCoord, yCoord, zCoord, 30, world.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } - return stack; + return par1ItemStack; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java index e5c4a333..4bf48cf2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.spell.simple; import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -21,14 +21,14 @@ public class SpellExplosions extends HomSpell @Override public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); @@ -44,14 +44,14 @@ public class SpellExplosions extends HomSpell @Override public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } int distance = 4; @@ -64,14 +64,14 @@ public class SpellExplosions extends HomSpell @Override public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } int distance = 4; @@ -82,14 +82,14 @@ public class SpellExplosions extends HomSpell @Override public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } int radius = 3; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java index f8b23fdc..7e030d91 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.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.FireProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; public class SpellFireBurst extends HomSpell { @@ -26,75 +25,75 @@ public class SpellFireBurst extends HomSpell } @Override - public ItemStack onOffensiveRangedRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } - world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!world.isRemote) + if (!par2World.isRemote) { - FireProjectile proj = new FireProjectile(world, player, 7); - world.spawnEntityInWorld(proj); + FireProjectile proj = new FireProjectile(par2World, par3EntityPlayer, 7); + par2World.spawnEntityInWorld(proj); } - return stack; + return par1ItemStack; } @Override - public ItemStack onOffensiveMeleeRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } - world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!world.isRemote) + if (!par2World.isRemote) { for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { - world.spawnEntityInWorld(new FireProjectile(world, player, 8, 2, player.posX, player.posY + player.getEyeHeight(), player.posZ, player.rotationYaw + i * 10F, player.rotationPitch + j * 10F)); + par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 8, 2, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw + i * 10F, par3EntityPlayer.rotationPitch + j * 10F)); } } } - return stack; + return par1ItemStack; } @Override - public ItemStack onDefensiveRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } - world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); int d0 = 2; - AxisAlignedBB axisalignedbb = new AxisAlignedBB((double) player.posX, (double) player.posY, (double) player.posZ, (double) (player.posX + 1), (double) (player.posY + 2), (double) (player.posZ + 1)).expand(d0, d0, d0); - List list = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (par3EntityPlayer.posX + 1), (par3EntityPlayer.posY + 2), (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); while (iterator.hasNext()) @@ -103,7 +102,7 @@ public class SpellFireBurst extends HomSpell if (entityLiving instanceof EntityPlayer) { - if (entityLiving.equals(player)) + if (entityLiving.equals(par3EntityPlayer)) { continue; } @@ -112,24 +111,23 @@ public class SpellFireBurst extends HomSpell entityLiving.setFire(100); entityLiving.attackEntityFrom(DamageSource.inFire, 2); } - return stack; + return par1ItemStack; } @Override - public ItemStack onEnvironmentalRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } - world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - World worldObj = world; + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); for (int i = -1; i <= 1; i++) { @@ -137,18 +135,17 @@ public class SpellFireBurst extends HomSpell { for (int k = -1; k <= 1; k++) { - BlockPos pos = player.getPosition().add(i, k, k); - if (worldObj.isAirBlock(pos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k)) { - if (worldObj.rand.nextFloat() < 0.8F) + if (par2World.rand.nextFloat() < 0.8F) { - worldObj.setBlockState(pos, Blocks.fire.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.fire); } } } } } - return stack; + return par1ItemStack; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java index 10cf5ccb..8d3e8873 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java @@ -1,15 +1,14 @@ package WayofTime.alchemicalWizardry.common.spell.simple; -import java.util.Random; - -import net.minecraft.block.state.IBlockState; +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.util.BlockPos; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; + +import java.util.Random; public class SpellFrozenWater extends HomSpell { @@ -22,63 +21,60 @@ public class SpellFrozenWater extends HomSpell } @Override - public ItemStack onOffensiveRangedRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } - world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!world.isRemote) + if (!par2World.isRemote) { - world.spawnEntityInWorld(new IceProjectile(world, player, 6)); + par2World.spawnEntityInWorld(new IceProjectile(par2World, par3EntityPlayer, 6)); } - return stack; + return par1ItemStack; } @Override - public ItemStack onOffensiveMeleeRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } for (int i = -2; i <= 2; i++) { - world.spawnEntityInWorld(new IceProjectile(world, player, 6, 2, player.posX, player.posY + player.getEyeHeight(), player.posZ, player.rotationYaw + i * 5F, player.rotationPitch)); + par2World.spawnEntityInWorld(new IceProjectile(par2World, par3EntityPlayer, 6, 2, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw + i * 5F, par3EntityPlayer.rotationPitch)); } - return stack; + return par1ItemStack; } @Override - public ItemStack onDefensiveRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!player.capabilities.isCreativeMode) + if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(stack, player, getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, getDefensiveEnergy()); } - float yaw = player.rotationYaw; - float pitch = player.rotationPitch; + float yaw = par3EntityPlayer.rotationYaw; + float pitch = par3EntityPlayer.rotationPitch; int range = 2; - - BlockPos pos = player.getPosition(); - BlockPos newPos = pos; if (pitch > 40F) { @@ -86,32 +82,28 @@ public class SpellFrozenWater extends HomSpell { for (int j = -range; j <= range; j++) { - newPos = pos.add(i, -1, j); - - if (world.isAirBlock(newPos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY - 1, (int) par3EntityPlayer.posZ + j)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY - 1, (int) par3EntityPlayer.posZ + j, Blocks.ice); } } } - return stack; + return par1ItemStack; } else if (pitch < -40F) { for (int i = -range; i <= range; i++) { for (int j = -range; j <= range; j++) { - newPos = pos.add(i, 3, j); - - if (world.isAirBlock(newPos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + 3, (int) par3EntityPlayer.posZ + j)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + 3, (int) par3EntityPlayer.posZ + j, Blocks.ice); } } } - return stack; + return par1ItemStack; } if ((yaw >= 315 && yaw < 360) || (yaw >= 0 && yaw < 45)) @@ -120,11 +112,9 @@ public class SpellFrozenWater extends HomSpell { for (int j = 0; j < range * 2 + 1; j++) { - newPos = pos.add(i, j, 2); - - if (world.isAirBlock(newPos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + 2)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + 2, Blocks.ice); } } } @@ -134,11 +124,9 @@ public class SpellFrozenWater extends HomSpell { for (int j = 0; j < range * 2 + 1; j++) { - newPos = pos.add(-2, j, i); - - if (world.isAirBlock(newPos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX - 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX - 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i, Blocks.ice); } } } @@ -148,11 +136,9 @@ public class SpellFrozenWater extends HomSpell { for (int j = 0; j < range * 2 + 1; j++) { - newPos = pos.add(i, j, -2); - - if (world.isAirBlock(newPos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ - 2)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ - 2, Blocks.ice); } } } @@ -162,31 +148,26 @@ public class SpellFrozenWater extends HomSpell { for (int j = 0; j < range * 2 + 1; j++) { - newPos = pos.add(2, j, i); - - if (world.isAirBlock(newPos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX + 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i)) { - world.setBlockState(newPos, Blocks.ice.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i, Blocks.ice); } } } } - return stack; + return par1ItemStack; } @Override - public ItemStack onEnvironmentalRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { - return stack; + return par1ItemStack; } int radius = 3; - int posX = (int) player.posX; - int posY = (int) player.posY; - int posZ = (int) player.posZ; for (int i = -radius; i <= radius; i++) { @@ -194,16 +175,14 @@ public class SpellFrozenWater extends HomSpell { for (int k = -radius; k <= radius; k++) { - BlockPos pos = player.getPosition().add(i, j, k); - - IBlockState state = world.getBlockState(pos); - if (state.getBlock() == Blocks.water || state.getBlock() == Blocks.flowing_water) + Block block = par2World.getBlock((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k); + if (block == Blocks.water || block == Blocks.flowing_water) { - world.setBlockState(pos, Blocks.ice.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.ice); } } } } - return stack; + return par1ItemStack; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java index f837d538..3102ba88 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java @@ -1,14 +1,13 @@ package WayofTime.alchemicalWizardry.common.spell.simple; import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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.util.EnumParticleTypes; import net.minecraft.world.World; import java.util.Iterator; @@ -28,14 +27,14 @@ public class SpellHolyBlast extends HomSpell @Override public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); @@ -51,14 +50,14 @@ public class SpellHolyBlast extends HomSpell @Override public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } int distance = 2; @@ -68,7 +67,7 @@ public class SpellHolyBlast extends HomSpell double yCoord = par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance; double zCoord = par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance; float d0 = 0.5f; - AxisAlignedBB axisalignedbb = new AxisAlignedBB(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 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); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -97,7 +96,7 @@ public class SpellHolyBlast extends HomSpell for (int i = 0; i < 5; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; @@ -106,14 +105,14 @@ public class SpellHolyBlast extends HomSpell @Override public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } if (!par2World.isRemote) @@ -130,18 +129,18 @@ public class SpellHolyBlast extends HomSpell @Override public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } int d0 = 3; - AxisAlignedBB axisalignedbb = new AxisAlignedBB((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 axisalignedbb = AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (par3EntityPlayer.posX + 1), (par3EntityPlayer.posY + 2), (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -173,7 +172,7 @@ public class SpellHolyBlast extends HomSpell for (int i = 0; i < 20; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java index e2f4cb5c..7dac5a82 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java @@ -1,12 +1,11 @@ package WayofTime.alchemicalWizardry.common.spell.simple; import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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.util.EnumParticleTypes; import net.minecraft.world.World; import java.util.Random; @@ -24,14 +23,14 @@ public class SpellLightningBolt extends HomSpell @Override public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); @@ -48,14 +47,14 @@ public class SpellLightningBolt extends HomSpell public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { //TODO Make it work better...? - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } double xCoord = par3EntityPlayer.posX; @@ -73,7 +72,7 @@ public class SpellLightningBolt extends HomSpell for (int i = 0; i < 5; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; @@ -82,14 +81,14 @@ public class SpellLightningBolt extends HomSpell @Override public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } double xCoord = par3EntityPlayer.posX; @@ -103,7 +102,7 @@ public class SpellLightningBolt extends HomSpell for (int i = 0; i < 8; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; @@ -112,14 +111,14 @@ public class SpellLightningBolt extends HomSpell @Override public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } if (!par2World.isRemote) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java index a4158eaf..d588fcbe 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java @@ -1,29 +1,26 @@ package WayofTime.alchemicalWizardry.common.spell.simple; +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.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.EnderTeleportEvent; + import java.util.Iterator; import java.util.List; import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumParticleTypes; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.EnderTeleportEvent; -import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; - public class SpellTeleport extends HomSpell { - public static Random itemRand = new Random(); + Random itemRand = new Random(); public SpellTeleport() { @@ -34,33 +31,32 @@ public class SpellTeleport extends HomSpell @Override public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } par2World.spawnEntityInWorld(new TeleportProjectile(par2World, par3EntityPlayer, 8, true)); par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - EntityEnderman g; return par1ItemStack; } @Override public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } par2World.spawnEntityInWorld(new TeleportProjectile(par2World, par3EntityPlayer, 8, false)); @@ -70,14 +66,14 @@ public class SpellTeleport extends HomSpell @Override public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } double xCoord = par3EntityPlayer.posX; @@ -87,7 +83,7 @@ public class SpellTeleport extends HomSpell for (int i = 0; i < 20; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.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()); } return par1ItemStack; @@ -96,20 +92,20 @@ public class SpellTeleport extends HomSpell @Override public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } if (!par2World.isRemote) { int d0 = 3; - AxisAlignedBB axisalignedbb = new AxisAlignedBB((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 axisalignedbb = AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (par3EntityPlayer.posX + 1), (par3EntityPlayer.posY + 2), (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -134,7 +130,7 @@ public class SpellTeleport extends HomSpell for (int i = 0; i < 32; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.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()); } return par1ItemStack; @@ -147,14 +143,14 @@ public class SpellTeleport extends HomSpell double z = entityLiving.posZ; Random rand = new Random(); double d0 = x + (rand.nextDouble() - 0.5D) * distance; - double d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); + double d1 = y + (rand.nextInt((int) distance) - (distance) / 2); double d2 = z + (rand.nextDouble() - 0.5D) * distance; int i = 0; while (!SpellTeleport.teleportTo(entityLiving, d0, d1, d2, x, y, z) && i < 100) { d0 = x + (rand.nextDouble() - 0.5D) * distance; - d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); + d1 = y + (rand.nextInt((int) distance) - (distance) / 2); d2 = z + (rand.nextDouble() - 0.5D) * distance; i++; } @@ -169,42 +165,43 @@ public class SpellTeleport extends HomSpell private static boolean teleportTo(EntityLivingBase entityLiving, double par1, double par3, double par5, double lastX, double lastY, double lastZ) { - net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(entityLiving, par1, par3, par5, 0); - if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false; - double d3 = entityLiving.posX; - double d4 = entityLiving.posY; - double d5 = entityLiving.posZ; - entityLiving.posX = event.targetX; - entityLiving.posY = event.targetY; - entityLiving.posZ = event.targetZ; - boolean flag = false; - BlockPos blockpos = new BlockPos(entityLiving.posX, entityLiving.posY, entityLiving.posZ); + EnderTeleportEvent event = new EnderTeleportEvent(entityLiving, par1, par3, par5, 0); - if (entityLiving.worldObj.isBlockLoaded(blockpos)) + if (MinecraftForge.EVENT_BUS.post(event)) + { + return false; + } + + SpellTeleport.moveEntityViaTeleport(entityLiving, event.targetX, event.targetY, event.targetZ); + boolean flag = false; + int i = MathHelper.floor_double(entityLiving.posX); + int j = MathHelper.floor_double(entityLiving.posY); + int k = MathHelper.floor_double(entityLiving.posZ); + Block l; + + if (entityLiving.worldObj.blockExists(i, j, k)) { boolean flag1 = false; - while (!flag1 && blockpos.getY() > 0) + while (!flag1 && j > 0) { - BlockPos blockpos1 = blockpos.offsetDown(); - Block block = entityLiving.worldObj.getBlockState(blockpos1).getBlock(); + l = entityLiving.worldObj.getBlock(i, j - 1, k); - if (block.getMaterial().blocksMovement()) + if (l != null && l.getMaterial().blocksMovement()) { flag1 = true; - } - else + } else { --entityLiving.posY; - blockpos = blockpos1; + --j; } } if (flag1) { - entityLiving.setPositionAndUpdate(entityLiving.posX, entityLiving.posY, entityLiving.posZ); + SpellTeleport.moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ); - if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.getEntityBoundingBox()).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.getEntityBoundingBox())) + if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) { flag = true; } @@ -213,27 +210,23 @@ public class SpellTeleport extends HomSpell if (!flag) { - entityLiving.setPosition(d3, d4, d5); + SpellTeleport.moveEntityViaTeleport(entityLiving, lastX, lastY, lastZ); return false; - } - else + } else { short short1 = 128; - for (int i = 0; i < short1; ++i) + for (j = 0; j < short1; ++j) { - double d9 = (double)i / ((double)short1 - 1.0D); - float f = (itemRand.nextFloat() - 0.5F) * 0.2F; - float f1 = (itemRand.nextFloat() - 0.5F) * 0.2F; - float f2 = (itemRand.nextFloat() - 0.5F) * 0.2F; - double d6 = d3 + (entityLiving.posX - d3) * d9 + (itemRand.nextDouble() - 0.5D) * (double)entityLiving.width * 2.0D; - double d7 = d4 + (entityLiving.posY - d4) * d9 + itemRand.nextDouble() * (double)entityLiving.height; - double d8 = d5 + (entityLiving.posZ - d5) * d9 + (itemRand.nextDouble() - 0.5D) * (double)entityLiving.width * 2.0D; - entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d6, d7, d8, (double)f, (double)f1, (double)f2, new int[0]); + double d6 = (double) j / ((double) short1 - 1.0D); + float f = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; + double d7 = lastX + (entityLiving.posX - lastX) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + double d8 = lastY + (entityLiving.posY - lastY) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; + double d9 = lastZ + (entityLiving.posZ - lastZ) * 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); } - - entityLiving.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F); - entityLiving.playSound("mob.endermen.portal", 1.0F, 1.0F); return true; } } @@ -253,7 +246,7 @@ public class SpellTeleport extends HomSpell { if (entityLiving.isRiding()) { - entityLiving.mountEntity((Entity) null); + entityLiving.mountEntity(null); } entityLiving.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java index 054538fe..3b9bc15c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java @@ -1,23 +1,21 @@ 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; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; -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 { @@ -32,14 +30,14 @@ public class SpellWateryGrave extends HomSpell @Override public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } par2World.spawnEntityInWorld(new WaterProjectile(par2World, par3EntityPlayer, 8)); @@ -50,14 +48,14 @@ public class SpellWateryGrave extends HomSpell @Override public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } if (!par2World.isRemote) @@ -77,18 +75,18 @@ public class SpellWateryGrave extends HomSpell @Override public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } int d0 = 3; - AxisAlignedBB axisalignedbb = new AxisAlignedBB((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 axisalignedbb = AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (par3EntityPlayer.posX + 1), (par3EntityPlayer.posY + 2), (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -121,7 +119,7 @@ public class SpellWateryGrave extends HomSpell for (int i = 0; i < 20; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; @@ -130,14 +128,14 @@ public class SpellWateryGrave extends HomSpell @Override public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } int range = 2; @@ -148,10 +146,9 @@ public class SpellWateryGrave extends HomSpell { for (int j = -range; j <= range; j++) { - BlockPos newPos = new BlockPos((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ + j); - if (par2World.isAirBlock(newPos)) + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ + j)) { - par2World.setBlockState(newPos, Blocks.water.getDefaultState()); + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ + j, Blocks.water); } } } @@ -163,7 +160,7 @@ public class SpellWateryGrave extends HomSpell for (int i = 0; i < 16; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java index 2bbfd322..3541359a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java @@ -1,13 +1,12 @@ package WayofTime.alchemicalWizardry.common.spell.simple; import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile; -import WayofTime.alchemicalWizardry.common.items.BindableItems; +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.EnumParticleTypes; import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -28,14 +27,14 @@ public class SpellWindGust extends HomSpell @Override public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); } par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); @@ -51,14 +50,14 @@ public class SpellWindGust extends HomSpell @Override public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); } int distance = 3; @@ -68,7 +67,7 @@ public class SpellWindGust extends HomSpell double yCoord = par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance; double zCoord = par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance; float d0 = 0.5f; - AxisAlignedBB axisalignedbb = new AxisAlignedBB(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 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); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); @@ -89,7 +88,7 @@ public class SpellWindGust extends HomSpell } for (int i = 0; i < 5; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; @@ -98,17 +97,16 @@ public class SpellWindGust extends HomSpell @Override public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); } - - int distance = 3; + double yaw = par3EntityPlayer.rotationYaw / 180 * Math.PI; double pitch = par3EntityPlayer.rotationPitch / 180 * Math.PI; double wantedVelocity = 5; @@ -128,7 +126,7 @@ public class SpellWindGust extends HomSpell for (int i = 0; i < 8; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; @@ -137,18 +135,18 @@ public class SpellWindGust extends HomSpell @Override public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) { return par1ItemStack; } if (!par3EntityPlayer.capabilities.isCreativeMode) { - BindableItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); } int d0 = 3; - AxisAlignedBB axisalignedbb = new AxisAlignedBB((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 axisalignedbb = AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (par3EntityPlayer.posX + 1), (par3EntityPlayer.posY + 2), (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); Iterator iterator = list.iterator(); double xCoord = par3EntityPlayer.posX; @@ -179,7 +177,7 @@ public class SpellWindGust extends HomSpell } for (int i = 0; i < 20; i++) { - SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.getDimensionId(), EnumParticleTypes.SPELL_MOB, 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); } return par1ItemStack; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java index 65423c95..c324adf8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java @@ -7,8 +7,6 @@ import java.util.Random; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.AlchemicalWizardry; @@ -38,8 +36,8 @@ public class MeteorParadigm } } - public void createMeteorImpact(World world, BlockPos pos, boolean[] flags) - { + public void createMeteorImpact(World world, int x, int y, int z, boolean[] flags) + { boolean hasTerrae = false; boolean hasOrbisTerrae = false; boolean hasCrystallos = false; @@ -68,7 +66,7 @@ public class MeteorParadigm chance += 100; } - world.createExplosion(null, pos.getX(), pos.getY(), pos.getZ(), newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks); + world.createExplosion(null, x, y, z, newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks); float iceChance = hasCrystallos ? 1 : 0; float soulChance = hasIncendium ? 1 : 0; @@ -87,9 +85,7 @@ public class MeteorParadigm continue; } - BlockPos newPos = pos.add(i, j, k); - - if (!world.isAirBlock(newPos)) + if (!world.isAirBlock(x + i, y + j, z + k)) { continue; } @@ -111,12 +107,12 @@ public class MeteorParadigm ItemStack blockStack = mpc.getValidBlockParadigm(); if(blockStack != null && blockStack.getItem() instanceof ItemBlock) { - ((ItemBlock)blockStack.getItem()).placeBlockAt(blockStack, null, world, newPos, EnumFacing.DOWN, 0, 0, 0, ((ItemBlock)blockStack.getItem()).block.getStateFromMeta(blockStack.getItemDamage())); - world.markBlockForUpdate(newPos); + ((ItemBlock)blockStack.getItem()).placeBlockAt(blockStack, null, world, x + i, y + j, z + k, 0, 0, 0, 0, blockStack.getItemDamage()); + world.markBlockForUpdate(x + i, y + j, z + k); hasPlacedBlock = true; break; } -// world.setBlock(newPos, Block.getBlockById(Item.getIdFromItem(blockStack.getItem())), blockStack.getItemDamage(), 3); +// world.setBlock(x + i, y + j, z + k, Block.getBlockById(Item.getIdFromItem(blockStack.getItem())), blockStack.getItemDamage(), 3); // hasPlacedBlock = true; // break; } @@ -128,7 +124,7 @@ public class MeteorParadigm if (randChance < iceChance) { - world.setBlockState(newPos, Blocks.ice.getDefaultState(), 3); + world.setBlock(x + i, y + j, z + k, Blocks.ice, 0, 3); } else { randChance -= iceChance; @@ -138,13 +134,13 @@ public class MeteorParadigm switch (rand.nextInt(3)) { case 0: - world.setBlockState(newPos, Blocks.soul_sand.getDefaultState(), 3); + world.setBlock(x + i, y + j, z + k, Blocks.soul_sand, 0, 3); break; case 1: - world.setBlockState(newPos, Blocks.glowstone.getDefaultState(), 3); + world.setBlock(x + i, y + j, z + k, Blocks.glowstone, 0, 3); break; case 2: - world.setBlockState(newPos, Blocks.netherrack.getDefaultState(), 3); + world.setBlock(x + i, y + j, z + k, Blocks.netherrack, 0, 3); break; } } else @@ -153,12 +149,12 @@ public class MeteorParadigm if (randChance < obsidChance) { - world.setBlockState(newPos, Blocks.obsidian.getDefaultState(), 3); + world.setBlock(x + i, y + j, z + k, Blocks.obsidian, 0, 3); } else { randChance -= obsidChance; - world.setBlockState(newPos, Blocks.stone.getDefaultState(), 3); + world.setBlock(x + i, y + j, z + k, Blocks.stone, 0, 3); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java index 1ed03f73..7deedd38 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java @@ -1,13 +1,12 @@ package WayofTime.alchemicalWizardry.common.summoning.meteor; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + import java.util.ArrayList; import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; - public class MeteorRegistry { public static List paradigmList = new ArrayList(); @@ -27,11 +26,11 @@ public class MeteorRegistry } } - public static void createMeteorImpact(World world, BlockPos pos, int paradigmID, boolean[] flags) + public static void createMeteorImpact(World world, int x, int y, int z, int paradigmID, boolean[] flags) { if (paradigmID < paradigmList.size()) { - paradigmList.get(paradigmID).createMeteorImpact(world, pos, flags); + paradigmList.get(paradigmID).createMeteorImpact(world, x, y, z, flags); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/thread/GAPIChecker.java b/src/main/java/WayofTime/alchemicalWizardry/common/thread/GAPIChecker.java index fa7bda35..70d02550 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/thread/GAPIChecker.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/thread/GAPIChecker.java @@ -1,26 +1,20 @@ package WayofTime.alchemicalWizardry.common.thread; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.*; + +import java.io.*; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.relauncher.FMLInjectionData; - public class GAPIChecker { public static boolean doneChecking = false; @@ -35,7 +29,7 @@ public class GAPIChecker public void init() { FMLCommonHandler.instance().bus().register(this); - File mcDir = (File)FMLInjectionData.data()[6]; + File mcDir = (File)cpw.mods.fml.relauncher.FMLInjectionData.data()[6]; this.modsDir = new File(mcDir, "mods"); @@ -109,7 +103,7 @@ public class GAPIChecker if (event.phase == TickEvent.Phase.END && Minecraft.getMinecraft().thePlayer != null && !triedToWarnPlayer) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - IChatComponent component = IChatComponent.Serializer.jsonToComponent(StatCollector.translateToLocal("bm.versioning.getGAPI")); + IChatComponent component = IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("bm.versioning.getGAPI")); player.addChatComponentMessage(component); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/thread/ThreadDownloadGAPI.java b/src/main/java/WayofTime/alchemicalWizardry/common/thread/ThreadDownloadGAPI.java index 67965eeb..cafaf35d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/thread/ThreadDownloadGAPI.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/thread/ThreadDownloadGAPI.java @@ -35,7 +35,7 @@ public class ThreadDownloadGAPI extends Thread { try { - IChatComponent component = IChatComponent.Serializer.jsonToComponent(String.format(StatCollector.translateToLocal("bm.versioning.startingDownload"), fileName)); + IChatComponent component = IChatComponent.Serializer.func_150699_a(String.format(StatCollector.translateToLocal("bm.versioning.startingDownload"), fileName)); if (Minecraft.getMinecraft().thePlayer != null) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicalCalcinator.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicCalcinator.java similarity index 86% rename from src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicalCalcinator.java rename to src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicCalcinator.java index b406f3dc..d5891819 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAlchemicalCalcinator.java +++ b/src/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; @@ -8,28 +15,19 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.server.gui.IUpdatePlayerListBox; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.IChatComponent; import net.minecraftforge.common.util.Constants; -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.minecraftforge.common.util.ForgeDirection; -public class TEAlchemicalCalcinator extends TEReagentConduit implements IInventory, IUpdatePlayerListBox +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 progress; + public int progress; - public TEAlchemicalCalcinator() + public TEAlchemicCalcinator() { super(1, Reagent.REAGENT_SIZE * 4); this.inv = new ItemStack[2]; @@ -99,9 +97,9 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento } @Override - public void update() + public void updateEntity() { - super.update(); + super.updateEntity(); if (!worldObj.isRemote) { @@ -113,12 +111,12 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento public void moveBufferToMain() { ReagentStack amountStack = this.bufferTank.drain(bufferTransferRate, false); - int drainAmount = this.fill(EnumFacing.UP, amountStack, false); + int drainAmount = this.fill(ForgeDirection.UNKNOWN, amountStack, false); if (drainAmount > 0) { ReagentStack drainedStack = this.bufferTank.drain(drainAmount, true); - this.fill(EnumFacing.UP, drainedStack, true); + this.fill(ForgeDirection.UNKNOWN, drainedStack, true); } } @@ -127,7 +125,6 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento int lpPerTick = 10; int ticksPerReagent = 200; ItemStack reagentItemStack = this.getStackInSlot(1); - if (reagentItemStack == null) { progress = 0; @@ -161,7 +158,7 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento if (worldObj.getWorldTime() % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (progress >= ticksPerReagent) @@ -255,14 +252,14 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeClientNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(pos, -999, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { super.onDataPacket(net, packet); - readClientNBT(packet.getNbtCompound()); + readClientNBT(packet.func_148857_g()); } @Override @@ -287,7 +284,7 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento stack.stackSize = getInventoryStackLimit(); } - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @Override @@ -336,23 +333,27 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento @Override public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(pos) == this && pos.distanceSqToCenter(player.posX, player.posY, player.posZ) < 64; + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; } @Override - public void openInventory(EntityPlayer player) {} + public void openInventory() + { + } @Override - public void closeInventory(EntityPlayer player) {} + public void closeInventory() + { + } @Override - public String getName() + public String getInventoryName() { return "AlchemicCalcinator"; } @Override - public boolean hasCustomName() + public boolean hasCustomInventoryName() { return false; } @@ -364,37 +365,13 @@ public class TEAlchemicalCalcinator extends TEReagentConduit implements IInvento } @Override - public int fill(EnumFacing from, ReagentStack resource, boolean doFill) + public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) { if (doFill && !worldObj.isRemote) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return super.fill(from, resource, doFill); } - - @Override - public IChatComponent getDisplayName() - { - return null; - } - - @Override - public int getField(int id) - { - return 0; - } - - @Override - public void setField(int id, int value) {} - - @Override - public int getFieldCount() - { - return 0; - } - - @Override - public void clear() {} } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index ff3cc550..91d80544 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -11,13 +10,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidEvent; @@ -37,7 +34,7 @@ import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeCompone import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, IBloodAltar, IUpdatePlayerListBox +public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, IBloodAltar { public static final int sizeInv = 1; @@ -106,6 +103,11 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I return filledAmount; } + + public int getRSPowerOutput() + { + return 5; + } public void addToDemonBloodDuration(int dur) { @@ -244,7 +246,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I } @Override - public String getName() + public String getInventoryName() { return "TEAltar"; } @@ -337,7 +339,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I return 0; } - if (resource.getFluid() != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).getFluid()) + if (resource.getFluidID() != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).getFluidID()) { return 0; } @@ -362,7 +364,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I fluidInput = new FluidStack(resource, Math.min(bufferCapacity, resource.amount)); if (tile != null) { - FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorld(), tile.getPos(), this, fluidInput.amount)); + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); } return fluidInput.amount; @@ -386,7 +388,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if (tile != null) { - FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorld(), tile.getPos(), this, fluidInput.amount)); + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); } return filled; @@ -420,7 +422,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if (this != null) { - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluidOutput, this.worldObj, this.pos, this, fluidOutput.amount)); + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluidOutput, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this)); } } @@ -431,7 +433,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return stack; @@ -439,13 +441,13 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I //Logic for the actual block is under here @Override - public void update() + public void updateEntity() { this.decrementDemonBlood(); if(this.hasDemonBlood() && !worldObj.isRemote) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (this.lockdownDuration > 0) @@ -461,18 +463,23 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) { { - for(EnumFacing facing : EnumFacing.VALUES) - { - BlockPos newPos = pos.offset(facing); - IBlockState state = worldObj.getBlockState(newPos); - Block block = state.getBlock(); - block.onNeighborBlockChange(worldObj, newPos, state, this.getBlockType()); - } + 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); } if (AlchemicalWizardry.lockdownAltar) { - List list = SpellHelper.getPlayersInRange(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 15, 15); + 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); @@ -504,8 +511,8 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if(worldObj.getWorldTime() % Math.max(20 - this.accelerationUpgrades, 1) == 0) { int syphonMax = (int) (20 * this.dislocationMultiplier); - int fluidInputted; - int fluidOutputted; + int fluidInputted = 0; + int fluidOutputted = 0; fluidInputted = Math.min(syphonMax, -this.fluid.amount + capacity); fluidInputted = Math.min(this.fluidInput.amount, fluidInputted); this.fluid.amount += fluidInputted; @@ -559,7 +566,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (progress >= liquidRequired * stackSize) @@ -576,7 +583,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I for (int i = 0; i < 8; i++) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos.getX(), pos.getY(), pos.getZ(), 20, worldObj.provider.getDimensionId(), 4, pos.getX() + 0.5f, pos.getY() + 1.0f, pos.getZ() + 0.5f); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 4, xCoord + 0.5f, yCoord + 1.0f, zCoord + 0.5f); } this.isActive = false; } @@ -586,7 +593,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if (worldTime % 2 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 2, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 2, xCoord, yCoord, zCoord); } } } else @@ -623,13 +630,13 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 3, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 3, xCoord, yCoord, zCoord); } } } if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } @@ -683,9 +690,9 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I } } - FluidStack flMain = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, fluidData[1]); //First parameter was fluidData[0] --Checking to see if this will cause issues or not - FluidStack flIn = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, fluidData[3]); //" " - FluidStack flOut = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 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); @@ -721,7 +728,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I { if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } this.checkAndSetAltar(); @@ -753,7 +760,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I public void checkAndSetAltar() { boolean checkUpgrade = true; - int upgradeState = UpgradedAltars.isAltarValid(worldObj, pos); + int upgradeState = UpgradedAltars.isAltarValid(worldObj, xCoord, yCoord, zCoord); if (upgradeState <= 1) { @@ -770,7 +777,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I return; } - AltarUpgradeComponent upgrades = UpgradedAltars.getUpgrades(worldObj, pos, upgradeState); + AltarUpgradeComponent upgrades = UpgradedAltars.getUpgrades(worldObj, xCoord, yCoord, zCoord, upgradeState); if (upgrades == null) { @@ -816,7 +823,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I this.fluidInput.amount = this.bufferCapacity; } - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @Override @@ -826,7 +833,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I } @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { //TODO if (resource == null) @@ -844,7 +851,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I } @Override - public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { if (resource == null) { @@ -860,26 +867,26 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I } @Override - public FluidStack drain(EnumFacing from, int maxEmpty, boolean doDrain) + public FluidStack drain(ForgeDirection from, int maxEmpty, boolean doDrain) { return this.drain(maxEmpty, doDrain); } @Override - public boolean canFill(EnumFacing from, Fluid fluid) + public boolean canFill(ForgeDirection from, Fluid fluid) { //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()); } @Override - public boolean canDrain(EnumFacing from, Fluid fluid) + public boolean canDrain(ForgeDirection from, Fluid fluid) { return true; } @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) + public FluidTankInfo[] getTankInfo(ForgeDirection from) { FluidTank compositeTank = new FluidTank(capacity); compositeTank.setFluid(fluid); @@ -926,7 +933,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I public void sendChatInfoToPlayer(EntityPlayer player) { player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.currentessence"), this.fluid.amount)); - player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.currenttier"), UpgradedAltars.isAltarValid(worldObj, pos))); + player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.currenttier"), UpgradedAltars.isAltarValid(worldObj, xCoord, yCoord, zCoord))); player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.capacity"), this.getCapacity())); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBelljar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBelljar.java index fe0767a0..1126762a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBelljar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEBelljar.java @@ -1,22 +1,19 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -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; +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; -public class TEBelljar extends TEReagentConduit +public class TEBellJar extends TEReagentConduit { - public TEBelljar() + public TEBellJar() { super(1, 16000); this.maxConnextions = 1; @@ -39,7 +36,7 @@ public class TEBelljar extends TEReagentConduit public static ReagentContainerInfo[] getContainerInfoFromItem(ItemStack stack) { - if (stack != null && stack.getItem() instanceof ItemBlock && ModBlocks.blockCrystalBelljar == ((ItemBlock) stack.getItem()).getBlock()) + if (stack != null && stack.getItem() instanceof ItemBlock && ModBlocks.blockCrystalBelljar == ((ItemBlock) stack.getItem()).field_150939_a) { NBTTagCompound tag = stack.getTagCompound(); if (tag != null) @@ -101,19 +98,24 @@ public class TEBelljar extends TEReagentConduit } @Override - public void update() + public void updateEntity() { - super.update(); - + super.updateEntity(); + if (hasChanged == 1) { - for(EnumFacing facing : EnumFacing.VALUES) - { - BlockPos newPos = pos.offset(facing); - IBlockState state = worldObj.getBlockState(newPos); - Block block = state.getBlock(); - block.onNeighborBlockChange(worldObj, newPos, state, this.getBlockType()); - } + 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); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java index ed90c954..3c09f67a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java @@ -17,9 +17,16 @@ public class TEConduit extends TESpellBlock super.writeToNBT(par1NBTTagCompound); } + //Logic for the actual block is under here @Override - protected void applySpellChange(SpellParadigm parad) + public void updateEntity() { } + + @Override + protected void applySpellChange(SpellParadigm parad) + { + return; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TECrucible.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TECrucible.java index 1b4f449c..eae4f507 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TECrucible.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TECrucible.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Random; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -12,33 +11,31 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.server.gui.IUpdatePlayerListBox; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import WayofTime.alchemicalWizardry.api.sacrifice.IIncense; import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -public class TECrucible extends TEInventory implements IUpdatePlayerListBox +public class TECrucible extends TEInventory { - private float rColour; - private float gColour; - private float bColour; - - private int ticksRemaining = 0; - private int minValue = 0; - private int maxValue = 0; - private float incrementValue = 0; + private int radius = 5; - private int state = 0; //0 is when it gives off gray particles, 1 is when it gives off white particles (player can't use this incense anymore), 2 is the normal colour of the incense, 3 means no particles (it is out) + public float rColour; + public float gColour; + public float bColour; + + public int ticksRemaining = 0; + public int minValue = 0; + public int maxValue = 0; + public float incrementValue = 0; + + public int state = 0; //0 is when it gives off gray particles, 1 is when it gives off white particles (player can't use this incense anymore), 2 is the normal colour of the incense, 3 means no particles (it is out) public TECrucible() { super(1); - float f = 1.0F; + 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; @@ -48,18 +45,17 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox } @Override - public void update() + public void updateEntity() { - int radius = 5; - - if (worldObj.isRemote) return; - + if(worldObj.isRemote) + return; + boolean stateChanged = false; - if (ticksRemaining <= 0) + if(ticksRemaining <= 0) { ItemStack stack = this.getStackInSlot(0); - if (stack != null && stack.getItem() instanceof IIncense) + if(stack != null && stack.getItem() instanceof IIncense) { IIncense incense = (IIncense)stack.getItem(); @@ -85,7 +81,7 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox if(ticksRemaining > 0) { - List playerList = SpellHelper.getPlayersInRange(worldObj, pos.getX(), pos.getY(), pos.getZ(), radius, radius); + List playerList = SpellHelper.getPlayersInRange(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, radius, radius); if(playerList != null && !playerList.isEmpty()) { @@ -118,7 +114,7 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox if(state != 0) { state = 0; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); updateNeighbors(); } } @@ -127,14 +123,14 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox if(state != 0) { state = 0; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); updateNeighbors(); } } if(stateChanged) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); updateNeighbors(); } @@ -142,30 +138,35 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox private void updateNeighbors() { - for(EnumFacing facing : EnumFacing.VALUES) - { - BlockPos newPos = pos.offset(facing); - IBlockState state = worldObj.getBlockState(newPos); - Block block = state.getBlock(); - block.onNeighborBlockChange(worldObj, newPos, state, this.getBlockType()); - } + 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); } - public void spawnClientParticle(World world, BlockPos blockPos, Random rand) + public void spawnClientParticle(World world, int x, int y, int z, Random rand) { switch(state) { case 0: - world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, 0.15, 0.15, 0.15); + world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 0.7D, z + 0.5D + rand.nextGaussian() / 8, 0.15, 0.15, 0.15); break; case 1: - world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, 1.0, 1.0, 1.0); + world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 0.7D, z + 0.5D + rand.nextGaussian() / 8, 1.0, 1.0, 1.0); break; case 2: - world.spawnParticle(EnumParticleTypes.REDSTONE, blockPos.getX() + 0.5D + rand.nextGaussian() / 8, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 8, rColour, gColour, bColour); - world.spawnParticle(EnumParticleTypes.FLAME, blockPos.getX() + 0.5D + rand.nextGaussian() / 32, blockPos.getY() + 0.7D, blockPos.getZ() + 0.5D + rand.nextGaussian() / 32, 0, 0.02, 0); + world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 0.7D, z + 0.5D + rand.nextGaussian() / 8, rColour, gColour, bColour); + world.spawnParticle("flame", x + 0.5D + rand.nextGaussian() / 32, y + 0.7D, z + 0.5D + rand.nextGaussian() / 32, 0, 0.02, 0); break; case 3: @@ -247,18 +248,18 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeClientNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(pos, 90210, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 90210, nbttagcompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { super.onDataPacket(net, packet); - readClientNBT(packet.getNbtCompound()); + readClientNBT(packet.func_148857_g()); } @Override - public String getName() + public String getInventoryName() { return "TECrucible"; } @@ -266,7 +267,7 @@ public class TECrucible extends TEInventory implements IUpdatePlayerListBox @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { - return stack != null && stack.getItem() instanceof IIncense; + return stack != null ? stack.getItem() instanceof IIncense : false; } public int getRSPowerOutput() diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java similarity index 55% rename from src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellTable.java rename to src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java index d90314d9..2a8c0e79 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellTable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java @@ -4,14 +4,13 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.common.spell.simple.HomSpell; import WayofTime.alchemicalWizardry.common.spell.simple.HomSpellRegistry; -public class TESpellTable extends TileEntity +public class TEHomHeart extends TileEntity { - public boolean canCastSpell() + public boolean canCastSpell(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { return true; } @@ -72,25 +71,73 @@ public class TESpellTable extends TileEntity public HomSpell getSpell() { - for(EnumFacing face : EnumFacing.HORIZONTALS) - { - TileEntity tileEntity = worldObj.getTileEntity(pos.offset(face)); + TileEntity tileEntity = worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); - if (tileEntity instanceof TEAltar) + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) { - ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); - if (itemStack != null) + if (spell != null) { - HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); - - if (spell != null) - { - return spell; - } + return spell; } } - } + } + + tileEntity = worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); + + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) + { + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); + + if (spell != null) + { + return spell; + } + } + } + + tileEntity = worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); + + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) + { + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); + + if (spell != null) + { + return spell; + } + } + } + + tileEntity = worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); + + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) + { + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); + + if (spell != null) + { + return spell; + } + } + } return null; } @@ -99,11 +146,11 @@ public class TESpellTable extends TileEntity { //TODO change so that it works with a Tile Entity for a custom head or whatnot - TileEntity tileEntity = worldObj.getTileEntity(pos.offsetUp()); + TileEntity tileEntity = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); if (tileEntity instanceof TileEntitySkull) { - int skullType = ((TileEntitySkull) tileEntity).getSkullType(); + int skullType = ((TileEntitySkull) tileEntity).func_145904_a(); switch (skullType) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java index ec5ccc86..6d28ea18 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEInventory.java @@ -6,7 +6,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IChatComponent; import net.minecraftforge.common.util.Constants; /** @@ -66,16 +65,16 @@ public abstract class TEInventory extends TileEntity implements IInventory public void setInventorySlotContents(int slot, ItemStack stack) { inv[slot] = stack; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); if (stack != null && stack.stackSize > getInventoryStackLimit()) stack.stackSize = getInventoryStackLimit(); } @Override - public abstract String getName(); + public abstract String getInventoryName(); @Override - public boolean hasCustomName() + public boolean hasCustomInventoryName() { return false; } @@ -89,17 +88,17 @@ public abstract class TEInventory extends TileEntity implements IInventory @Override public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(this.pos) == this - && player.getDistanceSqToCenter(pos) < 64; + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this + && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; } @Override - public void openInventory(EntityPlayer player) + public void openInventory() { } @Override - public void closeInventory(EntityPlayer player) + public void closeInventory() { } @@ -148,28 +147,4 @@ public abstract class TEInventory extends TileEntity implements IInventory { inv = new ItemStack[inv.length]; } - - @Override - public int getField(int id) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setField(int id, int value) { - // TODO Auto-generated method stub - - } - - @Override - public int getFieldCount() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public IChatComponent getDisplayName() { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java index 01d78af0..a4f56112 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java @@ -11,16 +11,14 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; @@ -33,8 +31,9 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualBreakMethod; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.common.eventhandler.Event; -public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUpdatePlayerListBox +public class TEMasterStone extends TileEntity implements IMasterRitualStone { private String currentRitualString; private boolean isActive; @@ -56,7 +55,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp public TEMasterStone() { tanks = new ReagentContainer[]{new ReagentContainer(1000), new ReagentContainer(1000), new ReagentContainer(1000)}; - this.attunedTankMap = new HashMap(); + this.attunedTankMap = new HashMap(); isActive = false; owner = ""; @@ -152,7 +151,9 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp { newStorage.readFromNBT(localStorageTag); storage = newStorage; - storage.setLocation(pos); + storage.xCoord = xCoord; + storage.yCoord = yCoord; + storage.zCoord = zCoord; } } @@ -214,7 +215,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp return; } - String testRitual = Rituals.checkValidRitual(world, pos); + String testRitual = Rituals.checkValidRitual(world, xCoord, yCoord, zCoord); if (testRitual.equals("")) { @@ -270,7 +271,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp for (int i = 0; i < 12; i++) { - SpellHelper.sendIndexedParticleToAllAround(world, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } }else { @@ -290,11 +291,11 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp var1 = 0; currentRitualString = testRitual; storage = Rituals.getLocalStorage(currentRitualString); - storage.setLocation(pos); + storage.setLocation(new Int3(xCoord, yCoord, zCoord)); isActive = true; isRunning = true; - direction = Rituals.getDirectionOfRitual(world, pos, testRitual); - worldObj.markBlockForUpdate(pos); + direction = Rituals.getDirectionOfRitual(world, xCoord, yCoord, zCoord, testRitual); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } public void setOwner(String owner) @@ -313,7 +314,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp } @Override - public void update() + public void updateEntity() { if (isRunning && runningTime < 100) { @@ -337,26 +338,26 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp if (worldTime % 100 == 0) { - boolean testRunes = Rituals.checkDirectionOfRitualValid(worldObj, pos, currentRitualString, direction); - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + boolean testRunes = Rituals.checkDirectionOfRitualValid(worldObj, xCoord, yCoord, zCoord, currentRitualString, direction); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); if (!testRunes) { Rituals.onRitualBroken(this, currentRitualString, RitualBreakMethod.BREAK_STONE); isActive = false; currentRitualString = ""; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); return; } } - if (worldObj.getStrongPower(pos) > 0) + if (worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0) { if (isRunning) { Rituals.onRitualBroken(this, this.currentRitualString, RitualBreakMethod.REDSTONE); isRunning = false; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -365,14 +366,14 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp if (!isRunning) { isRunning = true; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } - performRitual(worldObj, pos, currentRitualString); + performRitual(worldObj, xCoord, yCoord, zCoord, currentRitualString); } - public void performRitual(World world, BlockPos pos, String currentRitualString) + public void performRitual(World world, int x, int y, int z, String currentRitualString) { Rituals.performEffect(this, currentRitualString); } @@ -407,7 +408,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp Rituals.onRitualBroken(this, this.currentRitualString, RitualBreakMethod.DEACTIVATE); this.isActive = active; this.isRunning = active; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } public int getDirection() @@ -416,15 +417,27 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp } @Override - public World getWorldObj() + public World getWorld() { - return this.getWorld(); + return this.getWorldObj(); } @Override - public BlockPos getPosition() + public int getXCoord() { - return this.getPos(); + return xCoord; + } + + @Override + public int getYCoord() + { + return yCoord; + } + + @Override + public int getZCoord() + { + return zCoord; } public String getCurrentRitual() @@ -442,29 +455,30 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeClientNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(pos, -999, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { super.onDataPacket(net, packet); - readClientNBT(packet.getNbtCompound()); + readClientNBT(packet.func_148857_g()); } public AxisAlignedBB getRenderBoundingBox() { - double renderExtension = 1.0d; - return new AxisAlignedBB(pos.add(-renderExtension, -renderExtension, -renderExtension), pos.add(1 + renderExtension, 1 + renderExtension, 1 + renderExtension)); + 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(EnumFacing from, ReagentStack resource, boolean doFill) + public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) { if (doFill) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } int totalFill = 0; @@ -531,7 +545,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp } @Override - public ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain) + public ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain) { if (resource == null) { @@ -540,7 +554,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp if (doDrain) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } int maxDrain = resource.amount; @@ -569,7 +583,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp /* Only returns the amount from the first available tank */ @Override - public ReagentStack drain(EnumFacing from, int maxDrain, boolean doDrain) + public ReagentStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { for (int i = 0; i < tanks.length; i++) { @@ -578,7 +592,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp { if (doDrain) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return stack; @@ -589,19 +603,19 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone, IUp } @Override - public boolean canFill(EnumFacing from, Reagent reagent) + public boolean canFill(ForgeDirection from, Reagent reagent) { return true; } @Override - public boolean canDrain(EnumFacing from, Reagent reagent) + public boolean canDrain(ForgeDirection from, Reagent reagent) { return true; } @Override - public ReagentContainerInfo[] getContainerInfo(EnumFacing from) + public ReagentContainerInfo[] getContainerInfo(ForgeDirection from) { ReagentContainerInfo[] info = new ReagentContainerInfo[this.getNumberOfTanks()]; for (int i = 0; i < this.getNumberOfTanks(); i++) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMimicBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMimicBlock.java index d059a92e..465cec69 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMimicBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMimicBlock.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -10,9 +9,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import WayofTime.alchemicalWizardry.ModBlocks; @@ -21,7 +18,7 @@ import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry; -public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox +public class TEMimicBlock extends TileEntity { private ItemStack[] inv; public Reagent reagent; @@ -40,14 +37,14 @@ public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(pos, -999, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { super.onDataPacket(net, packet); - readFromNBT(packet.getNbtCompound()); + readFromNBT(packet.func_148857_g()); } @Override @@ -94,8 +91,10 @@ public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox } @Override - public void update() + public void updateEntity() { + super.updateEntity(); + this.ticksRemaining--; if (this.ticksRemaining <= 0) @@ -104,35 +103,34 @@ public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox } } - public static boolean createMimicBlockAtLocation(World world, BlockPos pos, int duration, IBlockState state, Reagent reagent) + public static boolean createMimicBlockAtLocation(World world, int x, int y, int z, int duration, Block block, int meta, Reagent reagent) { - Block block = state.getBlock(); if (block == null) { return false; } - TileEntity tileEntity = world.getTileEntity(pos); + TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null && world.isAirBlock(pos)) + if (tileEntity == null && world.isAirBlock(x, y, z)) { - ItemStack item = new ItemStack(block, 1, block.getMetaFromState(state)); + ItemStack item = new ItemStack(block, 1, meta); - world.setBlockState(pos, ModBlocks.blockMimic.getDefaultState()); - TileEntity tile = world.getTileEntity(pos); + world.setBlock(x, y, z, ModBlocks.blockMimic); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TEMimicBlock) { ((TEMimicBlock) tile).setContainedItem(item); ((TEMimicBlock) tile).setDuration(duration); ((TEMimicBlock) tile).reagent = reagent; - world.markBlockForUpdate(pos); + world.markBlockForUpdate(x, y, z); return true; } }else { if(tileEntity instanceof TEMimicBlock) { - if(((TEMimicBlock) tileEntity).getBlock() == block) + if(((TEMimicBlock) tileEntity).getBlock() == block && ((TEMimicBlock) tileEntity).getMetaOfMimic() == meta) { ((TEMimicBlock) tileEntity).ticksRemaining = Math.max(duration, ((TEMimicBlock) tileEntity).ticksRemaining); } @@ -183,7 +181,7 @@ public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox // // } else { - this.worldObj.setBlockToAir(pos); + this.worldObj.setBlockToAir(xCoord, yCoord, zCoord); } } @@ -194,8 +192,7 @@ public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox { if (item.getItem() instanceof ItemBlock) { - Block block = ((ItemBlock) item.getItem()).getBlock(); - return block; + return ((ItemBlock) item.getItem()).field_150939_a; } } return null; @@ -212,25 +209,14 @@ public class TEMimicBlock extends TileEntity implements IUpdatePlayerListBox return 0; } - public IBlockState getStateOfMimic() - { - Block block = this.getBlock(); - if(block == null) - { - return null; - } - - return block.getStateFromMeta(getMetaOfMimic()); - } - - public boolean getBlockEffectWhileInside(Entity entity, BlockPos blockPos) + public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z) { if(reagent != null) { OmegaParadigm paradigm = OmegaRegistry.getParadigmForReagent(reagent); if(paradigm != null) { - return paradigm.getBlockEffectWhileInside(entity, blockPos); + return paradigm.getBlockEffectWhileInside(entity, x, y, z); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java index 160bf6a7..4029c2fa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java @@ -1,64 +1,64 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +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.minecraft.util.EnumFacing; -import WayofTime.alchemicalWizardry.common.NewPacketHandler; -import WayofTime.alchemicalWizardry.common.block.IOrientable; +import net.minecraftforge.common.util.ForgeDirection; public class TEOrientable extends TileEntity implements IOrientable { - protected EnumFacing inputFace; - protected EnumFacing outputFace; + protected ForgeDirection inputFace; + protected ForgeDirection outputFace; public TEOrientable() { - this.inputFace = EnumFacing.DOWN; - this.outputFace = EnumFacing.UP; + this.inputFace = ForgeDirection.DOWN; + this.outputFace = ForgeDirection.UP; } @Override public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); - this.setInputDirection(EnumFacing.getFront(par1NBTTagCompound.getInteger("inputFace"))); - this.setOutputDirection(EnumFacing.getFront(par1NBTTagCompound.getInteger("outputFace"))); + this.setInputDirection(ForgeDirection.getOrientation(par1NBTTagCompound.getInteger("inputFace"))); + this.setOutputDirection(ForgeDirection.getOrientation(par1NBTTagCompound.getInteger("outputFace"))); } @Override public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("inputFace", TEOrientable.getIntForEnumFacing(this.getInputDirection())); - par1NBTTagCompound.setInteger("outputFace", TEOrientable.getIntForEnumFacing(this.getOutputDirection())); + par1NBTTagCompound.setInteger("inputFace", TEOrientable.getIntForForgeDirection(this.getInputDirection())); + par1NBTTagCompound.setInteger("outputFace", TEOrientable.getIntForForgeDirection(this.getOutputDirection())); } @Override - public EnumFacing getInputDirection() + public ForgeDirection getInputDirection() { return this.inputFace; } @Override - public EnumFacing getOutputDirection() + public ForgeDirection getOutputDirection() { return this.outputFace; } @Override - public void setInputDirection(EnumFacing direction) + public void setInputDirection(ForgeDirection direction) { this.inputFace = direction; } @Override - public void setOutputDirection(EnumFacing direction) + public void setOutputDirection(ForgeDirection direction) { this.outputFace = direction; } - public static int getIntForEnumFacing(EnumFacing direction) + public static int getIntForForgeDirection(ForgeDirection direction) { switch (direction) { @@ -92,7 +92,7 @@ public class TEOrientable extends TileEntity implements IOrientable } - public boolean isSideRendered(EnumFacing side) + public boolean isSideRendered(ForgeDirection side) { if (side.equals(this.getInputDirection()) || side.equals(this.getOutputDirection())) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java index 7b664d7f..ff2d1875 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java @@ -46,7 +46,7 @@ public class TEPedestal extends TEInventory } @Override - public String getName() + public String getInventoryName() { return "TEPedestal"; } @@ -57,6 +57,13 @@ public class TEPedestal extends TEInventory return 1; } + //Logic for the actual block is under here + @Override + public void updateEntity() + { + super.updateEntity(); + } + public void setActive() { isActive = false; @@ -127,12 +134,13 @@ public class TEPedestal extends TEInventory public void onItemDeletion() { - worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, pos.getX(), pos.getY(), pos.getZ())); - worldObj.markBlockForUpdate(pos); + worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, xCoord, yCoord, zCoord)); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); for (int i = 0; i < 16; i++) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 2, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 2, xCoord, yCoord, zCoord); } } + } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java index 05be629f..8ad6d782 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java @@ -10,9 +10,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.Packet; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraftforge.common.util.Constants; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; @@ -20,9 +18,9 @@ import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistryCompo import WayofTime.alchemicalWizardry.common.IDemon; import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.PlinthComponent; -import WayofTime.alchemicalWizardry.common.items.Orb; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; -public class TEPlinth extends TEInventory implements IUpdatePlayerListBox +public class TEPlinth extends TEInventory { public static final int sizeInv = 1; @@ -36,7 +34,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox private int progressInterval; private int progress; - public static List pedestalPositions = new ArrayList(); + public static List pedestalPositions = new ArrayList(); public TEPlinth() { @@ -151,7 +149,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox } @Override - public String getName() + public String getInventoryName() { return "TEPlinth"; } @@ -164,8 +162,10 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox //Logic for the actual block is under here @Override - public void update() + public void updateEntity() { + super.updateEntity(); + if (worldObj.isRemote) { return; @@ -173,9 +173,9 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox if (!isActive()) { - if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof Orb) + if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof EnergyBattery) { - int bloodOrbLevel = ((Orb) getStackInSlot(0).getItem()).getOrbLevel(); + int bloodOrbLevel = ((EnergyBattery) getStackInSlot(0).getItem()).getOrbLevel(); if (SummoningRegistry.isRecipeValid(bloodOrbLevel, composeItemsForRingAndParadigm(1, true), composeItemsForRingAndParadigm(2, true), composeItemsForRingAndParadigm(3, true))) { @@ -203,7 +203,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox } } else { - if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof Orb) + if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof EnergyBattery) { if (progress % progressInterval == 0) { @@ -246,12 +246,12 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox if (progress >= progressInterval * 18) { - int bloodOrbLevel = ((Orb) getStackInSlot(0).getItem()).getOrbLevel(); + int bloodOrbLevel = ((EnergyBattery) getStackInSlot(0).getItem()).getOrbLevel(); EntityLivingBase entity = SummoningRegistry.getEntity(worldObj, bloodOrbLevel, ring1Inv, ring2Inv, ring3Inv); if (entity != null) { - entity.setPosition(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5); + entity.setPosition(xCoord + 0.5, yCoord + 1, zCoord + 0.5); worldObj.spawnEntityInWorld(entity); if (entity instanceof IDemon) @@ -266,7 +266,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } @@ -284,13 +284,12 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox { if (i < 6 && pc.getRing() == ring) { - BlockPos newPos = pos.add(pc.xOffset, pc.yOffset, pc.zOffset); - TileEntity tileEntity = worldObj.getTileEntity(newPos); + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); if (tileEntity instanceof TEPedestal) { ((TEPedestal) tileEntity).setInventorySlotContents(0, null); - worldObj.markBlockForUpdate(newPos); + worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); i++; } } @@ -303,13 +302,12 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox { if (i < 6 && pc.getRing() == ring) { - BlockPos newPos = pos.add(pc.zOffset, pc.yOffset, pc.xOffset); - TileEntity tileEntity = worldObj.getTileEntity(newPos); + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); if (tileEntity instanceof TEPedestal) { ((TEPedestal) tileEntity).setInventorySlotContents(0, null); - worldObj.markBlockForUpdate(newPos); + worldObj.markBlockForUpdate(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); i++; } } @@ -332,8 +330,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox { if (i < 6 && pc.getRing() == ring) { - BlockPos newPos = pos.add(pc.xOffset, pc.yOffset, pc.zOffset); - TileEntity tileEntity = worldObj.getTileEntity(newPos); + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); if (tileEntity instanceof TEPedestal) { @@ -368,7 +365,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox ((TEPedestal) tileEntity).setInventorySlotContents(0, null); } ((TEPedestal) tileEntity).onItemDeletion(); - worldObj.markBlockForUpdate(newPos); + worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); return true; } } @@ -385,8 +382,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox { if (i < 6 && pc.getRing() == ring) { - BlockPos newPos = pos.add(pc.zOffset, pc.yOffset, pc.xOffset); - TileEntity tileEntity = worldObj.getTileEntity(newPos); + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); if (tileEntity instanceof TEPedestal) { @@ -417,7 +413,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox { ((TEPedestal) tileEntity).decrStackSize(0, 1); ((TEPedestal) tileEntity).onItemDeletion(); - worldObj.markBlockForUpdate(newPos); + worldObj.markBlockForUpdate(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); return true; } } @@ -443,8 +439,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox { if (i < 6 && pc.getRing() == ring) { - BlockPos newPos = pos.add(pc.xOffset, pc.yOffset, pc.zOffset); - TileEntity tileEntity = worldObj.getTileEntity(newPos); + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); if (tileEntity instanceof TEPedestal) { @@ -461,8 +456,7 @@ public class TEPlinth extends TEInventory implements IUpdatePlayerListBox { if (i < 6 && pc.getRing() == ring) { - BlockPos newPos = pos.add(pc.zOffset, pc.yOffset, pc.xOffset); - TileEntity tileEntity = worldObj.getTileEntity(newPos); + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); if (tileEntity instanceof TEPedestal) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java index fc59f70b..6efd07e2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEReagentConduit.java +++ b/src/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.Int3; +import WayofTime.alchemicalWizardry.api.alchemy.energy.*; +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; @@ -13,25 +14,18 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import WayofTime.alchemicalWizardry.api.ColourAndCoords; -import WayofTime.alchemicalWizardry.api.Int3; -import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; -import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; -import WayofTime.alchemicalWizardry.api.alchemy.energy.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.entity.projectile.EntityParticleBeam; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import net.minecraftforge.common.util.ForgeDirection; -public class TEReagentConduit extends TileSegmentedReagentHandler implements IUpdatePlayerListBox +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; @@ -54,9 +48,9 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp { super(numberOfTanks, size); - destinationList = new LinkedList(); - reagentTargetList = new HashMap>(); - reagentTankDesignationList = new HashMap(); + destinationList = new LinkedList(); + reagentTargetList = new HashMap(); + reagentTankDesignationList = new HashMap(); } public Int3 getColour() @@ -163,7 +157,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp NBTTagList tagList = tag.getTagList("destinationList", Constants.NBT.TAG_COMPOUND); - destinationList = new LinkedList(); + destinationList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { @@ -172,7 +166,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp destinationList.add(ColourAndCoords.readFromNBT(savedTag)); } - reagentTargetList = new HashMap>(); + reagentTargetList = new HashMap(); NBTTagList reagentTagList = tag.getTagList("reagentTargetList", Constants.NBT.TAG_COMPOUND); @@ -182,7 +176,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp Reagent reagent = ReagentRegistry.getReagentForKey(savedTag.getString("reagent")); - List coordList = new LinkedList(); + List coordList = new LinkedList(); NBTTagList coordinateList = savedTag.getTagList("coordinateList", Constants.NBT.TAG_COMPOUND); @@ -194,7 +188,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp reagentTargetList.put(reagent, coordList); } - reagentTankDesignationList = new HashMap(); + reagentTankDesignationList = new HashMap(); NBTTagList tankDesignationList = tag.getTagList("tankDesignationList", Constants.NBT.TAG_COMPOUND); @@ -202,7 +196,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp { NBTTagCompound savedTag = tankDesignationList.getCompoundTagAt(i); - this.reagentTankDesignationList.put(ReagentRegistry.getReagentForKey(savedTag.getString("reagent")), savedTag.getInteger("integer")); + this.reagentTankDesignationList.put(ReagentRegistry.getReagentForKey(savedTag.getString("reagent")), new Integer(savedTag.getInteger("integer"))); } } @@ -210,7 +204,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp { NBTTagList tagList = tag.getTagList("destinationList", Constants.NBT.TAG_COMPOUND); - destinationList = new LinkedList(); + destinationList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { @@ -259,7 +253,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp } @Override - public void update() + public void updateEntity() { if (!worldObj.isRemote) { @@ -276,7 +270,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp this.updateColourList(); } - if (affectedByRedstone && worldObj.isBlockPowered(pos)) //isBlockBeingIndirectlyPowered() + if (affectedByRedstone && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { return; } @@ -292,7 +286,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp break; } - ReagentStack maxDrainAmount = this.drain(EnumFacing.UP, new ReagentStack(entry.getKey(), this.tickRate - totalTransfered), false); + ReagentStack maxDrainAmount = this.drain(ForgeDirection.UNKNOWN, new ReagentStack(entry.getKey(), this.tickRate - totalTransfered), false); if (maxDrainAmount == null) { @@ -306,25 +300,28 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp continue; } - BlockPos newPos = pos.add(coord.xCoord, coord.yCoord, coord.zCoord); + int x = xCoord + coord.xCoord; + int y = yCoord + coord.yCoord; + int z = zCoord + coord.zCoord; - TileEntity tile = worldObj.getTileEntity(newPos); + TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof IReagentHandler) { - int amount = Math.min(((IReagentHandler) tile).fill(EnumFacing.UP, maxDrainAmount, false), amountLeft); + int amount = Math.min(((IReagentHandler) tile).fill(ForgeDirection.UNKNOWN, maxDrainAmount, false), amountLeft); if (amount > 0) { + amountLeft -= amount; totalTransfered += amount; - ReagentStack stack = this.drain(EnumFacing.UP, new ReagentStack(entry.getKey(), amount), true); - ((IReagentHandler) tile).fill(EnumFacing.UP, stack, true); + ReagentStack stack = this.drain(ForgeDirection.UNKNOWN, new ReagentStack(entry.getKey(), amount), true); + ((IReagentHandler) tile).fill(ForgeDirection.UNKNOWN, stack, true); } } } } } else { - if (affectedByRedstone && worldObj.isBlockPowered(pos)) + if (affectedByRedstone && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { return; } @@ -340,26 +337,27 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp } } + @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) { - BlockPos newPos = pos.add(colourSet.xCoord, colourSet.yCoord, colourSet.zCoord); - if (!(worldObj.getTileEntity(newPos) instanceof IReagentHandler)) + if (!(worldObj.getTileEntity(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord) instanceof IReagentHandler)) { continue; } - EntityParticleBeam beam = new EntityParticleBeam(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + 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(pos.getX() + colourSet.xCoord, pos.getY() + colourSet.yCoord, pos.getZ() + colourSet.zCoord); + beam.setDestination(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord); worldObj.spawnEntityInWorld(beam); } } @@ -377,13 +375,13 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp if (newList != null && !newList.equals(destinationList)) { this.destinationList = newList; - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } public List compileListForReagentTargets(Map> map) { - List list = new LinkedList(); + List list = new LinkedList(); for (Entry> entry : map.entrySet()) { @@ -423,7 +421,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp 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 - pos.getX(), y - pos.getY(), z - pos.getZ()); + return this.addDestinationViaOffset(red, green, blue, intensity, x - this.xCoord, y - this.yCoord, z - this.zCoord); } @Override @@ -431,14 +429,14 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeClientNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(pos, 90210, nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 90210, nbttagcompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { super.onDataPacket(net, packet); - readClientNBT(packet.getNbtCompound()); + readClientNBT(packet.func_148857_g()); } public boolean addReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) @@ -471,7 +469,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp List coordList = this.reagentTargetList.get(reagent); if (coordList == null) { - List newCoordList = new LinkedList(); + List newCoordList = new LinkedList(); newCoordList.add(newCoord); this.reagentTargetList.put(reagent, newCoordList); } else @@ -482,7 +480,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp return true; } else { - List newCoordList = new LinkedList(); + List newCoordList = new LinkedList(); newCoordList.add(newCoord); this.reagentTargetList.put(reagent, newCoordList); @@ -492,7 +490,7 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp public boolean addReagentDestinationViaActual(Reagent reagent, int x, int y, int z) { - return (this.addReagentDestinationViaOffset(reagent, x - pos.getX(), y - pos.getY(), z - pos.getZ())); + return (this.addReagentDestinationViaOffset(reagent, x - xCoord, y - yCoord, z - zCoord)); } public boolean removeReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) @@ -512,15 +510,15 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp public boolean removeReagentDestinationViaActual(Reagent reagent, int x, int y, int z) { - return this.removeReagentDestinationViaOffset(reagent, x - pos.getX(), y - pos.getY(), z - pos.getZ()); + return this.removeReagentDestinationViaOffset(reagent, x - xCoord, y - yCoord, z - zCoord); } @Override - public int fill(EnumFacing from, ReagentStack resource, boolean doFill) + public int fill(ForgeDirection from, ReagentStack resource, boolean doFill) { if (doFill && !worldObj.isRemote) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); hasChanged = 2; } @@ -528,24 +526,14 @@ public class TEReagentConduit extends TileSegmentedReagentHandler implements IUp } @Override - public ReagentStack drain(EnumFacing from, ReagentStack resource, boolean doDrain) + public ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain) { if (doDrain && !worldObj.isRemote) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); hasChanged = 2; } return super.drain(from, resource, doDrain); } - - public void removeReagentDestinationViaActual(Reagent reagent, BlockPos pos) - { - this.removeReagentDestinationViaActual(reagent, pos.getX(), pos.getY(), pos.getZ()); - } - - public boolean addReagentDestinationViaActual(Reagent reagent, BlockPos pos) - { - return addReagentDestinationViaActual(reagent, pos.getX(), pos.getY(), pos.getZ()); - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java index 82cd940e..b1aa3e94 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESchematicSaver.java @@ -1,26 +1,24 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +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.block.state.IBlockState; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -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() + public void rightClickBlock(EntityPlayer player, int side) { BuildingSchematic schematic = new BuildingSchematic(); @@ -37,15 +35,14 @@ public class TESchematicSaver extends TileEntity { for (int k = -negZ + 1; k <= posZ - 1; k++) { - BlockPos newPos = pos.add(i, j, k); - IBlockState state = worldObj.getBlockState(newPos); - Block block = state.getBlock(); - int meta = block.getMetaFromState(state); + int meta = worldObj.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); + Block block = worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k); - if (!block.isAir(worldObj, newPos)) + if (!block.isAir(worldObj, xCoord + i, yCoord + j, zCoord + k)) { schematic.addBlockWithMeta(block, meta, i, j, k); } + } } @@ -73,7 +70,7 @@ public class TESchematicSaver extends TileEntity int i = 1; while (i < 100) { - if (targetBlock == (worldObj.getBlockState(pos.add(0, i, 0)).getBlock())) + if (targetBlock == (worldObj.getBlock(xCoord, yCoord + i, zCoord))) { return i; } @@ -88,7 +85,7 @@ public class TESchematicSaver extends TileEntity int i = 1; while (i < 100) { - if (targetBlock == (worldObj.getBlockState(pos.add(0, -i, 0)).getBlock())) + if (targetBlock == (worldObj.getBlock(xCoord, yCoord - i, zCoord))) { return i; } @@ -103,7 +100,7 @@ public class TESchematicSaver extends TileEntity int i = 1; while (i < 100) { - if (targetBlock == (worldObj.getBlockState(pos.add(i, 0, 0)).getBlock())) + if (targetBlock == (worldObj.getBlock(xCoord + i, yCoord, zCoord))) { return i; } @@ -118,7 +115,7 @@ public class TESchematicSaver extends TileEntity int i = 1; while (i < 100) { - if (targetBlock == (worldObj.getBlockState(pos.add(-i, 0, 0)).getBlock())) + if (targetBlock == (worldObj.getBlock(xCoord - i, yCoord, zCoord))) { return i; } @@ -133,7 +130,7 @@ public class TESchematicSaver extends TileEntity int i = 1; while (i < 100) { - if (targetBlock == (worldObj.getBlockState(pos.add(0, 0, i)).getBlock())) + if (targetBlock == (worldObj.getBlock(xCoord, yCoord, zCoord + i))) { return i; } @@ -148,7 +145,7 @@ public class TESchematicSaver extends TileEntity int i = 1; while (i < 100) { - if (targetBlock == (worldObj.getBlockState(pos.add(0, 0, -i)).getBlock())) + if (targetBlock == (worldObj.getBlock(xCoord, yCoord, zCoord - i))) { return i; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java index 2dab8da8..faa72994 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java @@ -45,7 +45,7 @@ public class TESocket extends TEInventory } @Override - public String getName() + public String getInventoryName() { return "TESocket"; } @@ -56,6 +56,13 @@ public class TESocket extends TEInventory return 1; } + //Logic for the actual block is under here + @Override + public void updateEntity() + { + super.updateEntity(); + } + public void setActive() { isActive = false; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java index 56ddd107..22e637c3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralBlock.java @@ -1,13 +1,11 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.gui.IUpdatePlayerListBox; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModBlocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; -public class TESpectralBlock extends TileEntity implements IUpdatePlayerListBox +public class TESpectralBlock extends TileEntity { private int ticksRemaining; @@ -33,30 +31,31 @@ public class TESpectralBlock extends TileEntity implements IUpdatePlayerListBox } @Override - public void update() + public void updateEntity() { - if (worldObj.isRemote) + super.updateEntity(); + +// if (worldObj.isRemote) { - return; +// return; } this.ticksRemaining--; if (this.ticksRemaining <= 0) { - worldObj.setBlockToAir(pos); + worldObj.setBlockToAir(xCoord, yCoord, zCoord); } } - public static boolean createSpectralBlockAtLocation(World world, BlockPos pos, int duration) + public static boolean createSpectralBlockAtLocation(World world, int x, int y, int z, int duration) { - if (!world.isAirBlock(pos)) + if (!world.isAirBlock(x, y, z)) { return false; } - - world.setBlockState(pos, ModBlocks.spectralBlock.getDefaultState()); - TileEntity tile = world.getTileEntity(pos); + world.setBlock(x, y, z, ModBlocks.spectralBlock); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TESpectralBlock) { ((TESpectralBlock) tile).setDuration(duration); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralContainer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralContainer.java index 5936d83f..1ee0076c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralContainer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpectralContainer.java @@ -1,20 +1,17 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import WayofTime.alchemicalWizardry.ModBlocks; import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fluids.IFluidBlock; -import WayofTime.alchemicalWizardry.ModBlocks; -public class TESpectralContainer extends TileEntity implements IUpdatePlayerListBox +public class TESpectralContainer extends TileEntity { private ItemStack[] inv; @@ -69,8 +66,10 @@ public class TESpectralContainer extends TileEntity implements IUpdatePlayerList } @Override - public void update() + public void updateEntity() { + super.updateEntity(); + this.ticksRemaining--; if (this.ticksRemaining <= 0) @@ -79,23 +78,22 @@ public class TESpectralContainer extends TileEntity implements IUpdatePlayerList } } - public static boolean createSpectralBlockAtLocation(World world, BlockPos pos, int duration) + public static boolean createSpectralBlockAtLocation(World world, int x, int y, int z, int duration) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); + Block block = world.getBlock(x, y, z); if (block == null) { return false; } - if (world.getTileEntity(pos) == null || block instanceof IFluidBlock) + if (world.getTileEntity(x, y, z) == null || block instanceof IFluidBlock) { - int meta = block.getMetaFromState(state); + int meta = world.getBlockMetadata(x, y, z); ItemStack item = new ItemStack(block, 1, meta); - world.setBlockState(pos, ModBlocks.blockSpectralContainer.getDefaultState()); - TileEntity tile = world.getTileEntity(pos); + world.setBlock(x, y, z, ModBlocks.blockSpectralContainer); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TESpectralContainer) { ((TESpectralContainer) tile).setContainedItem(item); @@ -132,18 +130,18 @@ public class TESpectralContainer extends TileEntity implements IUpdatePlayerList { if (item.getItem() instanceof ItemBlock) { - Block block = ((ItemBlock) item.getItem()).getBlock(); + Block block = ((ItemBlock) item.getItem()).field_150939_a; int meta = item.getItemDamage(); if (block != null) { - this.worldObj.setBlockState(pos, block.getStateFromMeta(meta), 6); + this.worldObj.setBlock(xCoord, yCoord, zCoord, block, meta, 6); } } } else { - this.worldObj.setBlockToAir(pos); + this.worldObj.setBlockToAir(xCoord, yCoord, zCoord); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java index 278c943a..5e38781c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java @@ -1,9 +1,9 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; import WayofTime.alchemicalWizardry.api.spell.SpellParadigm; import WayofTime.alchemicalWizardry.api.tile.ISpellTile; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; public abstract class TESpellBlock extends TEOrientable implements ISpellTile { @@ -23,9 +23,12 @@ public abstract class TESpellBlock extends TEOrientable implements ISpellTile public TESpellBlock getTileAtOutput() { - EnumFacing output = this.getOutputDirection(); + ForgeDirection output = this.getOutputDirection(); + int xOffset = output.offsetX; + int yOffset = output.offsetY; + int zOffset = output.offsetZ; - TileEntity tile = worldObj.getTileEntity(pos.add(output.getDirectionVec())); + TileEntity tile = worldObj.getTileEntity(xCoord + xOffset, yCoord + yOffset, zCoord + zOffset); if (tile instanceof TESpellBlock && ((TESpellBlock) tile).canInputRecieveOutput(output)) { @@ -41,7 +44,7 @@ public abstract class TESpellBlock extends TEOrientable implements ISpellTile } @Override - public boolean canInputRecieveOutput(EnumFacing output) + public boolean canInputRecieveOutput(ForgeDirection output) { return this.canInputRecieve() && this.getInputDirection().getOpposite() == output; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java index da988b1a..28f3f504 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java @@ -14,7 +14,7 @@ public class TESpellEffectBlock extends TESpellBlock public SpellEffect getSpellEffect() { - int meta = this.getBlockMetadata(); + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); switch (meta) { case 0: diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java index 13aaf122..2682d67b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java @@ -37,7 +37,7 @@ public class TESpellEnhancementBlock extends TESpellBlock public SpellEnhancement getSpellEnhancement() { - int meta = this.getBlockMetadata(); + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); switch (meta) { case 0: @@ -64,7 +64,7 @@ public class TESpellEnhancementBlock extends TESpellBlock public int getLimit() { - int meta = this.getBlockMetadata(); + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); switch (meta) { case 0: @@ -103,7 +103,7 @@ public class TESpellEnhancementBlock extends TESpellBlock public int enhancementType() //0 is power, 1 is cost, 2 is potency { - int meta = this.getBlockMetadata(); + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); switch (meta) { case 0: diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellModifierBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellModifierBlock.java index b1a3e1fa..06787e48 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellModifierBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellModifierBlock.java @@ -13,7 +13,7 @@ public class TESpellModifierBlock extends TESpellBlock public ComplexSpellModifier getSpellModifier() { - int meta = this.getBlockMetadata(); + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); switch (meta) { case 0: diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java index c60c5ebc..21f12faa 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java @@ -2,8 +2,8 @@ package WayofTime.alchemicalWizardry.common.tileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import WayofTime.alchemicalWizardry.api.spell.SpellParadigm; import WayofTime.alchemicalWizardry.api.spell.SpellParadigmMelee; import WayofTime.alchemicalWizardry.api.spell.SpellParadigmProjectile; @@ -15,7 +15,7 @@ public class TESpellParadigmBlock extends TESpellBlock implements ISpellParadigm { public SpellParadigm getSpellParadigm() { - int meta = this.getBlockMetadata(); + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); switch (meta) { case 0: @@ -31,7 +31,10 @@ public class TESpellParadigmBlock extends TESpellBlock implements ISpellParadigm } @Override - protected void applySpellChange(SpellParadigm parad) {} + protected void applySpellChange(SpellParadigm parad) + { + + } public boolean canInputRecieve() { @@ -65,11 +68,14 @@ public class TESpellParadigmBlock extends TESpellBlock implements ISpellParadigm } @Override - public void setInputDirection(EnumFacing direction) {} + public void setInputDirection(ForgeDirection direction) + { + + } @Override - public EnumFacing getInputDirection() + public ForgeDirection getInputDirection() { - return EnumFacing.WEST; + return ForgeDirection.UNKNOWN; } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java index 018f3244..e9ae36df 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java @@ -9,16 +9,15 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; -import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -public class TETeleposer extends TEInventory implements IUpdatePlayerListBox +public class TETeleposer extends TEInventory { public static final int sizeInv = 1; @@ -60,7 +59,7 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox } @Override - public String getName() + public String getInventoryName() { return "TETeleposer"; } @@ -73,14 +72,16 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox //Logic for the actual block is under here @Override - public void update() + public void updateEntity() { + super.updateEntity(); + if (worldObj.isRemote) { return; } - int currentInput = worldObj.getStrongPower(pos); + int currentInput = worldObj.getBlockPowerInput(xCoord, yCoord, zCoord); if (previousInput == 0 && currentInput != 0) { @@ -92,20 +93,18 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox int xf = focusItem.xCoord(focus); int yf = focusItem.yCoord(focus); int zf = focusItem.zCoord(focus); - BlockPos posF = focusItem.getBlockPos(focus); - World worldF = focusItem.getWorld(focus); - int damage = (int) (0.5f * Math.sqrt(pos.distanceSq(posF))); + int damage = (int) (0.5f * Math.sqrt((xCoord - xf) * (xCoord - xf) + (yCoord - yf + 1) * (yCoord - yf + 1) + (zCoord - zf) * (zCoord - zf))); int focusLevel = focusItem.getFocusLevel(); int transportCount = 0; int entityCount = 0; - if (worldF != null && worldF.getTileEntity(posF) instanceof TETeleposer && !worldF.getTileEntity(posF).equals(this)) + if (worldF != null && worldF.getTileEntity(xf, yf, zf) instanceof TETeleposer && !worldF.getTileEntity(xf, yf, zf).equals(this)) { //Prime the teleportation int d0 = focusLevel - 1; - AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(pos.add(0, 1, 0), pos.add(1, 2, 1)).expand(d0, d0, d0); -// axisalignedbb1.maxY = Math.min((double) this.worldObj.getHeight(), pos.getY() + 2 + d0 + d0); + AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getBoundingBox((double) this.xCoord-0.5, (double) this.yCoord + d0 + 0.5, (double) this.zCoord-0.5, (double) (this.xCoord + 0.5), (double) (this.yCoord + 1.5 + d0), (double) (this.zCoord + 0.5)).expand(d0, d0, d0); + axisalignedbb1.maxY = Math.min((double) this.worldObj.getHeight(), this.yCoord + 2 + d0 + d0); List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb1); Iterator iterator1 = list1.iterator(); EntityLivingBase entityplayer1; @@ -116,7 +115,7 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox entityCount++; } - AxisAlignedBB axisalignedbb2 = new AxisAlignedBB(xf-0.5, yf + d0 + 0.5, zf-0.5, xf + 0.5, yf + 1.5 + d0, zf+0.5).expand(d0, d0, d0); + AxisAlignedBB axisalignedbb2 = AxisAlignedBB.getBoundingBox(xf-0.5, yf + d0 + 0.5, zf-0.5, xf + 0.5, yf + 1.5 + d0, zf+0.5).expand(d0, d0, d0); List list2 = worldF.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb2); Iterator iterator2 = list2.iterator(); EntityLivingBase entityplayer2; @@ -127,7 +126,7 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox entityCount++; } - if (SoulNetworkHandler.canSyphonInContainer(focus, damage * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) + damage * entityCount)) + 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 i = -(focusLevel - 1); i <= (focusLevel - 1); i++) @@ -135,7 +134,7 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox for (int j = -(focusLevel - 1); j <= (focusLevel - 1); j++) { { - if (BlockTeleposer.swapBlocks(this, worldObj, worldF, pos.add(i, 1 + k, j), posF.add(i, 1 + k, j))) + if (BlockTeleposer.swapBlocks(this, worldObj, worldF, xCoord + i, yCoord + 1 + k, zCoord + j, xf + i, yf + 1 + k, zf + j)) { transportCount++; } @@ -148,7 +147,7 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox entityCount = 0; } - SoulNetworkHandler.syphonFromNetworkWhileInContainer(focus, damage * transportCount + damage * entityCount); + SoulNetworkHandler.syphonFromNetwork(focus, damage * transportCount + damage * entityCount); //Teleport if (worldF.equals(worldObj)) @@ -160,14 +159,14 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox { entityplayer1 = (EntityLivingBase) iterator1.next(); entityplayer1.worldObj = worldF; - entityplayer1.setPositionAndUpdate(entityplayer1.posX - pos.getX() + xf, entityplayer1.posY - pos.getY() + yf, entityplayer1.posZ - pos.getZ() + zf); + entityplayer1.setPositionAndUpdate(entityplayer1.posX - this.xCoord + xf, entityplayer1.posY - this.yCoord + yf, entityplayer1.posZ - this.zCoord + zf); } while (iterator2.hasNext()) { entityplayer2 = (EntityLivingBase) iterator2.next(); entityplayer2.worldObj = worldF; - entityplayer2.setPositionAndUpdate(entityplayer2.posX + pos.getX() - xf, entityplayer2.posY + pos.getY() - yf, entityplayer2.posZ + pos.getZ() - zf); + entityplayer2.setPositionAndUpdate(entityplayer2.posX + this.xCoord - xf, entityplayer2.posY + this.yCoord - yf, entityplayer2.posZ + this.zCoord - zf); } }else { @@ -177,17 +176,17 @@ public class TETeleposer extends TEInventory implements IUpdatePlayerListBox while (iterator1.hasNext()) { entityplayer1 = (EntityLivingBase) iterator1.next(); - SpellHelper.teleportEntityToDim(worldObj, worldF.provider.getDimensionId(), entityplayer1.posX - pos.getX() + xf, entityplayer1.posY - pos.getY() + yf, entityplayer1.posZ - pos.getZ() + zf, entityplayer1); + SpellHelper.teleportEntityToDim(worldObj, worldF.provider.dimensionId, entityplayer1.posX - this.xCoord + xf, entityplayer1.posY - this.yCoord + yf, entityplayer1.posZ - this.zCoord + zf, entityplayer1); // entityplayer1.worldObj = worldF; -// entityplayer1.setPositionAndUpdate(entityplayer1.posX - pos.getX() + xf, entityplayer1.posY - pos.getY() + yf, entityplayer1.posZ - pos.getZ() + zf); +// entityplayer1.setPositionAndUpdate(entityplayer1.posX - this.xCoord + xf, entityplayer1.posY - this.yCoord + yf, entityplayer1.posZ - this.zCoord + zf); } while (iterator2.hasNext()) { entityplayer2 = (EntityLivingBase) iterator2.next(); - SpellHelper.teleportEntityToDim(worldF, worldObj.provider.getDimensionId(), entityplayer2.posX + pos.getX() - xf, entityplayer2.posY + pos.getY() - yf, entityplayer2.posZ + pos.getZ() - zf, entityplayer2); + SpellHelper.teleportEntityToDim(worldF, worldObj.provider.dimensionId, entityplayer2.posX + this.xCoord - xf, entityplayer2.posY + this.yCoord - yf, entityplayer2.posZ + this.zCoord - zf, entityplayer2); // entityplayer2.worldObj = worldF; -// entityplayer2.setPositionAndUpdate(entityplayer2.posX + pos.getX() - xf, entityplayer2.posY + pos.getY() - yf, entityplayer2.posZ + pos.getZ() - zf); +// entityplayer2.setPositionAndUpdate(entityplayer2.posX + this.xCoord - xf, entityplayer2.posY + this.yCoord - yf, entityplayer2.posZ + this.zCoord - zf); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEChemistrySet.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java similarity index 88% rename from src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEChemistrySet.java rename to src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java index 502c3f75..101950d1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEChemistrySet.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java @@ -5,8 +5,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.gui.IUpdatePlayerListBox; -import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler; @@ -23,7 +22,7 @@ import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst; import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpdatePlayerListBox +public class TEWritingTable extends TEInventory implements ISidedInventory { public static final int sizeInv = 7; @@ -32,7 +31,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd private int accelerationTime; - public TEChemistrySet() + public TEWritingTable() { super(sizeInv); } @@ -60,7 +59,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd } @Override - public String getName() + public String getInventoryName() { return "aw.TEWritingTable"; } @@ -180,7 +179,13 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd public boolean containsCombinationCatalyst() { - return getCombinationCatalystPosition() != -1; + if (getCombinationCatalystPosition() != -1) + { + return true; + } else + { + return false; + } } public int getCombinationCatalystPosition() @@ -293,7 +298,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd } @Override - public void update() + public void updateEntity() { int progressNeeded = 100; long worldTime = worldObj.getWorldTime(); @@ -317,7 +322,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (progress >= progressNeeded) @@ -332,7 +337,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -348,7 +353,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -369,7 +374,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } @@ -381,7 +386,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (progress >= progressNeeded) @@ -396,7 +401,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -412,7 +417,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -424,7 +429,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd this.setInventorySlotContents(6, flaskStack); } else { - worldObj.createExplosion(null, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 2, false); + worldObj.createExplosion(null, xCoord + 0.5, yCoord + 1, zCoord + 0.5, 2, false); } this.decrStackSize(this.getPotionFlaskPosition(), 1); @@ -434,7 +439,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } @@ -447,7 +452,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (progress >= progressNeeded) @@ -461,7 +466,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -474,7 +479,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } @@ -486,7 +491,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (progress >= progressNeeded) @@ -500,7 +505,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -515,7 +520,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } @@ -528,7 +533,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (progress >= progressNeeded) @@ -542,7 +547,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } return; @@ -559,7 +564,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } @@ -579,7 +584,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } @@ -594,7 +599,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } progress += acceleration; @@ -615,14 +620,14 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } else if (getStackInSlot(6).getItem() == getResultingItemStack().getItem() && getResultingItemStack().stackSize <= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize)) { if (worldTime % 4 == 0) { - SpellHelper.sendIndexedParticleToAllAround(worldObj, pos, 20, worldObj.provider.getDimensionId(), 1, pos); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); } if (!SoulNetworkHandler.syphonFromNetworkWhileInContainer(getStackInSlot(0), amountUsed * acceleration)) @@ -650,7 +655,7 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd if (worldObj != null) { - worldObj.markBlockForUpdate(pos); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } @@ -732,25 +737,26 @@ public class TEChemistrySet extends TEInventory implements ISidedInventory, IUpd } @Override - public int[] getSlotsForFace(EnumFacing facing) + public int[] getAccessibleSlotsFromSide(int side) { - switch(facing) + ForgeDirection dir = ForgeDirection.getOrientation(side); + switch(dir) { - case DOWN: - return new int[]{6}; - default: - return new int[]{0, 1, 2, 3, 4, 5}; + case DOWN: + return new int[]{6}; + default: + return new int[]{0, 1, 2, 3, 4, 5}; } } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing facing) + public boolean canInsertItem(int slot, ItemStack stack, int side) { return slot != 6; } @Override - public boolean canExtractItem(int slot, ItemStack stack, EnumFacing facing) + public boolean canExtractItem(int slot, ItemStack stack, int side) { return slot == 6; } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java index 23bc01cc..647f43e7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java @@ -1,7 +1,7 @@ package WayofTime.alchemicalWizardry.common.tileEntity.container; import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -10,9 +10,9 @@ import net.minecraft.item.ItemStack; public class ContainerWritingTable extends Container { - protected TEChemistrySet tileEntity; + protected TEWritingTable tileEntity; - public ContainerWritingTable(InventoryPlayer inventoryPlayer, TEChemistrySet te) + public ContainerWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable te) { tileEntity = te; addSlotToContainer(new Slot(tileEntity, 0, 152, 110)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java index 8245881e..135de81b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java @@ -2,16 +2,15 @@ package WayofTime.alchemicalWizardry.common.tileEntity.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.common.network.IGuiHandler; import WayofTime.alchemicalWizardry.common.items.sigil.holding.ContainerHolding; import WayofTime.alchemicalWizardry.common.items.sigil.holding.GuiHolding; import WayofTime.alchemicalWizardry.common.items.sigil.holding.InventoryHolding; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; -import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer; import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable; +import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { @@ -20,20 +19,19 @@ public class GuiHandler implements IGuiHandler public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity; - BlockPos pos = new BlockPos(x, y, z); switch (id) { case 0: - tileEntity = world.getTileEntity(pos); + tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof TEChemistrySet) + if (tileEntity instanceof TEWritingTable) { - return new ContainerWritingTable(player.inventory, (TEChemistrySet) tileEntity); + return new ContainerWritingTable(player.inventory, (TEWritingTable) tileEntity); } case 1: - tileEntity = world.getTileEntity(pos); + tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof TETeleposer) { @@ -52,22 +50,21 @@ public class GuiHandler implements IGuiHandler public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity; - BlockPos pos = new BlockPos(x, y, z); - + switch (id) { case 0: - tileEntity = world.getTileEntity(pos); + tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof TEChemistrySet) + if (tileEntity instanceof TEWritingTable) { - return new GuiChemistrySet(player.inventory, (TEChemistrySet) tileEntity); + return new GuiWritingTable(player.inventory, (TEWritingTable) tileEntity); } break; case 1: - tileEntity = world.getTileEntity(pos); + tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof TETeleposer) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiChemistrySet.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java similarity index 87% rename from src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiChemistrySet.java rename to src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java index e1a05602..a0c1baba 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiChemistrySet.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java @@ -7,12 +7,12 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable; -public class GuiChemistrySet extends GuiContainer +public class GuiWritingTable extends GuiContainer { - public GuiChemistrySet(InventoryPlayer inventoryPlayer, TEChemistrySet tileEntity) + public GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity) { super(new ContainerWritingTable(inventoryPlayer, tileEntity)); xSize = 176; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Alchemy.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Alchemy.java index 1cf2a2a3..68ae82e1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Alchemy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Alchemy.java @@ -1,126 +1,131 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStacks; -//import net.minecraft.item.ItemStack; -//import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe; -//import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -// -///** -// * MineTweaker3 Alchemy Recipe Handler by joshie * -// */ -//@ZenClass("mods.bloodmagic.Alchemy") -//public class Alchemy -//{ -// @ZenMethod -// public static void addRecipe(IItemStack output, IItemStack[] input, int tier, int lp) { -// MineTweakerAPI.apply(new Add(new AlchemyRecipe(toStack(output), (int) (((double) lp) / 100), toStacks(input), tier))); -// } -// -// private static class Add implements IUndoableAction -// { -// private final AlchemyRecipe recipe; -// -// public Add(AlchemyRecipe recipe) -// { -// this.recipe = recipe; -// } -// -// @Override -// public void apply() -// { -// AlchemyRecipeRegistry.recipes.add(recipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return AlchemyRecipeRegistry.recipes != null; -// } -// -// @Override -// public void undo() -// { -// AlchemyRecipeRegistry.recipes.remove(recipe); -// } -// -// @Override -// public String describe() -// { -// return "Adding Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Removing Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -// -// @ZenMethod -// public static void removeRecipe(IItemStack output) { -// MineTweakerAPI.apply(new Remove(toStack(output))); -// } -// -// private static class Remove implements IUndoableAction -// { -// private final ItemStack output; -// private AlchemyRecipe recipe; -// -// public Remove(ItemStack output) -// { -// this.output = output; -// } -// -// @Override -// public void apply() -// { -// for (AlchemyRecipe r : AlchemyRecipeRegistry.recipes) -// { -// if (r.getResult() != null && r.getResult().isItemEqual(output)) -// { -// recipe = r; -// break; -// } -// } -// -// AlchemyRecipeRegistry.recipes.remove(recipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return AlchemyRecipeRegistry.recipes != null && recipe != null; -// } -// -// @Override -// public void undo() -// { -// AlchemyRecipeRegistry.recipes.add(recipe); -// } -// -// @Override -// public String describe() -// { -// return "Removing Alchemy Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Restoring Alchemy Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStacks; +import minetweaker.IUndoableAction; +import minetweaker.MineTweakerAPI; +import minetweaker.api.item.IItemStack; +import net.minecraft.item.ItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; + +/** + * MineTweaker3 Alchemy Recipe Handler by joshie * + */ +@ZenClass("mods.bloodmagic.Alchemy") +public class Alchemy +{ + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack[] input, int tier, int lp) { + MineTweakerAPI.apply(new Add(new AlchemyRecipe(toStack(output), (int) (((double) lp) / 100), toStacks(input), tier))); + } + + private static class Add implements IUndoableAction + { + private final AlchemyRecipe recipe; + + public Add(AlchemyRecipe recipe) + { + this.recipe = recipe; + } + + @Override + public void apply() + { + AlchemyRecipeRegistry.recipes.add(recipe); + } + + @Override + public boolean canUndo() + { + return AlchemyRecipeRegistry.recipes != null; + } + + @Override + public void undo() + { + AlchemyRecipeRegistry.recipes.remove(recipe); + } + + @Override + public String describe() + { + return "Adding Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Removing Alchemy Recipe for " + ((AlchemyRecipe) recipe).getResult().getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } + + @ZenMethod + public static void removeRecipe(IItemStack output) { + MineTweakerAPI.apply(new Remove(toStack(output))); + } + + private static class Remove implements IUndoableAction + { + private final ItemStack output; + private AlchemyRecipe recipe; + + public Remove(ItemStack output) + { + this.output = output; + } + + @Override + public void apply() + { + for (AlchemyRecipe r : AlchemyRecipeRegistry.recipes) + { + if (r.getResult() != null && r.getResult().isItemEqual(output)) + { + recipe = r; + break; + } + } + + AlchemyRecipeRegistry.recipes.remove(recipe); + } + + @Override + public boolean canUndo() + { + return AlchemyRecipeRegistry.recipes != null && recipe != null; + } + + @Override + public void undo() + { + AlchemyRecipeRegistry.recipes.add(recipe); + } + + @Override + public String describe() + { + return "Removing Alchemy Recipe for " + output.getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Restoring Alchemy Recipe for " + output.getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Binding.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Binding.java index 01384dc6..5f5eac4f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Binding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/Binding.java @@ -1,130 +1,130 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; -//import minetweaker.IUndoableAction; -//import minetweaker.MineTweakerAPI; -//import minetweaker.api.item.IItemStack; -//import net.minecraft.item.ItemStack; -//import stanhebben.zenscript.annotations.ZenClass; -//import stanhebben.zenscript.annotations.ZenMethod; -//import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe; -//import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; -// -///** -// * MineTweaker3 Binding Recipe Handler by joshie * -// */ -//@ZenClass("mods.bloodmagic.Binding") -//public class Binding -//{ -// @ZenMethod -// public static void addRecipe(IItemStack input, IItemStack output) { -// MineTweakerAPI.apply(new Add(new BindingRecipe(toStack(output), toStack(input)))); -// } -// -// private static class Add implements IUndoableAction -// { -// private final BindingRecipe recipe; -// -// public Add(BindingRecipe recipe) -// { -// this.recipe = recipe; -// } -// -// @Override -// public void apply() -// { -// BindingRegistry.bindingRecipes.add(recipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return BindingRegistry.bindingRecipes != null; -// } -// -// @Override -// public void undo() -// { -// BindingRegistry.bindingRecipes.remove(recipe); -// } -// -// @Override -// public String describe() -// { -// return "Adding Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Removing Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -// -// @ZenMethod -// public static void removeRecipe(IItemStack output) { -// MineTweakerAPI.apply(new Remove(toStack(output))); -// } -// -// private static class Remove implements IUndoableAction -// { -// private final ItemStack output; -// private BindingRecipe recipe; -// -// public Remove(ItemStack output) -// { -// this.output = output; -// } -// -// @Override -// public void apply() -// { -// for (BindingRecipe r : BindingRegistry.bindingRecipes) -// { -// if (r.getResult() != null && r.getResult().isItemEqual(output)) -// { -// recipe = r; -// break; -// } -// } -// -// BindingRegistry.bindingRecipes.remove(recipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return BindingRegistry.bindingRecipes != null && recipe != null; -// } -// -// @Override -// public void undo() -// { -// BindingRegistry.bindingRecipes.add(recipe); -// } -// -// @Override -// public String describe() -// { -// return "Removing Binding Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Restoring Binding Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; +import minetweaker.IUndoableAction; +import minetweaker.MineTweakerAPI; +import minetweaker.api.item.IItemStack; +import net.minecraft.item.ItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; +import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe; +import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; + +/** + * MineTweaker3 Binding Recipe Handler by joshie * + */ +@ZenClass("mods.bloodmagic.Binding") +public class Binding +{ + @ZenMethod + public static void addRecipe(IItemStack input, IItemStack output) { + MineTweakerAPI.apply(new Add(new BindingRecipe(toStack(output), toStack(input)))); + } + + private static class Add implements IUndoableAction + { + private final BindingRecipe recipe; + + public Add(BindingRecipe recipe) + { + this.recipe = recipe; + } + + @Override + public void apply() + { + BindingRegistry.bindingRecipes.add(recipe); + } + + @Override + public boolean canUndo() + { + return BindingRegistry.bindingRecipes != null; + } + + @Override + public void undo() + { + BindingRegistry.bindingRecipes.remove(recipe); + } + + @Override + public String describe() + { + return "Adding Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Removing Binding Recipe for " + ((BindingRecipe) recipe).getResult().getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } + + @ZenMethod + public static void removeRecipe(IItemStack output) { + MineTweakerAPI.apply(new Remove(toStack(output))); + } + + private static class Remove implements IUndoableAction + { + private final ItemStack output; + private BindingRecipe recipe; + + public Remove(ItemStack output) + { + this.output = output; + } + + @Override + public void apply() + { + for (BindingRecipe r : BindingRegistry.bindingRecipes) + { + if (r.getResult() != null && r.getResult().isItemEqual(output)) + { + recipe = r; + break; + } + } + + BindingRegistry.bindingRecipes.remove(recipe); + } + + @Override + public boolean canUndo() + { + return BindingRegistry.bindingRecipes != null && recipe != null; + } + + @Override + public void undo() + { + BindingRegistry.bindingRecipes.add(recipe); + } + + @Override + public String describe() + { + return "Removing Binding Recipe for " + output.getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Restoring Binding Recipe for " + output.getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodAltar.java index 9ca40713..e1b7d3f7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodAltar.java @@ -1,133 +1,133 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; -//import minetweaker.IUndoableAction; -//import minetweaker.MineTweakerAPI; -//import minetweaker.api.item.IItemStack; -//import net.minecraft.item.ItemStack; -//import stanhebben.zenscript.annotations.Optional; -//import stanhebben.zenscript.annotations.ZenClass; -//import stanhebben.zenscript.annotations.ZenMethod; -//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; -//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; -// -///** -// * MineTweaker3 Blood Altar Recipe Handler by joshie * -// */ -//@ZenClass("mods.bloodmagic.Altar") -//public class BloodAltar -//{ -// @ZenMethod -// public static void addRecipe(IItemStack output, IItemStack input, int tier, int lp, @Optional int consume, @Optional int drain) { -// consume = consume > 0 ? consume : 20; -// drain = drain > 0 ? drain : 20; -// MineTweakerAPI.apply(new Add(new AltarRecipe(toStack(output), toStack(input), tier, lp, consume, drain, false))); -// } -// -// private static class Add implements IUndoableAction -// { -// private final AltarRecipe recipe; -// -// public Add(AltarRecipe recipe) -// { -// this.recipe = recipe; -// } -// -// @Override -// public void apply() -// { -// AltarRecipeRegistry.altarRecipes.add(recipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return AltarRecipeRegistry.altarRecipes != null; -// } -// -// @Override -// public void undo() -// { -// AltarRecipeRegistry.altarRecipes.remove(recipe); -// } -// -// @Override -// public String describe() -// { -// return "Adding Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Removing Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -// -// @ZenMethod -// public static void removeRecipe(IItemStack output) { -// MineTweakerAPI.apply(new Remove(toStack(output))); -// } -// -// private static class Remove implements IUndoableAction -// { -// private final ItemStack output; -// private AltarRecipe recipe; -// -// public Remove(ItemStack output) -// { -// this.output = output; -// } -// -// @Override -// public void apply() -// { -// for (AltarRecipe r : AltarRecipeRegistry.altarRecipes) -// { -// if (r.getResult() != null && r.getResult().isItemEqual(output)) -// { -// recipe = r; -// break; -// } -// } -// -// AltarRecipeRegistry.altarRecipes.remove(recipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return AltarRecipeRegistry.altarRecipes != null && recipe != null; -// } -// -// @Override -// public void undo() -// { -// AltarRecipeRegistry.altarRecipes.add(recipe); -// } -// -// @Override -// public String describe() -// { -// return "Removing Blood Altar Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Restoring Blood Altar Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; +import minetweaker.IUndoableAction; +import minetweaker.MineTweakerAPI; +import minetweaker.api.item.IItemStack; +import net.minecraft.item.ItemStack; +import stanhebben.zenscript.annotations.Optional; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; + +/** + * MineTweaker3 Blood Altar Recipe Handler by joshie * + */ +@ZenClass("mods.bloodmagic.Altar") +public class BloodAltar +{ + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack input, int tier, int lp, @Optional int consume, @Optional int drain) { + consume = consume > 0 ? consume : 20; + drain = drain > 0 ? drain : 20; + MineTweakerAPI.apply(new Add(new AltarRecipe(toStack(output), toStack(input), tier, lp, consume, drain, false))); + } + + private static class Add implements IUndoableAction + { + private final AltarRecipe recipe; + + public Add(AltarRecipe recipe) + { + this.recipe = recipe; + } + + @Override + public void apply() + { + AltarRecipeRegistry.altarRecipes.add(recipe); + } + + @Override + public boolean canUndo() + { + return AltarRecipeRegistry.altarRecipes != null; + } + + @Override + public void undo() + { + AltarRecipeRegistry.altarRecipes.remove(recipe); + } + + @Override + public String describe() + { + return "Adding Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Removing Blood Altar Recipe for " + ((AltarRecipe) recipe).getResult().getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } + + @ZenMethod + public static void removeRecipe(IItemStack output) { + MineTweakerAPI.apply(new Remove(toStack(output))); + } + + private static class Remove implements IUndoableAction + { + private final ItemStack output; + private AltarRecipe recipe; + + public Remove(ItemStack output) + { + this.output = output; + } + + @Override + public void apply() + { + for (AltarRecipe r : AltarRecipeRegistry.altarRecipes) + { + if (r.getResult() != null && r.getResult().isItemEqual(output)) + { + recipe = r; + break; + } + } + + AltarRecipeRegistry.altarRecipes.remove(recipe); + } + + @Override + public boolean canUndo() + { + return AltarRecipeRegistry.altarRecipes != null && recipe != null; + } + + @Override + public void undo() + { + AltarRecipeRegistry.altarRecipes.add(recipe); + } + + @Override + public String describe() + { + return "Removing Blood Altar Recipe for " + output.getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Restoring Blood Altar Recipe for " + output.getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodOrb.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodOrb.java index b3af37db..3997fd74 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodOrb.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/BloodOrb.java @@ -1,147 +1,147 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toObjects; -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toShapedObjects; -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; -// -//import java.util.List; -// -//import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; -//import minetweaker.IUndoableAction; -//import minetweaker.MineTweakerAPI; -//import minetweaker.api.item.IIngredient; -//import minetweaker.api.item.IItemStack; -//import net.minecraft.item.ItemStack; -//import net.minecraft.item.crafting.CraftingManager; -//import net.minecraft.item.crafting.IRecipe; -//import stanhebben.zenscript.annotations.ZenClass; -//import stanhebben.zenscript.annotations.ZenMethod; -//import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; -// -///** -// * MineTweaker3 Blood Orb Recipe Handler by joshie * -// */ -//@ZenClass("mods.bloodmagic.BloodOrb") -//public class BloodOrb -//{ -// @ZenMethod -// public static void addShaped(IItemStack output, IIngredient[][] ingredients) -// { -// MineTweakerAPI.apply(new Add(false, toStack(output), toShapedObjects(ingredients))); -// } -// -// @ZenMethod -// public static void addShapeless(IItemStack output, IIngredient[] ingredients) -// { -// MineTweakerAPI.apply(new Add(true, toStack(output), toObjects(ingredients))); -// } -// -// private static class Add implements IUndoableAction { -// private IRecipe iRecipe; -// private final boolean isShapeless; -// private final ItemStack output; -// private final Object[] recipe; -// -// public Add(boolean isShapeless, ItemStack output, Object... recipe) -// { -// this.isShapeless = isShapeless; -// this.output = output; -// this.recipe = recipe; -// } -// -// @Override -// public void apply() -// { -// if (isShapeless) iRecipe = new ShapelessBloodOrbRecipe(output, recipe); -// else iRecipe = new ShapedBloodOrbRecipe(output, recipe); -// CraftingManager.getInstance().getRecipeList().add(iRecipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return CraftingManager.getInstance().getRecipeList() != null; -// } -// -// @Override -// public void undo() -// { -// CraftingManager.getInstance().getRecipeList().remove(iRecipe); -// } -// -// @Override -// public String describe() { -// return "Adding Blood Orb Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Removing Blood Orb Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -// -// @ZenMethod -// public static void removeRecipe(IItemStack output) { -// MineTweakerAPI.apply(new Remove(toStack(output))); -// } -// -// private static class Remove implements IUndoableAction { -// private final ItemStack output; -// private IRecipe iRecipe; -// -// public Remove(ItemStack output) -// { -// this.output = output; -// } -// -// @Override -// public void apply() -// { -// for (IRecipe r : (List) CraftingManager.getInstance().getRecipeList()) -// { -// if((r instanceof ShapedBloodOrbRecipe || r instanceof ShapelessBloodOrbRecipe) && r.getRecipeOutput() != null && r.getRecipeOutput().isItemEqual(output)) { -// iRecipe = r; -// break; -// } -// } -// -// CraftingManager.getInstance().getRecipeList().remove(iRecipe); -// } -// -// @Override -// public boolean canUndo() -// { -// return CraftingManager.getInstance().getRecipeList() != null && iRecipe != null; -// } -// -// @Override -// public void undo() -// { -// CraftingManager.getInstance().getRecipeList().add(iRecipe); -// } -// -// @Override -// public String describe() { -// return "Removing Blood Orb Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Restoring Blood Orb Recipe for " + output.getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toObjects; +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toShapedObjects; +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; + +import java.util.List; + +import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; +import minetweaker.IUndoableAction; +import minetweaker.MineTweakerAPI; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; +import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; + +/** + * MineTweaker3 Blood Orb Recipe Handler by joshie * + */ +@ZenClass("mods.bloodmagic.BloodOrb") +public class BloodOrb +{ + @ZenMethod + public static void addShaped(IItemStack output, IIngredient[][] ingredients) + { + MineTweakerAPI.apply(new Add(false, toStack(output), toShapedObjects(ingredients))); + } + + @ZenMethod + public static void addShapeless(IItemStack output, IIngredient[] ingredients) + { + MineTweakerAPI.apply(new Add(true, toStack(output), toObjects(ingredients))); + } + + private static class Add implements IUndoableAction { + private IRecipe iRecipe; + private final boolean isShapeless; + private final ItemStack output; + private final Object[] recipe; + + public Add(boolean isShapeless, ItemStack output, Object... recipe) + { + this.isShapeless = isShapeless; + this.output = output; + this.recipe = recipe; + } + + @Override + public void apply() + { + if (isShapeless) iRecipe = new ShapelessBloodOrbRecipe(output, recipe); + else iRecipe = new ShapedBloodOrbRecipe(output, recipe); + CraftingManager.getInstance().getRecipeList().add(iRecipe); + } + + @Override + public boolean canUndo() + { + return CraftingManager.getInstance().getRecipeList() != null; + } + + @Override + public void undo() + { + CraftingManager.getInstance().getRecipeList().remove(iRecipe); + } + + @Override + public String describe() { + return "Adding Blood Orb Recipe for " + output.getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Removing Blood Orb Recipe for " + output.getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } + + @ZenMethod + public static void removeRecipe(IItemStack output) { + MineTweakerAPI.apply(new Remove(toStack(output))); + } + + private static class Remove implements IUndoableAction { + private final ItemStack output; + private IRecipe iRecipe; + + public Remove(ItemStack output) + { + this.output = output; + } + + @Override + public void apply() + { + for (IRecipe r : (List) CraftingManager.getInstance().getRecipeList()) + { + if((r instanceof ShapedBloodOrbRecipe || r instanceof ShapelessBloodOrbRecipe) && r.getRecipeOutput() != null && r.getRecipeOutput().isItemEqual(output)) { + iRecipe = r; + break; + } + } + + CraftingManager.getInstance().getRecipeList().remove(iRecipe); + } + + @Override + public boolean canUndo() + { + return CraftingManager.getInstance().getRecipeList() != null && iRecipe != null; + } + + @Override + public void undo() + { + CraftingManager.getInstance().getRecipeList().add(iRecipe); + } + + @Override + public String describe() { + return "Removing Blood Orb Recipe for " + output.getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Restoring Blood Orb Recipe for " + output.getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/FallingTower.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/FallingTower.java index 68a52b6a..84263c3e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/FallingTower.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/FallingTower.java @@ -1,139 +1,139 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; -//import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; -//import minetweaker.IUndoableAction; -//import minetweaker.MineTweakerAPI; -//import minetweaker.api.item.IItemStack; -//import net.minecraft.item.ItemStack; -//import net.minecraftforge.oredict.OreDictionary; -//import stanhebben.zenscript.annotations.ZenClass; -//import stanhebben.zenscript.annotations.ZenMethod; -// -//import java.util.Iterator; -// -//import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; -// -///** -// * MineTweaker3 Falling Tower Paradigm Handler by hilburn * -// */ -//@ZenClass("mods.bloodmagic.FallingTower") -//public class FallingTower -//{ -// @ZenMethod -// public static void addFocus(IItemStack stack, int radius, String[] components) -// { -// MineTweakerAPI.apply(new Add(toStack(stack),radius, components)); -// } -// -// @ZenMethod -// public static void addFocus(IItemStack stack, int radius, String components) -// { -// MineTweakerAPI.apply(new Add(toStack(stack),radius, components.split("\\s*,\\s*"))); -// } -// -// @ZenMethod -// public static void removeFocus(IItemStack output) { -// MineTweakerAPI.apply(new Remove(toStack(output))); -// } -// -// private static class Add implements IUndoableAction -// { -// private MeteorParadigm paradigm; -// -// public Add(ItemStack stack, int radius, String[] components) -// { -// paradigm = new MeteorParadigm(stack,radius); -// paradigm.parseStringArray(components); -// } -// -// @Override -// public void apply() -// { -// MeteorRegistry.registerMeteorParadigm(paradigm); -// } -// -// @Override -// public boolean canUndo() -// { -// return MeteorRegistry.paradigmList!= null; -// } -// -// @Override -// public void undo() -// { -// MeteorRegistry.paradigmList.remove(paradigm); -// } -// -// @Override -// public String describe() { -// return "Adding Falling Tower Focus for " + paradigm.focusStack.getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Removing Falling Tower Focus for " + paradigm.focusStack.getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -// -// private static class Remove implements IUndoableAction { -// private final ItemStack focus; -// private MeteorParadigm paradigm; -// -// public Remove(ItemStack focus) -// { -// this.focus = focus; -// } -// -// @Override -// public void apply() -// { -// for (Iterator itr = MeteorRegistry.paradigmList.iterator(); itr.hasNext();) -// { -// MeteorParadigm paradigm = itr.next(); -// if (OreDictionary.itemMatches(paradigm.focusStack,focus,false)) -// { -// this.paradigm = paradigm; -// itr.remove(); -// break; -// } -// } -// } -// -// @Override -// public boolean canUndo() -// { -// return MeteorRegistry.paradigmList!= null && paradigm != null; -// } -// -// @Override -// public void undo() -// { -// MeteorRegistry.paradigmList.add(paradigm); -// } -// -// @Override -// public String describe() { -// return "Removing Falling Tower Focus for " + focus.getDisplayName(); -// } -// -// @Override -// public String describeUndo() -// { -// return "Restoring Falling Tower Focus for " + focus.getDisplayName(); -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; +import minetweaker.IUndoableAction; +import minetweaker.MineTweakerAPI; +import minetweaker.api.item.IItemStack; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import java.util.Iterator; + +import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack; + +/** + * MineTweaker3 Falling Tower Paradigm Handler by hilburn * + */ +@ZenClass("mods.bloodmagic.FallingTower") +public class FallingTower +{ + @ZenMethod + public static void addFocus(IItemStack stack, int radius, String[] components) + { + MineTweakerAPI.apply(new Add(toStack(stack),radius, components)); + } + + @ZenMethod + public static void addFocus(IItemStack stack, int radius, String components) + { + MineTweakerAPI.apply(new Add(toStack(stack),radius, components.split("\\s*,\\s*"))); + } + + @ZenMethod + public static void removeFocus(IItemStack output) { + MineTweakerAPI.apply(new Remove(toStack(output))); + } + + private static class Add implements IUndoableAction + { + private MeteorParadigm paradigm; + + public Add(ItemStack stack, int radius, String[] components) + { + paradigm = new MeteorParadigm(stack,radius); + paradigm.parseStringArray(components); + } + + @Override + public void apply() + { + MeteorRegistry.registerMeteorParadigm(paradigm); + } + + @Override + public boolean canUndo() + { + return MeteorRegistry.paradigmList!= null; + } + + @Override + public void undo() + { + MeteorRegistry.paradigmList.remove(paradigm); + } + + @Override + public String describe() { + return "Adding Falling Tower Focus for " + paradigm.focusStack.getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Removing Falling Tower Focus for " + paradigm.focusStack.getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } + + private static class Remove implements IUndoableAction { + private final ItemStack focus; + private MeteorParadigm paradigm; + + public Remove(ItemStack focus) + { + this.focus = focus; + } + + @Override + public void apply() + { + for (Iterator itr = MeteorRegistry.paradigmList.iterator(); itr.hasNext();) + { + MeteorParadigm paradigm = itr.next(); + if (OreDictionary.itemMatches(paradigm.focusStack,focus,false)) + { + this.paradigm = paradigm; + itr.remove(); + break; + } + } + } + + @Override + public boolean canUndo() + { + return MeteorRegistry.paradigmList!= null && paradigm != null; + } + + @Override + public void undo() + { + MeteorRegistry.paradigmList.add(paradigm); + } + + @Override + public String describe() { + return "Removing Falling Tower Focus for " + focus.getDisplayName(); + } + + @Override + public String describeUndo() + { + return "Restoring Falling Tower Focus for " + focus.getDisplayName(); + } + + @Override + public Object getOverrideKey() + { + return null; + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/HarvestMoon.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/HarvestMoon.java index 222f8acf..7dc4d07b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/HarvestMoon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/HarvestMoon.java @@ -1,90 +1,90 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; -//import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; -//import WayofTime.alchemicalWizardry.common.harvest.GenericItemStackHarvestHandler; -//import minetweaker.IUndoableAction; -//import minetweaker.MineTweakerAPI; -//import minetweaker.api.item.IItemStack; -//import net.minecraft.block.Block; -//import net.minecraft.init.Blocks; -//import net.minecraft.item.ItemStack; -//import net.minecraftforge.common.IPlantable; -//import stanhebben.zenscript.annotations.ZenClass; -//import stanhebben.zenscript.annotations.ZenMethod; -// -///** -// * MineTweaker3 Harvest Moon Handler by hilburn * -// */ -//@ZenClass("mods.bloodmagic.HarvestMoon") -//public class HarvestMoon -//{ -// -// @ZenMethod -// public static void addHarvestable(IItemStack block, IItemStack seed) -// { -// addHarvestable(block,block.getDamage(),seed); -// } -// -// @ZenMethod -// public static void addHarvestable(IItemStack block, int meta, IItemStack seed) -// { -// ItemStack seedStack = MTHelper.toStack(seed); -// Block plantBlock = Block.getBlockFromItem(MTHelper.toStack(block).getItem()); -// if (!(plantBlock==null || plantBlock== Blocks.air || seedStack==null || !(seedStack.getItem() instanceof IPlantable))) -// { -// MineTweakerAPI.apply(new Add(plantBlock, meta, seedStack)); -// } -// else -// { -// throw new IllegalArgumentException("Invalid Harvest Block or Seed"); -// } -// } -// -// private static class Add implements IUndoableAction -// { -// private IHarvestHandler handler; -// private String name; -// -// public Add(Block block, int meta, ItemStack seed) -// { -// handler = new GenericItemStackHarvestHandler(block,meta,seed); -// name = seed.getDisplayName(); -// } -// -// @Override -// public void apply() -// { -// HarvestRegistry.registerHarvestHandler(handler); -// } -// -// @Override -// public boolean canUndo() -// { -// return HarvestRegistry.handlerList!=null; -// } -// -// @Override -// public void undo() -// { -// HarvestRegistry.handlerList.remove(handler); -// } -// -// @Override -// public String describe() { -// return "Adding Harvest Moon Support for " + name; -// } -// -// @Override -// public String describeUndo() -// { -// return "Removing Harvest Moon Support for " + name; -// } -// -// @Override -// public Object getOverrideKey() -// { -// return null; -// } -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; +import WayofTime.alchemicalWizardry.common.harvest.GenericItemStackHarvestHandler; +import minetweaker.IUndoableAction; +import minetweaker.MineTweakerAPI; +import minetweaker.api.item.IItemStack; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.IPlantable; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +/** + * MineTweaker3 Harvest Moon Handler by hilburn * + */ +@ZenClass("mods.bloodmagic.HarvestMoon") +public class HarvestMoon +{ + + @ZenMethod + public static void addHarvestable(IItemStack block, IItemStack seed) + { + addHarvestable(block,block.getDamage(),seed); + } + + @ZenMethod + public static void addHarvestable(IItemStack block, int meta, IItemStack seed) + { + ItemStack seedStack = MTHelper.toStack(seed); + Block plantBlock = Block.getBlockFromItem(MTHelper.toStack(block).getItem()); + if (!(plantBlock==null || plantBlock== Blocks.air || seedStack==null || !(seedStack.getItem() instanceof IPlantable))) + { + MineTweakerAPI.apply(new Add(plantBlock, meta, seedStack)); + } + else + { + throw new IllegalArgumentException("Invalid Harvest Block or Seed"); + } + } + + private static class Add implements IUndoableAction + { + private IHarvestHandler handler; + private String name; + + public Add(Block block, int meta, ItemStack seed) + { + handler = new GenericItemStackHarvestHandler(block,meta,seed); + name = seed.getDisplayName(); + } + + @Override + public void apply() + { + HarvestRegistry.registerHarvestHandler(handler); + } + + @Override + public boolean canUndo() + { + return HarvestRegistry.handlerList!=null; + } + + @Override + public void undo() + { + HarvestRegistry.handlerList.remove(handler); + } + + @Override + public String describe() { + return "Adding Harvest Moon Support for " + name; + } + + @Override + public String describeUndo() + { + return "Removing Harvest Moon Support for " + name; + } + + @Override + public Object getOverrideKey() + { + return null; + } + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MTHelper.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MTHelper.java index d16df05e..019bc5f3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MTHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MTHelper.java @@ -1,82 +1,82 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import static minetweaker.api.minecraft.MineTweakerMC.getItemStack; -// -//import java.util.ArrayList; -// -//import minetweaker.api.item.IIngredient; -//import minetweaker.api.item.IItemStack; -//import minetweaker.api.oredict.IOreDictEntry; -//import net.minecraft.item.ItemStack; -// -///** -// * MineTweaker3 Helper by joshie * -// */ -//public class MTHelper { -// public static ItemStack toStack(IItemStack iStack) { -// return getItemStack(iStack); -// } -// -// public static ItemStack[] toStacks(IItemStack[] iStack) { -// if (iStack == null) return null; -// else { -// ItemStack[] output = new ItemStack[iStack.length]; -// for (int i = 0; i < iStack.length; i++) { -// output[i] = toStack(iStack[i]); -// } -// -// return output; -// } -// } -// -// public static Object toObject(IIngredient iStack) { -// if (iStack == null) return null; -// else { -// if (iStack instanceof IOreDictEntry) { -// return toString((IOreDictEntry) iStack); -// } else if (iStack instanceof IItemStack) { -// return getItemStack((IItemStack) iStack); -// } else return null; -// } -// } -// -// public static Object[] toObjects(IIngredient[] ingredient) { -// if (ingredient == null) return null; -// else { -// Object[] output = new Object[ingredient.length]; -// for (int i = 0; i < ingredient.length; i++) { -// if (ingredient[i] != null) { -// output[i] = toObject(ingredient[i]); -// } else output[i] = ""; -// } -// -// return output; -// } -// } -// -// public static Object[] toShapedObjects(IIngredient[][] ingredients) { -// if (ingredients == null) return null; -// else { -// ArrayList prep = new ArrayList(); -// prep.add("abc"); -// prep.add("def"); -// prep.add("ghi"); -// char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } }; -// for (int x = 0; x < ingredients.length; x++) { -// if (ingredients[x] != null) { -// for (int y = 0; y < ingredients[x].length; y++) { -// if (ingredients[x][y] != null && x < map.length && y < map[x].length) { -// prep.add(map[x][y]); -// prep.add(toObject(ingredients[x][y])); -// } -// } -// } -// } -// return prep.toArray(); -// } -// } -// -// public static String toString(IOreDictEntry entry) { -// return ((IOreDictEntry) entry).getName(); -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import static minetweaker.api.minecraft.MineTweakerMC.getItemStack; + +import java.util.ArrayList; + +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.oredict.IOreDictEntry; +import net.minecraft.item.ItemStack; + +/** + * MineTweaker3 Helper by joshie * + */ +public class MTHelper { + public static ItemStack toStack(IItemStack iStack) { + return getItemStack(iStack); + } + + public static ItemStack[] toStacks(IItemStack[] iStack) { + if (iStack == null) return null; + else { + ItemStack[] output = new ItemStack[iStack.length]; + for (int i = 0; i < iStack.length; i++) { + output[i] = toStack(iStack[i]); + } + + return output; + } + } + + public static Object toObject(IIngredient iStack) { + if (iStack == null) return null; + else { + if (iStack instanceof IOreDictEntry) { + return toString((IOreDictEntry) iStack); + } else if (iStack instanceof IItemStack) { + return getItemStack((IItemStack) iStack); + } else return null; + } + } + + public static Object[] toObjects(IIngredient[] ingredient) { + if (ingredient == null) return null; + else { + Object[] output = new Object[ingredient.length]; + for (int i = 0; i < ingredient.length; i++) { + if (ingredient[i] != null) { + output[i] = toObject(ingredient[i]); + } else output[i] = ""; + } + + return output; + } + } + + public static Object[] toShapedObjects(IIngredient[][] ingredients) { + if (ingredients == null) return null; + else { + ArrayList prep = new ArrayList(); + prep.add("abc"); + prep.add("def"); + prep.add("ghi"); + char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } }; + for (int x = 0; x < ingredients.length; x++) { + if (ingredients[x] != null) { + for (int y = 0; y < ingredients[x].length; y++) { + if (ingredients[x][y] != null && x < map.length && y < map[x].length) { + prep.add(map[x][y]); + prep.add(toObject(ingredients[x][y])); + } + } + } + } + return prep.toArray(); + } + } + + public static String toString(IOreDictEntry entry) { + return ((IOreDictEntry) entry).getName(); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MineTweakerIntegration.java b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MineTweakerIntegration.java index ae6d45ab..e95af3f9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MineTweakerIntegration.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tweaker/MineTweakerIntegration.java @@ -1,19 +1,19 @@ -//package WayofTime.alchemicalWizardry.common.tweaker; -// -//import minetweaker.MineTweakerAPI; -// -///** -// * MineTweaker3 Integration by joshie * -// */ -//public class MineTweakerIntegration -//{ -// public static void register() -// { -// MineTweakerAPI.registerClass(Alchemy.class); -// MineTweakerAPI.registerClass(Binding.class); -// MineTweakerAPI.registerClass(BloodAltar.class); -// MineTweakerAPI.registerClass(BloodOrb.class); -// MineTweakerAPI.registerClass(FallingTower.class); -// MineTweakerAPI.registerClass(HarvestMoon.class); -// } -//} +package WayofTime.alchemicalWizardry.common.tweaker; + +import minetweaker.MineTweakerAPI; + +/** + * MineTweaker3 Integration by joshie * + */ +public class MineTweakerIntegration +{ + public static void register() + { + MineTweakerAPI.registerClass(Alchemy.class); + MineTweakerAPI.registerClass(Binding.class); + MineTweakerAPI.registerClass(BloodAltar.class); + MineTweakerAPI.registerClass(BloodOrb.class); + MineTweakerAPI.registerClass(FallingTower.class); + MineTweakerAPI.registerClass(HarvestMoon.class); + } +} diff --git a/src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json b/src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json deleted file mode 100644 index 75063334..00000000 --- a/src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "forge_marker": 1, - "defaults": { - "textures": { - "all": "alchemicalwizardry:blocks/BlankRune" - }, - "model": "cube_all", - "uvlock": true - }, - "variants": { - "rune": { - 0: { - "textures": { - "all": "alchemicalwizardry:blocks/AltarCapacityRune" - } - }, - 1: { - "textures": { - "all": "alchemicalwizardry:blocks/AltarCapacityRune" - } - }, - 2: { - "textures": { - "all": "alchemicalwizardry:blocks/DislocationRune" - } - }, - 3: { - "textures": { - "all": "alchemicalwizardry:blocks/OrbCapacityRune" - } - }, - 4: { - "textures": { - "all": "alchemicalwizardry:blocks/BetterCapacityRune" - } - }, - 5: { - "textures": { - "all": "alchemicalwizardry:blocks/AccelerationRune" - } - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json b/src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json deleted file mode 100644 index e2dcb2d7..00000000 --- a/src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "variants": { - "normal": { "model": "alchemicalwizardry:soul_armour_forge" } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang index d8485d0e..47e8fca7 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/en_US.lang @@ -1,247 +1,247 @@ #Block Localization -tile.altar.name=Blood Altar -tile.blood_rune.blank.name=Blood Rune -tile.blood_rune.fill.name=Rune of Augmented Capacity -tile.blood_rune.empty.name=Rune of Dislocation -tile.blood_rune.orb.name=Rune of the Orb -tile.blood_rune.betterCapacity.name=Rune of Superior Capacity -tile.blood_rune.acceleration.name=Rune of Acceleration -tile.speed_rune.name=Speed Rune -tile.efficiency_rune.name=Efficiency Rune -tile.sacrifice_rune.name=Rune of Sacrifice -tile.self_sacrifice_rune.name=Rune of Self-Sacrifice -tile.ritual_stone.name=Ritual Stone -tile.master_ritual_stone.name=Master Ritual Stone -tile.filled_socket.name=Filled Socket -tile.imperfect_ritual_stone.name=Imperfect Ritual Stone -tile.soul_armour_forge.name=Soul Armour Forge -tile.empty_socket.name=Empty Socket -tile.bloodstone_brick.name=Bloodstone Brick -tile.large_bloodstone_brick.name=Large Bloodstone Brick -tile.chemistry_set.name=Alchemical Chemistry Set -tile.spell_table.name=Spell Table -tile.pedestal.name=Arcane Pedestal -tile.plinth.name=Arcane Plinth -tile.teleposer.name=Teleposer -tile.spell_conduit.name=Spell Conduit -tile.spell_paradigm.projectile.name=Particle Generator -tile.spell_paradigm.self.name=Self Augmentator -tile.spell_paradigm.melee.name=Melee Aggregator -tile.spell_paradigm.tool.name=Tool Forger -tile.spell_enhancement.power1.name=Unstable Spell Empowerer -tile.spell_enhancement.power2.name=Standard Spell Empowerer -tile.spell_enhancement.power3.name=Reinforced Spell Empowerer -tile.spell_enhancement.power4.name=Imbued Spell Empowerer -tile.spell_enhancement.power5.name=Demonic Spell Empowerer -tile.spell_enhancement.cost1.name=Unstable Spell Dampener -tile.spell_enhancement.cost2.name=Standard Spell Dampener -tile.spell_enhancement.cost3.name=Reinforced Spell Dampener -tile.spell_enhancement.cost4.name=Imbued Spell Dampener -tile.spell_enhancement.cost5.name=Demonic Spell Dampener -tile.spell_enhancement.potency1.name=Unstable Spell Augmentor -tile.spell_enhancement.potency2.name=Standard Spell Augmentor -tile.spell_enhancement.potency3.name=Reinforced Spell Augmentor -tile.spell_enhancement.potency4.name=Imbued Spell Augmentor -tile.spell_enhancement.potency5.name=Demonic Spell Augmentor -tile.spell_modifier.default.name=Default Spell Modifier -tile.spell_modifier.offensive.name=Offensive Spell Modifier -tile.spell_modifier.defensive.name=Defensive Spell Modifier -tile.spell_modifier.environmental.name=Environmental Spell Modifier -tile.spell_effect.fire.name=Crucible of Fire -tile.spell_effect.ice.name=Ice Maker -tile.spell_effect.wind.name=Wind Generator -tile.spell_effect.earth.name=Earth Former -tile.alchemical_calcinator.name=Alchemical Calcinator -tile.crystal_belljar.name=Crystal Belljar -tile.reagent_conduit.name=Alchemy Relay -tile.life_essence.name=Life Essence -tile.crystal_block.fullCrystal.name=Crystal Cluster -tile.crystal_block.crystalBrick.name=Crystal Cluster Brick -tile.demon_portal.name=Demon Portal -tile.demon_chest.name=Demon's Chest -tile.enchantment_glyph.enchantability.name=Glyph of the Adept Enchanter -tile.enchantment_glyph.enchantmentLevel.name=Glyph of Arcane Potential -tile.stability_glyph.stability1.name=Glyph of Rigid Stability -tile.schematic_saver.name=Schematic Saver -tile.mimic_block.name=Mimic Block -tile.spectral_container.name=Spectral Container -tile.blood_light.name=Blood Light -tile.spectral_block.name=Spectral Block -tile.incense_crucible.name=Incense Crucible +tile.bloodAltar.name=Blood Altar +tile.bloodRune.blank.name=Blood Rune +tile.bloodRune.fill.name=Rune of Augmented Capacity +tile.bloodRune.empty.name=Rune of Dislocation +tile.bloodRune.orb.name=Rune of the Orb +tile.bloodRune.betterCapacity.name=Rune of Superior Capacity +tile.bloodRune.acceleration.name=Rune of Acceleration +tile.speedRune.name=Speed Rune +tile.efficiencyRune.name=Efficiency Rune +tile.runeOfSacrifice.name=Rune of Sacrifice +tile.runeOfSelfSacrifice.name=Rune of Self-Sacrifice +tile.ritualStone.name=Ritual Stone +tile.blockMasterStone.name=Master Ritual Stone +tile.bloodSocket.name=Filled Socket +tile.imperfectRitualStone.name=Imperfect Ritual Stone +tile.armourForge.name=Soul Armour Forge +tile.emptySocket.name=Empty Socket +tile.bloodStoneBrick.name=Bloodstone Brick +tile.largeBloodStoneBrick.name=Large Bloodstone Brick +tile.blockWritingTable.name=Alchemic Chemistry Set +tile.blockHomHeart.name=Spell Table +tile.bloodPedestal.name=Arcane Pedestal +tile.bloodPlinth.name=Arcane Plinth +tile.bloodTeleposer.name=Teleposer +tile.blockConduit.name=Spell Conduit +tile.blockSpellParadigm.projectile.name=Particle Generator +tile.blockSpellParadigm.self.name=Self Augmentator +tile.blockSpellParadigm.melee.name=Melee Aggregator +tile.blockSpellParadigm.tool.name=Tool Forger +tile.blockSpellEnhancement.power1.name=Unstable Spell Empowerer +tile.blockSpellEnhancement.power2.name=Standard Spell Empowerer +tile.blockSpellEnhancement.power3.name=Reinforced Spell Empowerer +tile.blockSpellEnhancement.power4.name=Imbued Spell Empowerer +tile.blockSpellEnhancement.power5.name=Demonic Spell Empowerer +tile.blockSpellEnhancement.cost1.name=Unstable Spell Dampener +tile.blockSpellEnhancement.cost2.name=Standard Spell Dampener +tile.blockSpellEnhancement.cost3.name=Reinforced Spell Dampener +tile.blockSpellEnhancement.cost4.name=Imbued Spell Dampener +tile.blockSpellEnhancement.cost5.name=Demonic Spell Dampener +tile.blockSpellEnhancement.potency1.name=Unstable Spell Augmentor +tile.blockSpellEnhancement.potency2.name=Standard Spell Augmentor +tile.blockSpellEnhancement.potency3.name=Reinforced Spell Augmentor +tile.blockSpellEnhancement.potency4.name=Imbued Spell Augmentor +tile.blockSpellEnhancement.potency5.name=Demonic Spell Augmentor +tile.blockSpellModifier.default.name=Default Spell Modifier +tile.blockSpellModifier.offensive.name=Offensive Spell Modifier +tile.blockSpellModifier.defensive.name=Defensive Spell Modifier +tile.blockSpellModifier.environmental.name=Environmental Spell Modifier +tile.blockSpellEffect.fire.name=Crucible of Fire +tile.blockSpellEffect.ice.name=Ice Maker +tile.blockSpellEffect.wind.name=Wind Generator +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 +tile.crystalBlock.fullCrystal.name=Crystal Cluster +tile.crystalBlock.crystalBrick.name=Crystal Cluster Brick +tile.demonPortal.name=Demon Portal +tile.demonChest.name=Demon's Chest +tile.enchantmentGlyph.enchantability.name=Glyph of the Adept Enchanter +tile.enchantmentGlyph.enchantmentLevel.name=Glyph of Arcane Potential +tile.stabilityGlyph.stability1.name=Glyph of Rigid Stability +tile.schematicSaver.name=Schematic Saver +tile.blockMimic.name=Mimic Block +tile.blockSpectralContainer.name=Spectral Container +tile.blockBloodLightSource.name=Blood Light +tile.spectralBlock.name=Spectral Block +tile.blockCrucible.name=Incense Crucible #Item Localization -item.weak_blood_orb.name=Weak Blood Orb -item.apprentice_blood_orb.name=Apprentice Blood Orb -item.magician_blood_orb.name=Magician's Blood Orb -item.master_blood_orb.name=Master Blood Orb -item.archmage_blood_orb.name=Archmage's Blood Orb -item.energy_blast.name=Energy Blaster -item.energy_sword.name=Bound Blade -item.lava_crystal.name=Lava Crystal -item.water_sigil.name=Water Sigil -item.lava_sigil.name=Lava Sigil -item.void_sigil.name=Void Sigil -item.blank_slate.name=Blank Slate -item.reinforced_slate.name=Reinforced Slate -item.sacrificial_dagger.name=Sacrificial Knife -item.dagger_of_sacrifice.name=Dagger of Sacrifice -item.air_sigil.name=Air Sigil -item.sigil_of_the_fast_miner.name=Sigil of the Fast Miner -item.sigil_of_elemental_affinity.name=Sigil of Elemental Affinity -item.sigil_of_haste.name=Sigil of Haste -item.sigil_of_holding.name=Sigil of Holding -item.divination_sigil.name=Divination Sigil -item.water_scribe_tool.name=Elemental Inscription Tool: Water -item.fire_scribe_tool.name=Elemental Inscription Tool: Fire -item.earth_scribe_tool.name=Elemental Inscription Tool: Earth -item.air_scribe_tool.name=Elemental Inscription Tool: Air -item.dusk_scribe_tool.name=Elemental Inscription Tool: Dusk -item.activation_crystal_weak.name=Weak Activation Crystal -item.activation_crystal_awakened.name=Awakened Activation Crystal -item.activation_crystal_creative.name=Creative Activation Crystal -item.bound_pickaxe.name=Bound Pickaxe -item.bound_axe.name=Bound Axe -item.bound_shovel.name=Bound Shovel -item.bound_helmet.name=Bound Helmet -item.bound_chestplate.name=Bound Chestplate -item.bound_leggings.name=Bound Leggings -item.bound_boots.name=Bound Boots -item.weak_blood_shard.name=Weak Blood Shard -item.growth_sigil.name=Sigil of the Green Grove -item.blank_spell.name=Unbound Crystal -item.alchemy_flask.name=Potion Flask -item.standard_binding_agent.name=Standard Binding Agent -item.mundane_power_catalyst.name=Mundane Power Catalyst -item.average_power_catalyst.name=Average Power Catalyst -item.greater_power_catalyst.name=Greater Power Catalyst -item.mundane_lengthening_catalyst.name=Mundane Lengthening Catalyst -item.average_lengthening_catalyst.name=Average Lengthening Catalyst -item.greater_lengthening_catalyst.name=Greater Lengthening Catalyst +item.weakBloodOrb.name=Weak Blood Orb +item.apprenticeBloodOrb.name=Apprentice Blood Orb +item.magicianBloodOrb.name=Magician's Blood Orb +item.masterBloodOrb.name=Master Blood Orb +item.archmageBloodOrb.name=Archmage's Blood Orb +item.energyBlast.name=Energy Blaster +item.energySword.name=Bound Blade +item.lavaCrystal.name=Lava Crystal +item.waterSigil.name=Water Sigil +item.lavaSigil.name=Lava Sigil +item.voidSigil.name=Void Sigil +item.blankSlate.name=Blank Slate +item.reinforcedSlate.name=Reinforced Slate +item.sacrificialDagger.name=Sacrificial Knife +item.daggerOfSacrifice.name=Dagger of Sacrifice +item.airSigil.name=Air Sigil +item.sigilOfTheFastMiner.name=Sigil of the Fast Miner +item.sigilOfElementalAffinity.name=Sigil of Elemental Affinity +item.sigilOfHaste.name=Sigil of Haste +item.sigilOfHolding.name=Sigil of Holding +item.divinationSigil.name=Divination Sigil +item.waterScribeTool.name=Elemental Inscription Tool: Water +item.fireScribeTool.name=Elemental Inscription Tool: Fire +item.earthScribeTool.name=Elemental Inscription Tool: Earth +item.airScribeTool.name=Elemental Inscription Tool: Air +item.duskScribeTool.name=Elemental Inscription Tool: Dusk +item.activationCrystalWeak.name=Weak Activation Crystal +item.activationCrystalAwakened.name=Awakened Activation Crystal +item.activationCrystalCreative.name=Creative Activation Crystal +item.boundPickaxe.name=Bound Pickaxe +item.boundAxe.name=Bound Axe +item.boundShovel.name=Bound Shovel +item.boundHelmet.name=Bound Helmet +item.boundPlate.name=Bound Plate +item.boundLeggings.name=Bound Leggings +item.boundBoots.name=Bound Boots +item.weakBloodShard.name=Weak Blood Shard +item.growthSigil.name=Sigil of the Green Grove +item.blankSpell.name=Unbound Crystal +item.alchemyFlask.name=Potion Flask +item.standardBindingAgent.name=Standard Binding Agent +item.mundanePowerCatalyst.name=Mundane Power Catalyst +item.averagePowerCatalyst.name=Average Power Catalyst +item.greaterPowerCatalyst.name=Greater Power Catalyst +item.mundaneLengtheningCatalyst.name=Mundane Lengthening Catalyst +item.averageLengtheningCatalyst.name=Average Lengthening Catalyst +item.greaterLengtheningCatalyst.name=Greater Lengthening Catalyst item.incendium.name=Incendium item.magicales.name=Magicales item.sanctus.name=Sanctus item.aether.name=Aether -item.simple_catalyst.name=Simple Catalyst +item.simpleCatalyst.name=Simple Catalyst item.crepitous.name=Crepitous item.crystallos.name=Crystallos item.terrae.name=Terrae item.aquasalus.name=Aquasalus item.tennebrae.name=Tenebrae -item.demon_blood_shard.name=Demon Blood Shard -item.sigil_of_wind.name=Sigil of the Whirlwind -item.teleposition_focus.name=Teleposition Focus -item.enhanced_teleposition_focus.name=Enhanced Teleposition Focus -item.reinforced_teleposition_focus.name=Reinforced Teleposition Focus -item.demonic_teleposition_focus.name=Demonic Teleposition Focus -item.imbued_slate.name=Imbued Slate -item.demonic_slate.name=Demonic Slate -item.sigil_of_the_bridge.name=Sigil of the Phantom Bridge -item.armour_inhibitor.name=Armour Inhibitor -item.creative_orb.name=Orb of Testing -item.weak_filling_agent.name=Weak Filling Agent -item.standard_filling_agent.name=Standard Filling Agent -item.enhanced_filling_agent.name=Enhanced Filling Agent -item.weak_binding_agent.name=Weak Binding Agent -item.ritual_diviner.name=Ritual Diviner -item.ritual_dismantler.name=Ritual Dismantler -item.sigil_of_magnetism.name=Sigil of Magnetism -item.key_of_binding.name=Key of Binding -item.energy_bazooka.name=Energy Bazooka -item.blood_light_sigil.name=Sigil of the Blood Lamp -item.complex_spell_crystal.name=Complex Spell Crystal -item.sigil_of_supression.name=Sigil of Supression -item.sigil_of_ender_severance.name=Sigil of Ender Severance -item.bucket_life.name=Bucket of Life -item.base_items.quartz_rod.name=Quartz Rod -item.base_items.empty_core.name=Empty Core -item.base_items.magicales_cable.name=Magicales Cable -item.base_items.wood_brace.name=Wooden Brace -item.base_items.stone_brace.name=Stone Brace -item.base_items.projectile_core.name=Projectile Core -item.base_items.self_core.name=Self Core -item.base_items.melee_core.name=Melee Core -item.base_items.tool_core.name=Tool Core -item.base_items.paradigm_back_plate.name=Paradigm Plate -item.base_items.output_cable.name=Output Spell Cable -item.base_items.input_cable.name=Input Spell Cable -item.base_items.flame_core.name=Fire Core -item.base_items.icy_core.name=Icy Core -item.base_items.gust_core.name=Gusty Core -item.base_items.earthen_core.name=Earthen Core -item.base_items.cracked_runic_plate.name=Cracked Runic Plate -item.base_items.runic_plate.name=Runic Plate -item.base_items.scribed_runic_plate.name=Imbued Runic Plate -item.base_items.default_core.name=Unattuned Core -item.base_items.offensive_core.name=Offensive Core -item.base_items.defensive_core.name=Defensive Core -item.base_items.environmental_core.name=Environmental Core -item.base_items.power_core.name=Power Core -item.base_items.cost_core.name=Reduction Core -item.base_items.potency_core.name=Potency Core -item.base_items.obsidian_brace.name=Obsidian Brace -item.base_items.ethereal_slate.name=Ethereal Slate -item.base_items.life_shard.name=Life Shard -item.base_items.soul_shard.name=Soul Shard -item.base_items.life_brace.name=Living Brace -item.base_items.soul_runic_plate.name=Soul Runic Plate -item.base_items.ender_shard.name=Ender Shard -item.base_alchemy_items.offensa.name=Offensa -item.base_alchemy_items.praesidium.name=Praesidium -item.base_alchemy_items.orbis_terrae.name=Orbis Terrae -item.base_alchemy_items.strengthened_catalyst.name=Strengthened Catalyst -item.base_alchemy_items.concentrated_catalyst.name=Concentrated Catalyst -item.base_alchemy_items.fractured_bone.name=Fractured Bone -item.base_alchemy_items.virtus.name=Virtus -item.base_alchemy_items.reductus.name=Reductus -item.base_alchemy_items.potentia.name=Potentia -item.sanguine_helmet.name=Sanguine Helmet -item.seer_sigil.name=Sigil of Sight -item.fluid_sigil.name=Sigil of Fluidity -item.multi_tool.name=Dynamic Mace -item.combinational_catalyst.name=Combinational Catalyst -item.sanguine_robe.name=Sanguine Robes -item.sanguine_pants.name=Sanguine Leggings -item.sanguine_boots.name=Sanguine Boots -item.alchemical_router.name=Alchemic Router -item.alchemical_segmenter.name=Alchemic Segmenter -item.alchemical_cleanser.name=Alchemic Cleanser -item.demon_crystal.name=Demon Crystal -item.creative_dagger.name=Creative Sacrificial Knife -item.blood_pack.name=Blood Letter's Pack -item.harvest_sigil.name=Harvest Goddess Sigil -item.compression_sigil.name=Sigil of Compression -item.assassin_sigil.name=Sigil of the Assassin -item.transcendent_blood_orb.name=Transcendent Blood Orb -item.mail_catalogue.name=Mail Order Catalogue -item.input_routing_focus.name=Input Routing Focus -item.output_routing_focus.default.name=Default Output Routing Focus -item.output_routing_focus.modItem.name=Output Routing Focus (ModItem) -item.output_routing_focus.ignMeta.name=Output Routing Focus (Ignore Meta) -item.output_routing_focus.matchNBT.name=Output Routing Focus (MatchNBT) -item.output_routing_focus.global.name=Output Routing Focus (Global) -item.dawn_scribe_tool.name=Elemental Inscription Tool: Dawn -item.bound_helmet_earth.name=Earth Omega Helmet -item.bound_chestplate_earth.name=Earth Omega Chestplate -item.bound_leggings_earth.name=Earth Omega Leggings -item.bound_boots_earth.name=Earth Omega Boots -item.bound_helmet_wind.name=Wind Omega Helmet -item.bound_chestplate_wind.name=Wind Omega Chestplate -item.bound_leggings_wind.name=Wind Omega Leggings -item.bound_boots_wind.name=Wind Omega Boots -item.bound_helmet_fire.name=Fire Omega Helmet -item.bound_chestplate_fire.name=Fire Omega Chestplate -item.bound_leggings_fire.name=Fire Omega Leggings -item.bound_boots_fire.name=Fire Omega Boots -item.bound_helmet_water.name=Water Omega Helmet -item.bound_chestplate_water.name=Water Omega Chestplate -item.bound_leggings_water.name=Water Omega Leggings -item.bound_boots_water.name=Water Omega Boots +item.demonBloodShard.name=Demon Blood Shard +item.sigilOfWind.name=Sigil of the Whirlwind +item.telepositionFocus.name=Teleposition Focus +item.enhancedTelepositionFocus.name=Enhanced Teleposition Focus +item.reinforcedTelepositionFocus.name=Reinforced Teleposition Focus +item.demonicTelepositionFocus.name=Demonic Teleposition Focus +item.imbuedSlate.name=Imbued Slate +item.demonicSlate.name=Demonic Slate +item.sigilOfTheBridge.name=Sigil of the Phantom Bridge +item.armourInhibitor.name=Armour Inhibitor +item.cheatyItem.name=Orb of Testing +item.weakFillingAgent.name=Weak Filling Agent +item.standardFillingAgent.name=Standard Filling Agent +item.enhancedFillingAgent.name=Enhanced Filling Agent +item.weakBindingAgent.name=Weak Binding Agent +item.ritualDiviner.name=Ritual Diviner +item.ritualDismantler.name=Ritual Dismantler +item.sigilOfMagnetism.name=Sigil of Magnetism +item.itemDiabloKey.name=Key of Binding +item.energyBazooka.name=Energy Bazooka +item.bloodLightSigil.name=Sigil of the Blood Lamp +item.itemComplexSpellCrystal.name=Complex Spell Crystal +item.itemSigilOfSupression.name=Sigil of Supression +item.itemSigilOfEnderSeverance.name=Sigil of Ender Severance +item.bucketLife.name=Bucket of Life +item.bloodMagicBaseItem.QuartzRod.name=Quartz Rod +item.bloodMagicBaseItem.EmptyCore.name=Empty Core +item.bloodMagicBaseItem.MagicalesCable.name=Magicales Cable +item.bloodMagicBaseItem.WoodBrace.name=Wooden Brace +item.bloodMagicBaseItem.StoneBrace.name=Stone Brace +item.bloodMagicBaseItem.ProjectileCore.name=Projectile Core +item.bloodMagicBaseItem.SelfCore.name=Self Core +item.bloodMagicBaseItem.MeleeCore.name=Melee Core +item.bloodMagicBaseItem.ToolCore.name=Tool Core +item.bloodMagicBaseItem.ParadigmBackPlate.name=Paradigm Plate +item.bloodMagicBaseItem.OutputCable.name=Output Spell Cable +item.bloodMagicBaseItem.InputCable.name=Input Spell Cable +item.bloodMagicBaseItem.FlameCore.name=Fire Core +item.bloodMagicBaseItem.IcyCore.name=Icy Core +item.bloodMagicBaseItem.GustCore.name=Gusty Core +item.bloodMagicBaseItem.EarthenCore.name=Earthen Core +item.bloodMagicBaseItem.CrackedRunicPlate.name=Cracked Runic Plate +item.bloodMagicBaseItem.RunicPlate.name=Runic Plate +item.bloodMagicBaseItem.ScribedRunicPlate.name=Imbued Runic Plate +item.bloodMagicBaseItem.DefaultCore.name=Unattuned Core +item.bloodMagicBaseItem.OffensiveCore.name=Offensive Core +item.bloodMagicBaseItem.DefensiveCore.name=Defensive Core +item.bloodMagicBaseItem.EnvironmentalCore.name=Environmental Core +item.bloodMagicBaseItem.PowerCore.name=Power Core +item.bloodMagicBaseItem.CostCore.name=Reduction Core +item.bloodMagicBaseItem.PotencyCore.name=Potency Core +item.bloodMagicBaseItem.ObsidianBrace.name=Obsidian Brace +item.bloodMagicBaseItem.EtherealSlate.name=Ethereal Slate +item.bloodMagicBaseItem.LifeShard.name=Life Shard +item.bloodMagicBaseItem.SoulShard.name=Soul Shard +item.bloodMagicBaseItem.LifeBrace.name=Living Brace +item.bloodMagicBaseItem.SoulRunicPlate.name=Soul Runic Plate +item.bloodMagicAlchemyItem.Offensa.name=Offensa +item.bloodMagicAlchemyItem.Praesidium.name=Praesidium +item.bloodMagicAlchemyItem.OrbisTerrae.name=Orbis Terrae +item.bloodMagicAlchemyItem.StrengthenedCatalyst.name=Strengthened Catalyst +item.bloodMagicAlchemyItem.ConcentratedCatalyst.name=Concentrated Catalyst +item.bloodMagicAlchemyItem.FracturedBone.name=Fractured Bone +item.bloodMagicAlchemyItem.Virtus.name=Virtus +item.bloodMagicAlchemyItem.Reductus.name=Reductus +item.bloodMagicAlchemyItem.Potentia.name=Potentia +item.sanguineHelmet.name=Sanguine Helmet +item.itemSeerSigil.name=Sigil of Sight +item.itemFluidSigil.name= +item.multiTool.name=Dynamic Mace +item.itemCombinationalCatalyst.name=Combinational Catalyst +item.sanguineRobe.name=Sanguine Robes +item.sanguinePants.name=Sanguine Leggings +item.sanguineBoots.name=Sanguine Boots +item.itemAttunedCrystal.name=Alchemic Router +item.itemTankSegmenter.name=Alchemic Segmenter +item.destinationClearer.name=Alchemic Cleanser +item.demonPlacer.name=Demon Crystal +item.creativeDagger.name=Creative Sacrificial Knife +item.itemBloodPack.name=Blood Letter's Pack +item.itemHarvestSigil.name=Harvest Goddess Sigil +item.itemCompressionSigil.name=Sigil of Compression +item.itemAssassinSigil.name=Sigil of the Assassin +item.transcendentBloodOrb.name=Transcendent Blood Orb +item.itemMailCatalogue.name=Mail Order Catalogue +item.inputRoutingFocus.name=Input Routing Focus +item.bloodMagicBaseItem.EnderShard.name=Ender Shard +item.outputRoutingFocus.default.name=Default Output Routing Focus +item.outputRoutingFocus.modItem.name=Output Routing Focus (ModItem) +item.outputRoutingFocus.ignMeta.name=Output Routing Focus (Ignore Meta) +item.outputRoutingFocus.matchNBT.name=Output Routing Focus (MatchNBT) +item.outputRoutingFocus.global.name=Output Routing Focus (Global) +item.dawnScribeTool.name=Elemental Inscription Tool: Dawn +item.boundHelmetEarth.name=Earth Omega Helmet +item.boundPlateEarth.name=Earth Omega Plate +item.boundLeggingsEarth.name=Earth Omega Leggings +item.boundBootsEarth.name=Earth Omega Boots +item.boundHelmetWind.name=Wind Omega Helmet +item.boundPlateWind.name=Wind Omega Plate +item.boundLeggingsWind.name=Wind Omega Leggings +item.boundBootsWind.name=Wind Omega Boots +item.boundHelmetFire.name=Fire Omega Helmet +item.boundPlateFire.name=Fire Omega Plate +item.boundLeggingsFire.name=Fire Omega Leggings +item.boundBootsFire.name=Fire Omega Boots +item.boundHelmetWater.name=Water Omega Helmet +item.boundPlateWater.name=Water Omega Plate +item.boundLeggingsWater.name=Water Omega Leggings +item.boundBootsWater.name=Water Omega Boots -item.incense.wood_ash.name=Wood Ash -item.incense.byrrus.name=Byrrus -item.incense.livens.name=Livens -item.incense.viridis.name=Viridis -item.incense.purpura.name=Purpura +item.bloodMagicIncenseItem.Woodash.name=Wood Ash +item.bloodMagicIncenseItem.Byrrus.name=Byrrus +item.bloodMagicIncenseItem.Livens.name=Livens +item.bloodMagicIncenseItem.Viridis.name=Viridis +item.bloodMagicIncenseItem.Purpura.name=Purpura #Creative Tab itemGroup.tabBloodMagic=Blood Magic @@ -328,7 +328,7 @@ tooltip.attunedcrystal.desc1=A tool to tune alchemy tooltip.attunedcrystal.desc2=reagent transmission tooltip.blankspell.desc=Crystal of infinite possibilities. tooltip.bloodframe.desc=Stirs bees into a frenzy. -tooltip.bloodletterpack.desc=This pack really chaffes... +tooltip.bloodletterpack.desc=This pack really chaffs... tooltip.bloodlightsigil.desc=I see a light! tooltip.boundarmor.devprotect=Devilish Protection tooltip.boundaxe.desc=Axe me about my puns! @@ -393,34 +393,34 @@ tooltip.ritualdiviner.ritualtunedto=Ritual tuned to face: tooltip.ritualdiviner.waterstones=Water Stones: tooltip.ritualdiviner.dawnstones=Dawn Stones: tooltip.ritualdiviner.totalStones=Total Stones: -tooltip.dismatler.desc=You could turn this upside down? +tooltip.dismatler.desc=You can turn this upside down? tooltip.sacrificialdagger.desc1=A slight draining feeling tickles your fingers tooltip.sacrificialdagger.desc2=Just a prick of the tooltip.sacrificialdagger.desc3=finger will suffice... tooltip.sanguinearmor.desc1=A pair of goggles imbued with power tooltip.sanguinearmor.desc2=Robes imbued with forbidden power tooltip.sanguinearmor.visdisc=Vis discount: -tooltip._scribe_tool.desc=The writing is on the wall... +tooltip.scribetool.desc=The writing is on the wall... tooltip.seersigil.desc=When seeing all is not enough -tooltip.sigil_ofelementalaffinity.desc1=Perfect for a fire-breathing fish -tooltip.sigil_ofelementalaffinity.desc2=who is afraid of heights! -tooltip.sigil_ofenderseverance.desc=Put those endermen in a Dire situation! -tooltip.sigil_ofgrowth.desc1=Who needs a green thumb when -tooltip.sigil_ofgrowth.desc2=you have a green slate? -tooltip.sigil_ofhaste.desc=One dose of caffeine later... -tooltip.sigil_ofholding.desc=Used to hold several Sigils! -tooltip.sigil_ofmagnetism.desc=I have a very magnetic personality! -tooltip.sigil_ofsupression.desc=Better than telekinesis -tooltip.sigil_oftheassassin.desc=Time to stay stealthy... -tooltip.sigil_ofthebridge.desc1=Activate to create a bridge -tooltip.sigil_ofthebridge.desc2=beneath your feet. -tooltip.sigil_ofthefastminer.desc=Keep going and going and going... -tooltip.sigil_ofwind.desc=Best not to wear a skirt. +tooltip.sigilofelementalaffinity.desc1=Perfect for a fire-breathing fish +tooltip.sigilofelementalaffinity.desc2=who is afraid of heights! +tooltip.sigilofenderseverance.desc=Put those endermen in a Dire situation! +tooltip.sigilofgrowth.desc1=Who needs a green thumb when +tooltip.sigilofgrowth.desc2=you have a green slate? +tooltip.sigilofhaste.desc=One dose of caffeine later... +tooltip.sigilofholding.desc=Used to hold several Sigils! +tooltip.sigilofmagnetism.desc=I have a very magnetic personality! +tooltip.sigilofsupression.desc=Better than telekinesis +tooltip.sigiloftheassassin.desc=Time to stay stealthy... +tooltip.sigilofthebridge.desc1=Activate to create a bridge +tooltip.sigilofthebridge.desc2=beneath your feet. +tooltip.sigilofthefastminer.desc=Keep going and going and going... +tooltip.sigilofwind.desc=Best not to wear a skirt. tooltip.sigil.state.activated=Activated tooltip.sigil.state.deactivated=Deactivated tooltip.tanksegmenter.desc1=Used to designate which tooltip.tanksegmenter.desc2=reagents can go into a container -tooltip._teleposition_focus.desc=An Enderpearl imbued with blood +tooltip.telepositionfocus.desc=An Enderpearl imbued with blood tooltip.voidsigil.desc=Better than a Swiffer! tooltip.watersigil.desc=Infinite water, anyone? tooltip.routingFocus.limit=Limit: @@ -468,9 +468,53 @@ message.routerfocus.limit=Focus' Item Limit set to: #Achievements achievement.alchemicalwizardry:firstPrick=Your First Prick! -achievement.alchemicalwizardry:firstPrick.desc=The first drop of life into the Altar... -achievement.alchemicalwizardry:weakOrb=Faintly Glowing Red... -achievement.alchemicalwizardry:weakOrb.desc=This orb will suffice...for now... +achievement.alchemicalwizardry:firstPrick.desc=Craft a Sacrificial Knife/Orb +achievement.alchemicalwizardry:weakOrb=Faintly Glowing Red +achievement.alchemicalwizardry:weakOrb.desc=Pickup a Weak Blood Orb +achievement.alchemicalwizardry:bloodLettersPack=Gathering More Blood +achievement.alchemicalwizardry:bloodLettersPack.desc=Create a Blood Letter's Pack +achievement.alchemicalwizardry:waterSigil=Infinite Water! +achievement.alchemicalwizardry:waterSigil.desc=Make a Water Sigil with your Weak Blood Orb +achievement.alchemicalwizardry:blankRunes=Stepping Towards Tier 2 +achievement.alchemicalwizardry:blankRunes.desc=Make a couple of Blank Runes +achievement.alchemicalwizardry:apprenticeOrb=Getting Stronger +achievement.alchemicalwizardry:apprenticeOrb.desc=Pickup an Apprentice Orb +achievement.alchemicalwizardry:airSigil=Whoosh! +achievement.alchemicalwizardry:airSigil.desc=Craft an Air Sigil +achievement.alchemicalwizardry:daggerSacrifice=Sacrificing Others +achievement.alchemicalwizardry:daggerSacrifice.desc=Pickup a Dagger of Sacrifice +achievement.alchemicalwizardry:brewingPotions=Alchemical Chemistry +achievement.alchemicalwizardry:brewingPotions.desc=Craft an Alchemical Chemistry set +achievement.alchemicalwizardry:magicianOrb=Even Stronger +achievement.alchemicalwizardry:magicianOrb.desc=Pickup a Magician's Orb +achievement.alchemicalwizardry:sigilHolding=Hold All The Sigils! +achievement.alchemicalwizardry:sigilHolding.desc=Make a Sigil of Holding +achievement.alchemicalwizardry:boundBlade=More Pain +achievement.alchemicalwizardry:boundBlade.desc=Create a Bound Blade from a Ritual of Binding +achievement.alchemicalwizardry:boundArmor=Uncrackable +achievement.alchemicalwizardry:boundArmor.desc=Craft Bound Armor from the Armor Forge +achievement.alchemicalwizardry:complexSpells=Not Quite Hemomancy +achievement.alchemicalwizardry:complexSpells.desc=Pickup a Complex Spell Crystal +achievement.alchemicalwizardry:ritualDiviner=Ritual Making +achievement.alchemicalwizardry:ritualDiviner.desc=Craft a Ritual Diviner +achievement.alchemicalwizardry:masterOrb=Getting Very Strong +achievement.alchemicalwizardry:masterOrb.desc=Pickup a Master Orb +achievement.alchemicalwizardry:demonSpawn=Demon Spawn +achievement.alchemicalwizardry:demonSpawn.desc=Summon and slay a demon/elemental +achievement.alchemicalwizardry:phantomBridgeSigil=Walking In Mid-Air +achievement.alchemicalwizardry:phantomBridgeSigil.desc=Make the Sigil of the Phantom Bridge +achievement.alchemicalwizardry:teleposer=Teleposed! +achievement.alchemicalwizardry:teleposer.desc=Craft a Teleposer +achievement.alchemicalwizardry:suppressionSigil=Suppress! +achievement.alchemicalwizardry:suppressionSigil.desc=Create a Suppression Sigil +achievement.alchemicalwizardry:archmageOrb=Too Strong +achievement.alchemicalwizardry:archmageOrb.desc=Pickup an Archmage Orb +achievement.alchemicalwizardry:energyBazooka=BOOM!!! +achievement.alchemicalwizardry:energyBazooka.desc=Create the all powerful, Energy Bazooka!! +achievement.alchemicalwizardry:demons=Demon Hunter +achievement.alchemicalwizardry:demons.desc=Kill a Demon +achievement.alchemicalwizardry:trancsendentOrb=OVERPOWERED +achievement.alchemicalwizardry:trancsendentOrb.desc=Pickup a Transcendent Blood Orb #G-API Downloading bm.versioning.getGAPI=["[BM] You don't have Guide-API installed! Install it to get it to unlock the book! [",{"text":"Download","color":"red","hoverEvent":{"action":"show_text","value":{"text":"Click this to auto-magically download the latest version","color":"red"}},"clickEvent":{"action":"run_command","value":"/bloodmagic-download-g-api"}},"]"] diff --git a/src/main/resources/assets/alchemicalwizardry/lang/zh_CN.lang b/src/main/resources/assets/alchemicalwizardry/lang/zh_CN.lang index d49998b6..8dfb70c2 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/zh_CN.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/zh_CN.lang @@ -51,17 +51,30 @@ tile.blockSpellEffect.fire.name=火焰效应器 tile.blockSpellEffect.ice.name=冰霜效应器 tile.blockSpellEffect.wind.name=风暴效应器 tile.blockSpellEffect.earth.name=尘土效应器 -tile.alchemicCalcinator.name=元素煅烧炉 +tile.alchemicCalcinator.name=炼金煅烧炉 tile.crystalBelljar.name=玻璃钟罩 -tile.blockReagentConduit.name=元素中续器 +tile.blockReagentConduit.name=炼金中续器 tile.lifeEssenceFluidBlock.name=生命本质 +tile.crystalBlock.fullCrystal.name=碎片集晶 +tile.crystalBlock.crystalBrick.name=碎片集晶砖 +tile.demonPortal.name=恶魔传送站 +tile.demonChest.name=恶魔的箱子 +tile.enchantmentGlyph.enchantability.name=图符: 魔咒专家 +tile.enchantmentGlyph.enchantmentLevel.name=图符: 神秘潜能 +tile.stabilityGlyph.stability1.name=图符: 刚硬稳定 +tile.schematicSaver.name=Schematic Saver +tile.blockMimic.name=Mimic Block +tile.blockSpectralContainer.name=Spectral Container +tile.blockBloodLightSource.name=血之光源 +tile.spectralBlock.name=影桥方块 +tile.blockCrucible.name=香炉 #Item Localization item.weakBloodOrb.name=虚弱气血宝珠 item.apprenticeBloodOrb.name=学徒气血宝珠 -item.magicianBloodOrb.name=法师的气血宝珠 +item.magicianBloodOrb.name=法师气血宝珠 item.masterBloodOrb.name=导师气血宝珠 -item.archmageBloodOrb.name=大法师的气血宝珠 +item.archmageBloodOrb.name=贤者气血宝珠 item.energyBlast.name=能源爆破枪 item.energySword.name=约束之剑 item.lavaCrystal.name=熔岩晶体 @@ -83,8 +96,9 @@ item.fireScribeTool.name=元素铭文:火 item.earthScribeTool.name=元素铭文:地 item.airScribeTool.name=元素铭文:风 item.duskScribeTool.name=元素铭文: 幽暗 -item.activationCrystalWeak.name=[低等]激活水晶 +item.activationCrystalWeak.name=[虚弱]激活水晶 item.activationCrystalAwakened.name=[觉醒]激活水晶 +item.activationCrystalCreative.name=[创造模式]激活水晶 item.boundPickaxe.name=约束之镐 item.boundAxe.name=约束之斧 item.boundShovel.name=约束之锹 @@ -165,6 +179,10 @@ item.bloodMagicBaseItem.CostCore.name=代价核心 item.bloodMagicBaseItem.PotencyCore.name=效能核心 item.bloodMagicBaseItem.ObsidianBrace.name=黑曜石支架 item.bloodMagicBaseItem.EtherealSlate.name=悬幽石板 +item.bloodMagicBaseItem.LifeShard.name=生命碎片 +item.bloodMagicBaseItem.SoulShard.name=灵魂碎片 +item.bloodMagicBaseItem.LifeBrace.name=生命支架 +item.bloodMagicBaseItem.SoulRunicPlate.name=灵魂文板 item.bloodMagicAlchemyItem.Offensa.name=攻势粉末 item.bloodMagicAlchemyItem.Praesidium.name=防守粉末 item.bloodMagicAlchemyItem.OrbisTerrae.name=环境粉末 @@ -182,14 +200,48 @@ item.itemCombinationalCatalyst.name=组合催化剂 item.sanguineRobe.name=血红法袍 item.sanguinePants.name=血红护腿 item.sanguineBoots.name=血红靴子 -item.itemAttunedCrystal.name=元素通递仗 -item.itemTankSegmenter.name=元素分配仗 -item.destinationClearer.name=元素清通器 +item.itemAttunedCrystal.name=炼金通递仗 +item.itemTankSegmenter.name=炼金分配仗 +item.destinationClearer.name=炼金清通器 item.demonPlacer.name=恶魔水晶 item.creativeDagger.name=[创造模式]牺牲匕首 item.itemBloodPack.name=血液背包 item.itemHarvestSigil.name=丰收印记 item.itemCompressionSigil.name=压缩印记 +item.itemAssassinSigil.name=刺客印记 +item.transcendentBloodOrb.name=卓越气血宝珠 +item.itemMailCatalogue.name=邮购目录 +item.inputRoutingFocus.name=输入路由核心 +item.bloodMagicBaseItem.EnderShard.name=末影碎片 +item.outputRoutingFocus.default.name=输出路由核心(默认) +item.outputRoutingFocus.modItem.name=输出路由核心(ModItem) +item.outputRoutingFocus.ignMeta.name=输出路由核心(数据值忽视) +item.outputRoutingFocus.matchNBT.name=输出路由核心(NBT匹配) +item.outputRoutingFocus.global.name=输出路由核心(Global) +item.dawnScribeTool.name=元素铭文:破晓 +item.boundHelmetEarth.name=土`欧米伽头盔 +item.boundPlateEarth.name=土`欧米伽胸甲 +item.boundLeggingsEarth.name=土`欧米伽护腿 +item.boundBootsEarth.name=土`欧米伽之靴 +item.boundHelmetWind.name=风`欧米伽头盔 +item.boundPlateWind.name=风`欧米伽胸甲 +item.boundLeggingsWind.name=风`欧米伽护腿 +item.boundBootsWind.name=风`欧米伽之靴 +item.boundHelmetFire.name=火`欧米伽头盔 +item.boundPlateFire.name=火`欧米伽胸甲 +item.boundLeggingsFire.name=火`欧米伽护腿 +item.boundBootsFire.name=火`欧米伽之靴 +item.boundHelmetWater.name=水`欧米伽头盔 +item.boundPlateWater.name=水`欧米伽胸甲 +item.boundLeggingsWater.name=水`欧米伽护腿 +item.boundBootsWater.name=水`欧米伽之靴 + +item.bloodMagicIncenseItem.Woodash.name=木灰粉末 +item.bloodMagicIncenseItem.Byrrus.name=玫香粉末 +item.bloodMagicIncenseItem.Livens.name=晶香粉末 +item.bloodMagicIncenseItem.Viridis.name=翠香粉末 +item.bloodMagicIncenseItem.Purpura.name=紫香粉末 + #Creative Tab itemGroup.tabBloodMagic=血魔法 @@ -199,6 +251,10 @@ bm.string.drain=消耗 bm.string.tier=层数 bm.string.crafting.orb.shaped=特定血宝珠合成 bm.string.crafting.orb.shapeless=不定血宝珠合成 +text.recipe.altar=血之祭坛 +text.recipe.altar.tier=层数: %s +text.recipe.altar.bloodRequired=LP: %s +text.recipe.shapedOrb=合适宝珠合成 #Entities entity.AWWayofTime.EarthElemental.name=土之元素精灵 @@ -215,3 +271,199 @@ entity.AWWayofTime.WingedFireDemon.name=火翼恶魔 entity.AWWayofTime.BileDemon.name=胆汁恶魔 entity.AWWayofTime.LowerGuardian.name=低等守护者 entity.AWWayofTime.FallenAngel.name=堕天使 +entity.AWWayofTime.MinorDemonGruntGuardian.name=格伦魔守卫 +entity.AWWayofTime.MinorDemonGruntGuardianWind.name=风格伦魔守卫 +entity.AWWayofTime.MinorDemonGruntGuardianFire.name=火格伦魔守卫 +entity.AWWayofTime.MinorDemonGruntGuardianIce.name=冰格伦魔守卫 +entity.AWWayofTime.MinorDemonGruntGuardianEarth.name=土格伦魔守卫 +entity.AWWayofTime.MinorDemonGruntWind.name=风格伦魔 +entity.AWWayofTime.MinorDemonGruntFire.name=火格伦魔 +entity.AWWayofTime.MinorDemonGruntIce.name=冰格伦魔 +entity.AWWayofTime.MinorDemonGruntEarth.name=土格伦魔 +entity.AWWayofTime.MinorDemonGrunt.name=格伦魔 + +#Commands +commands.soulnetwork.usage=/soulnetwork <玩家> +commands.bind.usage=/bind <玩家> +commands.bind.success=物品成功绑定! +commands.bind.failed.noPlayer=没有指定玩家 +commands.bind.failed.alreadyBound=物品已经被绑定; 使用 /unbind 来解除绑定 +commands.bind.failed.notBindable=物品无法被绑定 +commands.unbind.usage=/unbind +commands.unbind.success=物品成功解除绑定! +commands.unbind.failed.notBindable=物品无法解除绑定 +commands.soulnetwork.usage=/soulnetwork <玩家> [数量] +commands.soulnetwork.add.success=成功添加 %dLP 到 %s 的灵魂网络! +commands.soulnetwork.subtract.success=成功从 %s 的灵魂网络中减去 %dLP ! +commands.soulnetwork.fill.success=成功填满 %s 的灵魂网络! +commands.soulnetwork.empty.success=成功掏空 %s 的灵魂网络! +commands.soulnetwork.get.success=目前有 %dLP 在 %s 的灵魂网络! +commands.soulnetwork.noPlayer=没有指定玩家 +commands.soulnetwork.noCommand=命令不够详细 +commands.soulnetwork.notACommand=这不是有效的命令 + +#Tooltips +tooltip.activationcrystal.creativeonly=创造模式独有 - 激活任何仪式 +tooltip.activationcrystal.lowlevelrituals=激活低级仪式 +tooltip.activationcrystal.powerfulrituals=激活更多强大的仪式 +tooltip.airsigil.desc=我感觉已经轻盈。。。 +tooltip.alchemy.coords=坐标: +tooltip.alchemy.damage=攻击伤害: +tooltip.alchemy.dimension=绑定世界: +tooltip.alchemy.direction=方向: +tooltip.alchemy.forrecipe=了解配方 +tooltip.alchemy.press=对着物品按 +tooltip.alchemy.recipe=材料: +tooltip.alchemy.ritualid=仪式ID: +tooltip.alchemy.shift=shift +tooltip.alchemy.usedinalchemy=用于炼金术 +tooltip.alchemyflask.caution=警 告: 内部异常 +tooltip.alchemyflask.swigsleft=药水剩余: +tooltip.armorinhibitor.desc1=用来约束一个灵魂的 +tooltip.armorinhibitor.desc2=不自然的能力. +tooltip.attunedcrystal.desc1=一个用于调整 +tooltip.attunedcrystal.desc2=炼金试剂传输的工具 +tooltip.blankspell.desc=拥有无限可能性的水晶. +tooltip.bloodframe.desc=Stirs bees into a frenzy. +tooltip.bloodletterpack.desc=这个背包穿起来真的挺疼... +tooltip.bloodlightsigil.desc=我看见一个光芒! +tooltip.boundarmor.devprotect=邪恶的保护 +tooltip.boundaxe.desc=Axe me 我的双关语! +tooltip.boundpickaxe.desc1=被诅咒的灵魂 +tooltip.boundpickaxe.desc2=不喜欢石头... +tooltip.boundshovel.desc=不, 不是那种类型的铁锹. +tooltip.caution.desc1=注意: 可能会导致 +tooltip.caution.desc2=一个糟糕的一天... +tooltip.cheatyitem.desc1=右键填充网络, +tooltip.cheatyitem.desc2=Shift+右键清空. +tooltip.complexspellcrystal.desc=拥有难以想象能力的水晶 +tooltip.crystalbelljar.contents=当前储存 +tooltip.crystalbelljar.empty=- 空的 +tooltip.demonictelepfocus.desc1=一个强化的核心 +tooltip.demonictelepfocus.desc2=与恶魔气血碎片合成 +tooltip.demonplacer.desc=用来生成恶魔. +tooltip.destclearer.desc1=用于清除一个炼金试剂容器 +tooltip.destclearer.desc2=的连接目标列表 +tooltip.diablokey.desc=绑定其他物品到主人的灵魂网络 +tooltip.divinationsigil.desc1=凝视着灵魂 +tooltip.divinationsigil.desc2=获取当前生命本质的情况 +tooltip.energybazooka.desc=Boom. +tooltip.energybattery.desc=存储原始的生命本质 +tooltip.energyblast.desc1=用于发射 +tooltip.energyblast.desc2=毁灭性的炮弹. +tooltip.enhancedtelepfocus.desc=一个核心在祭坛中进一步加强 +tooltip.fluidsigil.beastmode=野兽模式 +tooltip.fluidsigil.desc=一个对液体有秀丽亲和力的印记 +tooltip.fluidsigil.draintankmode=排水槽模式 +tooltip.fluidsigil.filltankmode=满水槽魔石 +tooltip.fluidsigil.fluidplacementmode=流动模式 +tooltip.fluidsigil.forcesyphonmode=强迫虹吸模式 +tooltip.fluidsigil.syphoningmode=虹吸魔石 +tooltip.harvestsigil.desc=得豆种豆, 得瓜种瓜. +tooltip.infusedstone.desc1=在祭坛中为 +tooltip.infusedstone.desc2=石头输入生命本质 +tooltip.item.iteminslot=集合的印记 +tooltip.item.currentitem=目前印记: +tooltip.lavacrystal.desc1=储存生命 +tooltip.lavacrystal.desc2=去烧炼熔炉中的材料. +tooltip.lavasigil.desc1=接触液体是 +tooltip.lavasigil.desc2=非常不推荐的. +tooltip.lp.storedlp=现储存的LP: +tooltip.mode.creative=创造模式独有 +tooltip.owner.currentowner=当前所有者: +tooltip.owner.demonsowner=恶魔的主人: +tooltip.packratsigil.desc=金刚石般的双手 +tooltip.reagent.selectedreagent=当前选定的炼金试剂: +tooltip.reinforcedtelepfocus.desc1=一个强化的核心 +tooltip.reinforcedtelepfocus.desc2=与恶魔气血碎片合成 +tooltip.ritualdiviner.airstones=空气仪式石: +tooltip.ritualdiviner.blankstones=空白仪式石: +tooltip.ritualdiviner.cannotplace=无法放置幽暗仪式石 +tooltip.ritualdiviner.canplace=可以放置幽暗仪式石 +tooltip.ritualdiviner.canplacedawn=可以放置幽暗和破晓仪式石 +tooltip.ritualdiviner.desc=用于探索新的仪式 +tooltip.ritualdiviner.duskstones=幽暗仪式石: +tooltip.ritualdiviner.earthstones=地之仪式石: +tooltip.ritualdiviner.firestones=火之仪式石: +tooltip.ritualdiviner.moreinfo=按 shift 了解详细信息 +tooltip.ritualdiviner.ritualtunedto=仪式朝向: +tooltip.ritualdiviner.waterstones=水之仪式石: +tooltip.ritualdiviner.dawnstones=破晓仪式石: +tooltip.ritualdiviner.totalStones=仪式石总数: +tooltip.sacrificialdagger.desc1=手指感到一股轻微的排失似的发痒 +tooltip.sacrificialdagger.desc2=只是刺一下, +tooltip.sacrificialdagger.desc3=手指就有能力了... +tooltip.sanguinearmor.desc1=一双充满力量的护目镜 +tooltip.sanguinearmor.desc2=灌入被禁止的力量的长袍 +tooltip.sanguinearmor.visdisc=灵气减免: +tooltip.scribetool.desc=书写是在墙壁上的... +tooltip.seersigil.desc=看到更多总会有所不足 +tooltip.sigilofelementalaffinity.desc1=在火中呼吸的鱼 +tooltip.sigilofelementalaffinity.desc2=是多么的完美! +tooltip.sigilofenderseverance.desc=使末影人遇上一个严峻的形势! +tooltip.sigilofgrowth.desc1=谁需要有特殊的园艺才能, +tooltip.sigilofgrowth.desc2=你有一个绿丛印记吗? +tooltip.sigilofhaste.desc=一剂兴奋剂后... +tooltip.sigilofholding.desc=用来装几个符印! +tooltip.sigilofmagnetism.desc=我有一个非常具有吸引力的人格ww +tooltip.sigilofsupression.desc=比念力更好 +tooltip.sigiloftheassassin.desc=现在该待在阴暗处了... +tooltip.sigilofthebridge.desc1=激活来创造一座幻影桥 +tooltip.sigilofthebridge.desc2=在你的双脚之下. +tooltip.sigilofthefastminer.desc=继续, 继续, 继续... +tooltip.sigilofwind.desc=最好不要穿裙子. +tooltip.sigil.state.activated=已激活 +tooltip.sigil.state.deactivated=停用 +tooltip.tanksegmenter.desc1=用于指定哪种炼金试剂 +tooltip.tanksegmenter.desc2=可以进入容器 +tooltip.telepositionfocus.desc=一个末影珍珠灌输本质 +tooltip.voidsigil.desc=比拖把的更好! +tooltip.watersigil.desc=无限的水, 任何人? +tooltip.routingFocus.limit=限制: +tooltip.routingFocus.desc=一个传送物件的核心 +tooltip.alchemy.usedinincense=用于香炉的精炼熏香粉末 + +#Messages +message.altar.capacity=容量: %s LP +message.altar.consumptionrate=消耗率: +message.altar.currentessence=祭坛目前的生命本质: %s LP +message.altar.currenttier=祭坛目前的层数: %s +message.altar.progress=祭坛的进展: +message.altar.inputtank= 输入槽: %s LP +message.altar.outputtank= 输出槽: %s LP +message.altar.hunger=[BM] 你的高级再生效果使你变得饥饿... +message.attunedcrystal.clearing=清除已保存的容器... +message.attunedcrystal.error.cannotfind=无法找到连接的容器. +message.attunedcrystal.error.noconnections=连接的容器没有剩余线路! +message.attunedcrystal.error.toofar=连接的两个容器离得太远或是不在同个世界. +message.attunedcrystal.linked=容器现在连接完成. 传输: +message.attunedcrystal.linking=连接到选择容器. +message.attunedcrystal.setto=调整水晶设置为: +message.demon.shallfollow=我将会跟随并且保护你! +message.demon.willstay=我会在这待着的, 主人. +message.destinationclearer.cleared=目标列表已清除. +message.divinationsigil.amount=数额: +message.divinationsigil.currentessence=目前的生命本质: +message.divinationsigil.reagent=炼金试剂: +message.masterstone.crystalvibrates=你的水晶弱弱的振动着. +message.masterstone.energyflows=一股能量流经这个仪式! +message.masterstone.nothinghappened=似乎什么都没发生... +message.masterstone.ritualresistyou=仪式似乎在积极的抵抗你! +message.masterstone.somethingstoppedyou=有什么东西使你的路径堵塞... +message.masterstone.youfeelapull=你感到一股拉力, 但没有足够的能量促进其发生. +message.ritual.currentritual=目前仪式: +message.ritual.side.east=东 +message.ritual.side.north=北 +message.ritual.side.south=南 +message.ritual.side.west=西 +message.ritualdemonportal.missingjar=柱子上的玻璃钟罩似乎不够... +message.tanksegmenter.nowhas=容器的槽 +message.tanksegmenter.setto=容器分配设置为: +message.tanksegmenter.tankssetto=槽设置为: +message.routerfocus.limit=核心的物品限制设置为: + +#Achievements +achievement.firstPrick=你第一次的疼痛! +achievement.alchemicalwizardy:firstPrick!.desc=第一滴祭坛中的生命... +achievement.alchemicalwizardry:weakOrb=微弱的红热... +achievement.alchemicalwizardry:weakOrb.desc=这个宝珠应该够了...就目前而言... diff --git a/src/main/resources/assets/alchemicalwizardry/models/block/soul_armour_forge.json b/src/main/resources/assets/alchemicalwizardry/models/block/soul_armour_forge.json deleted file mode 100644 index b455a113..00000000 --- a/src/main/resources/assets/alchemicalwizardry/models/block/soul_armour_forge.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "alchemicalwizardry:blocks/SoulForge" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardry/models/item/soul_armour_forge.json b/src/main/resources/assets/alchemicalwizardry/models/item/soul_armour_forge.json deleted file mode 100644 index ca3e1dff..00000000 --- a/src/main/resources/assets/alchemicalwizardry/models/item/soul_armour_forge.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent":"hemomancy:block/soul_armour_forge", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardryBooks/books.txt b/src/main/resources/assets/alchemicalwizardryBooks/books.txt new file mode 100644 index 00000000..2fcd1b60 --- /dev/null +++ b/src/main/resources/assets/alchemicalwizardryBooks/books.txt @@ -0,0 +1,259 @@ +aw.entry.Magnus.1= +A classic tragic backstory.1= My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village. I was brought to a village nearby, where a magician +A classic tragic backstory.2=named Magus helped tend to my wounds. The magic that he used was something that I had never seen before - it wasn't Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips. Fast-forward several years, and I have learned almost everything from Master Magus, being his third student ever to master his arts. Against his wishes, I have recorded +A classic tragic backstory.3=my research and put several wards and spells on this book. So welcome, apprentice. I am known as The Architect, and I am a Blood Mage. It took several years of pestering before I managed to convince Magus to teach me. He kept on telling me that, "Magic that uses the life essence of living beings requires patience and preparation in order to master it. One false move, go a little past your natural endurance, and you may find +A classic tragic backstory.4=yourself taking a nice vacation in Tartarus." The thing was, I wanted to go there - I had some unfinished business with the demons. The process that Magus originally constructed required powerful artifacts that he constructed himself, but were rather lacking where teaching was concerned. After studying a bit of alchemy and the process of "Equivalent Exchange," I managed to +A classic tragic backstory.5=construct myself an altar that would transmute items inside of its basin into new powerful forms. The only issue was that it needed a worthy catalyst, and so with a prick of the finger I set the Blood Altar alight! +The Blood Altar.1= +The Blood Altar.1= To start any form of transmutation involving blood, you would need to construct a blood altar and a sacrificial knife, as well as have a solitary diamond in your possession. After placing the blood altar down, Magus advised me to be +The Blood Altar.2=careful as I filled it slowly with my blood, and said that I would need to be really close to the altar (about a metre) for the knife to work. With about 2 buckets of blood in the altar, which Master Magus reminds me is about 10 hearts worth, I placed the diamond inside of the altar by activating it with the diamond in hand. +The Blood Altar.2= The blood dissipated in a cloud of red swirls as I waited for the atoms of the diamond to shift and reform. There were a few moments where the particles turned gray, which meant that the altar was empty and I had to hurry to fill it. After the +The Blood Altar.3=diamond burst in a shower of red particles, what finally sat in the altar was a Weak Blood Orb. +The Soul Network.1= One thing that I initially didn't understand was the overarching connection between the blood orb and myself. When I initially met Magus, I could see many sparkling strands branching off of him, flowing throughout his house and linking with intricate stones and runic drawings. I asked Magus about the strands, but he had no clue what I was talking about. It took three years of thorough research to finally find the answer, and when I +The Soul Network.2=brought my notes to him he was really impressed with what I have found. When you send power into the orb, the energy is transmitted from the strand connecting the orb and into the very soul of the person the orb is bound to. Similarly, and Magus managed to show this effect with several of his rituals, when you use something that drains energy it will drain the energy directly from the soul. The thing is that if you +The Soul Network.3=use an item whose owner has no energy left, the item will instead grab the requisite energy from the user of the item. Directly. From his or her life force. As such, the unit of measurement is called "Life Points," or LP. I experimented with this, and one heart equals 200 LP. I have christened this system to be the "Soul Network," and is used in all branches of Blood Magic indirectly. +Basics of sigils.1= Magus is a master at rituals. His power in the intricate layering of stones and inks is unmatched. The problem is that these rituals are rather... static in nature. Sure, being able to call the bounty of the earth to the surface is all fine and +Basics of sigils.2=dandy, but won't exactly protect you when you are on fire. To this end, I decided to link my soul network to powerful items that I have created. To start, I decided to transmute a piece of smooth stone in the Blood Altar with just 1kLP to create a blank slate. The first thing I did was to arrange the blank slate with some reflective glass and my weak blood orb. Pouring my power into the configuration created a Divination Sigil, +Basics of sigils.3=which I could link to my network and see how much power that my soul network holds. What is more, holding the sigil to the Blood Altar flooded my mind with information, giving me the knowledge about its current tier, capacity, and even how much it was holding. Happy with the sigil, I brought a fresh unbound one to Master Magus for him to use. When I took the divination sigil back in my hands and tried to use it to +Basics of sigils.4=view his network, for some reason I could not gleam any information from him. I don't really see why this is, considering that I used this same method for other people and I saw that they had no power at all, but to gleam actually ... nothing from Magus is strange. +Training, and water sigil.1= I've been training my body, lately. Master Magus told me that in order to extract most of my power, I have to get my mind, soul, and body into as perfect shape as possible. Even though my mind takes time to hone, and my soul requires methods I have yet +Training, and water sigil.2=mastered to strengthen, my body is something I can actively manage. No more cookies for me, apparently, since they have horrible saturation for the work I do. And it's hard to grow cocoa right now, anyways. The temperature is ridiculously high, and with it the humidity is pretty freaking low. Some bright spark of a thaumaturge got it into their head that it would be good to open up the Obelisk to the far north of +Training, and water sigil.3=the village, and because of it a large influx of taint spewed forth from the eldritch tomb. It looks like someone wasn't focusing enough on their sanity training! Thankfully Master Magus decided to head out to the site up north with a few stones and a new vat of ink, saying over his shoulder that he had a new ritual that he'd like to test to fix the problem. In the meantime, I was tasked to create something to +Training, and water sigil.4=fix our water problem. I thought about perhaps cooling the environment around the village in order to condense the water in the air, or perhaps find a way to create rain - neither of which I would be able to accomplish, because I'm sure that either task would take more than the 5 kLP capacity I currently have with my blood orb. So, I had to think small. At my desk, I mixed some dirt into the spare water I +Training, and water sigil.5=had for experimentation and started to paint on one of the blank slates I recently created to layer a bit of a base. Once I was satisfied, I took a bunch of buckets (to be safe in case that what I did would fail) and arranged them around the damp slate and then took my orb from the chest nearby. I then tapped the orb onto the slate, and the water started to boil and swirl out of the surrounding buckets, rushing into the slate! After a quick, +Training, and water sigil.6=bright flash, the new sigil lay steaming on the table in a puddle of water. Thankfully the sigil was what I needed. I could link it to my network and place water wherever I wanted by simply tapping it on the ground. The water was pricy, requiring a full 100 LP for each bucket's worth that I created in the world, but for an infinite supply of water, creeping upwards to 50 full buckets for my puny network was something that I +Training, and water sigil.7=desperately needed. It's just a shame that it started to rain an hour after I created the sigil. +The Lava crystal.1= There was an explosion in the lab today as I was trying to work out a few more artifacts. When I tried to infuse a few buckets of lava with my power, and used some glass to contain the effect, the assembly simply burst into flames and flew me +The Lava crystal.2=across the workshop. I wasn't really hurt, and thankfully my water sigil was used promptly to put out the fires, however it seemed that my experiment failed rather heartily. Apparently I needed just a little bit more time, however, since I got it to work a week after. By combining some glass and obsidian together with a few buckets of lava, and throwing in my blood orb and a diamond to hold it all together, the diamond was +The Lava crystal.3=transmuted into a fiery crystal that seemed to... do nothing at all. I peeked out from behind the blast shield, since by then I learned that playing with lava was not the safest of hobbies, and gingerly linked the crystal to my network. As soon as the pact was completed, I felt a wave of heat emanate from the crystal, and promptly tossed it into a furnace before it could burn my fingers. I was unsuccessful on that front. +The Lava crystal.4=The furnace immediately kindled, and the pork that was sitting in the top slot began to cook quickly. Quickly feeling a wave of nausea, I checked my network out and found that I had nothing left to offer. Once I pulled the blasted thing out of the furnace and stuffed it into a chest, the nausea subsided. So this Lava Crystal could work in any sort of furnace and feed off of the owner's network, but if the network was dry it would +The Lava crystal.5=instead cause the owner to feel a hearty blast of nausea unless removed from the solid fuel-burning machine. Good to know, since now I know of a way to trade my services with the blacksmiths in the village. +Sigil of lava.1= Finally, the day that I have been waiting for the past 7 months has come. The "Hell's Harvest Festival" is a day that the village celebrates the creation of the first portal to the Nether a century ago. It's funny that when I ask the villagers why +Sigil of lava.2=it is that we celebrate the formation of a portal to Hell, they simply laugh and say that I'll see when I finally go in. The portal was located in a vast stone cathedral, a three day's walk from the village on foot. Magus said that he'd meet us there, because he had a few things that he needed to prepare before actually going over to the Nether, but I was curious as to how he'd make it there in time - knowing Master Magus, +Sigil of lava.3=he'd spend a day or two reading up on a new theory for a ritual and forget himself in his works. When we entered the hall, however, Master Magus was there already talking to one of the guards of the unlit portal, stowing away a gem into his pocket. I knew something was up, because I could see a strand connecting the gem in his pocket to both himself and one that trailed off back to the village. Not wanting to be +Sigil of lava.4=distracted, I pulled out my wand (Master Magus insists on all of his apprentices learning of another field of magic, and Thaumaturgy has proved itself useful) and set alight the portal as was the custom of the newest member to the harvest. It seems that the harvest, however, was not exactly a trade. I saw giant stone walls and vast pumps throughout the land, grabbing all of the lava from the great pool below. A large +Sigil of lava.5=collection of bound pigmen walked by, led away by someone in a full set of shining steel armour. Huge machines that processed the lava were emblazoned by the brands of industrialization: Thermal Expansion, BuildCraft, Greg Tech, and many other labels dotted throughout the base of operations. So much for a festival - it seemed that the Conglomeration, the governing body that oversaw all of the villages in the land, saw it fit to turn a +Sigil of lava.6=civilization into a circus. After accepting a few supplies from the farce, I walked back home by myself two days early. There were some things that I wanted to create, but wasting my time there would have been fruitless. Clearing my desk of debris charts of alchemical constructs, I set to work with a vat of magma cream that I brought with me, attempting to combine it with another slate. Casting my orb aside, I fished the lava +Sigil of lava.7=crystal from my chest and combined it with the cream and some fresh buckets of lava - thankfully not from the Nether. Once the light faded, I picked up the new Lava Sigil that lay in front of me. What this sigil does is it siphons energy and uses the properties of the lava crystal to super heat rock, creating a source of lava wherever the wielder touches the ground. So, infinite lava, and infinite fire hazards. +Sigil of lava.8=Unfortunately, it takes about 1 kLP per single use, which is a lot for my network as it stands currently. It looks like I need more power, but seeing that Master Magus is currently enjoying himself at the festival, I'm going to have to find a way to boost the blood altar myself. +Blank runes.1= Of course! Runes! Why didn't I think of this earlier? The power of the altar itself comes from the structure of the components used to create it. The force of the diamond alone is not enough to create stronger materials through transmutation. What I +Blank runes.2=need to do is construct several runes to extend the altar, and thus the altar's power. The only thing that I could do on such short notice is to take several blank slates (I have about 16 left) and quite a bit more stone and combine them with my Weak Blood orb. +Blank runes.2= What came next was the hard part. After I made 8 runes for myself, I sat puzzling over the altar. "How could I extend this thing?" I asked myself. It took a few hours, but when I placed the 8 runes in the ground around +Blank runes.3=the altar in a ring, I felt a strange reverberation in the air. Something felt like it awoke, as if the power in the surrounding environment doubled. Quickly, I grabbed my Divination Sigil and slapped it onto the altar, and focused into it to view the power of the altar. I was pleased to find out that the altar was finally at its second tier, which should open up many more transmutation recipes. The problem now, as I sank slowly +Blank runes.4=into my bed to sleep after the long day, was to find out what I could now do. Although Magus was pleased with the upgraded altar, I was caught in a bind. I couldn't seem to do anything with it that the previous altar could not do. The first thing I did was I placed one of my leftover blank slates into the basin, and it promptly consumed 2 kLP worth of essence as it reinforced the structure. Although this Reinforced +Blank runes.5=Slate was much more durable, this process appeared to make the slate no longer work with creating both the lava and water sigils, as well as making it a waste to use in additional rune creation. +Speed runes.1= I can note, however, that when I combined one of the runes with a few more blank slates and some leftover sugar from the harvest it seemed to augment the altar even further. The sugar had to be laid in a configuration that mimicked a bow and +Speed runes.2=arrow on top of the rune, and by doing so it created what I can dub a Speed Rune. What this rune appeared to do was increase the speed of the altar's processes, both the transmutation rate as well as the speed that a bound orb will consume the essence from the altar, by an additive 20% per rune. This tier doesn't seem perfect, however, since it seems that for the second tier only the four edge runes (not the corners) could be used as +Speed runes.3=upgrade "slots" for the purpose of augmentation of the altar. +A shining green orb.1= The "eureka" moment came when I accidentally dropped a few things on the floor of the lab. When I bent down to phish the items from the floor I noticed that one of the emeralds rolled right up to the altar, almost as if it longed to be inside of its +A shining green orb.2=basin. It occurred to me that if a simple diamond inside the altar created a weak blood orb, perhaps a much rarer gem would make a stronger version! Quickly fetching my knife from the table, I filled up the altar over the course of the day so that I could make sure I didn't mess anything up, and then dropped the emerald into the altar. The speed runes made sure that the transmutation took no time at all! Wow, those +A shining green orb.3=things work fast - I better make a note of removing the runes when I try to create more difficult items inside of the altar, because if I was not prepared it would have chewed through my supply in no time! After a few tantalizing moments waiting, the altar burst in a shower of particles and the new orb sat there, revolving on top of the altar. Master Magus must have heard my shout of exclamation, because he +A shining green orb.4=hurried over from his side of the house and helped me to my feet. Not noticing the pain in my palm from earlier, I reached for the orb and sealed it to my network. Master Magus then helped me to fill up the orb inside of the altar, and when we were done that day I had a total of 25 kLP inside of my network. +The void sigil.1= After resting the rest of the day at the insistence of Magus, I returned to work this morning full of inspiration. While I laid in bed half awake, the thought struck me that so far I had managed to use sigils to create fluid. So why not make +The void sigil.2=one that can remove it? My first attempts with things like glass bottles and bowls failed with all of them working for a brief moment, then returning to their old forms. It was almost lunch time when the thought crossed me that I used buckets for the first two, so why not here? Half an hour, six buckets, a bit of twine and a reinforced slate later I had my first void sigil. +Air sigil.1= While tending to our small farm a few days later, I noticed a bird land on our fence. I turned to face it as it flied off, and had a revelation as I watched how it flew. If I could use magic to create the gust of wind like that made by bird wings, +Air sigil.2=I could fly through the air! After hastily finishing the days' chores, working out details in my head all the while, I rushed to my workstation to start work on what I have now dubbed the "Air Sigil". Using feathers and a Ghast tear as ink on a reinforced slate, I formed a sigil that on use creates a rush of air behind where you face to propel you forward. Flight using this sigil is fast, if a little pricey and hard to control, not like the +Air sigil.3=flight provided by Magus's thaumostatic harness. Also, landing is a bit of a problem as I learned the hard way... +Sigil of Sight.1= I've grown a little annoyed at my divination sigil. While it is able to read the current tier and essence of a blood altar, that is ALL it can read. As a result, my current goal is to improve its design using my new blood orb. So far it is going +Sigil of Sight.2=well. The "Sigil of Sight" is able to read the buffers of the altar to give how much they store, as well as how far along a craft in the altar is and how fast it is using LP. The downside of this upgrade is that it loses the power to read the altar's tier or the users soul network, but so far this is an unavoidable loss. For now I'll settle with what it does now, and might try to improve it further later. +Advanced altar mechanics.1= Even after all this time, I still don't fully understand the blood altar. Sure, I built the thing, but... It is almost like working directly with raw life essence has given it a bit of life of its own. After running a few experiments to try and make my life easier, I've noticed some odd behavior coming from it. First, I tried using some basic piping to extract life essence to store later to use for more pricey +Advanced altar mechanics.2=infusions. As it turns out, the altar doesn't like giving up its essence. I managed to get a bucket of LE out before it seemed to slow to a trickle feed, nothing more the 20LP a second. Further tests show that it has a "Buffer" tank that siphons off LP from the main tank, holding roughly 10% of the main tanks capacity. As I mentioned, it does this very slowly so piping is out of the question for now... A later test shows that it +Advanced altar mechanics.3=also doesn't like essence being piped in, as a similar restriction apples to imputing essence. I will defiantly need to find a way to improve this transfer rate... Another strange phenomenon about the altar is its "Hunger" for life. After the failure of the piping, I tried using a few regeneration potions from the local village to speed up the rate at which I recovered health. A normal or extended potion +Advanced altar mechanics.4=seemed fine, and were very effective for speeding up slate production. But a strengthened regeneration potion caused the altar to have a slight "Hum" about it, and I felt my energy being sapped by something. After talking with Magus about this, we have determined the altar senses the life flowing through us, and the potion makes the altars "Hunger" for this life create a sort of aura that causes you to lose energy akin to hunger. As a +Advanced altar mechanics.5=result of this, regeneration is still effective, but a sizable supply of food is needed for extended use to recover energy. +Sigil of the fast miner.1= I've decided to experiment with passive effects for sigils, since everything so far has been an active effect. While wondering through town looking for supplies, I noticed people cutting wood for a fire and some smashing stones to +Sigil of the fast miner.2=build a small fire pit. I keep coming back to how slow both of them were in my train of thought, then started going over ways to improve the tools. Then it hit me: Why improve the tools when you can improve the person? A few anatomy books and failed tests later, I hand the sigil of the Fast miner(Name pending) and two very tired arms. After activating the sigil, it speeds up muscle movements in the arms allowing you to break blocks +Sigil of the fast miner.3=far faster at a small LP cost every few seconds. I do need to keep reminding myself to turn it off when not in use, but the stinging pain of life essence being taken is always a quick reminder... +Soul Fray.1= Today I pushed myself too far. I've gotten close a few times, but today was the first time I have passed out due to draining too much life essence. Magus was thankfully with me at the time, and moved me to a bed to recover. As I regained my senses, I noticed something odd about my soul network thread: They were thin and looked damaged. As I kept watching my threads, it seemed like they were slowly reforming and repairing +Soul Fray.2=themselves. I mentioned this to Magus, and we theorized that after coming so close to death my soul was still recovering from the shock. I made a sacrifice at the altar to test this, and it seems that this state effects how much life essence a heart is worth quite negatively with it only giving a tenth the normal amount. +Green grove.1= Today Magus showed me his green grove ritual, a way to speed up crops. Unfortunately, it is very static and has a small range, limiting its uses. To amend this, I've been toying with the concepts behind the ritual in an attempt to make +Green grove.2=it more portable. By creating an ink from oak saplings and sugarcane, then inscribing a rune on a reinforced slate I have created the sigil of the green grove. It seems a little slower and more expensive then the ritual form, but it can be carried on your person and acts like bonemeal when used on plants. While I had it active I could barely keep up with our farm, and by the end we needed to give a few of our neighbors some of the excess +Green grove.3=we didn't need. They all accepted it, but with varied degrees of reluctance. +Dagger of sacrifice.1= My work on sigils has slowed for now as I'm reaching the limits of what my little green orb can do after only two weeks. As a result, I have turned my attentions to other aspects such as runes to pass the time. Magus is currently out +Dagger of sacrifice.2=dealing with a large forest fire to the east of us, and the village is in a bit of a lull with nothing planed for several weeks. Right now my task is to slaughter a few chickens Magus brought home from the market to prepare on his return home, and it seems the perfect time to test an idea I've been thinking about for a while... I will not mark it here, just in case it is another false hope. Success! I've managed to +Dagger of sacrifice.3=perfect my idea for a new source of life essence. Before the only option was to cut ourselves to give our own life essence to the altar, but now we have a way to use other living things as a source. Unfortunately, it is a little gruesome and a bit "All or nothing" from them... Regardless, it works! ...I have realized that, in my excitement, I may have forgotten to write down what it is. I call it "The Dagger of Sacrifice", formed in a +Dagger of sacrifice.4=blood altar out of an iron sword and 3K LP. The dagger doesn't deal much in the way of damage. It doesn't need to, as its main purpose is to "Mark" a living thing for the altar which takes care of the rest by forcibly extracting their life essence all at once. Through my tests it seems that your common farm animal's life isn't worth nearly as much as a person, only giving 250LP regardless of where it comes from. While I set about cleaning the +Dagger of sacrifice.5=animals after the tests were done, a common zombie managed to sneak in the door I left open when bringing the chickens down here. As soon as I noticed it, reflexes that were being drilled in by Magus every morning kicked in and I managed to poke it with my dagger before it had a chance to hurt me. At first I thought nothing happened, then it fell to the floor as lifeless as it should have already been. I glanced at the altar, quickly noting that +Dagger of sacrifice.6=a zombie was worth 500LP. Looking over the fallen creature as it started crumbling, I noticed that some of the defenses Magus had set up took there toll on the zombie as it was burned and freshly cut in several areas... Seems that the amount of HP they have is irreverent to the altar, giving the same amount of LP regardless. As I finished preparing the meat to cook after disposing of the zombies ash(Which +Dagger of sacrifice.7=reminds me, I wanted to look up why this happens...), a very dark thought crossed my mind. The knife works by giving life to the altar. The dagger works by taking life forcibly from a target. What would happen if a human was marked by the dagger? I asked this to Magus, after showing him the dagger and telling him everything that happened. "In all honestly, I'm not sure. I have a theory, but I don't really feel like testing it..." I asked him to +Dagger of sacrifice.8=elaborate, so he told me the basics of it. It seemed that source of the life essence mattered with the dagger, since the chicken and zombie gave two different amounts, so depending on the person in question they would be split into one of three groups: Passive, Hostile, and Innocent. The passive would be like the chicken, only giving a little. The hostile would be the bandits, the thieves, the murderers. The ones who gave into evil, and +Dagger of sacrifice.9=now seek to hurt or steal from anyone. The unredeemed, and would probably be like the zombie. The final group were the innocents, anyone who doesn't fall into the first two groups. It was nothing but a guess, but we agreed that using the dagger on an Innocent villager would extract all of their life essence like ours. 2K LP, all at once... We also couldn't work out what would divide the passive from the rest, but it was only a theory so +Dagger of sacrifice.10=we put it to rest. +Runes of Sacrifice.1= Looking at these little speed runes, I have decided to see what else can I make. My goal isn't anything in particular, just improving it in some way. The speed rune was made with powdered sugar, so another type of powder should work... +Runes of Sacrifice.2=Redstone failed, gunpowder failed, glowstone... Glowstone worked. I currently have no idea what it does, all I know is it didn't fall to bits seconds after creating it so that is progress. The altar seems to accept it as a proper rune, so all that is left is to run a few tests in the morning. For now, I am tired and feel a bed calling me... I've run dozens of tests trying to find out what this new rune does, after two +Runes of Sacrifice.3=days of obsessing over this I finally noticed it. It slightly increases the amount of LP self sacrifice gives. When I said slight, I mean one rune increases LP gained by ten percent on an additive rate. For those who don't understand that, it basically adds an additional twenty LP per self sacrifice. If my theory is right, I should be able to make a similar rune for normal sacrifice... What else would the altar respond to? +Runes of Sacrifice.3= Well, if there is anything thaumaturgy and magic in general has taught me, it is that gold is a very good metal for magic. By simply replacing the glowstone in the recipe with gold ingots, a sacrifice rune is formed. It has the same additional +Runes of Sacrifice.4=ten percent addition per rune per sacrifice, meaning the more LP of the mob sacrificed the more LP the runes adds. This has got me thinking... The altar was constructed with both diamond and gold. It seems to resonate with the diamond enough to make the first blood orb, and even a second, so why not try making one out of gold? I'll need to revisit this idea later as a test run showed some reaction to a block of +Runes of Sacrifice.5=solid gold(I didn't ask Magus where he got it, and he doesn't seem forthcoming about these matters), but the altar couldn't cope with the strain needed to shape the block. Before catastrophic failure happened, a few safety precautions Magus and I had built into the altar triggered, stopping the transmutation before... Well, neither of us are really sure what would happen. But Magus said he has dealt with matters of unstable and +Runes of Sacrifice.6=untested magic, and knew most of them end with a crater in the floor(Hence the safety precautions). It has been a few days since the experiment with the gold block. Magus and I have been discussing what to do now, as the altar is getting bigger then the basement. Magus has suggested moving it to some of the lower basement floors, but considering just how large it might be in the future... I finally got him to agree to +Runes of Sacrifice.7=building it behind his home, as long as I helped put up a few wards and spells to keep people away. Currently we're planning out the structure and needed runes for upgrading. The current altar only has eight runes, but what I have planned will more then triple that number to twenty eight. The current limitation we suffer is the strength of the altar itself, as it can only take power from runes adjacent to it. My plan is to use something the +Runes of Sacrifice.8=altar is naturally attuned to as a way to not only increase the range of this effect, but act as a counter balance and stabilizing it to prevent it from becoming uncontrollable. For this to work, the blocks in question must be above the altar and an equal distance apart. We've run several tests and calculations, and have a layout in mind for this upgrade. Four pillars topped with glowstone blocks, twenty runes in sections of five, +Runes of Sacrifice.9=built one block down and two out from the last set of runes. In theory this should provide a huge boost in power to the altar without risking our safety(Well, more then we normally risk it), but until we test full scale I can't be sure. For now, we have a lot of runes to make. After much debate we've decided to invest in the "Self sacrifice" runes, as having a steady supply of mobs will be tricky. But now I face the issue of making +Runes of Sacrifice.10=dozens of reinforced slates... I need to think on this. +The blood letters pack.1= It's so simple! I've discovered a way of obtaining LP for making slates that means I don't wait at the altar all day: The Blood letter's Backpack. Made with a modified leather chest-piece with a blank slate reinforced glass tank, it allows the wearer to gather LP by feeding it into the pack over time. Whenever the wearer has more then five hearts, the pack will drain their life and store it inside up to 10K LP to be +The blood letters pack.2=dumped into an altar later. This pack does have two shortcomings, however. When the life essence is deposited into the altar, runes will have no bonus to the amount added. The second problem is that the altar will only accept LP from the pack when not performing a transmutation. Despite these limitations, it will prove quite valuable for simply allowing me to step away from the altar to do other tasks. This is a simple progress +The blood letters pack.3=update, as it's been a few weeks since I last wrote in this journal. I've been making slow, but steady progress with assembling the slates needed for the runes and we're now halfway through. This isn't the only reason for the lack of entries, as I've been preoccupied with my research thorough thaumaturgy. An old friend of Magus has been visiting and happens to be a well versed thaumaturge, and he has been giving me pointers on how I +The blood letters pack.4=could be doing better while Magus has been preoccupied in his library dealing with a mountain of paperwork. Now that Master Ridden has returned home, I hope to progress farther in making runes in the next few days. +And then there was five.1= Or not, as it seems Fate has other far more interesting plans for us. Today we had a knock on our door while I was making the last of the runes, and after opening it was greeted by three apparent orphans. The two boys in the front looked like they were brothers, or at least close relatives. The girl hiding behind them on the other hand had a very different hair and eye color, so relation was unlikely at best. All of them were +And then there was five.2=covered in dirt, clothing ripped, torn, and patched with various levels of skill. The one on the left had an old sword with a chipped blade on his side, was slightly thinner and taller then the his brother, had a few deep scars that looked recent, long and messy dark brown hair, and was looking at me with a kind poker face. The brother looked more muscled, and was staring at me with a very analytical eyes and a similar poker +And then there was five.3=face, his hair was slightly shorter and lighter then his brother. From what I could see of the girl, she had a simple dress on that was almost caked in dirt and dried mud. The fabric near her elbows was becoming thread bare, and a large rip near the bottom of the dress exposed some of her right leg. Her hair was a light blond, almost pale white color, but the most shocking feature was her eyes... I haven't seen haunted eyes +And then there was five.4=like that in years, and last time it was in a mirror. From the looks of them, all of them hadn't ate anything in days and seemed to have everything they own on their bodies or in the simple packs on their backs. I asked them if there was anything they needed, to which the elder brother said they were looking for master Magus. I called Magus to the door, visitors being a rare thing as it stands with ones who ask for him by name and +And then there was five.5=not clearly mages being rarer still. Five minutes later we all sat in the main room, eating simple sandwiches I had prepared for us all at the request of Magus. Needless to say, this day was not going as expected. Magus spent the next few minutes practically interrogating the elder brother , asking questions on both of our minds. As it turns out the two brothers, Vlad and Demier, use to be caravan traders, eldest a +And then there was five.6=alchemist with basic knowledge of potion brewing, younger with enough mana and training already to cast basic spells. The girl on the other hand had a story all her own. From what the brothers had managed to gather, her village was raided like my own was and she was evidently the sole survivor. What shocked me was when they said she was found wandering the ashs, demons having left hours before without so much as a +And then there was five.7=scratch on her body. Vlad was with the traders when they found her, and he was forced to leave them if he wanted to help the girl named Bella. Their story seemed to win Magus over, as he told them he would try to do what he can for them.. Not long after that, Magus asked me to help him do some shopping for our new guests. On the way to the village, Magus asked me what I thought of the three. "I can't say I believe all their +And then there was five.8=story, but I also don't think their lying. Did you notice the girls eyes? Haven't see a look like that since...". Magus finished for me with "Your own?". I nodded at the dark memories of that time. We continued going over the details of their story, but we agreed that just leaving them in the cold wasn't an option worth considering. We decided to at least try to keep our recent endeavors into blood magic a secret from them, but when push comes to shove I +And then there was five.9=think we might have to let them in on the secret. Magus let out a long sigh. "It's been years since I had to juggle this many apprentices at once. I'm going to need your help training them. But something tell me that we're going to be learning as much from them as they will from us..." I asked him why he felt that way, and he said it was just a gut feeling. I must say I had a similar feeling. Things like this don't happen without reason, and of all +And then there was five.10=mages to come to they stopped at our door, something far easier said then done. An hour later we returned home, both our arms heavy with fabrics, food, and other necessities that we will need to take care of the new apprentices. I watched in amazement as the three ate, trying to make up for days with little food all at once. After that, Magus and I laid the three on various chairs and couches to rest, the +And then there was five.11=strain of travel catching up with them. While Magus dug around looking for a few of his old things that we'd soon need, I started creating some new clothing from enchanted fabric for the three to replace their current worn and ratty clothing. Now that that is done, I should try to get some sleep. Something is telling me tomorrow is going to be quite busy. The Early this morning Magus and I started carving out the earth for the three +And then there was five.12=new bedrooms, since the old ones Magus use to have had since been converted into a storage closet, a alchemy lab, and small study. It didn't take nearly as long as I expected with Magus using a few spells to clear away earth while I went behind using an equal trade foci to transmute it into stone brick before gravity caught on. Once that was done, Magus raised a few walls to separate the space into three rooms and a hallway. +And then there was five.13=Only after that was done did I notice the three children had awoken, and were watching us as we worked. Magus told them that he had some spare furniture in some storerooms they could use, but sadly only knew of one bed. It didn't take long for them to decide Bella got the bed, the brothers would make do with a pillow and a blanket on the floor. After that we spent the rest of the day hunting for then moving furniture to their +And then there was five.14=rooms, building little work areas and libraries for each of them. The following day was more of the same, with the evening filled with helping them find books to read from the grand library. Vlad grabbed as many alchemy books as possible, Demir took a few books on spell casting, and Bella took a Lexica botanica to read through. Later this evening, after the three had retired to their rooms, I sat in the main room with Magus, arms and legs +And then there was five.15=aching from the heavy lifting of the last two days. I told Magus how I thought their rooms should be almost finished, and how I spent the last hour before they retired just answering seemingly endless questions. "I'm sure. I've gone through the same more then once, when I have apprentices new to magic. You were the same, I recall." I opened my mouth to protest, but closed it as I thought back to those days. I decided I probably was as bad as +And then there was five.16=them, and left it at that. It's been just over a week, and the three have settled in nicely. They join Magus and I in morning exorcising, have started studying like true scholars, and have calmed the hungry nodes in their stomachs(Well, Vlad and Bella have. Demir on the other hand is another matter, but I feel he will always be like that.) Unfortunately, like true scholars and mages they've stumbled into places we didn't want them to go. Vlad has +And then there was five.17=created a chemistry set that uses life essence from a blood orb as a fuel source, Demir has turned an old table into a way to use life essence to cast powerful spells, and Bella... She's left me questioning what I know about demons, after taming one and using a blood orb to bind it to her. All three of them have stumbled blindly into blood magic, and now I don't think we'll be able to stop them. Magus and I have agreed to give them a choice +And then there was five.18=in whether they are blood mages or not, but I've seen the light in their eyes... I can't imagine any of them saying no. To seal their dedication to the art, we will have them make blood orbs of their own to use. +The next step: Tier three.1= Even with all the chaos of the last week I've managed to finish the altar construction, and it has been more successful then I predicted. With full access to twenty eight runes, each heart is now worth over seven +The next step: Tier three.2=hundred LP. I've already started prepping to try again with the gold block, having a few instant healing potions at hand. I got a brief glimpse with my sigil of sight, and this transmutation will take twenty five thousand LP to finish, over double what the altar can hold! Writing this down does give me an idea, however.... I'll need to look into it further once I have finished making this. +The next step: Tier three.2= It was close, but I finished the orb today. I was down to the last of my three potions and barely had the strength left to hold the knife, but I pulled through and finished my shiny new blood orb! I've already used it to craft a few things I had made before, +The next step: Tier three.3=and extra lava and air sigil, and it handles it all with such ease! Now that this is finished, I have a small list of ideas to go through... To start off the process, I want a stronger slate. As it stands the reinforced type is cracking under the strain I'm starting to place on it. Well, I got a new slate type when I last upgraded the altar... Let's see if it works again. It does! A reinforced slate in a tier three altar with around five thousand LP +The next step: Tier three.4=makes a new slate... I'll call it an imbued slate for now, and come up with a better name later. +New runes.1= First up to the drawing board: Rune of Capacity. The basic idea is simply to add more room to the altar, so a greater amount of LP can be stored at once to make bulk crafting or difficult crafts easier. Each rune adds 1K to the altar's main tank +New runes.2=capacity, but what is interesting is that the "Buffer" tanks expend as well to a lesser degree. From a few trial tests(My back is starting to hurt from moving runes all day), the buffer tanks are always ten percent of the main tanks size. This will be something to keep in mind later. After helping patch a hole in the wall caused by Demir accidentally unleashing a spell, then helping Vlad dispose of a few failed +New runes.3=alchemical "Experiments", I finally have an hour to myself to work on my ideas for runes. After the success of the last documented attempt, I've been on a bit of a failure streak. I've have runes fail to do anything, crumble to dust, blow up, and one attempt turned into cheese(I asked Magus about this, and said this isn't the first time he's seen that happen to a magical experiment. However he is just as stumped as I am over +New runes.4=why it is always cheese, of all things). Thankfully, I finally found something that doesn't need a blast shield to use or starts growing mold after a while. +New runes.4= Named the dislocation rune, it's only function is to increase the rate the life essence flows into and out of the buffers. Each rune increased the transfer rate by twenty percent per rune, and this effect stack manipulatively. That sounds +New runes.5=great, until you realize the first rune only raises the transfer rate by four LP a second. Needless to say, your going to need around a dozen of these runes before you have any noticeable impact on the transfer rate. While these runes make it possible to automate the creation of slates by storing the life essence outside the altar, you're going to be sacrificing speed, capacity, and generation efficiency for this. +Sigil of Magnetism.1= It's been a few weeks since I last made any headway with my blood magic research, needing to help with the tutoring of the Vlad, Demir and Bella along with my normal duties as a mage. I've had to leave twice this month in order to sort out some +Sigil of Magnetism.2=mess or another, whether is be a helping with a pack of wild wolves or a bad harvest. Today, however, I managed to get some inspiration for a new sigil. When I was in the market buy more food, I noticed two children playing with a rock that was slightly magnetic. They were just running around, seeing what it would stick too and cheering when it did, or seeing how close they could push it to something before it pulled itself closer... That +Sigil of Magnetism.3=is what sparked my idea: A sigil that acts as a magnet, pulling items off the ground closer to you. In theory I could rig the magic on it to apply a similar effect to all items and not just metallic ones... Three hours later, and my sigil is finished. It needs a great deal of mass in the form of four iron blocks, along with the classic gold plating infused into an imbued slate(Drat, I never did work on a better name). This +Sigil of Magnetism.4=sigil needs to be toggled to activate, and while active will draw all nearby items to the user if they have room for it. Simple, but very effective.... +The Phantom Bridge.1= I've been asked to visit a small town to settle a few complaints that have been voiced lately by them, and am currently surprised that a closer bridge isn't one of them. I've had to walk three miles to cross this river, and now must walk another +The Phantom Bridge.2=two tomorrow to reach them. If only I didn't need a bridge, or had thought to grab my air sigil(I still have a bruise from the last landing I had with it, so I wasn't keen on using it again so soon.) Wait... If if I had a bridge that went with me? Better yet, what if I had a bridge that formed under my feet as I walked? Yes, that would be amazing... I'm back home after dealing with a feud over who really owned a cow(Answer: Neither +The Phantom Bridge.3=of them, it wondered into town and they both thought it was one of their own), and have set out my work station to try and capitalize on my idea. I'd want the sigil to place blocks that are phantasmal, only there temporarily before fading into nothing after I leave. For that I'd need a special material... Soul sand might work... Add in a little stone for structuring around an imbued state, then use the orb... Done! Now then, for a +The Phantom Bridge.4=test run... Drat, I left the auto-writing quill running again. It works better then I hoped! The sigil creates a small five by five platform under me, staying at the same elevation as I walk through the air. Not only that, but I've tweaked it so that holding shift lowers the platform by one under you, and the blocks it makes can be easily broken for a quick decent. Not only that, but it will only spawn the blocks if +The Phantom Bridge.5=you are on the ground, jumping or flying will not cause the bridge to reform until you touch solid ground, unless you hold shift forcing it to form under you. And for one final convenience touch, right clicking a phantom block with a block replaces it with that block, making roofs and platforms far easier to build. That should be enough for one night, I'll dub this sigil "The Phantom Bridge" and call it a night. +Sigil of holding.1= Vlad asked me to help him today, requesting my assistance learning the sigils. Part way through he asked if it was ever burdensome having so many on me at once... And I told him it was. Now with a little of his help I've created the +Sigil of holding.2=sigil of holding, and it... Well, it holds other sigils. Shift right clicking with it while another sigil is in your inventory will cause it to absorb that sigil, taking all of it's powers and allowing you to swap between them with a shift right click. Unfortunately, it can't hold that many sigils(Only four) and not every sigil wants be become a part of it. Also, I had to ask Master Magus for help removing sigils from it as it refused to let them go. +Sigil of holding.3=For this task he created the ritual of unbinding, a rather grand looking ritual for such a simple task I must say. +Elemental affinity.1= Demir hurt himself again today with a fire spell that backfired(Well, it worked perfectly if setting the ground around him on fire was the intention). In hopes of stopping further injuries, I have infused the powers of the water, lava, and air sigil +Elemental affinity.2=into an imbued slate. This seems let the sigil act as protective aura around the user, shielding them from drowning, burning, or falling damage at a high over time LP cost. Since I asked Demir to use it he hasn't burned or bruised himself, but did pass out once from a lack of LP to fuel it. Sometimes solving one problem only makes more... But he has been learning, and I've been amazed at what his spells could do. Recently he made a +Elemental affinity.3=long range teleportation spell and a flight spell not unlike the air sigil, but far faster. +Recreating ritual stones.1= +Recreating ritual stones.1= +Recreating ritual stones.2=After a few days of nothing, I turned my attention to the construction of Master Magus's ritual stones. Looking them over, I might be able to replicate their usage and features using reinforced slates and obsidian... Master stone, more complicated then the average ritual stone might be possible if I use my magician's blood orb and four ritual stones to handle the complex nature of it, along with a little more obsidian... +Recreating ritual stones.3=Yes, yes it should be possible to recreate them without sacrificing any usage of them. After asking him how he originally made the elemental scribing tools, I believe I can also replicate the manufacturing of them in the blood altar... But it looks like the dusk inks are too complex for this altar to handle, creating an ink closer to dark gray then midnight black... Perhaps I'll have the power to form them later, for now these four will +Recreating ritual stones.4=work. +Shining a Blood Lamp.1= I had a flash of inspiration today (Quite literally, as watching a few town guards light a replacement torch nearly blinded me from the sudden light). They spend so much on coal and charcoal to fuel those things... What if I had a simple replacement? A +Shining a Blood Lamp.2=near invisible light source that never goes out, can be made almost endlessly, and can easily be carried on your person? Never again would you need to place a torch to light a room, and they can ruin a rooms look(Not to mention the fire hazard they pose, ruining the look even more. "Charred mess" is never in style.). Harnessing the power of glowstone by running a "Current" of LP through it, I can create a sigil that fires +Shining a Blood Lamp.3=a projectile that upon landing forms a stable light source par with that of torch. The only sign of its existence is the light it gives off and faint red particles. While it uses a small amount of LP, the advantage over carrying stacks of torches is enough to justify it. +Bound armor.1= Today Magus gave us a lecture on armors, going over the practical applications(Protection from large pointy sticks shoved in your direction and holding magic to improve the abilities of the wearer), typical construction of armor, and notable armors through the ages (And the very fatal flaws that their owners eventually discovered, much to their short lived dismay). Seeing and reading all this, I feel it is time I +Bound armor.2=take my own try at this art using blood magic. Testing a wide array of materials and structures, I discovered a process to make an almost indestructible metal using a casing filled with life essence with glass hardened with diamonds and reinforced with bright red blood shards(More on their properties later) Magus showed me a while back (Making the prototypes of this armor took longer then you would believe). The +Bound armor.3=process needs the soul of a demon bound to it, but this seems to be a small price to pay. +Bound armor.3= +Bound armor.3= +Bound armor.4=To start, you need to make a "Soul armor forge". This block summons the demon soul and controls the transformation of the "Socket" blocks into proper armor. By placing the filled socket blocks around the soul armor forge in roughly the shape of the armor piece you want with the forge in a gap, you set what it makes. Right clicking the forge will then finish the process, creating the armor piece and binding the demon to the +Bound armor.5=shards inside the armor. You will need to bind the armor to yourself, allowing the armor to drain your network to repair any damage it takes(Another benefit of using blood shards in the creation). After donning the armor(Making a few adjustments, still refining the creation process), I asked Magus to help test just how resistant this armor really is. Several nasty bruises later, we have decided this armor shields +Bound armor.6=the wearer from ninety percent of damage from mundane damage sources. What is interesting is that it also blocks roughly eighty percent of magical damage, meaning many armor piercing methods are far weaker. The metal also doesn't seem to hold enchantments, and the demons inside reacts quite negatively to our attempts to do so. Using the ritual of unbinding, we are able to deconstruct the armor back +Bound armor.7=into the component sockets and anything that was inside them. I mention this because we seem to be able to "Augment" the armor before creation by adding a combination of sigils, blood shard, and an orb. The sigil added to the armor piece(You can add anything to the socket by right clicking with the item in hand) determines the effect, and adds a passive cost to wearing the armor piece. The blood shard lets you add an upgrade, the +Bound armor.8=weak shards we have at our disposal only allow one upgrade but in theory a stronger shard should allow more to be added. Finally, the orb seems to lower the cost of the upgrade. Every sigil seems to have something to do with the normal effect of the sigil, either giving you a passive bonus or having the effect of the sigil happen automatically around you. A few examples are a water sigil making you immune to drowning, the fast miner +Bound armor.9=always active, and a green grove sigil acts around you. +Sanguine armor.1= I've managed to use my new found knowledge of armors and experience making bound armor to try and improve thaumium armor using blood magic. By throwing goggles of reviling or thumium chestplate, leggings, or boots the ritual transform the +Sanguine armor.2=armor into a "Sanguine" version, with a small vis discount and protection par that of pure diamond. What is really interesting is that this armor can be augmented with runic shielding, and then socketed into bound armor in the same fashion as a sigil to pass on the runic shielding, with the bonus that adding the sanguine helm to the bound helm well allow the wearer to see things like aura nodes as if you had goggles on. I should note +Sanguine armor.3=that you can only socket a sanguine armor piece into a same armor type(Helm in the helm, boots in the boots...), and that any vis discount is lost when you do this. +Suppressing the soul.1= Having the armors special effects all the time has become a little bothersome. To deal with this I have managed to create an "Armor Inhibitor" to repress the special effects it offers in the cases they are more bothersome then helpful. +Suppressing the soul.2=Unfortunately, it is a bit all or nothing in this regard. +The ritual diviner.1= It's coming up to the three year anniversary of Magus taking my on as an apprentice. Time seems to have flown by while I've been engrossed in research on applications of blood magic and working with Magus... I should make a gift for Magus +The ritual diviner.2=to as a thank you for these last few years. Considering the complex nature of his rituals, an aid to building them might just be the perfect gift... Ugh... Making a way to build rituals easier proved to be quite the task(And it reminds me of the rule of conservation of effort...), but I finally have it ready in time for the anniversary. While it isn't cheap to craft(Costing the four elemental inks, four diamonds +The ritual diviner.3=and an emerald), I've gone to pains to make it easy to use. Shift right clicking will cycle through a preset list of rituals, and shift right clicking on a block with also rotate the direction the ritual will face(For anything like the ritual of speed, where that matters). Shift left clicking will go through this list in reverse, for those times you accidentally go past the one you want. By normal right clicking on a master ritual stone the +The ritual diviner.4=diviner will take stones out of your inventory, place then in the world and ink them to build the set ritual. To make it clear it is working, it emits green particle effects whenever it places a block successfully. However, it can only place a block in an empty space. Anything at all in the way will stop the process until the obstruction has been removed. It is a small annoyance, but nothing major enough to risk breaking the diviner(Again). +The ritual diviner.5=Magus adores his gift, having rituals faster and easier to build is the one thing he could actually use(That he doesn't already have). The fact it makes anyone who uses rituals lives easier is a just a bonus at this point. As it turns out, he got me a gift as well: A pair of ichorium wand caps, the one thing I had been dreaming about for a long time... +Blood shards.1= Reading through my older entries for inspiration on things to do with our current power(I believe we have started reaching the limit, struggling to stretch what we have as far as it will go) I noticed that I "Might" have forgotten about covering the +Blood shards.2=blood shards like I said I would a few months ago... I'd best start from the top. Blood shards, as Magus has likely stated already, are fragments left behind after vanquishing a hostile mob with a demonic weapon(The Bound sword or Energy Blaster). Upon close inspection, I see small strands that looks shockingly like that of our soul networks... Well, in theory anything with a "Soul" could have a network, but this is a +Blood shards.3=surprise nonetheless. Because of this, the small shards contain a vast pool of energy that our magics should be able to tap into. A rather unfortunate first experiment involving stone showed that this energy can be wielded to create or transform matter(I believe several others have come across similar principles to convert energy into matter using science). I say unfortunate because I was stuck inside the lab's supply +Blood shards.4=closet for a few hours to hide from the rapidly expanding stone as the released energy of the shard grew the stone to thirty two times it's former size, filling the rooms and pushing out the open door and into the hallway. (Further crafting of blood stone was done outside after that...) But regardless, the blood shards potential energy and connection to the soul network is how we manged to form bound armor so easily. +Blood shards.5=Thinking about it... Blood shards might be the answer to our power problems. The last time we needed an upgrade, we used something related to the altar... Perhaps using something related to the soul network is the next step? +The life of a Mage.1= Once more I must make a progress update, as daily life as taken up most of my time these last few weeks. Magus has started offloading some of his work onto us, dealing with small problems and formal matters, bandits and demons, and general mage work. I have been able to do a little work on the altar or blood magic in general over the last few months because of this. Thankfully, we've burned though most of the grunt work that has piled up +The life of a Mage.2=and I now have some time to conduct our research. Magus and I have spent the last week doing the calculations for upgrading the altar, determining that bloodstone should work for the capstone, and now it is just a matter of seeing how many runes we can get away with adding without nasty side effects or it all just blowing up(The other three have placed bets on this, I believe). +The life of a Mage.2= After another few weeks of testing, balancing, and error we have finished the altar upgrade. This new tier adds twenty eight more runes to the altar's structure(Seven on each side, for a grand total of fifty six), and four pillars +The life of a Mage.3=capped with large bloodstone brick(This was the best material we could find that doesn't expire or fall apart. Or, in one memorable case, actively try to kill us). With these additional runes we are projected to be making roughly one thousand three hundred LP for every heart sacrificed, a hefty improvement from our seven hundred from before. Unfortunately more work has come in for us, so once we have the altar built it will +The life of a Mage.4=be some time before we can focus on the hunt for the material for the orb. Current plan is to start with precious materials like before, and work from there. Ah, innovation... Ten percent work, fifteen percent knowledge, five percent patience, seventy percent trying random things to see what happens. More work then expected flooded in at once, and we have been struggling to keep up with it all. Vlad has been +The life of a Mage.5=acting as a healer and doctor trying to deal with a plague that has going around (Caused by a witch-in-training using the wrong vial in a love potion), and has managed to keep it from running wild. Demir has been clearing out known bandit camps, and has enjoyed a chance to test out the spells we've helped him build(Only in the mage guild are bandits considered an endangered species. This is in part due to the average +The life of a Mage.6=intelligence level of said bandits, and thinking that an area where there are people who, sometimes quite literally, shoot fire out of their hands, mouths, and other places(Mostly the apprentice mages, as a joke or party trick that has often gone very wrong) is a great place to set up shop.). Bella meanwhile has been dealing with the demons that have been wondering in, the mage guild acting as a sort of beacon to them due to the +The life of a Mage.7=thinness of the fabric of space here caused by countless magical experiments, both successful and not. Magus and I have been going through a huge pile of letters(Seriously, where are they all coming from, and how do I not notice the pile building up until it flows off the table?) from local villages and mages, ranging from simple questions about an issue or problem to requests for assistance in matters ranging from theft to +The life of a Mage.8=flooding. We've been coordinating these issues, mapping out journeys to deal with as many as possible on one trip. As a reference point for how long it has taken us to deal with it all, dust has gathered on this book since the last time I wrote. Thankfully we've sorted out the letters and referenced the villagers to mages who are closer to them(Much to said mages chagrin), so it should be a while until this +The life of a Mage.9=is an issue again... Thankfully all this time has left me with a few ideas for future projects. +The masters of T4 altars.1= The others have tried countless gems and metals trying to create a new blood orb, all of them either did nothing or created a flawed orb(Cracked or chipped, extremely fragile or incomplete). But last night I had an idea from a dream... +The masters of T4 altars.2=The weak blood shards were once part of a soul network, so what would happen if we tried to reforge it into a whole orb? It is better then any other idea we've had, so I might as well try... Success! While we did burn through several instant health flasks, we now have half a dozen new blood orbs. While we haven't named them yet, they are a true master piece... A Master blood orb, that name has a nice ring to it... I'm getting side tracked +The masters of T4 altars.3=again, but I must remember to suggest this name to the others(It at least is better then the temporary name of "Shiny yellow blood orb"). With this new found power, I might be able to bring to life some of the ideas that have been just out of reach up to this point. The first interesting property of these new orbs has been shown in our bound armor. While lesser orbs simply lower the cost, this orb is able to negate it +The masters of T4 altars.4=entirely! A simple upgrade, but a very useful one... Another altar tier, another slate tier. Dubbed "Demonic" after the insignia that has formed on it's surface, we should be able to put this to some good use... I've also noticed that a demonic slate can be used with a weak blood shard and master orb to "Grow" the shard making four more. Going over my earlier successful experiments, I might be able to tweak a few +The masters of T4 altars.5=concepts used to achieve a new result. I'm starting with the fast miner, and if boosting my arms was this useful then what would happen if I augment my legs? Using cookies, sugar, and some of the normal materials I have created a new sigil. Time for a test run... Two hours(And two very sore legs) later, I've concluded the tests. The "Sigil of Haste" boosts the users leg muscles, allowing you to both run faster and jump higher then +The masters of T4 altars.6=normal. The best part? It seems to stack with the effect of jump boost and speed(Which Vlad was kind enough to brew a potion for testing). Now then, I need a rest after all this... +The sigil of whirlwinds.1= Continuing with my thought process of "Reworking the old", I have used a master orb, demonic slate, two ghast tears, and feathers to reform an air sigil. The "Whirlwind sigil" changes the core property of the air sigil to have the winds not effect the +The sigil of whirlwinds.2=user by propelling them, but instead creates a bubble of wind around them pushing away many forms of projectiles. I should note that not all forms of projectiles can be pushed back by the winds, and it has a tendency to effect your own shots. It isn't perfect, but it is useful enough to have around in a pinch. +The sigil of compression.1= After hearing the local miners complain about always having to stop work because they've run out of space in their packs, I've built "The Sigil of "Compression". While active, the sigil will check your inventory for anything that can be compressed into +The sigil of compression.2=a "Storage" block(A two by two or three by three recipe of that item that can then be crafted back into the item. An example is redstone into redstone block.) and squeezes it together for you. Simple, but extremely effective... I should note I added a few special cases to the sigil, such as glowstone dust to glowstone and a restriction to only compress cobblestone if you have more then a stack. +The Ender severance.1= Bloody endermen... Magus sent me out to try and stock up on ender pearls, but the pests keep warping away from me only to pop up later(And almost always when I don't want them too). It is just after dawn, and I've only managed to bring back six pearls... But maybe that is enough. I recall seeing some research notes on endermen and how they are able to teleport somewhere in the library. It is only an idea, but it might be perfect for +The Ender severance.2=this task... Eureka! After reading through the notes, I worked out how endermen connect to The End as a power source for their teleportation. Using a few ender pearls and eyes of ender, I've completed a sigil that acts as a sort of "Signal blocker". In layman's terms, it disrupts the connection to The End and renders them incapable of any teleportation. Not only that, but it also prevents many forms of magic that +The Ender severance.3=relay in similar methods, such as Demir's spells and the barbaric(But nevertheless effective) act of throwing an ender pearl. From the light, I'd say it is almost sunset. Time for some well deserved payback... +The Teleposer.1= After my research into the basics of teleportation, a thought struck me: As it stands we don't have an established transportation network for mages to use, instead using the long and winding roads or other means of land travel. Sure, a witch might have a few way stones or a broom and a spell caster has a convenient recall spell, but we don't have a dedicated transportation system. Considering how much Magus +The Teleposer.2=and I travel to deal with small matters, and how often mages visit each other it is a surprise no-one has built something like this sooner! After talking with Magus about this, it turns out something like this has been tried before. The main failing point each time was the limited number of people able to use the method established. (A thaumaturge rarely knows how a waystone works and so on.) This has prompted me to create a +The Teleposer.3=means of teleportation that, once properly set up, almost anyone can use if they know how to push a button. Further research into ender pearls is required... After close analysis, I've decided that my first priority should be the improvement of the base ender pearl. As it stands, they are a little too fragile and random for reliable long term transportation. By placing a pearl inside a T4 altar I have been able to +The Teleposer.4=refine it into a focus, stronger and more predictable then the base pearl. I am currently in the middle of creating a mechanism to hold and operate the more complicated bits of the process. My materials for this is mainly gold(A metal that hasn't shown any side effects to the ender energies used), two ender pearls(One input, one output), and the focus itself to handle the conversion. I've managed to finish +The Teleposer.5=building two of the "Transportation of matter across two relative positions devices", or teleposers for short. How they work is simple(-ish): To perform a teleport you need two teleporsers. Next, bind a teleposistion focus to one of them by right clicking on the teleposer, bind it to yourself by right clicking on anything else, then slot it into the second teleposer and apply a redstone signal. If the focus is bound to teleposer A and +The Teleposer.6=placed in B, then teleposer B is triggered with redstone, everything above A will move to B, and everything above B will move to A(I hope this is clear enough description, it is hard to put into word the process. If you try it yourself, it should be clearer.). This means that if you want a two way transport, you can have two foci(One in each teleposer) and trigger the one you stand on, one have one focus and always trigger the same teleposer. +The Teleposer.7=In theory, we could build a "Transport Nexus" by having an array of teleposers bound to the same one(One A, multiple B's, triggering the B's to do the transport). What is great about these teleposers is that they don't just transport people, but any mobs or blocks in range as well. It even functions on complex blocks like furnaces and chests! With a little redstone logic, amazing things should be possible with this simple(-ish) system! +The Teleposer.8=With the completion of the final prototype, I should get some sleep... A new day, a new idea! The basic teleposition focus only transports a one meter cubed area above it, but if I improve the focus a bit in the altar it will be able to handle a three meter area! Not only that, but it can be further boosted by adding a weak blood shard so it works in a five meter area, then these new demonic shards that Bella has been gathering +The Teleposer.9=for a final upgrade to seven by seven by seven area. I should mention that the cost of each transport is based on how much is moved, and how far it is moved. It also has the quirk of being unable to transport people or mobs across dimentions. +Sigil of suppression.1= After a recent flood where Magus built a ritual right in the middle of the village to save a huge chunk of it, I've decided to try and replicate the effect on a smaller, and much more portable, scale. Thus, I've made the first version of the "Sigil of Suppression". What it does, in layman terms(You don't wont me to get into the back end details involving temporary storage in a pocket dimension) is create a bubble around you that removes any +Sigil of suppression.2=liquids, replacing it all as you leave. Using this sigil, I was able to take a leisurely stroll under the nearby lake. I am glad I remembered to bring my elemental affinity sigil however, as the early prototype fail on the way back, so I had a very soggy trip home... I "Think" I found the cause of the issue, and have patched it. +Superior capacity rune.1= Taking a break from the sigils I've been making over the last few months(How time flies...), I have shifted my attention to improving the runes we have available for our altar. After going over the design of the capacity rune, I have found room for "improvement". I have that in quotation marks because it only becomes greater then normal capacity runes if you have more then fourteen of them. You see, the "Rune of superior capacity" adds ten +Superior capacity rune.2=percent to the altars capacity, and this effect stacks multiplicatively(Layman terms: The more of the rune you have, the stronger the next rune will be) instead of the normal capacity runes static rate. Powerful, if a niche rune. +The rune of the orb.1= Considering the amount of LP we burn through on a daily basis running our sigils, powering our spells, fueling the rituals, and feeding our tools and armor, it is a miracle we don't run out of LP more often then we do. Even with our soul network topped off with a master orb, we're tapped dry within a week. Just upgrading our orbs has served us so far, but that has shown to be too unreliable and a huge investment with the altar... +The rune of the orb.2=Wait, we're always using our orbs to make runes to improve the altar, so why can't we make runes that let the altar improve the orb? It can't be a one way road, can it? Yes, if we tweak this here and shift pressure here... I'm rambling again, I must talk with the others about this! Yes, it works! By focusing the power of three blood orbs and using two demonic slates, we've created "The Rune of the Orb". This boost +The rune of the orb.3=the altars ability to feed an orb(Think of it like pressurizing air, more of it in the same amount of space), letting it add an additional two percent per rune(Additive rate, so more runes won't change how much it adds). With our master orbs, one rune is an additional twenty thousand LP. While that doesn't sound like much(To think, I use to be limited to only five thousand...), consider the number of orb runes one altar can have... +A field trip.1= After hearing the demands of the younger apprentices, we are leaving tomorrow for a quick tour of the magelands, and expect to be back by the end of this month. Talking with Magus, I agree that we've been pushing ourselves hard lately with work and research. A little rest during a vacation might be just the thing I need to gather ideas for future projects... It will also give me a chance to talk with other mages about setting up +A field trip.2=a teleposer network. It is a vacation, so a little work on side projects you normally don't have time for is normal right? Talking with Magus during the long hours on the road, a few details about the mage guild were covered on this horseback lecture. Largest of the "Nations", most of the tech focused nations won't touch this area due to the high levels of magic in the land, air, and water causing technology to become a bit +A field trip.3=more unpredictable(Read: Unstable and often highly explosive), and have instead left it in control of the mages. As a result of this, thousands of kilometers of land filled with river valleys, harsh deserts, frost and snow covered forests, fertile plains and countless other biomes have been untouched for us to expand into. To this day there are people who venture out into these untamed lands hunting fame and fortune clawing +A field trip.4=over mountains and through the ancient ruins that litter the area. However, the vast majority of settlements are close to the borders with the other nations, thriving off trade(Their gadgets might not function here, but the results are another mater. Most of the mining towns send out the harvested ores across the borders for processing). The last tally was done roughly five years ago, with the number of total +A field trip.5=settlements at around three hundred scattered thin across the mage guild. Of this, we have roughly seventy active mages and thirty classified as "Apprentices" to manage village needs and deal with problems as they arise. Generally one mage would managed half a dozen of the closest villages and any apprentices they take on comes from this area however, it was not uncommon for mages to offload work onto other local mages if +A field trip.6=they have not the time or expertise in the field and for them to take on students who seek them out as tutor. That's enough for tonight, my watch is almost over and I feel sleep calling me. I'll write down any more interesting details I learn tomorrow. Magus said we should reach another village tomorrow, and he knows an inn there that should take us in for the night(Just in time as well, I don't trust those clouds on +A field trip.7=the horizon). Today's trip was more of the same, ridding through a dense oak forest while Magus went over anything and everything about the area around us and the Mage guild in general. Mages seems to have a list of unwritten rules governing how to act, what to do, what to say... For example, it is recommend to live at least a mile and a half from the closest village. Far enough away that people won't bother you with trivial things and +A field trip.8=you keep a mysterious reputation with the people, but close enough to be convenient for buying what you need. Another example pertains to marriage: A mage is free to wed whoever they like(Even other mages), but the spouse is entitled to most decisions and any compromises favor the spouse. Being wed to a mage often causes problems for the spouse, often with relatives and friends, and is typically a huge adjustment. +A field trip.9=Doing anything to try and make it up to them is common, as the mage feels themselves a burden and cause for their loved one's strife. From what I've gathered and how Magus speaks about the topic, these are more general outcomes and human reaction to the same events that Magus has seen happen time and again instead of rules or traditions passed down from master to student. One final interesting fact is that most mages send their children to +A field trip.10=learn the art(If the child so chooses to take on magic, and the have the talent for it) with another mage, preferably one they have rarely or never met as to prevent any bias and favor. I was right about those clouds, and we have reached the small town of Salis soaked to the bone. We're all currently sitting by a fire in the Mundes inn letting our robes dry and bodies warm from the chilling rain(From the clinking outside, now +A field trip.11=hail). I plan on acquiring another books tomorrow, and writing any more facts I learn from this trip with Magus in it instead of spending the pages of this book(Already longer then I ever dreamed it would be). According to Magus, we should be able to meet another mage in two days time, a woman by the name of Athis who is skilled in botany and herbs(Any medicine made by her always trades for a fair few coins). +A field trip.12=On another note, what Magus said about about people being wary of mages is holding true. The common room has been divided into two parts since we got here: The side where we are, and everyone else who have gone a table or two away from us and keep glancing at us as if to make sure we don't do anything without giving them a chance to run. The owners of the inn, a small family known as the Eldritches, seem to be the only ones who don't +A field trip.13=seem to mind us. Their daughter, or at least someone the right age and look to be their daughter, happily walks up to us asking if we needed anything other then rooms while we rested. Vlad and Demir order food for us all, Magus inquired to the drinks available, while I have asked if she knew if the general store had any writing journals for sale. And now I'm at the point of writing things as they happen... I needs some sleep in a nice bed +A field trip.14=after all this riding(But it looks like Demir is more saddle sore then I am), and the inn keepers have giving us cheap logging in the attic with a few decent, if old mattresses in a warm room with a roof over our heads. We left the next morning after a short trip to the market(Where I managed to get a good deal on a fairly nice journal, and have already filled out a few pages on my watch last night), and now are almost at Athis's +A field trip.15=residence. We currently are taking a short rest to eat and have the horses cool off after a long trip before riding the last leg of the journey after dusk has set. I'll detail anything interesting that happens. Talking with Athis, who I have already detailed in the other book along with most of our conversation, I managed to steer the conversation to how often she needs to travel for herbs, and if she has ever been in a situation +A field trip.16=where she can't get access to anything she needs but another mage might have an abundance of. As a response, she handed me a list of everything she buys when ever possible because of how rare it is here and the versatility or uses of it. The list was ten centimeters thick. Seeing a chance to get another mage's opinion, I mentioned a recent discovery in the field of magical transportation see might be interested in seeing. At this +A field trip.17=point, she gave me a wary eye and said she still has a bag of purple chalk and a stack of waystones from the last person who said that. Inviting her outside for a demonstration using a few of the teleposers I had packed, I showed step by step the process and how simple it was to use.(It took her a moment to recover from the initial shock of teleporting, but now she takes it in her stride.) Going over a few more details inside with hot +A field trip.18=tea, I asked if she would be interested in us setting up a link in the area nearby for her to use as a means of transport. Frankly, I was nerves enough at this point that I thought see would just laugh at my new goal. Instead, she was almost begging me to set a few up around a few locations several hundred kilometers apart. At this point I felt comfortable to tell her about my grand plan for setting up one of these near every mage +A field trip.19=in the guild and at some important points, so the days of needing to travel day and night to reach another mage would be over. Not only was she on board with the idea, she even offered to help us set them up if it meant that it would be ready faster! We spent the next few hours talking about this late into the night, covering little details and about enlisting the help of other mages to set it up. +The key of binding.1= Well, this has been an interesting trip... We've been visiting every mage we pass, talking and showing off the boons of our blood magic. Most of them have been extremely accepting of our arts, and the ones that haven't been at least aren't opposed enough to get violent about the subject(However, all of them are still welcome to the idea of a transport network). We have noticed one problem on our trip, however: We can't +The key of binding.2=easily give people the things we've been working on, as they need LP to run it and it takes time to reach a point of being able to support the usage of them. We've gotten around this somewhat by binding the items we gave them to ourselves, but anything they make once we've left will be near worthless to them... THAT'S IT! I could make a device that mimics the binding of an item, copying a thread of our soul network to another device, so anyone +The key of binding.3=can craft something new and have us power it. I can use a weak blood shard to hold the soul network thread that it uses to pass on the link... Yes, I should be able to make this easily. I really should have slept after getting home, instead of going straight to building something... It took me three hours to think of using gold for the "Key of Binding". Regardless, it has been finished. All you need to do is right click with it to set +The key of binding.4=the original owner, then hand it off to the person you wish to use it. Then they right click with it, and it will bind the first thing it finds in their inventory without an owner to the person the key belongs to. While it's uses are limited, it is something you want to have around in case you ever need it. +The trials of a T5 altar.1= In other news, we've started talking about what we do now that we've started reaching the limit of our power once again. I've calculated the number of runes we would need, and have in fact already crafted all fifty two of them. We even have a few guesses on what to use for a blood orb, starting with these demonic blood shards... The problem now is the stabilizers we need. There is only one thing I've found that can handle the strain of the +The trials of a T5 altar.2=altar: The raw power of beacons. We need four bloody beacons. One is near impossible, four is... We need a miracle to get any farther. Magus says he has some plan, but I think even he is going to struggle with this. Talking with the others, I believe I should focus on setting up "The Nexus" instead of struggling with the limits of our master orbs. This is going to be a project that will take months... I've decided to limit the usage of +The trials of a T5 altar.3=the Nexus to mages, as public usage would tax my network night and day. I start tomorrow on this task, and plan on cleaning out some ruins about a kilometer to the east of us to set up the Nexus base. I already have a few dozen teleposition foci crafted, and enough teleposers to set up over a dozen locations. First on my list, Athis... I'll leave this book here, and will document anything that happens in my other book. Once I start +The trials of a T5 altar.4=research in blood magic, I will write in here again. +The price of power.1= Magus... Magus has gotten us a reservation to kill Withers. Not only that, but we each must kill one on our own. I said I wouldn't write in here again until research started again, but I felt this is significant enough to mention... We are so close to being able to upgrade the altar. If we live through this trial, that is. I have written the details of the last few days in my other book(It has gotten far more use then I ever +The price of power.2=expected), but we have them. Enough nether stars to finish our altar, enough to experiment with, enough to make being stuck in bed with this broken leg worth it all. I have been hard at work since my leg healed, ideas gushing out of me to the point I have almost stopped eating and sleeping(Thankfully, one of the others tend to drag me out occasionally). Time to document the fruits of my labor. +Demonic orb.1= Our assumption about demon blood shards was right, and after a long crafting process we have the Archmage orb. We had to spend several hours trying to fill this orb, and finally hit the cap at ten million LP, ten times the size of the master orb... We also have graduated up to the slate dubbed "Ethereal". I know this isn't much fan fair, but this has become a bit of an expected event. +The unspeakable power of the energy bazooka.1= First thing I created with this new orb was an improvement to the energy blaster, as I felt it just wasn't strong enough during the fight with the wither. Harnessing the power of a few reagents and a demonic blood shard, I have created the "Energy Bazooka"(Not a clue what a bazooka is, but Demir tells me they shoot big explosions). Costing twenty thousand LP a shot, it launches one main projectile that upon hitting something +The unspeakable power of the energy bazooka.2=explodes into twenty more smaller explosive projectiles to devastate other living things around it. I have tried tweaking it so that terrain isn't harmed, but there may be minor damage depending on what is hit. There is a "Slight" problem of recoil, but nothing we can't live with. +Acceleration runes.1= Moving my attention on to runes for our wonderful new altar, I had revelation as I noticed a speed rune next to a dislocation rune: Increasing how much LP is moved from the buffer is fine, but how about increasing how often it transfers LP? Using a few materials like buckets and an ethereal slate, I have transformed a normal speed rune into something far greater. Instead of effecting crafting speed, one rune will +Acceleration runes.2=lower the delay the altar has on moving the contents of the buffer by a twentieth of a second per rune. I have noticed a strange limitation, however: Any runes beyond nineteen seem to have so little effect it isn't noticeable anymore, so you can only have the altar transfer nineteen times a second. I will need to run some experimentation on the best ratios of acceleration to dislocation runes... +The Harvest goddess.1= Bella has dragged me with her to town so she can be sure I'm out of the lab for a while(I have noticed I'm a little pale, but I just assumed that was from all the sacrifices I've been making lately). As we ate two sandwiches at a bench on the edge of the village, I watched the farmers in the field slaving over the harvest while trying to outrun the storm just visible in the distance. Talking with Bella about ways to help +The Harvest goddess.2=them, I created the basic idea for the sigil now known as the "Harvest Goddess". It is to the "Reap of the Harvest Moon" what the "Sigil of the Green grove" is to the ritual of the green grove, performing a similar effect to the harvest moon around the user by summoning a little demonic imp(You can thank Bella for this part). As soon as we had a version ready, Bella ran out into the field with a green grove, haste, and magnetism sigil to +The Harvest goddess.3=quickly run through the field collecting the harvest behind her. Needless to say, the few farmers in the field were awe struck by this sight and a few of the newer ones thought she was a goddess sent to answer their prayers(And I liked the sound of it, so we now have a name for the sigil). +Solving a demon problem.1= A mage can never get a good rest without something happening... Magus has finally launched an operation to deal with the demon portal, and has asked Vlad, Demir, and myself to lead the siege team. He has cooked up some complicated plan that only he knows all the details, and in fact might be the only one who even has any idea if it might work(Quite a few of us felt lost when he gave the basic overview of the plan). One question asked at the +Solving a demon problem.2=meeting that felt quite memorable was "Wait, how are you able to replicate this portal?" Magus only smiled and asked him "At what point does science stop being science and starts being magic? It is the same principles and theories at work, just a different means of execution." For Magus, that seemed to answer everything. Gah, I need to focus on packing for the trip as we won't be back for a few weeks. I feel like I heading +Solving a demon problem.3=out for war, and I guess in a way we are... Alright, I did not expect to find a camp of demons when we warped to Venric's folly. I expected a hole in the fabric of space, I expected a few demons, but a little village... Not to mention the fact that I had to save a fairly inexperienced thaumaturge who hasn't dealt with demons before. He rushed in, thinking he would show off a bit. To his credit, he did manage to kill a few demons +Solving a demon problem.4=before the hoard took him down. I had to run in with a teleposer to save him, but we did discover something important: From the vanishing remains of the demons, I retreated two crystals. One was a shiny red we have named a "Life shard". The other a brilliant blue we have dubbed a "Soul shard". What is odd is that my bound armor seemed to react when I touched them, and I saw a few stray strands of soul strands between the demons +Solving a demon problem.5=and these shards. But that isn't what was really odd. I was spotted by one of the demons when I went to save the fool, and noticed two things very quickly: The demon had a connection to the portal with a few soul stands. The second thing was that it seemed to be... Vibrating? Closest word that comes to mind when I think of it. Shortly after that, two things happened: The demons started running towards us from every part of the +Solving a demon problem.6=village, and for a few hours after we left the camp seemed to be under a lockdown. The demons had doned armor, and were patrolling the area instead of building. These guards seemed a little stronger then the others, but tomarrow I plan on mounting an operation to collect more of these shards for research... +The T6 altar already.1= From what we have learned so far, these crystals seem to be ordinary crystals(Well, ordinary as anything from Tartarious can be here) filled with demonic aura and... changed by the travel through the portal. These demons have been using them as a sort of personal anchor, an extension of the main portal's influence. I have discovered that mixing these crystals together in a five to four ratio of life to soul shards forms a purple +The T6 altar already.2=block that is practically pulsating with demonic power. Since we may be here a while, I have started construction of a prototype blood altar that utilizes these new blocks for enough stability for a T6 to be possible. I have yet to try this, but if it works... Once again, a theory proved to work out. With the addition of four pillars capped in these crystal clusters, we are able to support another seventy six runes, nineteen +on each side of the altar. I have also tried the clusters out for making a blood orb, and the "Transcendent orb" was the result with a cap of thirty million LP. Sadly, I haven't had a chance to experament with this new altar or orb, so I haven't anything else to share yet. diff --git a/src/main/resources/assets/alchemicalwizardryBooks/books/book.txt b/src/main/resources/assets/alchemicalwizardryBooks/books/book.txt new file mode 100644 index 00000000..caeadc87 --- /dev/null +++ b/src/main/resources/assets/alchemicalwizardryBooks/books/book.txt @@ -0,0 +1,370 @@ +//TITLE A classic tragic backstory +My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village. +I was brought to a village nearby, where a magician named Magus helped tend to my wounds. The magic that he used was something that I had never seen before it wasnt Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips. + +Fast-forward several years, and I have learned almost everything from Master Magus, being his third student ever to master his arts. Against his wishes, I have recorded my research and put several wards and spells on this book. So welcome, apprentice. I am known as The Architect, and I am a Blood Mage. + +It took several years of pestering before I managed to convince Magus to teach me. He kept on telling me that, Magic that uses the life essence of living beings requires patience and preparation in order to master it. One false move, go a little past your natural endurance, and you may find yourself taking a nice vacation in Tartarus. The thing was, I wanted to go there I had some unfinished business with the demons. + +The process that Magus originally constructed required powerful artifacts that he constructed himself, but were rather lacking where teaching was concerned. After studying a bit of alchemy and the process of Equivalent Exchange, I managed to construct myself an altar that would transmute items inside of its basin into new powerful forms. The only issue was that it needed a worthy catalyst, and so with a prick of the finger I set the Blood Altar alight! + +//TITLE The Blood Altar +//ITEM AWWayofTime:Altar +//ITEM AWWayofTime:sacrificialKnife +To start any form of transmutation involving blood, you would need to construct a blood altar and a sacrificial knife, as well as have a solitary diamond in your possession. After placing the blood altar down, Magus advised me to be careful as I filled it slowly with my blood, and said that I would need to be really close to the altar (about a metre) for the knife to work. With about 2 buckets of blood in the altar, which Master Magus reminds me is about 10 hearts worth, I placed the diamond inside of the altar by activating it with the diamond in hand. + +//ITEM AWWayofTime:weakBloodOrb +The blood dissipated in a cloud of red swirls as I waited for the atoms of the diamond to shift and reform. There were a few moments where the particles turned gray, which meant that the altar was empty and I had to hurry to fill it. After the diamond burst in a shower of red particles, what finally sat in the altar was a Weak Blood Orb. + +//TITLE The Soul Network + +One thing that I initially didnt understand was the overarching connection between the blood orb and myself. When I initially met Magus, I could see many sparkling strands branching off of him, flowing throughout his house and linking with intricate stones and runic drawings. I asked Magus about the strands, but he had no clue what I was talking about. It took three years of thorough research to finally find the answer, and when I brought my notes to him he was really impressed with what I have found. + +When you send power into the orb, the energy is transmitted from the strand connecting the orb and into the very soul of the person the orb is bound to. Similarly, and Magus managed to show this effect with several of his rituals, when you use something that drains energy it will drain the energy directly from the soul. The thing is that if you use an item whose owner has no energy left, the item will instead grab the requisite energy from the user of the item. Directly. From his or her life force. As such, the unit of measurement is called Life Points, or LP. I experimented with this, and one heart equals 200 LP. + +I have christened this system to be the Soul Network, and is used in all branches of Blood Magic indirectly. + +//TITLE Basics of sigils +//ITEM AWWayofTime:blankSlate +Magus is a master at rituals. His power in the intricate layering of stones and inks is unmatched. The problem is that these rituals are rather static in nature. Sure, being able to call the bounty of the earth to the surface is all fine and dandy, but wont exactly protect you when you are on fire. To this end, I decided to link my soul network to powerful items that I have created. To start, I decided to transmute a piece of smooth stone in the Blood Altar with just 1kLP to create a blank slate. +The first thing I did was to arrange the blank slate with some reflective glass and my weak blood orb. Pouring my power into the configuration created a Divination Sigil, which I could link to my network and see how much power that my soul network holds. What is more, holding the sigil to the Blood Altar flooded my mind with information, giving me the knowledge about its current tier, capacity, and even how much it was holding. +Happy with the sigil, I brought a fresh unbound one to Master Magus for him to use. When I took the divination sigil back in my hands and tried to use it to view his network, for some reason I could not gleam any information from him. I dont really see why this is, considering that I used this same method for other people and I saw that they had no power at all, but to gleam actually nothing from Magus is strange. + +//TITLE Training, and water sigil +//ITEM AWWayofTime:waterSigil +Ive been training my body, lately. Master Magus told me that in order to extract most of my power, I have to get my mind, soul, and body into as perfect shape as possible. Even though my mind takes time to hone, and my soul requires methods I have yet mastered to strengthen, my body is something I can actively manage. No more cookies for me, apparently, since they have horrible saturation for the work I do. And its hard to grow cocoa right now, anyways. +The temperature is ridiculously high, and with it the humidity is pretty freaking low. Some bright spark of a thaumaturge got it into their head that it would be good to open up the Obelisk to the far north of the village, and because of it a large influx of taint spewed forth from the eldritch tomb. It looks like someone wasnt focusing enough on their sanity training! Thankfully Master Magus decided to head out to the site up north with a few stones and a new vat of ink, saying over his shoulder that he had a new ritual that hed like to test to fix the problem. + +In the meantime, I was tasked to create something to fix our water problem. I thought about perhaps cooling the environment around the village in order to condense the water in the air, or perhaps find a way to create rain neither of which I would be able to accomplish, because Im sure that either task would take more than the 5 kLP capacity I currently have with my blood orb. So, I had to think small. + +At my desk, I mixed some dirt into the spare water I had for experimentation and started to paint on one of the blank slates I recently created to layer a bit of a base. Once I was satisfied, I took a bunch of buckets (to be safe in case that what I did would fail) and arranged them around the damp slate and then took my orb from the chest nearby. I then tapped the orb onto the slate, and the water started to boil and swirl out of the surrounding buckets, rushing into the slate! After a quick, bright flash, the new sigil lay steaming on the table in a puddle of water. + +Thankfully the sigil was what I needed. I could link it to my network and place water wherever I wanted by simply tapping it on the ground. The water was pricy, requiring a full 100 LP for each buckets worth that I created in the world, but for an infinite supply of water, creeping upwards to 50 full buckets for my puny network was something that I desperately needed. Its just a shame that it started to rain an hour after I created the sigil. + +//TITLE The Lava crystal +//ITEM AWWayofTime:lavaCrystal +There was an explosion in the lab today as I was trying to work out a few more artifacts. When I tried to infuse a few buckets of lava with my power, and used some glass to contain the effect, the assembly simply burst into flames and flew me across the workshop. I wasnt really hurt, and thankfully my water sigil was used promptly to put out the fires, however it seemed that my experiment failed rather heartily. + +Apparently I needed just a little bit more time, however, since I got it to work a week after. By combining some glass and obsidian together with a few buckets of lava, and throwing in my blood orb and a diamond to hold it all together, the diamond was transmuted into a fiery crystal that seemed to do nothing at all. + +I peeked out from behind the blast shield, since by then I learned that playing with lava was not the safest of hobbies, and gingerly linked the crystal to my network. As soon as the pact was completed, I felt a wave of heat emanate from the crystal, and promptly tossed it into a furnace before it could burn my fingers. I was unsuccessful on that front. The furnace immediately kindled, and the pork that was sitting in the top slot began to cook quickly. +Quickly feeling a wave of nausea, I checked my network out and found that I had nothing left to offer. Once I pulled the blasted thing out of the furnace and stuffed it into a chest, the nausea subsided. So this Lava Crystal could work in any sort of furnace and feed off of the owners network, but if the network was dry it would instead cause the owner to feel a hearty blast of nausea unless removed from the solid fuel-burning machine. Good to know, since now I know of a way to trade my services with the blacksmiths in the village. + +//TITLE Sigil of lava +//ITEM AWWayofTime:lavaSigil +Finally, the day that I have been waiting for the past 7 months has come. The Hells Harvest Festival is a day that the village celebrates the creation of the first portal to the Nether a century ago. Its funny that when I ask the villagers why it is that we celebrate the formation of a portal to Hell, they simply laugh and say that Ill see when I finally go in. +The portal was located in a vast stone cathedral, a three days walk from the village on foot. Magus said that hed meet us there, because he had a few things that he needed to prepare before actually going over to the Nether, but I was curious as to how hed make it there in time knowing Master Magus, hed spend a day or two reading up on a new theory for a ritual and forget himself in his works. + +When we entered the hall, however, Master Magus was there already talking to one of the guards of the unlit portal, stowing away a gem into his pocket. I knew something was up, because I could see a strand connecting the gem in his pocket to both himself and one that trailed off back to the village. Not wanting to be distracted, I pulled out my wand (Master Magus insists on all of his apprentices learning of another field of magic, and Thaumaturgy has proved itself useful) and set alight the portal as was the custom of the newest member to the harvest. + +It seems that the harvest, however, was not exactly a trade. I saw giant stone walls and vast pumps throughout the land, grabbing all of the lava from the great pool below. A large collection of bound pigmen walked by, led away by someone in a full set of shining steel armour. Huge machines that processed the lava were emblazoned by the brands of industrialization: Thermal Expansion, BuildCraft, Greg Tech, and many other labels dotted throughout the base of operations. So much for a festival it seemed that the Conglomeration, the governing body that oversaw all of the villages in the land, saw it fit to turn a civilization into a circus. + +After accepting a few supplies from the farce, I walked back home by myself two days early. There were some things that I wanted to create, but wasting my time there would have been fruitless. Clearing my desk of debris charts of alchemical constructs, I set to work with a vat of magma cream that I brought with me, attempting to combine it with another slate. Casting my orb aside, I fished the lava crystal from my chest and combined it with the cream and some fresh buckets of lava thankfully not from the Nether. Once the light faded, I picked up the new Lava Sigil that lay in front of me. +What this sigil does is it siphons energy and uses the properties of the lava crystal to super heat rock, creating a source of lava wherever the wielder touches the ground. So, infinite lava, and infinite fire hazards. Unfortunately, it takes about 1 kLP per single use, which is a lot for my network as it stands currently. It looks like I need more power, but seeing that Master Magus is currently enjoying himself at the festival, Im going to have to find a way to boost the blood altar myself. + +//TITLE Blank runes +//ITEM AWWayofTime:AlchemicalWizardrybloodRune +Of course! Runes! Why didnt I think of this earlier? The power of the altar itself comes from the structure of the components used to create it. The force of the diamond alone is not enough to create stronger materials through transmutation. What I need to do is construct several runes to extend the altar, and thus the altars power. The only thing that I could do on such short notice is to take several blank slates (I have about 16 left) and quite a bit more stone and combine them with my Weak Blood orb. + +//IMAGE 8 854 480 alchemicalwizardry:textures/misc/screenshots/altars/T2.png + +What came next was the hard part. After I made 8 runes for myself, I sat puzzling over the altar. How could I extend this thing? I asked myself. It took a few hours, but when I placed the 8 runes in the ground around the altar in a ring, I felt a strange reverberation in the air. Something felt like it awoke, as if the power in the surrounding environment doubled. Quickly, I grabbed my Divination Sigil and slapped it onto the altar, and focused into it to view the power of the altar. + +I was pleased to find out that the altar was finally at its second tier, which should open up many more transmutation recipes. The problem now, as I sank slowly into my bed to sleep after the long day, was to find out what I could now do. + +Although Magus was pleased with the upgraded altar, I was caught in a bind. I couldnt seem to do anything with it that the previous altar could not do. The first thing I did was I placed one of my leftover blank slates into the basin, and it promptly consumed 2 kLP worth of essence as it reinforced the structure. Although this Reinforced Slate was much more durable, this process appeared to make the slate no longer work with creating both the lava and water sigils, as well as making it a waste to use in additional rune creation. + +//TITLE Speed runes +//ITEM AWWayofTime:speedRune +I can note, however, that when I combined one of the runes with a few more blank slates and some leftover sugar from the harvest it seemed to augment the altar even further. The sugar had to be laid in a configuration that mimicked a bow and arrow on top of the rune, and by doing so it created what I can dub a Speed Rune. What this rune appeared to do was increase the speed of the altars processes, both the transmutation rate as well as the speed that a bound orb will consume the essence from the altar, by an additive 20% per rune. This tier doesnt seem perfect, however, since it seems that for the second tier only the four edge runes (not the corners) could be used as upgrade slots for the purpose of augmentation of the altar. + +//TITLE A shining green orb +//ITEM AWWayofTime:apprenticeBloodOrb +The eureka moment came when I accidentally dropped a few things on the floor of the lab. When I bent down to phish the items from the floor I noticed that one of the emeralds rolled right up to the altar, almost as if it longed to be inside of its basin. It occurred to me that if a simple diamond inside the altar created a weak blood orb, perhaps a much rarer gem would make a stronger version! Quickly fetching my knife from the table, I filled up the altar over the course of the day so that I could make sure I didnt mess anything up, and then dropped the emerald into the altar. +The speed runes made sure that the transmutation took no time at all! Wow, those things work fast I better make a note of removing the runes when I try to create more difficult items inside of the altar, because if I was not prepared it would have chewed through my supply in no time! After a few tantalizing moments waiting, the altar burst in a shower of particles and the new orb sat there, revolving on top of the altar. +Master Magus must have heard my shout of exclamation, because he hurried over from his side of the house and helped me to my feet. Not noticing the pain in my palm from earlier, I reached for the orb and sealed it to my network. Master Magus then helped me to fill up the orb inside of the altar, and when we were done that day I had a total of 25 kLP inside of my network. + +//TITLE The void sigil +//ITEM AWWayofTime:voidSigil +After resting the rest of the day at the insistence of Magus, I returned to work this morning full of inspiration. While I laid in bed half awake, the thought struck me that so far I had managed to use sigils to create fluid. So why not make one that can remove it? My first attempts with things like glass bottles and bowls failed with all of them working for a brief moment, then returning to their old forms. It was almost lunch time when the thought crossed me that I used buckets for the first two, so why not here? Half an hour, six buckets, a bit of twine and a reinforced slate later I had my first void sigil. + + +//TITLE Air sigil +//ITEM AWWayofTime:airSigil +While tending to our small farm a few days later, I noticed a bird land on our fence. I turned to face it as it flied off, and had a revelation as I watched how it flew. If I could use magic to create the gust of wind like that made by bird wings, I could fly through the air! After hastily finishing the days chores, working out details in my head all the while, I rushed to my workstation to start work on what I have now dubbed the Air Sigil. Using feathers and a Ghast tear as ink on a reinforced slate, I formed a sigil that on use creates a rush of air behind where you face to propel you forward. Flight using this sigil is fast, if a little pricey and hard to control, not like the flight provided by Magus's thaumostatic harness. Also, landing is a bit of a problem as I learned the hard way... + +//TITLE Sigil of Sight +//ITEM AWWayofTime:seerSigil +I've grown a little annoyed at my divination sigil. While it is able to read the current tier and essence of a blood altar, that is ALL it can read. As a result, my current goal is to improve its design using my new blood orb. So far it is going well. The Sigil of Sight is able to read the buffers of the altar to give how much they store, as well as how far along a craft in the altar is and how fast it is using LP. The downside of this upgrade is that it loses the power to read the altar's tier or the users soul network, but so far this is an unavoidable loss. For now I'll settle with what it does now, and might try to improve it further later. + +//TITLE Advanced altar mechanics + +Even after all this time, I still don't fully understand the blood altar. Sure, I built the thing, but... It is almost like working directly with raw life essence has given it a bit of life of its own. After running a few experiments to try and make my life easier, I've noticed some odd behavior coming from it. + +First, I tried using some basic piping to extract life essence to store later to use for more pricey infusions. As it turns out, the altar doesn't like giving up its essence. I managed to get a bucket of LE out before it seemed to slow to a trickle feed, nothing more the 20LP a second. Further tests show that it has a Buffer tank that siphons off LP from the main tank, holding roughly 10% of the main tanks capacity. As I mentioned, it does this very slowly so piping is out of the question for now... + +A later test shows that it also doesn't like essence being piped in, as a similar restriction apples to imputing essence. I will defiantly need to find a way to improve this transfer rate... + +Another strange phenomenon about the altar is its Hunger for life. After the failure of the piping, I tried using a few regeneration potions from the local village to speed up the rate at which I recovered health. A normal or extended potion seemed fine, and were very effective for speeding up slate production. But a strengthened regeneration potion caused the altar to have a slight Hum about it, and I felt my energy being sapped by something. After talking with Magus about this, we have determined the altar senses the life flowing through us, and the potion makes the altars Hunger for this life create a sort of aura that causes you to lose energy akin to hunger. As a result of this, regeneration is still effective, but a sizable supply of food is needed for extended use to recover energy. + +//TITLE Sigil of the fast miner +//ITEM AWWayofTime:sigilOfTheFastMiner +I've decided to experiment with passive effects for sigils, since everything so far has been an active effect. While wondering through town looking for supplies, I noticed people cutting wood for a fire and some smashing stones to build a small fire pit. I keep coming back to how slow both of them were in my train of thought, then started going over ways to improve the tools. Then it hit me: Why improve the tools when you can improve the person? A few anatomy books and failed tests later, I hand the sigil of the Fast miner(Name pending) and two very tired arms. After activating the sigil, it speeds up muscle movements in the arms allowing you to break blocks far faster at a small LP cost every few seconds. I do need to keep reminding myself to turn it off when not in use, but the stinging pain of life essence being taken is always a quick reminder... + +//TITLE Soul Fray + +Today I pushed myself too far. I've gotten close a few times, but today was the first time I have passed out due to draining too much life essence. Magus was thankfully with me at the time, and moved me to a bed to recover. As I regained my senses, I noticed something odd about my soul network thread: They were thin and looked damaged. As I kept watching my threads, it seemed like they were slowly reforming and repairing themselves. I mentioned this to Magus, and we theorized that after coming so close to death my soul was still recovering from the shock. I made a sacrifice at the altar to test this, and it seems that this state effects how much life essence a heart is worth quite negatively with it only giving a tenth the normal amount. + +//TITLE Green grove +//ITEM AWWayofTime:growthSigil +Today Magus showed me his green grove ritual, a way to speed up crops. Unfortunately, it is very static and has a small range, limiting its uses. To amend this, I've been toying with the concepts behind the +ritual in an attempt to make it more portable. By creating an ink from oak saplings and sugarcane, then inscribing a rune on a reinforced slate I have created the sigil of the green grove. It seems a little slower and more expensive then the ritual form, but it can be carried on your person and acts like bonemeal when used on plants. While I had it active I could barely keep up with our farm, and by the end we needed to give a few of our neighbors some of the excess we didn't need. They all accepted it, but with varied degrees of reluctance. + +//TITLE Dagger of sacrifice +//ITEM AWWayofTime:daggerOfSacrifice +My work on sigils has slowed for now as I'm reaching the limits of what my little green orb can do after only two weeks. As a result, I have turned my attentions to other aspects such as runes to pass the time. Magus is currently out dealing with a large forest fire to the east of us, and the village is in a bit of a lull with nothing planed for several weeks. Right now my task is to slaughter a few chickens Magus brought home from the market to prepare on his return home, and it seems the perfect time to test an idea I've been thinking about for a while... I will not mark it here, just in case it is another false hope. + +Success! I've managed to perfect my idea for a new source of life essence. Before the only option was to cut ourselves to give our own life essence to the altar, but now we have a way to use other living things as a source. Unfortunately, it is a little gruesome and a bit All or nothing from them... Regardless, it works! + +...I have realized that, in my excitement, I may have forgotten to write down what it is. I call it The Dagger of Sacrifice, formed in a blood altar out of an iron sword and 3K LP. The dagger doesn't deal much in the way of damage. It doesn't need to, as its main purpose is to Mark a living thing for the altar which takes care of the rest by forcibly extracting their life essence all at once. Through my tests it seems that your common farm animal's life isn't worth nearly as much as a person, only giving 250LP regardless of where it comes from. While I set about cleaning the animals after the tests were done, a common zombie managed to sneak in the door I left open when bringing the chickens down here. As soon as I noticed it, reflexes that were being drilled in by Magus every morning kicked in and I managed to poke it with my dagger before it had a chance to hurt me. At first I thought nothing happened, then it fell to the floor as lifeless as it should have already been. I glanced at the altar, quickly noting that a zombie was worth 500LP. Looking over the fallen creature as it started crumbling, I noticed that some of the defenses Magus had set up took there toll on the zombie as it was burned and freshly cut in several areas... Seems that the amount of HP they have is irreverent to the altar, giving the same amount of LP regardless. + +As I finished preparing the meat to cook after disposing of the zombies ash(Which reminds me, I wanted to look up why this happens...), a very dark thought crossed my mind. The knife works by giving life to the altar. The dagger works by taking life forcibly from a target. What would happen if a human was marked by the dagger? I asked this to Magus, after showing him the dagger and telling him everything that happened. In all honestly, I'm not sure. I have a theory, but I don't really feel like testing it... I asked him to elaborate, so he told me the basics of it. It seemed that source of the life essence mattered with the dagger, since the chicken and zombie gave two different amounts, so depending on the person in question they would be split into one of three groups: Passive, Hostile, and Innocent. The passive would be like the chicken, only giving a little. The hostile would be the bandits, the thieves, the murderers. The ones who gave into evil, and now seek to hurt or steal from anyone. The unredeemed, and would probably be like the zombie. The final group were the innocents, anyone who doesn't fall into the first two groups. It was nothing but a guess, but we agreed that using the dagger on an Innocent villager would extract all of their life essence like ours. 2K LP, all at once... We also couldn't work out what would divide the passive from the rest, but it was only a theory so we put it to rest. + +//TITLE Runes of Sacrifice +//ITEM AWWayofTime:runeOfSelfSacrifice +Looking at these little speed runes, I have decided to see what else can I make. My goal isn't anything in particular, just improving it in some way. The speed rune was made with powdered sugar, so another type of powder should work... + +Redstone failed, gunpowder failed, glowstone... Glowstone worked. I currently have no idea what it does, all I know is it didn't fall to bits seconds after creating it so that is progress. The altar seems to accept it as a proper rune, so all that is left is to run a few tests in the morning. For now, I am tired and feel a bed calling me... + +I've run dozens of tests trying to find out what this new rune does, after two days of obsessing over this I finally noticed it. It slightly increases the amount of LP self sacrifice gives. When I said slight, I mean one rune increases LP gained by ten percent on an additive rate. For those who don't understand that, it basically adds an additional twenty LP per self sacrifice. If my theory is right, I should be able to make a similar rune for normal sacrifice... What else would the altar respond to? + +//ITEM AWWayofTime:runeOfSacrifice +Well, if there is anything thaumaturgy and magic in general has taught me, it is that gold is a very good metal for magic. By simply replacing the glowstone in the recipe with gold ingots, a sacrifice rune is formed. It has the same additional ten percent addition per rune per sacrifice, meaning the more LP of the mob sacrificed the more LP the runes adds. This has got me thinking... The altar was constructed with both diamond and gold. It seems to resonate with the diamond enough to make the first blood orb, and even a second, so why not try making one out of gold? I'll need to revisit this idea later as a test run showed some reaction to a block of solid gold(I didn't ask Magus where he got it, and he doesn't seem forthcoming about these matters), but the altar couldn't cope with the strain needed to shape the block. Before catastrophic failure happened, a few safety precautions Magus and I had built into the altar triggered, stopping the transmutation before... Well, neither of us are really sure what would happen. But Magus said he has dealt with matters of unstable and untested magic, and knew most of them end with a crater in the floor(Hence the safety precautions). + +It has been a few days since the experiment with the gold block. Magus and I have been discussing what to do now, as the altar is getting bigger then the basement. Magus has suggested moving it to some of the lower basement floors, but considering just how large it might be in the future... I finally got him to agree to building it behind his home, as long as I helped put up a few wards and spells to keep people away. Currently we're planning out the structure and needed runes for upgrading. The current altar only has eight runes, but what I have planned will more then triple that number to twenty eight. The current limitation we suffer is the strength of the altar itself, as it can only take power from runes adjacent to it. My plan is to use something the altar is naturally attuned to as a way to not only increase the range of this effect, but act as a counter balance and stabilizing it to prevent it from becoming uncontrollable. For this to work, the blocks in question must be above the altar and an equal distance apart. + +We've run several tests and calculations, and have a layout in mind for this upgrade. Four pillars topped with glowstone blocks, twenty runes in sections of five, built one block down and two out from the last set of runes. In theory this should provide a huge boost in power to the altar without risking our safety(Well, more then we normally risk it), but until we test full scale I can't be sure. For now, we have a lot of runes to make. After much debate we've decided to invest in the Self sacrifice runes, as having a steady supply of mobs will be tricky. But now I face the issue of making dozens of reinforced slates... I need to think on this. + +//TITLE The blood letters pack +It's so simple! I've discovered a way of obtaining LP for making slates that means I don't wait at the altar all day: The Blood letter's Backpack. Made with a modified leather chest-piece with a blank slate reinforced glass tank, it allows the wearer to gather LP by feeding it into the pack over time. Whenever the wearer has more then five hearts, the pack will drain their life and store it inside up to 10K LP to be dumped into an altar later. This pack does have two shortcomings, however. When the life essence is deposited into the altar, runes will have no bonus to the amount added. The second problem is that the altar will only accept LP from the pack when not performing a transmutation. Despite these limitations, it will prove quite valuable for simply allowing me to step away from the altar to do other tasks. + +This is a simple progress update, as it's been a few weeks since I last wrote in this journal. I've been making slow, but steady progress with assembling the slates needed for the runes and we're now halfway through. This isn't the only reason for the lack of entries, as I've been preoccupied with my research thorough thaumaturgy. An old friend of Magus has been visiting and happens to be a well versed thaumaturge, and he has been giving me pointers on how I could be doing better while Magus has been preoccupied in his library dealing with a mountain of paperwork. Now that Master Ridden has returned home, I hope to progress farther in making runes in the next few days. + +//TITLE And then there was five +Or not, as it seems Fate has other far more interesting plans for us. Today we had a knock on our door while I was making the last of the runes, and after opening it was greeted by three apparent orphans. The two boys in the front looked like they were brothers, or at least close relatives. The girl hiding behind them on the other hand had a very different hair and eye color, so relation was unlikely at best. All of them were covered in dirt, clothing ripped, torn, and patched with various levels of skill. The one on the left had an old sword with a chipped blade on his side, was slightly thinner and taller then the his brother, had a few deep scars that looked recent, long and messy dark brown hair, and was looking at me with a kind poker face. The brother looked more muscled, and was staring at me with a very analytical eyes and a similar poker face, his hair was slightly shorter and lighter then his brother. From what I could see of the girl, she had a simple dress on that was almost caked in dirt and dried mud. The fabric near her elbows was becoming thread bare, and a large rip near the bottom of the dress exposed some of her right leg. Her hair was a light blond, almost pale white color, but the most shocking feature was her eyes... I haven't seen haunted eyes like that in years, and last time it was in a mirror. From the looks of them, all of them hadn't ate anything in days and seemed to have everything they own on their bodies or in the simple packs on their backs. + +I asked them if there was anything they needed, to which the elder brother said they were looking for master Magus. I called Magus to the door, visitors being a rare thing as it stands with ones who ask for him by name and not clearly mages being rarer still. Five minutes later we all sat in the main room, eating simple sandwiches I had prepared for us all at the request of Magus. Needless to say, this day was not going as expected. Magus spent the next few minutes practically interrogating the elder brother , asking questions on both of our minds. As it turns out the two brothers, Vlad and Demier, use to be caravan traders, eldest a alchemist with basic knowledge of potion brewing, younger with enough mana and training already to cast basic spells. The girl on the other hand had a story all her own. From what the brothers had managed to gather, her village was raided like my own was and she was evidently the sole survivor. What shocked me was when they said she was found wandering the ashs, demons having left hours before without so much as a scratch on her body. Vlad was with the traders when they found her, and he was forced to leave them if he wanted to help the girl named Bella. + +Their story seemed to win Magus over, as he told them he would try to do what he can for them.. Not long after that, Magus asked me to help him do some shopping for our new guests. On the way to the village, Magus asked me what I thought of the three. I can't say I believe all their story, but I also don't think their lying. Did you notice the girls eyes? Havent see a look like that since.... Magus finished for me with Your own?. I nodded at the dark memories of that time. We continued going over the details of their story, but we agreed that just leaving them in the cold wasn't an option worth considering. We decided to at least try to keep our recent endeavors into blood magic a secret from them, but when push comes to shove I think we might have to let them in on the secret. Magus let out a long sigh. It's been years since I had to juggle this many apprentices at once. I'm going to need your help training them. But something tell me that we're going to be learning as much from them as they will from us... I asked him why he felt that way, and he said it was just a gut feeling. I must say I had a similar feeling. Things like this don't happen without reason, and of all mages to come to they stopped at our door, something far easier said then done. + +An hour later we returned home, both our arms heavy with fabrics, food, and other necessities that we will need to take care of the new apprentices. I watched in amazement as the three ate, trying to make up for days with little food all at once. After that, Magus and I laid the three on various chairs and couches to rest, the strain of travel catching up with them. While Magus dug around looking for a few of his old things that we'd soon need, I started creating some new clothing from enchanted fabric for the three to replace their current worn and ratty clothing. Now that that is done, I should try to get some sleep. Something is telling me tomorrow is going to be quite busy. + +The Early this morning Magus and I started carving out the earth for the three new bedrooms, since the old ones Magus use to have had since been converted into a storage closet, a alchemy lab, and small study. It didn't take nearly as long as I expected with Magus using a few spells to clear away earth while I went behind using an equal trade foci to transmute it into stone brick before gravity caught on. Once that was done, Magus raised a few walls to separate the space into three rooms and a hallway. Only after that was done did I notice the three children had awoken, and were watching us as we worked. Magus told them that he had some spare furniture in some storerooms they could use, but sadly only knew of one bed. It didn't take long for them to decide Bella got the bed, the brothers would make do with a pillow and a blanket on the floor. + +After that we spent the rest of the day hunting for then moving furniture to their rooms, building little work areas and libraries for each of them. The following day was more of the same, with the evening filled with helping them find books to read from the grand library. Vlad grabbed as many alchemy books as possible, Demir took a few books on spell casting, and Bella took a Lexica botanica to read through. Later this evening, after the three had retired to their rooms, I sat in the main room with Magus, arms and legs aching from the heavy lifting of the last two days. I told Magus how I thought their rooms should be almost finished, and how I spent the last hour before they retired just answering seemingly endless questions. I'm sure. I've gone through the same more then once, when I have apprentices new to magic. You were the same, I recall. I opened my mouth to protest, but closed it as I thought back to those days. I decided I probably was as bad as them, and left it at that. + +It's been just over a week, and the three have settled in nicely. They join Magus and I in morning exorcising, have started studying like true scholars, and have calmed the hungry nodes in their stomachs(Well, Vlad and Bella have. Demir on the other hand is another matter, but I feel he will always be like that.) Unfortunately, like true scholars and mages they've stumbled into places we didn't want them to go. Vlad has created a chemistry set that uses life essence from a blood orb as a fuel source, Demir has turned an old table into a way to use life essence to cast powerful spells, and Bella... She's left me questioning what I know about demons, after taming one and using a blood orb to bind it to her. All three of them have stumbled blindly into blood magic, and now I don't think we'll be able to stop them. Magus and I have agreed to give them a choice in whether they are blood mages or not, but I've seen the light in their eyes... I can't imagine any of them saying no. To seal their dedication to the art, we will have them make blood orbs of their own to use. + +//TITLE The next step: Tier three +//IMAGE 8 854 480 alchemicalwizardry:textures/misc/screenshots/altars/T3.png +Even with all the chaos of the last week I've managed to finish the altar construction, and it has been more successful then I predicted. With full access to twenty eight runes, each heart is now worth over seven hundred LP. I've already started prepping to try again with the gold block, having a few instant healing potions at hand. I got a brief glimpse with my sigil of sight, and this transmutation will take twenty five thousand LP to finish, over double what the altar can hold! Writing this down does give me an idea, however.... I'll need to look into it further once I have finished making this. + +//ITEM AWWayofTime:magicianBloodOrb + +It was close, but I finished the orb today. I was down to the last of my three potions and barely had the strength left to hold the knife, but I pulled through and finished my shiny new blood orb! I've already used it to craft a few things I had made before, and extra lava and air sigil, and it handles it all with such ease! Now that this is finished, I have a small list of ideas to go through... + +To start off the process, I want a stronger slate. As it stands the reinforced type is cracking under the strain I'm starting to place on it. Well, I got a new slate type when I last upgraded the altar... Let's see if it works again. It does! A reinforced slate in a tier three altar with around five thousand LP makes a new slate... I'll call it an imbued slate for now, and come up with a better name later. + +//TITLE New runes +//ITEM AWWayofTime:AlchemicalWizardrybloodRune:1 +First up to the drawing board: Rune of Capacity. The basic idea is simply to add more room to the altar, so a greater amount of LP can be stored at once to make bulk crafting or difficult crafts easier. Each rune adds 1K to the altar's main tank capacity, but what is interesting is that the Buffer tanks expend as well to a lesser degree. From a few trial tests(My back is starting to hurt from moving runes all day), the buffer tanks are always ten percent of the main tanks size. This will be something to keep in mind later. + +After helping patch a hole in the wall caused by Demir accidentally unleashing a spell, then helping Vlad dispose of a few failed alchemical Experiments, I finally have an hour to myself to work on my ideas for runes. After the success of the last documented attempt, I've been on a bit of a failure streak. I've have runes fail to do anything, crumble to dust, blow up, and one attempt turned into cheese(I asked Magus about this, and said this isn't the first time he's seen that happen to a magical experiment. However he is just as stumped as I am over why it is always cheese, of all things). Thankfully, I finally found something that doesn't need a blast shield to use or starts growing mold after a while. + +//ITEM AWWayofTime:AlchemicalWizardrybloodRune:2 + +Named the dislocation rune, it's only function is to increase the rate the life essence flows into and out of the buffers. Each rune increased the transfer rate by twenty percent per rune, and this effect stack manipulatively. That sounds great, until you realize the first rune only raises the transfer rate by four LP a second. Needless to say, your going to need around a dozen of these runes before you have any noticeable impact on the transfer rate. While these runes make it possible to automate the creation of slates by storing the life essence outside the altar, you're going to be sacrificing speed, capacity, and generation efficiency for this. + +//TITLE Sigil of Magnetism +//ITEM AWWayofTime:sigilOfMagnetism +It's been a few weeks since I last made any headway with my blood magic research, needing to help with the tutoring of the Vlad, Demir and Bella along with my normal duties as a mage. I've had to leave twice this month in order to sort out some mess or another, whether is be a helping with a pack of wild wolves or a bad harvest. Today, however, I managed to get some inspiration for a new sigil. When I was in the market buy more food, I noticed two children playing with a rock that was slightly magnetic. They were just running around, seeing what it would stick too and cheering when it did, or seeing how close they could push it to something before it pulled itself closer... That is what sparked my idea: A sigil that acts as a magnet, pulling items off the ground closer to you. In theory I could rig the magic on it to apply a similar effect to all items and not just metallic ones... + +Three hours later, and my sigil is finished. It needs a great deal of mass in the form of four iron blocks, along with the classic gold plating infused into an imbued slate(Drat, I never did work on a better name). This sigil needs to be toggled to activate, and while active will draw all nearby items to the user if they have room for it. Simple, but very effective.... + +//TITLE The Phantom Bridge +//ITEM AWWayofTime:sigilOfTheBridge +I've been asked to visit a small town to settle a few complaints that have been voiced lately by them, and am currently surprised that a closer bridge isn't one of them. I've had to walk three miles to cross this river, and now must walk another two tomorrow to reach them. If only I didn't need a bridge, or had thought to grab my air sigil(I still have a bruise from the last landing I had with it, so I wasn't keen on using it again so soon.) Wait... If if I had a bridge that went with me? Better yet, what if I had a bridge that formed under my feet as I walked? Yes, that would be amazing... + +I'm back home after dealing with a feud over who really owned a cow(Answer: Neither of them, it wondered into town and they both thought it was one of their own), and have set out my work station to try and capitalize on my idea. I'd want the sigil to place blocks that are phantasmal, only there temporarily before fading into nothing after I leave. For that I'd need a special material... Soul sand might work... Add in a little stone for structuring around an imbued state, then use the orb... Done! Now then, for a test run... Drat, I left the auto-writing quill running again. + +It works better then I hoped! The sigil creates a small five by five platform under me, staying at the same elevation as I walk through the air. Not only that, but I've tweaked it so that holding shift lowers the platform by one under you, and the blocks it makes can be easily broken for a quick decent. Not only that, but it will only spawn the blocks if you are on the ground, jumping or flying will not cause the bridge to reform until you touch solid ground, unless you hold shift forcing it to form under you. And for one final convenience touch, right clicking a phantom block with a block replaces it with that block, making roofs and platforms far easier to build. That should be enough for one night, I'll dub this sigil The Phantom Bridge and call it a night. + +//TITLE Sigil of holding +//ITEM AWWayofTime:sigilOfHolding +Vlad asked me to help him today, requesting my assistance learning the sigils. Part way through he asked if it was ever burdensome having so many on me at once... And I told him it was. Now with a little of his help I've created the sigil of holding, and it... Well, it holds other sigils. Shift right clicking with it while another sigil is in your inventory will cause it to absorb that sigil, taking all of it's powers and allowing you to swap between them with a shift right click. Unfortunately, it can't hold that many sigils(Only four) and not every sigil wants be become a part of it. Also, I had to ask Master Magus for help removing sigils from it as it refused to let them go. For this task he created the ritual of unbinding, a rather grand looking ritual for such a simple task I must say. + +//TITLE Elemental affinity +//ITEM AWWayofTime:sigilOfElementalAffinity +Demir hurt himself again today with a fire spell that backfired(Well, it worked perfectly if setting the ground around him on fire was the intention). In hopes of stopping further injuries, I have infused the powers of the water, lava, and air sigil into an imbued slate. This seems let the sigil act as protective aura around the user, shielding them from drowning, burning, or falling damage at a high over time LP cost. Since I asked Demir to use it he hasn't burned or bruised himself, but did pass out once from a lack of LP to fuel it. Sometimes solving one problem only makes more... But he has been learning, and I've been amazed at what his spells could do. Recently he made a long range teleportation spell and a flight spell not unlike the air sigil, but far faster. + +//TITLE Recreating ritual stones +//CRAFTING AWWayofTime:ritualStone +//CRAFTING AWWayofTime:masterStone +After a few days of nothing, I turned my attention to the construction of Master Magus's ritual stones. Looking them over, I might be able to replicate their usage and features using reinforced slates and obsidian... + +Master stone, more complicated then the average ritual stone might be possible if I use my magicians blood orb and four ritual stones to handle the complex nature of it, along with a little more obsidian... Yes, yes it should be possible to recreate them without sacrificing any usage of them. After asking him how he originally made the elemental scribing tools, I believe I can also replicate the manufacturing of them in the blood altar... But it looks like the dusk inks are too complex for this altar to handle, creating an ink closer to dark gray then midnight black... Perhaps I'll have the power to form them later, for now these four will work. + +//TITLE Shining a Blood Lamp +//ITEM AWWayofTime:itemBloodLightSigil +I had a flash of inspiration today (Quite literally, as watching a few town guards light a replacement torch nearly blinded me from the sudden light). They spend so much on coal and charcoal to fuel those things... What if I had a simple replacement? A near invisible light source that never goes out, can be made almost endlessly, and can easily be carried on your person? Never again would you need to place a torch to light a room, and they can ruin a rooms look(Not to mention the fire hazard they pose, ruining the look even more. Charred mess is never in style.). + +Harnessing the power of glowstone by running a Current of LP through it, I can create a sigil that fires a projectile that upon landing forms a stable light source par with that of torch. The only sign of its existence is the light it gives off and faint red particles. While it uses a small amount of LP, the advantage over carrying stacks of torches is enough to justify it. + +//TITLE Bound armor +Today Magus gave us a lecture on armors, going over the practical applications(Protection from large pointy sticks shoved in your direction and holding magic to improve the abilities of the wearer), typical construction of armor, and notable armors through the ages (And the very fatal flaws that their owners eventually discovered, much to their short lived dismay). Seeing and reading all this, I feel it is time I take my own try at this art using blood magic. Testing a wide array of materials and structures, I discovered a process to make an almost indestructible metal using a casing filled with life essence with glass hardened with diamonds and reinforced with bright red blood shards(More on their properties later) Magus showed me a while back (Making the prototypes of this armor took longer then you would believe). The process needs the soul of a demon bound to it, but this seems to be a small price to pay. + +//CRAFTING AWWayofTime:emptySocket +//CRAFTING AWWayofTime:armourForge + +To start, you need to make a Soul armor forge. This block summons the demon soul and controls the transformation of the Socket blocks into proper armor. By placing the filled socket blocks around the soul armor forge in roughly the shape of the armor piece you want with the forge in a gap, you set what it makes. Right clicking the forge will then finish the process, creating the armor piece and binding the demon to the shards inside the armor. You will need to bind the armor to yourself, allowing the armor to drain your network to repair any damage it takes(Another benefit of using blood shards in the creation). After donning the armor(Making a few adjustments, still refining the creation process), I asked Magus to help test just how resistant this armor really is. Several nasty bruises later, we have decided this armor shields the wearer from ninety percent of damage from mundane damage sources. What is interesting is that it also blocks roughly eighty percent of magical damage, meaning many armor piercing methods are far weaker. The metal also doesn't seem to hold enchantments, and the demons inside reacts quite negatively to our attempts to do so. + +Using the ritual of unbinding, we are able to deconstruct the armor back into the component sockets and anything that was inside them. I mention this because we seem to be able to Augment the armor before creation by adding a combination of sigils, blood shard, and an orb. The sigil added to the armor piece(You can add anything to the socket by right clicking with the item in hand) determines the effect, and adds a passive cost to wearing the armor piece. The blood shard lets you add an upgrade, the weak shards we have at our disposal only allow one upgrade but in theory a stronger shard should allow more to be added. Finally, the orb seems to lower the cost of the upgrade. Every sigil seems to have something to do with the normal effect of the sigil, either giving you a passive bonus or having the effect of the sigil happen automatically around you. A few examples are a water sigil making you immune to drowning, the fast miner always active, and a green grove sigil acts around you. + +//TITLE Sanguine armor +//ITEM AWWayofTime:sanguineRobe +I've managed to use my new found knowledge of armors and experience making bound armor to try and improve thaumium armor using blood magic. By throwing goggles of reviling or thumium chestplate, leggings, or boots the ritual transform the armor into a Sanguine version, with a small vis discount and protection par that of pure diamond. What is really interesting is that this armor can be augmented with runic shielding, and then socketed into bound armor in the same fashion as a sigil to pass on the runic shielding, with the bonus that adding the sanguine helm to the bound helm well allow the wearer to see things like aura nodes as if you had goggles on. I should note that you can only socket a sanguine armor piece into a same armor type(Helm in the helm, boots in the boots...), and that any vis discount is lost when you do this. + +//TITLE Suppressing the soul +//ITEM AWWayofTime:armourInhibitor +Having the armors special effects all the time has become a little bothersome. To deal with this I have managed to create an Armor Inhibitor to repress the special effects it offers in the cases they are more bothersome then helpful. Unfortunately, it is a bit all or nothing in this regard. + +//TITLE The ritual diviner +//ITEM AWWayofTime:itemRitualDiviner +It's coming up to the three year anniversary of Magus taking my on as an apprentice. Time seems to have flown by while I've been engrossed in research on applications of blood magic and working with Magus... I should make a gift for Magus to as a thank you for these last few years. Considering the complex nature of his rituals, an aid to building them might just be the perfect gift... + +Ugh... Making a way to build rituals easier proved to be quite the task(And it reminds me of the rule of conservation of effort...), but I finally have it ready in time for the anniversary. While it isn't cheap to craft(Costing the four elemental inks, four diamonds and an emerald), I've gone to pains to make it easy to use. Shift right clicking will cycle through a preset list of rituals, and shift right clicking on a block with also rotate the direction the ritual will face(For anything like the ritual of speed, where that matters). Shift left clicking will go through this list in reverse, for those times you accidentally go past the one you want. By normal right clicking on a master ritual stone the diviner will take stones out of your inventory, place then in the world and ink them to build the set ritual. To make it clear it is working, it emits green particle effects whenever it places a block successfully. However, it can only place a block in an empty space. Anything at all in the way will stop the process until the obstruction has been removed. It is a small annoyance, but nothing major enough to risk breaking the diviner(Again). + +Magus adores his gift, having rituals faster and easier to build is the one thing he could actually use(That he doesn't already have). The fact it makes anyone who uses rituals lives easier is a just a bonus at this point. As it turns out, he got me a gift as well: A pair of ichorium wand caps, the one thing I had been dreaming about for a long time... + +//TITLE Blood shards +//ITEM AWWayofTime:weakBloodShard +Reading through my older entries for inspiration on things to do with our current power(I believe we have started reaching the limit, struggling to stretch what we have as far as it will go) I noticed that I Might have forgotten about covering the blood shards like I said I would a few months ago... I'd best start from the top. + +Blood shards, as Magus has likely stated already, are fragments left behind after vanquishing a hostile mob with a demonic weapon(The Bound sword or Energy Blaster). Upon close inspection, I see small strands that looks shockingly like that of our soul networks... Well, in theory anything with a Soul could have a network, but this is a surprise nonetheless. Because of this, the small shards contain a vast pool of energy that our magics should be able to tap into. A rather unfortunate first experiment involving stone showed that this energy can be wielded to create or transform matter(I believe several others have come across similar principles to convert energy into matter using science). I say unfortunate because I was stuck inside the lab's supply closet for a few hours to hide from the rapidly expanding stone as the released energy of the shard grew the stone to thirty two times it's former size, filling the rooms and pushing out the open door and into the hallway. (Further crafting of blood stone was done outside after that...) But regardless, the blood shards potential energy and connection to the soul network is how we manged to form bound armor so easily. + +Thinking about it... Blood shards might be the answer to our power problems. The last time we needed an upgrade, we used something related to the altar... Perhaps using something related to the soul network is the next step? + +//TITLE The life of a Mage +Once more I must make a progress update, as daily life as taken up most of my time these last few weeks. Magus has started offloading some of his work onto us, dealing with small problems and formal matters, bandits and demons, and general mage work. I have been able to do a little work on the altar or blood magic in general over the last few months because of this. Thankfully, we've burned though most of the grunt work that has piled up and I now have some time to conduct our research. Magus and I have spent the last week doing the calculations for upgrading the altar, determining that bloodstone should work for the capstone, and now it is just a matter of seeing how many runes we can get away with adding without nasty side effects or it all just blowing up(The other three have placed bets on this, I believe). + +//IMAGE 8 854 480 alchemicalwizardry:textures/misc/screenshots/altars/T4.png + +After another few weeks of testing, balancing, and error we have finished the altar upgrade. This new tier adds twenty eight more runes to the altar's structure(Seven on each side, for a grand total of fifty six), and four pillars capped with large bloodstone brick(This was the best material we could find that doesn't expire or fall apart. Or, in one memorable case, actively try to kill us). With these additional runes we are projected to be making roughly one thousand three hundred LP for every heart sacrificed, a hefty improvement from our seven hundred from before. Unfortunately more work has come in for us, so once we have the altar built it will be some time before we can focus on the hunt for the material for the orb. Current plan is to start with precious materials like before, and work from there. Ah, innovation... Ten percent work, fifteen percent knowledge, five percent patience, seventy percent trying random things to see what happens. + +More work then expected flooded in at once, and we have been struggling to keep up with it all. Vlad has been acting as a healer and doctor trying to deal with a plague that has going around (Caused by a witch-in-training using the wrong vial in a love potion), and has managed to keep it from running wild. Demir has been clearing out known bandit camps, and has enjoyed a chance to test out the spells we've helped him build(Only in the mage guild are bandits considered an endangered species. This is in part due to the average intelligence level of said bandits, and thinking that an area where there are people who, sometimes quite literally, shoot fire out of their hands, mouths, and other places(Mostly the apprentice mages, as a joke or party trick that has often gone very wrong) is a great place to set up shop.). Bella meanwhile has been dealing with the demons that have been wondering in, the mage guild acting as a sort of beacon to them due to the thinness of the fabric of space here caused by countless magical experiments, both successful and not. Magus and I have been going through a huge pile of letters(Seriously, where are they all coming from, and how do I not notice the pile building up until it flows off the table?) from local villages and mages, ranging from simple questions about an issue or problem to requests for assistance in matters ranging from theft to flooding. We've been coordinating these issues, mapping out journeys to deal with as many as possible on one trip. + +As a reference point for how long it has taken us to deal with it all, dust has gathered on this book since the last time I wrote. Thankfully we've sorted out the letters and referenced the villagers to mages who are closer to them(Much to said mages chagrin), so it should be a while until this is an issue again... Thankfully all this time has left me with a few ideas for future projects. + +//TITLE The masters of T4 altars +//ITEM AWWayofTime:masterBloodOrb +The others have tried countless gems and metals trying to create a new blood orb, all of them either did nothing or created a flawed orb(Cracked or chipped, extremely fragile or incomplete). But last night I had an idea from a dream... The weak blood shards were once part of a soul network, so what would happen if we tried to reforge it into a whole orb? It is better then any other idea we've had, so I might as well try... + +Success! While we did burn through several instant health flasks, we now have half a dozen new blood orbs. While we haven't named them yet, they are a true master piece... A Master blood orb, that name has a nice ring to it... I'm getting side tracked again, but I must remember to suggest this name to the others(It at least is better then the temporary name of Shiny yellow blood orb). With this new found power, I might be able to bring to life some of the ideas that have been just out of reach up to this point. + +The first interesting property of these new orbs has been shown in our bound armor. While lesser orbs simply lower the cost, this orb is able to negate it entirely! A simple upgrade, but a very useful one... + +Another altar tier, another slate tier. Dubbed Demonic after the insignia that has formed on it's surface, we should be able to put this to some good use... I've also noticed that a demonic slate can be used with a weak blood shard and master orb to Grow the shard making four more. + +Going over my earlier successful experiments, I might be able to tweak a few concepts used to achieve a new result. I'm starting with the fast miner, and if boosting my arms was this useful then what would happen if I augment my legs? Using cookies, sugar, and some of the normal materials I have created a new sigil. Time for a test run... Two hours(And two very sore legs) later, I've concluded the tests. The Sigil of Haste boosts the users leg muscles, allowing you to both run faster and jump higher then normal. The best part? It seems to stack with the effect of jump boost and speed(Which Vlad was kind enough to brew a potion for testing). Now then, I need a rest after all this... + +//TITLE The sigil of whirlwinds +//ITEM AWWayofTime:sigilOfWind +Continuing with my thought process of Reworking the old, I have used a master orb, demonic slate, two ghast tears, and feathers to reform an air sigil. The Whirlwind sigil changes the core property of the air sigil to have the winds not effect the user by propelling them, but instead creates a bubble of wind around them pushing away many forms of projectiles. I should note that not all forms of projectiles can be pushed back by the winds, and it has a tendency to effect your own shots. It isn't perfect, but it is useful enough to have around in a pinch. + +//TITLE The sigil of compression +//ITEM AWWayofTime:itemCompressionSigil +After hearing the local miners complain about always having to stop work because they've run out of space in their packs, I've built The Sigil of Compression. While active, the sigil will check your inventory for anything that can be compressed into a Storage block(A two by two or three by three recipe of that item that can then be crafted back into the item. An example is redstone into redstone block.) and squeezes it together for you. Simple, but extremely effective... I should note I added a few special cases to the sigil, such as glowstone dust to glowstone and a restriction to only compress cobblestone if you have more then a stack. + +//TITLE The Ender severance +Bloody endermen... Magus sent me out to try and stock up on ender pearls, but the pests keep warping away from me only to pop up later(And almost always when I don't want them too). It is just after dawn, and I've only managed to bring back six pearls... But maybe that is enough. I recall seeing some research notes on endermen and how they are able to teleport somewhere in the library. It is only an idea, but it might be perfect for this task... + +Eureka! After reading through the notes, I worked out how endermen connect to The End as a power source for their teleportation. Using a few ender pearls and eyes of ender, I've completed a sigil that acts as a sort of Signal blocker. In layman's terms, it disrupts the connection to The End and renders them incapable of any teleportation. Not only that, but it also prevents many forms of magic that relay in similar methods, such as Demir's spells and the barbaric(But nevertheless effective) act of throwing an ender pearl. From the light, I'd say it is almost sunset. Time for some well deserved payback... + +//TITLE The Teleposer +After my research into the basics of teleportation, a thought struck me: As it stands we don't have an established transportation network for mages to use, instead using the long and winding roads or other means of land travel. Sure, a witch might have a few way stones or a broom and a spell caster has a convenient recall spell, but we don't have a dedicated transportation system. Considering how much Magus and I travel to deal with small matters, and how often mages visit each other it is a surprise no-one has built something like this sooner! + +After talking with Magus about this, it turns out something like this has been tried before. The main failing point each time was the limited number of people able to use the method established. (A thaumaturge rarely knows how a waystone works and so on.) This has prompted me to create a means of teleportation that, once properly set up, almost anyone can use if they know how to push a button. Further research into ender pearls is required... + +After close analysis, I've decided that my first priority should be the improvement of the base ender pearl. As it stands, they are a little too fragile and random for reliable long term transportation. By placing a pearl inside a T4 altar I have been able to refine it into a focus, stronger and more predictable then the base pearl. I am currently in the middle of creating a mechanism to hold and operate the more complicated bits of the process. My materials for this is mainly gold(A metal that hasn't shown any side effects to the ender energies used), two ender pearls(One input, one output), and the focus itself to handle the conversion. + +I've managed to finish building two of the Transportation of matter across two relative positions devices, or teleposers for short. How they work is simple(-ish): To perform a teleport you need two teleporsers. Next, bind a teleposistion focus to one of them by right clicking on the teleposer, bind it to yourself by right clicking on anything else, then slot it into the second teleposer and apply a redstone signal. If the focus is bound to teleposer A and placed in B, then teleposer B is triggered with redstone, everything above A will move to B, and everything above B will move to A(I hope this is clear enough description, it is hard to put into word the process. If you try it yourself, it should be clearer.). This means that if you want a two way transport, you can have two foci(One in each teleposer) and trigger the one you stand on, one have one focus and always trigger the same teleposer. In theory, we could build a Transport Nexus by having an array of teleposers bound to the same one(One A, multiple B's, triggering the B's to do the transport). + +What is great about these teleposers is that they don't just transport people, but any mobs or blocks in range as well. It even functions on complex blocks like furnaces and chests! With a little redstone logic, amazing things should be possible with this simple(-ish) system! With the completion of the final prototype, I should get some sleep... + +A new day, a new idea! The basic teleposition focus only transports a one meter cubed area above it, but if I improve the focus a bit in the altar it will be able to handle a three meter area! Not only that, but it can be further boosted by adding a weak blood shard so it works in a five meter area, then these new demonic shards that Bella has been gathering for a final upgrade to seven by seven by seven area. I should mention that the cost of each transport is based on how much is moved, and how far it is moved. It also has the quirk of being unable to transport people or mobs across dimentions. + +//TITLE Sigil of suppression +After a recent flood where Magus built a ritual right in the middle of the village to save a huge chunk of it, I've decided to try and replicate the effect on a smaller, and much more portable, scale. Thus, I've made the first version of the Sigil of Suppression. What it does, in layman terms(You don't wont me to get into the back end details involving temporary storage in a pocket dimension) is create a bubble around you that removes any liquids, replacing it all as you leave. Using this sigil, I was able to take a leisurely stroll under the nearby lake. I am glad I remembered to bring my elemental affinity sigil however, as the early prototype fail on the way back, so I had a very soggy trip home... I Think I found the cause of the issue, and have patched it. + +//TITLE Superior capacity rune +Taking a break from the sigils I've been making over the last few months(How time flies...), I have shifted my attention to improving the runes we have available for our altar. After going over the design of the capacity rune, I have found room for improvement. I have that in quotation marks because it only becomes greater then normal capacity runes if you have more then fourteen of them. You see, the Rune of superior capacity adds ten percent to the altars capacity, and this effect stacks multiplicatively(Layman terms: The more of the rune you have, the stronger the next rune will be) instead of the normal capacity runes static rate. Powerful, if a niche rune. + +//TITLE The rune of the orb +Considering the amount of LP we burn through on a daily basis running our sigils, powering our spells, fueling the rituals, and feeding our tools and armor, it is a miracle we don't run out of LP more often then we do. Even with our soul network topped off with a master orb, we're tapped dry within a week. Just upgrading our orbs has served us so far, but that has shown to be too unreliable and a huge investment with the altar... Wait, we're always using our orbs to make runes to improve the altar, so why can't we make runes that let the altar improve the orb? It can't be a one way road, can it? Yes, if we tweak this here and shift pressure here... I'm rambling again, I must talk with the others about this! + +Yes, it works! By focusing the power of three blood orbs and using two demonic slates, we've created The Rune of the Orb. This boost the altars ability to feed an orb(Think of it like pressurizing air, more of it in the same amount of space), letting it add an additional two percent per rune(Additive rate, so more runes won't change how much it adds). With our master orbs, one rune is an additional twenty thousand LP. While that doesn't sound like much(To think, I use to be limited to only five thousand...), consider the number of orb runes one altar can have... + +//TITLE A field trip +After hearing the demands of the younger apprentices, we are leaving tomorrow for a quick tour of the magelands, and expect to be back by the end of this month. Talking with Magus, I agree that we've been pushing ourselves hard lately with work and research. A little rest during a vacation might be just the thing I need to gather ideas for future projects... It will also give me a chance to talk with other mages about setting up a teleposer network. It is a vacation, so a little work on side projects you normally don't have time for is normal right? + +Talking with Magus during the long hours on the road, a few details about the mage guild were covered on this horseback lecture. Largest of the Nations, most of the tech focused nations won't touch this area due to the high levels of magic in the land, air, and water causing technology to become a bit more unpredictable(Read: Unstable and often highly explosive), and have instead left it in control of the mages. As a result of this, thousands of kilometers of land filled with river valleys, harsh deserts, frost and snow covered forests, fertile plains and countless other biomes have been untouched for us to expand into. To this day there are people who venture out into these untamed lands hunting fame and fortune clawing over mountains and through the ancient ruins that litter the area. However, the vast majority of settlements are close to the borders with the other nations, thriving off trade(Their gadgets might not function here, but the results are another mater. Most of the mining towns send out the harvested ores across the borders for processing). + +The last tally was done roughly five years ago, with the number of total settlements at around three hundred scattered thin across the mage guild. Of this, we have roughly seventy active mages and thirty classified as Apprentices to manage village needs and deal with problems as they arise. Generally one mage would managed half a dozen of the closest villages and any apprentices they take on comes from this area however, it was not uncommon for mages to offload work onto other local mages if they have not the time or expertise in the field and for them to take on students who seek them out as tutor. + +That's enough for tonight, my watch is almost over and I feel sleep calling me. I'll write down any more interesting details I learn tomorrow. + +Magus said we should reach another village tomorrow, and he knows an inn there that should take us in for the night(Just in time as well, I don't trust those clouds on the horizon). Todays trip was more of the same, ridding through a dense oak forest while Magus went over anything and everything about the area around us and the Mage guild in general. Mages seems to have a list of unwritten rules governing how to act, what to do, what to say... For example, it is recommend to live at least a mile and a half from the closest village. Far enough away that people won't bother you with trivial things and you keep a mysterious reputation with the people, but close enough to be convenient for buying what you need. Another example pertains to marriage: A mage is free to wed whoever they like(Even other mages), but the spouse is entitled to most decisions and any compromises favor the spouse. Being wed to a mage often causes problems for the spouse, often with relatives and friends, and is typically a huge adjustment. Doing anything to try and make it up to them is common, as the mage feels themselves a burden and cause for their loved one's strife. From what I've gathered and how Magus speaks about the topic, these are more general outcomes and human reaction to the same events that Magus has seen happen time and again instead of rules or traditions passed down from master to student. One final interesting fact is that most mages send their children to learn the art(If the child so chooses to take on magic, and the have the talent for it) with another mage, preferably one they have rarely or never met as to prevent any bias and favor. + +I was right about those clouds, and we have reached the small town of Salis soaked to the bone. We're all currently sitting by a fire in the Mundes inn letting our robes dry and bodies warm from the chilling rain(From the clinking outside, now hail). I plan on acquiring another books tomorrow, and writing any more facts I learn from this trip with Magus in it instead of spending the pages of this book(Already longer then I ever dreamed it would be). According to Magus, we should be able to meet another mage in two days time, a woman by the name of Athis who is skilled in botany and herbs(Any medicine made by her always trades for a fair few coins). On another note, what Magus said about about people being wary of mages is holding true. The common room has been divided into two parts since we got here: The side where we are, and everyone else who have gone a table or two away from us and keep glancing at us as if to make sure we don't do anything without giving them a chance to run. The owners of the inn, a small family known as the Eldritches, seem to be the only ones who don't seem to mind us. Their daughter, or at least someone the right age and look to be their daughter, happily walks up to us asking if we needed anything other then rooms while we rested. Vlad and Demir order food for us all, Magus inquired to the drinks available, while I have asked if she knew if the general store had any writing journals for sale. And now I'm at the point of writing things as they happen... I needs some sleep in a nice bed after all this riding(But it looks like Demir is more saddle sore then I am), and the inn keepers have giving us cheap logging in the attic with a few decent, if old mattresses in a warm room with a roof over our heads. + +We left the next morning after a short trip to the market(Where I managed to get a good deal on a fairly nice journal, and have already filled out a few pages on my watch last night), and now are almost at Athis's residence. We currently are taking a short rest to eat and have the horses cool off after a long trip before riding the last leg of the journey after dusk has set. I'll detail anything interesting that happens. + +Talking with Athis, who I have already detailed in the other book along with most of our conversation, I managed to steer the conversation to how often she needs to travel for herbs, and if she has ever been in a situation where she can't get access to anything she needs but another mage might have an abundance of. As a response, she handed me a list of everything she buys when ever possible because of how rare it is here and the versatility or uses of it. The list was ten centimeters thick. Seeing a chance to get another mage's opinion, I mentioned a recent discovery in the field of magical transportation see might be interested in seeing. At this point, she gave me a wary eye and said she still has a bag of purple chalk and a stack of waystones from the last person who said that. Inviting her outside for a demonstration using a few of the teleposers I had packed, I showed step by step the process and how simple it was to use.(It took her a moment to recover from the initial shock of teleporting, but now she takes it in her stride.) Going over a few more details inside with hot tea, I asked if she would be interested in us setting up a link in the area nearby for her to use as a means of transport. Frankly, I was nerves enough at this point that I thought see would just laugh at my new goal. Instead, she was almost begging me to set a few up around a few locations several hundred kilometers apart. At this point I felt comfortable to tell her about my grand plan for setting up one of these near every mage in the guild and at some important points, so the days of needing to travel day and night to reach another mage would be over. Not only was she on board with the idea, she even offered to help us set them up if it meant that it would be ready faster! We spent the next few hours talking about this late into the night, covering little details and about enlisting the help of other mages to set it up. + +//TITLE The key of binding +Well, this has been an interesting trip... We've been visiting every mage we pass, talking and showing off the boons of our blood magic. Most of them have been extremely accepting of our arts, and the ones that haven't been at least aren't opposed enough to get violent about the subject(However, all of them are still welcome to the idea of a transport network). We have noticed one problem on our trip, however: We can't easily give people the things we've been working on, as they need LP to run it and it takes time to reach a point of being able to support the usage of them. We've gotten around this somewhat by binding the items we gave them to ourselves, but anything they make once we've left will be near worthless to them THAT'S IT! I could make a device that mimics the binding of an item, copying a thread of our soul network to another device, so anyone can craft something new and have us power it. I can use a weak blood shard to hold the soul network thread that it uses to pass on the link... Yes, I should be able to make this easily. + +I really should have slept after getting home, instead of going straight to building something... It took me three hours to think of using gold for the Key of Binding. Regardless, it has been finished. All you need to do is right click with it to set the original owner, then hand it off to the person you wish to use it. Then they right click with it, and it will bind the first thing it finds in their inventory without an owner to the person the key belongs to. While it's uses are limited, it is something you want to have around in case you ever need it. + +//TITLE The trials of a T5 altar +In other news, we've started talking about what we do now that we've started reaching the limit of our power once again. I've calculated the number of runes we would need, and have in fact already crafted all fifty two of them. We even have a few guesses on what to use for a blood orb, starting with these demonic blood shards... The problem now is the stabilizers we need. There is only one thing I've found that can handle the strain of the altar: The raw power of beacons. We need four bloody beacons. One is near impossible, four is... We need a miracle to get any farther. Magus says he has some plan, but I think even he is going to struggle with this. Talking with the others, I believe I should focus on setting up The Nexus instead of struggling with the limits of our master orbs. This is going to be a project that will take months... I've decided to limit the usage of the Nexus to mages, as public usage would tax my network night and day. I start tomorrow on this task, and plan on cleaning out some ruins about a kilometer to the east of us to set up the Nexus base. I already have a few dozen teleposition foci crafted, and enough teleposers to set up over a dozen locations. First on my list, Athis... I'll leave this book here, and will document anything that happens in my other book. Once I start research in blood magic, I will write in here again. + +//TITLE The price of power +Magus... Magus has gotten us a reservation to kill Withers. Not only that, but we each must kill one on our own. I said I wouldn't write in here again until research started again, but I felt this is significant enough to mention... We are so close to being able to upgrade the altar. If we live through this trial, that is. + +I have written the details of the last few days in my other book(It has gotten far more use then I ever expected), but we have them. Enough nether stars to finish our altar, enough to experiment with, enough to make being stuck in bed with this broken leg worth it all. + +I have been hard at work since my leg healed, ideas gushing out of me to the point I have almost stopped eating and sleeping(Thankfully, one of the others tend to drag me out occasionally). Time to document the fruits of my labor. + +//TITLE Demonic orb +Our assumption about demon blood shards was right, and after a long crafting process we have the Archmage orb. We had to spend several hours trying to fill this orb, and finally hit the cap at ten million LP, ten times the size of the master orb... We also have graduated up to the slate dubbed Ethereal. I know this isn't much fan fair, but this has become a bit of an expected event. + +//TITLE The unspeakable power of the energy bazooka +First thing I created with this new orb was an improvement to the energy blaster, as I felt it just wasn't strong enough during the fight with the wither. Harnessing the power of a few reagents and a demonic blood shard, I have created the Energy Bazooka(Not a clue what a bazooka is, but Demir tells me they shoot big explosions). Costing twenty thousand LP a shot, it launches one main projectile that upon hitting something explodes into twenty more smaller explosive projectiles to devastate other living things around it. I have tried tweaking it so that terrain isn't harmed, but there may be minor damage depending on what is hit. There is a Slight problem of recoil, but nothing we can't live with. + +//TITLE Acceleration runes +Moving my attention on to runes for our wonderful new altar, I had revelation as I noticed a speed rune next to a dislocation rune: Increasing how much LP is moved from the buffer is fine, but how about increasing how often it transfers LP? Using a few materials like buckets and an ethereal slate, I have transformed a normal speed rune into something far greater. Instead of effecting crafting speed, one rune will lower the delay the altar has on moving the contents of the buffer by a twentieth of a second per rune. I have noticed a strange limitation, however: Any runes beyond nineteen seem to have so little effect it isn't noticeable anymore, so you can only have the altar transfer nineteen times a second. I will need to run some experimentation on the best ratios of acceleration to dislocation runes... +//TITLE The Harvest goddess +Bella has dragged me with her to town so she can be sure I'm out of the lab for a while(I have noticed I'm a little pale, but I just assumed that was from all the sacrifices I've been making lately). As we ate two sandwiches at a bench on the edge of the village, I watched the farmers in the field slaving over the harvest while trying to outrun the storm just visible in the distance. Talking with Bella about ways to help them, I created the basic idea for the sigil now known as the Harvest Goddess. It is to the Reap of the Harvest Moon what the Sigil of the Green grove is to the ritual of the green grove, performing a similar effect to the harvest moon around the user by summoning a little demonic imp(You can thank Bella for this part). As soon as we had a version ready, Bella ran out into the field with a green grove, haste, and magnetism sigil to quickly run through the field collecting the harvest behind her. Needless to say, the few farmers in the field were awe struck by this sight and a few of the newer ones thought she was a goddess sent to answer their prayers(And I liked the sound of it, so we now have a name for the sigil). + +//TITLE Solving a demon problem +A mage can never get a good rest without something happening... Magus has finally launched an operation to deal with the demon portal, and has asked Vlad, Demir, and myself to lead the siege team. He has cooked up some complicated plan that only he knows all the details, and in fact might be the only one who even has any idea if it might work(Quite a few of us felt lost when he gave the basic overview of the plan). One question asked at the meeting that felt quite memorable was Wait, how are you able to replicate this portal? Magus only smiled and asked him At what point does science stop being science and starts being magic? It is the same principles and theories at work, just a different means of execution. For Magus, that seemed to answer everything. Gah, I need to focus on packing for the trip as we won't be back for a few weeks. I feel like I heading out for war, and I guess in a way we are... + +Alright, I did not expect to find a camp of demons when we warped to Venric's folly. I expected a hole in the fabric of space, I expected a few demons, but a little village... Not to mention the fact that I had to save a fairly inexperienced thaumaturge who hasn't dealt with demons before. He rushed in, thinking he would show off a bit. To his credit, he did manage to kill a few demons before the hoard took him down. I had to run in with a teleposer to save him, but we did discover something important: From the vanishing remains of the demons, I retreated two crystals. One was a shiny red we have named a Life shard. The other a brilliant blue we have dubbed a Soul shard. What is odd is that my bound armor seemed to react when I touched them, and I saw a few stray strands of soul strands between the demons and these shards. But that isn't what was really odd. + +I was spotted by one of the demons when I went to save the fool, and noticed two things very quickly: The demon had a connection to the portal with a few soul stands. The second thing was that it seemed to be... Vibrating? Closest word that comes to mind when I think of it. Shortly after that, two things happened: The demons started running towards us from every part of the village, and for a few hours after we left the camp seemed to be under a lockdown. The demons had doned armor, and were patrolling the area instead of building. These guards seemed a little stronger then the others, but tomarrow I plan on mounting an operation to collect more of these shards for research... + +//TITLE The T6 altar already +From what we have learned so far, these crystals seem to be ordinary crystals(Well, ordinary as anything from Tartarious can be here) filled with demonic aura and... changed by the travel through the portal. These demons have been using them as a sort of personal anchor, an extension of the main portal's influence. I have discovered that mixing these crystals together in a five to four ratio of life to soul shards forms a purple block that is practically pulsating with demonic power. Since we may be here a while, I have started construction of a prototype blood altar that utilizes these new blocks for enough stability for a T6 to be possible. I have yet to try this, but if it works... + +Once again, a theory proved to work out. With the addition of four pillars capped in these crystal clusters, we are able to support another seventy six runes, nineteen on each side of the altar. I have also tried the clusters out for making a blood orb, and the Transcendent orb was the result with a cap of thirty million LP. Sadly, I haven't had a chance to experament with this new altar or orb, so I haven't anything else to share yet. diff --git a/src/main/resources/assets/alchemicalwizardryBooks/lang/en_US.lang b/src/main/resources/assets/alchemicalwizardryBooks/lang/en_US.lang new file mode 100644 index 00000000..73b24898 --- /dev/null +++ b/src/main/resources/assets/alchemicalwizardryBooks/lang/en_US.lang @@ -0,0 +1,414 @@ +--Entries-- +aw.entries.architect.intro=My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village. I was brought to a village nearby, where a magician named Magus helped tend to my wounds. The magic that he used was something that I had never seen before - it wasn't Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips. Fast-forward several years, and I have learned almost everything from Master Magus, being his third student ever to master his arts. Against his wishes, I have recorded my research and put several wards and spells on this book. So welcome, apprentice. I am known as The Architect, and I am a Blood Mage. It took several years of pestering before I managed to convince Magus to teach me. He kept on telling me that, "Magic that uses the life essence of living beings requires patience and preparation in order to master it. One false move, go a little past your natural endurance, and you may find yourself taking a nice vacation in Tartarus." The thing was, I wanted to go there - I had some unfinished business with the demons. The process that Magus originally constructed required powerful artifacts that he constructed himself, but were rather lacking where teaching was concerned. After studying a bit of alchemy and the process of "Equivalent Exchange," I managed to construct myself an altar that would transmute items inside of its basin into new powerful forms. The only issue was that it needed a worthy catalyst, and so with a prick of the finger I set the Blood Altar alight! +aw.entries.architect.bloodAltar.1=To start any form of transmutation involving blood, you would need to construct a blood altar and a sacrificial knife, as well as have a solitary diamond in your possession. After placing the blood altar down, Magus advised me to be careful as I filled it slowly with my blood, and said that I would need to be really close to the altar (about a metre) for the knife to work. With about 2 buckets of blood in the altar, which Master Magus reminds me is about 10 hearts worth, I placed the diamond inside of the altar by activating it with the diamond in hand. +aw.entries.architect.bloodAltar.2=The blood dissipated in a cloud of red swirls as I waited for the atoms of the diamond to shift and reform. There were a few moments where the particles turned gray, which meant that the altar was empty and I had to hurry to fill it. After the diamond burst in a shower of red particles, what finally sat in the altar was a Weak Blood Orb. +aw.entries.architect.soulNetwork=One thing that I initially didn't understand was the overarching connection between the blood orb and myself. When I initially met Magus, I could see many sparkling strands branching off of him, flowing throughout his house and linking with intricate stones and runic drawings. I asked Magus about the strands, but he had no clue what I was talking about. It took three years of thorough research to finally find the answer, and when I brought my notes to him he was really impressed with what I have found. When you send power into the orb, the energy is transmitted from the strand connecting the orb and into the very soul of the person the orb is bound to. Similarly, and Magus managed to show this effect with several of his rituals, when you use something that drains energy it will drain the energy directly from the soul. The thing is that if you use an item whose owner has no energy left, the item will instead grab the requisite energy from the user of the item. Directly. From his or her life force. As such, the unit of measurement is called "Life Points," or LP. I experimented with this, and one heart equals 200 LP. I have christened this system to be the "Soul Network," and is used in all branches of Blood Magic indirectly. +aw.entries.architect.blankSlate=Magus is a master at rituals. His power in the intricate layering of stones and inks is unmatched. The problem is that these rituals are rather... static in nature. Sure, being able to call the bounty of the earth to the surface is all fine and dandy, but won't exactly protect you when you are on fire. To this end, I decided to link my soul network to powerful items that I have created. To start, I decided to transmute a piece of smooth stone in the Blood Altar with just 1kLP to create a blank slate. +aw.entries.architect.divination=The first thing I did was to arrange the blank slate with some reflective glass and my weak blood orb. Pouring my power into the configuration created a Divination Sigil, which I could link to my network and see how much power that my soul network holds. What is more, holding the sigil to the Blood Altar flooded my mind with information, giving me the knowledge about its current tier, capacity, and even how much it was holding. Happy with the sigil, I brought a fresh unbound one to Master Magus for him to use. When I took the divination sigil back in my hands and tried to use it to view his network, for some reason I could not gleam any information from him. I don't really see why this is, considering that I used this same method for other people and I saw that they had no power at all, but to gleam actually... nothing from Magus is strange. +aw.entries.architect.waterSigil.1=I've been training my body, lately. Master Magus told me that in order to extract most of my power, I have to get my mind, soul, and body into as perfect shape as possible. Even though my mind takes time to hone, and my soul requires methods I have yet mastered to strengthen, my body is something I can actively manage. No more cookies for me, apparently, since they have horrible saturation for the work I do. And it's hard to grow cocoa right now, anyways. The temperature is ridiculously high, and with it the humidity is pretty freaking low. Some bright spark of a thaumaturge got it into their head that it would be good to open up the Obelisk to the far north of the village, and because of it a large influx of taint spewed forth from the eldritch tomb. It looks like someone wasn't focusing enough on their sanity training! Thankfully Master Magus decided to head out to the site up north with a few stones and a new vat of ink, saying over his shoulder that he had a new ritual that he'd like to test to fix the problem. +aw.entries.architect.waterSigil.2=In the meantime, I was tasked to create something to fix our water problem. I thought about perhaps cooling the environment around the village in order to condense the water in the air, or perhaps find a way to create rain - neither of which I would be able to accomplish, because I'm sure that either task would take more than the 5 kLP capacity I currently have with my blood orb. So, I had to think small. At my desk, I mixed some dirt into the spare water I had for experimentation and started to paint on one of the blank slates I recently created to layer a bit of a base. Once I was satisfied, I took a bunch of buckets (to be safe in case that what I did would fail) and arranged them around the damp slate and then took my orb from the chest nearby. I then tapped the orb onto the slate, and the water started to boil and swirl out of the surrounding buckets, rushing into the slate! After a quick, bright flash, the new sigil lay steaming on the table in a puddle of water. Thankfully the sigil was what I needed. I could link it to my network and place water wherever I wanted by simply tapping it on the ground. The water was pricy, requiring a full 100 LP for each bucket's worth that I created in the world, but for an infinite supply of water, creeping upwards to 50 full buckets for my puny network was something that I desperately needed. It's just a shame that it started to rain an hour after I created the sigil. +aw.entries.architect.lavaCrystal=There was an explosion in the lab today as I was trying to work out a few more artifacts. When I tried to infuse a few buckets of lava with my power, and used some glass to contain the effect, the assembly simply burst into flames and flew me across the workshop. I wasn't really hurt, and thankfully my water sigil was used promptly to put out the fires, however it seemed that my experiment failed rather heartily. Apparently I needed just a little bit more time, however, since I got it to work a week after. By combining some glass and obsidian together with a few buckets of lava, and throwing in my blood orb and a diamond to hold it all together, the diamond was transmuted into a fiery crystal that seemed to... do nothing at all. I peeked out from behind the blast shield, since by then I learned that playing with lava was not the safest of hobbies, and gingerly linked the crystal to my network. As soon as the pact was completed, I felt a wave of heat emanate from the crystal, and promptly tossed it into a furnace before it could burn my fingers. I was unsuccessful on that front. The furnace immediately kindled, and the pork that was sitting in the top slot began to cook quickly. Quickly feeling a wave of nausea, I checked my network out and found that I had nothing left to offer. Once I pulled the blasted thing out of the furnace and stuffed it into a chest, the nausea subsided. So this Lava Crystal could work in any sort of furnace and feed off of the owner's network, but if the network was dry it would instead cause the owner to feel a hearty blast of nausea unless removed from the solid fuel-burning machine. Good to know, since now I know of a way to trade my services with the blacksmiths in the village. +aw.entries.architect.hellHarvest=Finally, the day that I have been waiting for the past 7 months has come. The "Hell's Harvest Festival" is a day that the village celebrates the creation of the first portal to the Nether a century ago. It's funny that when I ask the villagers why it is that we celebrate the formation of a portal to Hell, they simply laugh and say that I'll see when I finally go in. The portal was located in a vast stone cathedral, a three day's walk from the village on foot. Magus said that he'd meet us there, because he had a few things that he needed to prepare before actually going over to the Nether, but I was curious as to how he'd make it there in time - knowing Master Magus, he'd spend a day or two reading up on a new theory for a ritual and forget himself in his works. When we entered the hall, however, Master Magus was there already talking to one of the guards of the unlit portal, stowing away a gem into his pocket. I knew something was up, because I could see a strand connecting the gem in his pocket to both himself and one that trailed off back to the village. Not wanting to be distracted, I pulled out my wand (Master Magus insists on all of his apprentices learning of another field of magic, and Thaumaturgy has proved itself useful) and set alight the portal as was the custom of the newest member to the harvest. It seems that the harvest, however, was not exactly a trade. I saw giant stone walls and vast pumps throughout the land, grabbing all of the lava from the great pool below. A large collection of bound pigmen walked by, led away by someone in a full set of shining steel armour. Huge machines that processed the lava were emblazoned by the brands of industrialization: Thermal Expansion, BuildCraft, Greg Tech, and many other labels dotted throughout the base of operations. So much for a festival - it seemed that the Conglomeration, the governing body that oversaw all of the villages in the land, saw it fit to turn a civilization into a circus. +aw.entries.architect.lavaSigil=After accepting a few supplies from the farce, I walked back home by myself two days early. There were some things that I wanted to create, but wasting my time there would have been fruitless. Clearing my desk of debris charts of alchemical constructs, I set to work with a vat of magma cream that I brought with me, attempting to combine it with another slate. Casting my orb aside, I fished the lava crystal from my chest and combined it with the cream and some fresh buckets of lava - thankfully not from the Nether. Once the light faded, I picked up the new Lava Sigil that lay in front of me. What this sigil does is it siphons energy and uses the properties of the lava crystal to super heat rock, creating a source of lava wherever the wielder touches the ground. So, infinite lava, and infinite fire hazards. Unfortunately, it takes about 1 kLP per single use, which is a lot for my network as it stands currently. It looks like I need more power, but seeing that Master Magus is currently enjoying himself at the festival, I'm going to have to find a way to boost the blood altar myself. +aw.entries.architect.blankRunes.1=Of course! Runes! Why didn't I think of this earlier? The power of the altar itself comes from the structure of the components used to create it. The force of the diamond alone is not enough to create stronger materials through transmutation. What I need to do is construct several runes to extend the altar, and thus the altar's power. The only thing that I could do on such short notice is to take several blank slates (I have about 16 left) and quite a bit more stone and combine them with my Weak Blood orb. +aw.entries.architect.blankRunes.2=What came next was the hard part. After I made 8 runes for myself, I sat puzzling over the altar. "How could I extend this thing?" I asked myself. It took a few hours, but when I placed the 8 runes in the ground around the altar in a ring, I felt a strange reverberation in the air. Something felt like it awoke, as if the power in the surrounding environment doubled. Quickly, I grabbed my Divination Sigil and slapped it onto the altar, and focused into it to view the power of the altar. I was pleased to find out that the altar was finally at its second tier, which should open up many more transmutation recipes. The problem now, as I sank slowly into my bed to sleep after the long day, was to find out what I could now do. Although Magus was pleased with the upgraded altar, I was caught in a bind. I couldn't seem to do anything with it that the previous altar could not do. The first thing I did was I placed one of my leftover blank slates into the basin, and it promptly consumed 2 kLP worth of essence as it reinforced the structure. Although this Reinforced Slate was much more durable, this process appeared to make the slate no longer work with creating both the lava and water sigils, as well as making it a waste to use in additional rune creation. +aw.entries.architect.speedRunes=I can note, however, that when I combined one of the runes with a few more blank slates and some leftover sugar from the harvest it seemed to augment the altar even further. The sugar had to be laid in a configuration that mimicked a bow and arrow on top of the rune, and by doing so it created what I can dub a Speed Rune. What this rune appeared to do was increase the speed of the altar's processes, both the transmutation rate as well as the speed that a bound orb will consume the essence from the altar, by an additive 20% per rune. This tier doesn't seem perfect, however, since it seems that for the second tier only the four edge runes (not the corners) could be used as upgrade "slots" for the purpose of augmentation of the altar. +aw.entries.architect.apprenticeOrb=The "eureka" moment came when I accidentally dropped a few things on the floor of the lab. When I bent down to phish the items from the floor I noticed that one of the emeralds rolled right up to the altar, almost as if it longed to be inside of its basin. It occurred to me that if a simple diamond inside the altar created a weak blood orb, perhaps a much rarer gem would make a stronger version! Quickly fetching my knife from the table, I filled up the altar over the course of the day so that I could make sure I didn't mess anything up, and then dropped the emerald into the altar. The speed runes made sure that the transmutation took no time at all! Wow, those things work fast - I better make a note of removing the runes when I try to create more difficult items inside of the altar, because if I was not prepared it would have chewed through my supply in no time! After a few tantalizing moments waiting, the altar burst in a shower of particles and the new orb sat there, revolving on top of the altar. Master Magus must have heard my shout of exclamation, because he hurried over from his side of the house and helped me to my feet. Not noticing the pain in my palm from earlier, I reached for the orb and sealed it to my network. Master Magus then helped me to fill up the orb inside of the altar, and when we were done that day I had a total of 25 kLP inside of my network. +aw.entries.architect.voidSigil=After resting the rest of the day at the insistence of Magus, I returned to work this morning full of inspiration. While I laid in bed half awake, the thought struck me that so far I had managed to use sigils to create fluid. So why not make one that can remove it? My first attempts with things like glass bottles and bowls failed with all of them working for a brief moment, then returning to their old forms. It was almost lunch time when the thought crossed me that I used buckets for the first two, so why not here? Half an hour, six buckets, a bit of twine and a reinforced slate later I had my first void sigil. +aw.entries.architect.airSigil=While tending to our small farm a few days later, I noticed a bird land on our fence. I turned to face it as it flied off, and had a revelation as I watched how it flew. If I could use magic to create the gust of wind like that made by bird wings, I could fly through the air! After hastily finishing the days' chores, working out details in my head all the while, I rushed to my workstation to start work on what I have now dubbed the "Air Sigil". Using feathers and a Ghast tear as ink on a reinforced slate, I formed a sigil that on use creates a rush of air behind where you face to propel you forward. Flight using this sigil is fast, if a little pricey and hard to control, not like the flight provided by Magus's thaumostatic harness. Also, landing is a bit of a problem as I learned the hard way... +aw.entries.architect.sightSigil=I've grown a little annoyed at my divination sigil. While it is able to read the current tier and essence of a blood altar, that is ALL it can read. As a result, my current goal is to improve its design using my new blood orb. So far it is going well. The "Sigil of Sight" is able to read the buffers of the altar to give how much they store, as well as how far along a craft in the altar is and how fast it is using LP. The downside of this upgrade is that it loses the power to read the altar's tier or the users soul network, but so far this is an unavoidable loss. For now I'll settle with what it does now, and might try to improve it further later. +aw.entries.architect.advancedAltar=Even after all this time, I still don't fully understand the blood altar. Sure, I built the thing, but... It is almost like working directly with raw life essence has given it a bit of life of its own. After running a few experiments to try and make my life easier, I've noticed some odd behavior coming from it. First, I tried using some basic piping to extract life essence to store later to use for more pricey infusions. As it turns out, the altar doesn't like giving up its essence. I managed to get a bucket of LE out before it seemed to slow to a trickle feed, nothing more the 20LP a second. Further tests show that it has a "Buffer" tank that siphons off LP from the main tank, holding roughly 10% of the main tanks capacity. As I mentioned, it does this very slowly so piping is out of the question for now... A later test shows that it also doesn't like essence being piped in, as a similar restriction apples to imputing essence. I will defiantly need to find a way to improve this transfer rate... Another strange phenomenon about the altar is its "Hunger" for life. After the failure of the piping, I tried using a few regeneration potions from the local village to speed up the rate at which I recovered health. A normal or extended potion seemed fine, and were very effective for speeding up slate production. But a strengthened regeneration potion caused the altar to have a slight "Hum" about it, and I felt my energy being sapped by something. After talking with Magus about this, we have determined the altar senses the life flowing through us, and the potion makes the altars "Hunger" for this life create a sort of aura that causes you to lose energy akin to hunger. As a result of this, regeneration is still effective, but a sizable supply of food is needed for extended use to recover energy. +aw.entries.architect.fastMiner=I've decided to experiment with passive effects for sigils, since everything so far has been an active effect. While wondering through town looking for supplies, I noticed people cutting wood for a fire and some smashing stones to build a small fire pit. I keep coming back to how slow both of them were in my train of thought, then started going over ways to improve the tools. Then it hit me: Why improve the tools when you can improve the person? A few anatomy books and failed tests later, I hand the sigil of the Fast miner(Name pending) and two very tired arms. After activating the sigil, it speeds up muscle movements in the arms allowing you to break blocks far faster at a small LP cost every few seconds. I do need to keep reminding myself to turn it off when not in use, but the stinging pain of life essence being taken is always a quick reminder... +aw.entries.architect.soulFray=Today I pushed myself too far. I've gotten close a few times, but today was the first time I have passed out due to draining too much life essence. Magus was thankfully with me at the time, and moved me to a bed to recover. As I regained my senses, I noticed something odd about my soul network thread: They were thin and looked damaged. As I kept watching my threads, it seemed like they were slowly reforming and repairing themselves. I mentioned this to Magus, and we theorized that after coming so close to death my soul was still recovering from the shock. I made a sacrifice at the altar to test this, and it seems that this state effects how much life essence a heart is worth quite negatively with it only giving a tenth the normal amount. +aw.entries.architect.greenGrove=Today Magus showed me his green grove ritual, a way to speed up crops. Unfortunately, it is very static and has a small range, limiting its uses. To amend this, I've been toying with the concepts behind the ritual in an attempt to make it more portable. By creating an ink from oak saplings and sugarcane, then inscribing a rune on a reinforced slate I have created the sigil of the green grove. It seems a little slower and more expensive then the ritual form, but it can be carried on your person and acts like bonemeal when used on plants. While I had it active I could barely keep up with our farm, and by the end we needed to give a few of our neighbors some of the excess we didn't need. They all accepted it, but with varied degrees of reluctance. +aw.entries.architect.dagger=My work on sigils has slowed for now as I'm reaching the limits of what my little green orb can do after only two weeks. As a result, I have turned my attentions to other aspects such as runes to pass the time. Magus is currently out dealing with a large forest fire to the east of us, and the village is in a bit of a lull with nothing planed for several weeks. Right now my task is to slaughter a few chickens Magus brought home from the market to prepare on his return home, and it seems the perfect time to test an idea I've been thinking about for a while... I will not mark it here, just in case it is another false hope. Success! I've managed to perfect my idea for a new source of life essence. Before the only option was to cut ourselves to give our own life essence to the altar, but now we have a way to use other living things as a source. Unfortunately, it is a little gruesome and a bit "All or nothing" from them... Regardless, it works! ...I have realized that, in my excitement, I may have forgotten to write down what it is. I call it "The Dagger of Sacrifice", formed in a blood altar out of an iron sword and 3K LP. The dagger doesn't deal much in the way of damage. It doesn't need to, as its main purpose is to "Mark" a living thing for the altar which takes care of the rest by forcibly extracting their life essence all at once. Through my tests it seems that your common farm animal's life isn't worth nearly as much as a person, only giving 250LP regardless of where it comes from. While I set about cleaning the animals after the tests were done, a common zombie managed to sneak in the door I left open when bringing the chickens down here. As soon as I noticed it, reflexes that were being drilled in by Magus every morning kicked in and I managed to poke it with my dagger before it had a chance to hurt me. At first I thought nothing happened, then it fell to the floor as lifeless as it should have already been. I glanced at the altar, quickly noting that a zombie was worth 500LP. Looking over the fallen creature as it started crumbling, I noticed that some of the defenses Magus had set up took there toll on the zombie as it was burned and freshly cut in several areas... Seems that the amount of HP they have is irreverent to the altar, giving the same amount of LP regardless. As I finished preparing the meat to cook after disposing of the zombies ash(Which reminds me, I wanted to look up why this happens...), a very dark thought crossed my mind. The knife works by giving life to the altar. The dagger works by taking life forcibly from a target. What would happen if a human was marked by the dagger? I asked this to Magus, after showing him the dagger and telling him everything that happened. "In all honestly, I'm not sure. I have a theory, but I don't really feel like testing it..." I asked him to elaborate, so he told me the basics of it. It seemed that source of the life essence mattered with the dagger, since the chicken and zombie gave two different amounts, so depending on the person in question they would be split into one of three groups: Passive, Hostile, and Innocent. The passive would be like the chicken, only giving a little. The hostile would be the bandits, the thieves, the murderers. The ones who gave into evil, and now seek to hurt or steal from anyone. The unredeemed, and would probably be like the zombie. The final group were the innocents, anyone who doesn't fall into the first two groups. It was nothing but a guess, but we agreed that using the dagger on an Innocent villager would extract all of their life essence like ours. 2K LP, all at once... We also couldn't work out what would divide the passive from the rest, but it was only a theory so we put it to rest. +aw.entries.architect.sacrifice.1=Looking at these little speed runes, I have decided to see what else can I make. My goal isn't anything in particular, just improving it in some way. The speed rune was made with powdered sugar, so another type of powder should work... Redstone failed, gunpowder failed, glowstone... Glowstone worked. I currently have no idea what it does, all I know is it didn't fall to bits seconds after creating it so that is progress. The altar seems to accept it as a proper rune, so all that is left is to run a few tests in the morning. For now, I am tired and feel a bed calling me... I've run dozens of tests trying to find out what this new rune does, after two days of obsessing over this I finally noticed it. It slightly increases the amount of LP self sacrifice gives. When I said slight, I mean one rune increases LP gained by ten percent on an additive rate. For those who don't understand that, it basically adds an additional twenty LP per self sacrifice. If my theory is right, I should be able to make a similar rune for normal sacrifice... What else would the altar respond to? +aw.entries.architect.sacrifice.2=Well, if there is anything thaumaturgy and magic in general has taught me, it is that gold is a very good metal for magic. By simply replacing the glowstone in the recipe with gold ingots, a sacrifice rune is formed. It has the same additional ten percent addition per rune per sacrifice, meaning the more LP of the mob sacrificed the more LP the runes adds. This has got me thinking... The altar was constructed with both diamond and gold. It seems to resonate with the diamond enough to make the first blood orb, and even a second, so why not try making one out of gold? I'll need to revisit this idea later as a test run showed some reaction to a block of solid gold(I didn't ask Magus where he got it, and he doesn't seem forthcoming about these matters), but the altar couldn't cope with the strain needed to shape the block. Before catastrophic failure happened, a few safety precautions Magus and I had built into the altar triggered, stopping the transmutation before... Well, neither of us are really sure what would happen. But Magus said he has dealt with matters of unstable and untested magic, and knew most of them end with a crater in the floor(Hence the safety precautions). It has been a few days since the experiment with the gold block. Magus and I have been discussing what to do now, as the altar is getting bigger then the basement. Magus has suggested moving it to some of the lower basement floors, but considering just how large it might be in the future... I finally got him to agree to building it behind his home, as long as I helped put up a few wards and spells to keep people away. Currently we're planning out the structure and needed runes for upgrading. The current altar only has eight runes, but what I have planned will more then triple that number to twenty eight. The current limitation we suffer is the strength of the altar itself, as it can only take power from runes adjacent to it. My plan is to use something the altar is naturally attuned to as a way to not only increase the range of this effect, but act as a counter balance and stabilizing it to prevent it from becoming uncontrollable. For this to work, the blocks in question must be above the altar and an equal distance apart. We've run several tests and calculations, and have a layout in mind for this upgrade. Four pillars topped with glowstone blocks, twenty runes in sections of five, built one block down and two out from the last set of runes. In theory this should provide a huge boost in power to the altar without risking our safety(Well, more then we normally risk it), but until we test full scale I can't be sure. For now, we have a lot of runes to make. After much debate we've decided to invest in the "Self sacrifice" runes, as having a steady supply of mobs will be tricky. But now I face the issue of making dozens of reinforced slates... I need to think on this. +aw.entries.architect.bloodPack=It's so simple! I've discovered a way of obtaining LP for making slates that means I don't wait at the altar all day: The Blood letter's Backpack. Made with a modified leather chest-piece with a blank slate reinforced glass tank, it allows the wearer to gather LP by feeding it into the pack over time. Whenever the wearer has more than five hearts, the pack will drain their life and store it inside up to 10K LP to be dumped into an altar later. This pack does have two shortcomings, however. When the life essence is deposited into the altar, runes will have no bonus to the amount added. The second problem is that the altar will only accept LP from the pack when not performing a transmutation. Despite these limitations, it will prove quite valuable for simply allowing me to step away from the altar to do other tasks. This is a simple progress update, as it's been a few weeks since I last wrote in this journal. I've been making slow, but steady progress with assembling the slates needed for the runes and we're now halfway through. This isn't the only reason for the lack of entries, as I've been preoccupied with my research thorough thaumaturgy. An old friend of Magus has been visiting and happens to be a well versed thaumaturge, and he has been giving me pointers on how I could be doing better while Magus has been preoccupied in his library dealing with a mountain of paperwork. Now that Master Ridden has returned home, I hope to progress farther in making runes in the next few days. +aw.entries.architect.fivePeople=Or not, as it seems Fate has other far more interesting plans for us. Today we had a knock on our door while I was making the last of the runes, and after opening it was greeted by three apparent orphans. The two boys in the front looked like they were brothers, or at least close relatives. The girl hiding behind them on the other hand had a very different hair and eye color, so relation was unlikely at best. All of them were covered in dirt, clothing ripped, torn, and patched with various levels of skill. The one on the left had an old sword with a chipped blade on his side, was slightly thinner and taller then the his brother, had a few deep scars that looked recent, long and messy dark brown hair, and was looking at me with a kind poker face. The brother looked more muscled, and was staring at me with a very analytical eyes and a similar poker face, his hair was slightly shorter and lighter then his brother. From what I could see of the girl, she had a simple dress on that was almost caked in dirt and dried mud. The fabric near her elbows was becoming thread bare, and a large rip near the bottom of the dress exposed some of her right leg. Her hair was a light blond, almost pale white color, but the most shocking feature was her eyes... I haven't seen haunted eyes like that in years, and last time it was in a mirror. From the looks of them, all of them hadn't ate anything in days and seemed to have everything they own on their bodies or in the simple packs on their backs. I asked them if there was anything they needed, to which the elder brother said they were looking for master Magus. I called Magus to the door, visitors being a rare thing as it stands with ones who ask for him by name and not clearly mages being rarer still. Five minutes later we all sat in the main room, eating simple sandwiches I had prepared for us all at the request of Magus. Needless to say, this day was not going as expected. Magus spent the next few minutes practically interrogating the elder brother , asking questions on both of our minds. As it turns out the two brothers, Vlad and Demier, use to be caravan traders, eldest a alchemist with basic knowledge of potion brewing, younger with enough mana and training already to cast basic spells. The girl on the other hand had a story all her own. From what the brothers had managed to gather, her village was raided like my own was and she was evidently the sole survivor. What shocked me was when they said she was found wandering the ashs, demons having left hours before without so much as a scratch on her body. Vlad was with the traders when they found her, and he was forced to leave them if he wanted to help the girl named Bella. Their story seemed to win Magus over, as he told them he would try to do what he can for them.. Not long after that, Magus asked me to help him do some shopping for our new guests. On the way to the village, Magus asked me what I thought of the three. "I can't say I believe all their story, but I also don't think their lying. Did you notice the girls eyes? Haven't see a look like that since...". Magus finished for me with "Your own?". I nodded at the dark memories of that time. We continued going over the details of their story, but we agreed that just leaving them in the cold wasn't an option worth considering. We decided to at least try to keep our recent endeavors into blood magic a secret from them, but when push comes to shove I think we might have to let them in on the secret. Magus let out a long sigh. "It's been years since I had to juggle this many apprentices at once. I'm going to need your help training them. But something tell me that we're going to be learning as much from them as they will from us..." I asked him why he felt that way, and he said it was just a gut feeling. I must say I had a similar feeling. Things like this don't happen without reason, and of all mages to come to they stopped at our door, something far easier said then done. An hour later we returned home, both our arms heavy with fabrics, food, and other necessities that we will need to take care of the new apprentices. I watched in amazement as the three ate, trying to make up for days with little food all at once. After that, Magus and I laid the three on various chairs and couches to rest, the strain of travel catching up with them. While Magus dug around looking for a few of his old things that we'd soon need, I started creating some new clothing from enchanted fabric for the three to replace their current worn and ratty clothing. Now that that is done, I should try to get some sleep. Something is telling me tomorrow is going to be quite busy. The Early this morning Magus and I started carving out the earth for the three new bedrooms, since the old ones Magus use to have had since been converted into a storage closet, a alchemy lab, and small study. It didn't take nearly as long as I expected with Magus using a few spells to clear away earth while I went behind using an equal trade foci to transmute it into stone brick before gravity caught on. Once that was done, Magus raised a few walls to separate the space into three rooms and a hallway. Only after that was done did I notice the three children had awoken, and were watching us as we worked. Magus told them that he had some spare furniture in some storerooms they could use, but sadly only knew of one bed. It didn't take long for them to decide Bella got the bed, the brothers would make do with a pillow and a blanket on the floor. After that we spent the rest of the day hunting for then moving furniture to their rooms, building little work areas and libraries for each of them. The following day was more of the same, with the evening filled with helping them find books to read from the grand library. Vlad grabbed as many alchemy books as possible, Demir took a few books on spell casting, and Bella took a Lexica botanica to read through. Later this evening, after the three had retired to their rooms, I sat in the main room with Magus, arms and legs aching from the heavy lifting of the last two days. I told Magus how I thought their rooms should be almost finished, and how I spent the last hour before they retired just answering seemingly endless questions. "I'm sure. I've gone through the same more then once, when I have apprentices new to magic. You were the same, I recall." I opened my mouth to protest, but closed it as I thought back to those days. I decided I probably was as bad as them, and left it at that. It's been just over a week, and the three have settled in nicely. They join Magus and I in morning exorcising, have started studying like true scholars, and have calmed the hungry nodes in their stomachs(Well, Vlad and Bella have. Demir on the other hand is another matter, but I feel he will always be like that.) Unfortunately, like true scholars and mages they've stumbled into places we didn't want them to go. Vlad has created a chemistry set that uses life essence from a blood orb as a fuel source, Demir has turned an old table into a way to use life essence to cast powerful spells, and Bella... She's left me questioning what I know about demons, after taming one and using a blood orb to bind it to her. All three of them have stumbled blindly into blood magic, and now I don't think we'll be able to stop them. Magus and I have agreed to give them a choice in whether they are blood mages or not, but I've seen the light in their eyes... I can't imagine any of them saying no. To seal their dedication to the art, we will have them make blood orbs of their own to use. +aw.entries.architect.tier3=Even with all the chaos of the last week I've managed to finish the altar construction, and it has been more successful then I predicted. With full access to twenty eight runes, each heart is now worth over seven hundred LP. I've already started prepping to try again with the gold block, having a few instant healing potions at hand. I got a brief glimpse with my sigil of sight, and this transmutation will take twenty five thousand LP to finish, over double what the altar can hold! Writing this down does give me an idea, however.... I'll need to look into it further once I have finished making this. +aw.entries.architect.magicianOrb=It was close, but I finished the orb today. I was down to the last of my three potions and barely had the strength left to hold the knife, but I pulled through and finished my shiny new blood orb! I've already used it to craft a few things I had made before, and extra lava and air sigil, and it handles it all with such ease! Now that this is finished, I have a small list of ideas to go through... To start off the process, I want a stronger slate. As it stands the reinforced type is cracking under the strain I'm starting to place on it. Well, I got a new slate type when I last upgraded the altar... Let's see if it works again. It does! A reinforced slate in a tier three altar with around five thousand LP makes a new slate... I'll call it an imbued slate for now, and come up with a better name later. +aw.entries.architect.newRune.1=First up to the drawing board: Rune of Capacity. The basic idea is simply to add more room to the altar, so a greater amount of LP can be stored at once to make bulk crafting or difficult crafts easier. Each rune adds 1.5K to the altar's main tank capacity, but what is interesting is that the "Buffer" tanks expend as well to a lesser degree. From a few trial tests(My back is starting to hurt from moving runes all day), the buffer tanks are always ten percent of the main tanks size. This will be something to keep in mind later. After helping patch a hole in the wall caused by Demir accidentally unleashing a spell, then helping Vlad dispose of a few failed alchemical "Experiments", I finally have an hour to myself to work on my ideas for runes. After the success of the last documented attempt, I've been on a bit of a failure streak. I've have runes fail to do anything, crumble to dust, blow up, and one attempt turned into cheese(I asked Magus about this, and said this isn't the first time he's seen that happen to a magical experiment. However he is just as stumped as I am over why it is always cheese, of all things). Thankfully, I finally found something that doesn't need a blast shield to use or starts growing mold after a while. +aw.entries.architect.newRune.2=Named the dislocation rune, it's only function is to increase the rate the life essence flows into and out of the buffers. Each rune increased the transfer rate by twenty percent per rune, and this effect stack manipulatively. That sounds great, until you realize the first rune only raises the transfer rate by four LP a second. Needless to say, your going to need around a dozen of these runes before you have any noticeable impact on the transfer rate. While these runes make it possible to automate the creation of slates by storing the life essence outside the altar, you're going to be sacrificing speed, capacity, and generation efficiency for this. +aw.entries.architect.magnetism=It's been a few weeks since I last made any headway with my blood magic research, needing to help with the tutoring of Vlad, Demir and Bella along with my normal duties as a mage. I've had to leave twice this month in order to sort out some mess or another, whether is be a helping with a pack of wild wolves or a bad harvest. Today, however, I managed to get some inspiration for a new sigil. When I was in the market buy more food, I noticed two children playing with a rock that was slightly magnetic. They were just running around, seeing what it would stick to and cheering when it did, or seeing how close they could push it to something before it pulled itself closer... That is what sparked my idea: A sigil that acts as a magnet, pulling items off the ground closer to you. In theory I could rig the magic on it to apply a similar effect to all items and not just metallic ones... Three hours later, and my sigil is finished. It needs a great deal of mass in the form of four iron blocks, along with the classic gold plating infused into an imbued slate(Drat, I never did work on a better name). This sigil needs to be toggled to activate, and while active will draw all nearby items to the user if they have room for it. Simple, but very effective.... +aw.entries.architect.phantomBridge=I've been asked to visit a small town to settle a few complaints that have been voiced lately by them, and am currently surprised that a closer bridge isn't one of them. I've had to walk three miles to cross this river, and now must walk another two tomorrow to reach them. If only I didn't need a bridge, or had thought to grab my air sigil(I still have a bruise from the last landing I had with it, so I wasn't keen on using it again so soon.) Wait... If if I had a bridge that went with me? Better yet, what if I had a bridge that formed under my feet as I walked? Yes, that would be amazing... I'm back home after dealing with a feud over who really owned a cow(Answer: Neither of them, it wondered into town and they both thought it was one of their own), and have set out my work station to try and capitalize on my idea. I'd want the sigil to place blocks that are phantasmal, only there temporarily before fading into nothing after I leave. For that I'd need a special material... Soul sand might work... Add in a little stone for structuring around an imbued state, then use the orb... Done! Now then, for a test run... Drat, I left the auto-writing quill running again. It works better then I hoped! The sigil creates a small five by five platform under me, staying at the same elevation as I walk through the air. Not only that, but I've tweaked it so that holding shift lowers the platform by one under you, and the blocks it makes can be easily broken for a quick decent. Not only that, but it will only spawn the blocks if you are on the ground, jumping or flying will not cause the bridge to reform until you touch solid ground, unless you hold shift forcing it to form under you. And for one final convenience touch, right clicking a phantom block with a block replaces it with that block, making roofs and platforms far easier to build. That should be enough for one night, I'll dub this sigil "The Phantom Bridge" and call it a night. +aw.entries.architect.holding=Vlad asked me to help him today, requesting my assistance learning the sigils. Part way through he asked if it was ever burdensome having so many on me at once... And I told him it was. Now with a little of his help I've created the sigil of holding, and it... Well, it holds other sigils. Shift right clicking with it while another sigil is in your inventory will cause it to absorb that sigil, taking all of it's powers and allowing you to swap between them with a shift right click. Unfortunately, it can't hold that many sigils(Only four) and not every sigil wants be become a part of it. Also, I had to ask Master Magus for help removing sigils from it as it refused to let them go. For this task he created the ritual of unbinding, a rather grand looking ritual for such a simple task I must say. +aw.entries.architect.elementalAffinity=Demir hurt himself again today with a fire spell that backfired(Well, it worked perfectly if setting the ground around him on fire was the intention). In hopes of stopping further injuries, I have infused the powers of the water, lava, and air sigil into an imbued slate. This seems let the sigil act as protective aura around the user, shielding them from drowning, burning, or falling damage at a high over time LP cost. Since I asked Demir to use it he hasn't burned or bruised himself, but did pass out once from a lack of LP to fuel it. Sometimes solving one problem only makes more... But he has been learning, and I've been amazed at what his spells could do. Recently he made a long range teleportation spell and a flight spell not unlike the air sigil, but far faster. +aw.entries.architect.ritualStones=After a few days of nothing, I turned my attention to the construction of Master Magus's ritual stones. Looking them over, I might be able to replicate their usage and features using reinforced slates and obsidian... Master stone, more complicated then the average ritual stone might be possible if I use my magician's blood orb and four ritual stones to handle the complex nature of it, along with a little more obsidian... Yes, yes it should be possible to recreate them without sacrificing any usage of them. After asking him how he originally made the elemental scribing tools, I believe I can also replicate the manufacturing of them in the blood altar... But it looks like the dusk inks are too complex for this altar to handle, creating an ink closer to dark gray then midnight black... Perhaps I'll have the power to form them later, for now these four will work. +aw.entries.architect.bloodLamp=I had a flash of inspiration today (Quite literally, as watching a few town guards light a replacement torch nearly blinded me from the sudden light). They spend so much on coal and charcoal to fuel those things... What if I had a simple replacement? A near invisible light source that never goes out, can be made almost endlessly, and can easily be carried on your person? Never again would you need to place a torch to light a room, and they can ruin a rooms look(Not to mention the fire hazard they pose, ruining the look even more. "Charred mess" is never in style.). Harnessing the power of glowstone by running a "Current" of LP through it, I can create a sigil that fires a projectile that upon landing forms a stable light source par with that of torch. The only sign of its existence is the light it gives off and faint red particles. While it uses a small amount of LP, the advantage over carrying stacks of torches is enough to justify it. +aw.entries.architect.boundArmour.1=Today Magus gave us a lecture on armors, going over the practical applications(Protection from large pointy sticks shoved in your direction and holding magic to improve the abilities of the wearer), typical construction of armor, and notable armors through the ages (And the very fatal flaws that their owners eventually discovered, much to their short lived dismay). Seeing and reading all this, I feel it is time I take my own try at this art using blood magic. Testing a wide array of materials and structures, I discovered a process to make an almost indestructible metal using a casing filled with life essence with glass hardened with diamonds and reinforced with bright red blood shards(More on their properties later) Magus showed me a while back (Making the prototypes of this armor took longer then you would believe). The process needs the soul of a demon bound to it, but this seems to be a small price to pay. +aw.entries.architect.boundArmour.2=To start, you need to make a "Soul armor forge". This block summons the demon soul and controls the transformation of the "Socket" blocks into proper armor. By placing the filled socket blocks around the soul armor forge in roughly the shape of the armor piece you want with the forge in a gap, you set what it makes. Right clicking the forge will then finish the process, creating the armor piece and binding the demon to the shards inside the armor. You will need to bind the armor to yourself, allowing the armor to drain your network to repair any damage it takes(Another benefit of using blood shards in the creation). After donning the armor(Making a few adjustments, still refining the creation process), I asked Magus to help test just how resistant this armor really is. Several nasty bruises later, we have decided this armor shields the wearer from ninety percent of damage from mundane damage sources. What is interesting is that it also blocks roughly eighty percent of magical damage, meaning many armor piercing methods are far weaker. The metal also doesn't seem to hold enchantments, and the demons inside reacts quite negatively to our attempts to do so. Using the ritual of unbinding, we are able to deconstruct the armor back into the component sockets and anything that was inside them. I mention this because we seem to be able to "Augment" the armor before creation by adding a combination of sigils, blood shard, and an orb. The sigil added to the armor piece(You can add anything to the socket by right clicking with the item in hand) determines the effect, and adds a passive cost to wearing the armor piece. The blood shard lets you add an upgrade, the weak shards we have at our disposal only allow one upgrade but in theory a stronger shard should allow more to be added. Finally, the orb seems to lower the cost of the upgrade. Every sigil seems to have something to do with the normal effect of the sigil, either giving you a passive bonus or having the effect of the sigil happen automatically around you. A few examples are a water sigil making you immune to drowning, the fast miner always active, and a green grove sigil acts around you. +aw.entries.architect.sanguineArmour=I've managed to use my new found knowledge of armors and experience making bound armor to try and improve thaumium armor using blood magic. By throwing goggles of reviling or thumium chestplate, leggings, or boots the ritual transform the armor into a "Sanguine" version, with a small vis discount and protection par that of pure diamond. What is really interesting is that this armor can be augmented with runic shielding, and then socketed into bound armor in the same fashion as a sigil to pass on the runic shielding, with the bonus that adding the sanguine helm to the bound helm well allow the wearer to see things like aura nodes as if you had goggles on. I should note that you can only socket a sanguine armor piece into a same armor type(Helm in the helm, boots in the boots...), and that any vis discount is lost when you do this. +aw.entries.architect.soulSuppress=Having the armors special effects all the time has become a little bothersome. To deal with this I have managed to create an "Armor Inhibitor" to repress the special effects it offers in the cases they are more bothersome then helpful. Unfortunately, it is a bit all or nothing in this regard. +aw.entries.architect.ritualDiviner=It's coming up to the three year anniversary of Magus taking my on as an apprentice. Time seems to have flown by while I've been engrossed in research on applications of blood magic and working with Magus... I should make a gift for Magus to as a thank you for these last few years. Considering the complex nature of his rituals, an aid to building them might just be the perfect gift... Ugh... Making a way to build rituals easier proved to be quite the task(And it reminds me of the rule of conservation of effort...), but I finally have it ready in time for the anniversary. While it isn't cheap to craft(Costing the four elemental inks, four diamonds and an emerald), I've gone to pains to make it easy to use. Shift right clicking will cycle through a preset list of rituals, and shift right clicking on a block with also rotate the direction the ritual will face(For anything like the ritual of speed, where that matters). Shift left clicking will go through this list in reverse, for those times you accidentally go past the one you want. By normal right clicking on a master ritual stone the diviner will take stones out of your inventory, place then in the world and ink them to build the set ritual. To make it clear it is working, it emits green particle effects whenever it places a block successfully. However, it can only place a block in an empty space. Anything at all in the way will stop the process until the obstruction has been removed. It is a small annoyance, but nothing major enough to risk breaking the diviner(Again). Magus adores his gift, having rituals faster and easier to build is the one thing he could actually use(That he doesn't already have). The fact it makes anyone who uses rituals lives easier is a just a bonus at this point. As it turns out, he got me a gift as well: A pair of ichorium wand caps, the one thing I had been dreaming about for a long time... +aw.entries.architect.bloodShard=Reading through my older entries for inspiration on things to do with our current power(I believe we have started reaching the limit, struggling to stretch what we have as far as it will go) I noticed that I "Might" have forgotten about covering the blood shards like I said I would a few months ago... I'd best start from the top. Blood shards, as Magus has likely stated already, are fragments left behind after vanquishing a hostile mob with a demonic weapon(The Bound sword or Energy Blaster). Upon close inspection, I see small strands that looks shockingly like that of our soul networks... Well, in theory anything with a "Soul" could have a network, but this is a surprise nonetheless. Because of this, the small shards contain a vast pool of energy that our magics should be able to tap into. A rather unfortunate first experiment involving stone showed that this energy can be wielded to create or transform matter(I believe several others have come across similar principles to convert energy into matter using science). I say unfortunate because I was stuck inside the lab's supply closet for a few hours to hide from the rapidly expanding stone as the released energy of the shard grew the stone to thirty two times it's former size, filling the rooms and pushing out the open door and into the hallway. (Further crafting of blood stone was done outside after that...) But regardless, the blood shards potential energy and connection to the soul network is how we manged to form bound armor so easily. Thinking about it... Blood shards might be the answer to our power problems. The last time we needed an upgrade, we used something related to the altar... Perhaps using something related to the soul network is the next step? +aw.entries.architect.tier4Altar.1=Once more I must make a progress update, as daily life as taken up most of my time these last few weeks. Magus has started offloading some of his work onto us, dealing with small problems and formal matters, bandits and demons, and general mage work. I have been able to do a little work on the altar or blood magic in general over the last few months because of this. Thankfully, we've burned though most of the grunt work that has piled up and I now have some time to conduct our research. Magus and I have spent the last week doing the calculations for upgrading the altar, determining that bloodstone should work for the capstone, and now it is just a matter of seeing how many runes we can get away with adding without nasty side effects or it all just blowing up(The other three have placed bets on this, I believe). +aw.entries.architect.tier4Altar.2=After another few weeks of testing, balancing, and error we have finished the altar upgrade. This new tier adds twenty eight more runes to the altar's structure(Seven on each side, for a grand total of fifty six), and four pillars capped with large bloodstone brick(This was the best material we could find that doesn't expire or fall apart. Or, in one memorable case, actively try to kill us). With these additional runes we are projected to be making roughly one thousand three hundred LP for every heart sacrificed, a hefty improvement from our seven hundred from before. Unfortunately more work has come in for us, so once we have the altar built it will be some time before we can focus on the hunt for the material for the orb. Current plan is to start with precious materials like before, and work from there. Ah, innovation... Ten percent work, fifteen percent knowledge, five percent patience, seventy percent trying random things to see what happens. More work then expected flooded in at once, and we have been struggling to keep up with it all. Vlad has been acting as a healer and doctor trying to deal with a plague that has going around (Caused by a witch-in-training using the wrong vial in a love potion), and has managed to keep it from running wild. Demir has been clearing out known bandit camps, and has enjoyed a chance to test out the spells we've helped him build(Only in the mage guild are bandits considered an endangered species. This is in part due to the average intelligence level of said bandits, and thinking that an area where there are people who, sometimes quite literally, shoot fire out of their hands, mouths, and other places(Mostly the apprentice mages, as a joke or party trick that has often gone very wrong) is a great place to set up shop.). Bella meanwhile has been dealing with the demons that have been wondering in, the mage guild acting as a sort of beacon to them due to the thinness of the fabric of space here caused by countless magical experiments, both successful and not. Magus and I have been going through a huge pile of letters(Seriously, where are they all coming from, and how do I not notice the pile building up until it flows off the table?) from local villages and mages, ranging from simple questions about an issue or problem to requests for assistance in matters ranging from theft to flooding. We've been coordinating these issues, mapping out journeys to deal with as many as possible on one trip. As a reference point for how long it has taken us to deal with it all, dust has gathered on this book since the last time I wrote. Thankfully we've sorted out the letters and referenced the villagers to mages who are closer to them(Much to said mages chagrin), so it should be a while until this is an issue again... Thankfully all this time has left me with a few ideas for future projects. +aw.entries.architect.masterOrb=The others have tried countless gems and metals trying to create a new blood orb, all of them either did nothing or created a flawed orb(Cracked or chipped, extremely fragile or incomplete). But last night I had an idea from a dream... The weak blood shards were once part of a soul network, so what would happen if we tried to reforge it into a whole orb? It is better then any other idea we've had, so I might as well try... Success! While we did burn through several instant health flasks, we now have half a dozen new blood orbs. While we haven't named them yet, they are a true master piece... A Master blood orb, that name has a nice ring to it... I'm getting side tracked again, but I must remember to suggest this name to the others(It at least is better then the temporary name of "Shiny yellow blood orb"). With this new found power, I might be able to bring to life some of the ideas that have been just out of reach up to this point. The first interesting property of these new orbs has been shown in our bound armor. While lesser orbs simply lower the cost, this orb is able to negate it entirely! A simple upgrade, but a very useful one... Another altar tier, another slate tier. Dubbed "Demonic" after the insignia that has formed on it's surface, we should be able to put this to some good use... I've also noticed that a demonic slate can be used with a weak blood shard and master orb to "Grow" the shard making four more. Going over my earlier successful experiments, I might be able to tweak a few concepts used to achieve a new result. I'm starting with the fast miner, and if boosting my arms was this useful then what would happen if I augment my legs? Using cookies, sugar, and some of the normal materials I have created a new sigil. Time for a test run... Two hours(And two very sore legs) later, I've concluded the tests. The "Sigil of Haste" boosts the users leg muscles, allowing you to both run faster and jump higher then normal. The best part? It seems to stack with the effect of jump boost and speed(Which Vlad was kind enough to brew a potion for testing). Now then, I need a rest after all this... +aw.entries.architect.whirlwind=Continuing with my thought process of "Reworking the old", I have used a master orb, demonic slate, two ghast tears, and feathers to reform an air sigil. The "Whirlwind sigil" changes the core property of the air sigil to have the winds not effect the user by propelling them, but instead creates a bubble of wind around them pushing away many forms of projectiles. I should note that not all forms of projectiles can be pushed back by the winds, and it has a tendency to effect your own shots. It isn't perfect, but it is useful enough to have around in a pinch. +aw.entries.architect.compression=After hearing the local miners complain about always having to stop work because they've run out of space in their packs, I've built "The Sigil of "Compression". While active, the sigil will check your inventory for anything that can be compressed into a "Storage" block(A two by two or three by three recipe of that item that can then be crafted back into the item. An example is redstone into redstone block.) and squeezes it together for you. Simple, but extremely effective... I should note I added a few special cases to the sigil, such as glowstone dust to glowstone and a restriction to only compress cobblestone if you have more then a stack. +aw.entries.architect.severance=Bloody endermen... Magus sent me out to try and stock up on ender pearls, but the pests keep warping away from me only to pop up later(And almost always when I don't want them too). It is just after dawn, and I've only managed to bring back six pearls... But maybe that is enough. I recall seeing some research notes on endermen and how they are able to teleport somewhere in the library. It is only an idea, but it might be perfect for this task... Eureka! After reading through the notes, I worked out how endermen connect to The End as a power source for their teleportation. Using a few ender pearls and eyes of ender, I've completed a sigil that acts as a sort of "Signal blocker". In layman's terms, it disrupts the connection to The End and renders them incapable of any teleportation. Not only that, but it also prevents many forms of magic that relay in similar methods, such as Demir's spells and the barbaric(But nevertheless effective) act of throwing an ender pearl. From the light, I'd say it is almost sunset. Time for some well deserved payback... +aw.entries.architect.teleposer=After my research into the basics of teleportation, a thought struck me: As it stands we don't have an established transportation network for mages to use, instead using the long and winding roads or other means of land travel. Sure, a witch might have a few way stones or a broom and a spell caster has a convenient recall spell, but we don't have a dedicated transportation system. Considering how much Magus and I travel to deal with small matters, and how often mages visit each other it is a surprise no-one has built something like this sooner! After talking with Magus about this, it turns out something like this has been tried before. The main failing point each time was the limited number of people able to use the method established. (A thaumaturge rarely knows how a waystone works and so on.) This has prompted me to create a means of teleportation that, once properly set up, almost anyone can use if they know how to push a button. Further research into ender pearls is required... After close analysis, I've decided that my first priority should be the improvement of the base ender pearl. As it stands, they are a little too fragile and random for reliable long term transportation. By placing a pearl inside a T4 altar I have been able to refine it into a focus, stronger and more predictable then the base pearl. I am currently in the middle of creating a mechanism to hold and operate the more complicated bits of the process. My materials for this is mainly gold(A metal that hasn't shown any side effects to the ender energies used), two ender pearls(One input, one output), and the focus itself to handle the conversion. I've managed to finish building two of the "Transportation of matter across two relative positions devices", or teleposers for short. How they work is simple(-ish): To perform a teleport you need two teleporsers. Next, bind a teleposistion focus to one of them by right clicking on the teleposer, bind it to yourself by right clicking on anything else, then slot it into the second teleposer and apply a redstone signal. If the focus is bound to teleposer A and placed in B, then teleposer B is triggered with redstone, everything above A will move to B, and everything above B will move to A(I hope this is clear enough description, it is hard to put into word the process. If you try it yourself, it should be clearer.). This means that if you want a two way transport, you can have two foci(One in each teleposer) and trigger the one you stand on, one have one focus and always trigger the same teleposer. In theory, we could build a "Transport Nexus" by having an array of teleposers bound to the same one(One A, multiple B's, triggering the B's to do the transport). What is great about these teleposers is that they don't just transport people, but any mobs or blocks in range as well. It even functions on complex blocks like furnaces and chests! With a little redstone logic, amazing things should be possible with this simple(-ish) system! With the completion of the final prototype, I should get some sleep... A new day, a new idea! The basic teleposition focus only transports a one meter cubed area above it, but if I improve the focus a bit in the altar it will be able to handle a three meter area! Not only that, but it can be further boosted by adding a weak blood shard so it works in a five meter area, then these new demonic shards that Bella has been gathering for a final upgrade to seven by seven by seven area. I should mention that the cost of each transport is based on how much is moved, and how far it is moved. It also has the quirk of being unable to transport people or mobs across dimentions. +aw.entries.architect.suppression=After a recent flood where Magus built a ritual right in the middle of the village to save a huge chunk of it, I've decided to try and replicate the effect on a smaller, and much more portable, scale. Thus, I've made the first version of the "Sigil of Suppression". What it does, in layman terms(You don't wont me to get into the back end details involving temporary storage in a pocket dimension) is create a bubble around you that removes any liquids, replacing it all as you leave. Using this sigil, I was able to take a leisurely stroll under the nearby lake. I am glad I remembered to bring my elemental affinity sigil however, as the early prototype fail on the way back, so I had a very soggy trip home... I "Think" I found the cause of the issue, and have patched it. +aw.entries.architect.superiorCapacity=Taking a break from the sigils I've been making over the last few months(How time flies...), I have shifted my attention to improving the runes we have available for our altar. After going over the design of the capacity rune, I have found room for "improvement". I have that in quotation marks because it only becomes greater then normal capacity runes if you have more then fourteen of them. You see, the "Rune of superior capacity" adds ten percent to the altars capacity, and this effect stacks multiplicatively(Layman terms: The more of the rune you have, the stronger the next rune will be) instead of the normal capacity runes static rate. Powerful, if a niche rune. +aw.entries.architect.orbRune=Considering the amount of LP we burn through on a daily basis running our sigils, powering our spells, fueling the rituals, and feeding our tools and armor, it is a miracle we don't run out of LP more often then we do. Even with our soul network topped off with a master orb, we're tapped dry within a week. Just upgrading our orbs has served us so far, but that has shown to be too unreliable and a huge investment with the altar... Wait, we're always using our orbs to make runes to improve the altar, so why can't we make runes that let the altar improve the orb? It can't be a one way road, can it? Yes, if we tweak this here and shift pressure here... I'm rambling again, I must talk with the others about this! Yes, it works! By focusing the power of three blood orbs and using two demonic slates, we've created "The Rune of the Orb". This boost the altars ability to feed an orb(Think of it like pressurizing air, more of it in the same amount of space), letting it add an additional two percent per rune(Additive rate, so more runes won't change how much it adds). With our master orbs, one rune is an additional twenty thousand LP. While that doesn't sound like much(To think, I use to be limited to only five thousand...), consider the number of orb runes one altar can have... +aw.entries.architect.fieldTrip=After hearing the demands of the younger apprentices, we are leaving tomorrow for a quick tour of the magelands, and expect to be back by the end of this month. Talking with Magus, I agree that we've been pushing ourselves hard lately with work and research. A little rest during a vacation might be just the thing I need to gather ideas for future projects... It will also give me a chance to talk with other mages about setting up a teleposer network. It is a vacation, so a little work on side projects you normally don't have time for is normal right? Talking with Magus during the long hours on the road, a few details about the mage guild were covered on this horseback lecture. Largest of the "Nations", most of the tech focused nations won't touch this area due to the high levels of magic in the land, air, and water causing technology to become a bit more unpredictable(Read: Unstable and often highly explosive), and have instead left it in control of the mages. As a result of this, thousands of kilometers of land filled with river valleys, harsh deserts, frost and snow covered forests, fertile plains and countless other biomes have been untouched for us to expand into. To this day there are people who venture out into these untamed lands hunting fame and fortune clawing over mountains and through the ancient ruins that litter the area. However, the vast majority of settlements are close to the borders with the other nations, thriving off trade(Their gadgets might not function here, but the results are another mater. Most of the mining towns send out the harvested ores across the borders for processing). The last tally was done roughly five years ago, with the number of total settlements at around three hundred scattered thin across the mage guild. Of this, we have roughly seventy active mages and thirty classified as "Apprentices" to manage village needs and deal with problems as they arise. Generally one mage would managed half a dozen of the closest villages and any apprentices they take on comes from this area however, it was not uncommon for mages to offload work onto other local mages if they have not the time or expertise in the field and for them to take on students who seek them out as tutor. That's enough for tonight, my watch is almost over and I feel sleep calling me. I'll write down any more interesting details I learn tomorrow. Magus said we should reach another village tomorrow, and he knows an inn there that should take us in for the night(Just in time as well, I don't trust those clouds on the horizon). Today's trip was more of the same, ridding through a dense oak forest while Magus went over anything and everything about the area around us and the Mage guild in general. Mages seems to have a list of unwritten rules governing how to act, what to do, what to say... For example, it is recommend to live at least a mile and a half from the closest village. Far enough away that people won't bother you with trivial things and you keep a mysterious reputation with the people, but close enough to be convenient for buying what you need. Another example pertains to marriage: A mage is free to wed whoever they like(Even other mages), but the spouse is entitled to most decisions and any compromises favor the spouse. Being wed to a mage often causes problems for the spouse, often with relatives and friends, and is typically a huge adjustment. Doing anything to try and make it up to them is common, as the mage feels themselves a burden and cause for their loved one's strife. From what I've gathered and how Magus speaks about the topic, these are more general outcomes and human reaction to the same events that Magus has seen happen time and again instead of rules or traditions passed down from master to student. One final interesting fact is that most mages send their children to learn the art(If the child so chooses to take on magic, and the have the talent for it) with another mage, preferably one they have rarely or never met as to prevent any bias and favor. I was right about those clouds, and we have reached the small town of Salis soaked to the bone. We're all currently sitting by a fire in the Mundes inn letting our robes dry and bodies warm from the chilling rain(From the clinking outside, now hail). I plan on acquiring another books tomorrow, and writing any more facts I learn from this trip with Magus in it instead of spending the pages of this book(Already longer then I ever dreamed it would be). According to Magus, we should be able to meet another mage in two days time, a woman by the name of Athis who is skilled in botany and herbs(Any medicine made by her always trades for a fair few coins). On another note, what Magus said about about people being wary of mages is holding true. The common room has been divided into two parts since we got here: The side where we are, and everyone else who have gone a table or two away from us and keep glancing at us as if to make sure we don't do anything without giving them a chance to run. The owners of the inn, a small family known as the Eldritches, seem to be the only ones who don't seem to mind us. Their daughter, or at least someone the right age and look to be their daughter, happily walks up to us asking if we needed anything other then rooms while we rested. Vlad and Demir order food for us all, Magus inquired to the drinks available, while I have asked if she knew if the general store had any writing journals for sale. And now I'm at the point of writing things as they happen... I needs some sleep in a nice bed after all this riding(But it looks like Demir is more saddle sore then I am), and the inn keepers have giving us cheap logging in the attic with a few decent, if old mattresses in a warm room with a roof over our heads. We left the next morning after a short trip to the market(Where I managed to get a good deal on a fairly nice journal, and have already filled out a few pages on my watch last night), and now are almost at Athis's residence. We currently are taking a short rest to eat and have the horses cool off after a long trip before riding the last leg of the journey after dusk has set. I'll detail anything interesting that happens. Talking with Athis, who I have already detailed in the other book along with most of our conversation, I managed to steer the conversation to how often she needs to travel for herbs, and if she has ever been in a situation where she can't get access to anything she needs but another mage might have an abundance of. As a response, she handed me a list of everything she buys when ever possible because of how rare it is here and the versatility or uses of it. The list was ten centimeters thick. Seeing a chance to get another mage's opinion, I mentioned a recent discovery in the field of magical transportation see might be interested in seeing. At this point, she gave me a wary eye and said she still has a bag of purple chalk and a stack of waystones from the last person who said that. Inviting her outside for a demonstration using a few of the teleposers I had packed, I showed step by step the process and how simple it was to use.(It took her a moment to recover from the initial shock of teleporting, but now she takes it in her stride.) Going over a few more details inside with hot tea, I asked if she would be interested in us setting up a link in the area nearby for her to use as a means of transport. Frankly, I was nerves enough at this point that I thought see would just laugh at my new goal. Instead, she was almost begging me to set a few up around a few locations several hundred kilometers apart. At this point I felt comfortable to tell her about my grand plan for setting up one of these near every mage in the guild and at some important points, so the days of needing to travel day and night to reach another mage would be over. Not only was she on board with the idea, she even offered to help us set them up if it meant that it would be ready faster! We spent the next few hours talking about this late into the night, covering little details and about enlisting the help of other mages to set it up. +aw.entries.architect.bindingKey=Well, this has been an interesting trip... We've been visiting every mage we pass, talking and showing off the boons of our blood magic. Most of them have been extremely accepting of our arts, and the ones that haven't been at least aren't opposed enough to get violent about the subject(However, all of them are still welcome to the idea of a transport network). We have noticed one problem on our trip, however: We can't easily give people the things we've been working on, as they need LP to run it and it takes time to reach a point of being able to support the usage of them. We've gotten around this somewhat by binding the items we gave them to ourselves, but anything they make once we've left will be near worthless to them... THAT'S IT! I could make a device that mimics the binding of an item, copying a thread of our soul network to another device, so anyone can craft something new and have us power it. I can use a weak blood shard to hold the soul network thread that it uses to pass on the link... Yes, I should be able to make this easily. I really should have slept after getting home, instead of going straight to building something... It took me three hours to think of using gold for the "Key of Binding". Regardless, it has been finished. All you need to do is right click with it to set the original owner, then hand it off to the person you wish to use it. Then they right click with it, and it will bind the first thing it finds in their inventory without an owner to the person the key belongs to. While it's uses are limited, it is something you want to have around in case you ever need it. +aw.entries.architect.tier5Altar=In other news, we've started talking about what we do now that we've started reaching the limit of our power once again. I've calculated the number of runes we would need, and have in fact already crafted all fifty two of them. We even have a few guesses on what to use for a blood orb, starting with these demonic blood shards... The problem now is the stabilizers we need. There is only one thing I've found that can handle the strain of the altar: The raw power of beacons. We need four bloody beacons. One is near impossible, four is... We need a miracle to get any farther. Magus says he has some plan, but I think even he is going to struggle with this. Talking with the others, I believe I should focus on setting up "The Nexus" instead of struggling with the limits of our master orbs. This is going to be a project that will take months... I've decided to limit the usage of the Nexus to mages, as public usage would tax my network night and day. I start tomorrow on this task, and plan on cleaning out some ruins about a kilometer to the east of us to set up the Nexus base. I already have a few dozen teleposition foci crafted, and enough teleposers to set up over a dozen locations. First on my list, Athis... I'll leave this book here, and will document anything that happens in my other book. Once I start research in blood magic, I will write in here again. +aw.entries.architect.priceOfPower=Magus... Magus has gotten us a reservation to kill Withers. Not only that, but we each must kill one on our own. I said I wouldn't write in here again until research started again, but I felt this is significant enough to mention... We are so close to being able to upgrade the altar. If we live through this trial, that is. I have written the details of the last few days in my other book(It has gotten far more use then I ever expected), but we have them. Enough nether stars to finish our altar, enough to experiment with, enough to make being stuck in bed with this broken leg worth it all. I have been hard at work since my leg healed, ideas gushing out of me to the point I have almost stopped eating and sleeping(Thankfully, one of the others tend to drag me out occasionally). Time to document the fruits of my labor. +aw.entries.architect.demonicOrb=Our assumption about demon blood shards was right, and after a long crafting process we have the Archmage orb. We had to spend several hours trying to fill this orb, and finally hit the cap at ten million LP, ten times the size of the master orb... We also have graduated up to the slate dubbed "Ethereal". I know this isn't much fan fare, but this has become a bit of an expected event. +aw.entries.architect.energyBazooka=First thing I created with this new orb was an improvement to the energy blaster, as I felt it just wasn't strong enough during the fight with the wither. Harnessing the power of a few reagents and a demonic blood shard, I have created the "Energy Bazooka"(Not a clue what a bazooka is, but Demir tells me they shoot big explosions). Costing twenty thousand LP a shot, it launches one main projectile that upon hitting something explodes into twenty more smaller explosive projectiles to devastate other living things around it. I have tried tweaking it so that terrain isn't harmed, but there may be minor damage depending on what is hit. There is a "Slight" problem of recoil, but nothing we can't live with. +aw.entries.architect.accelerationRune=Moving my attention on to runes for our wonderful new altar, I had a revelation as I noticed a speed rune next to a dislocation rune: Increasing how much LP is moved from the buffer is fine, but how about increasing how often it transfers LP? Using a few materials like buckets and an ethereal slate, I have transformed a normal speed rune into something far greater. Instead of affecting crafting speed, one rune will lower the delay the altar has on moving the contents of the buffer by a twentieth of a second per rune. I have noticed a strange limitation, however: Any runes beyond nineteen seem to have so little effect it isn't noticeable anymore, so you can only have the altar transfer twenty times a second. I will need to run some experimentation on the best ratios of acceleration to dislocation runes, but I suspect that the capacity will also be a factor. +aw.entries.architect.harvest=Bella has dragged me with her to town so she can be sure I'm out of the lab for a while(I have noticed I'm a little pale, but I just assumed that was from all the sacrifices I've been making lately). As we ate two sandwiches at a bench on the edge of the village, I watched the farmers in the field slaving over the harvest while trying to outrun the storm just visible in the distance. Talking with Bella about ways to help them, I created the basic idea for the sigil now known as the "Harvest Goddess". It is to the "Reap of the Harvest Moon" what the "Sigil of the Green grove" is to the ritual of the green grove, performing a similar effect to the harvest moon around the user by summoning a little demonic imp(You can thank Bella for this part). As soon as we had a version ready, Bella ran out into the field with a green grove, haste, and magnetism sigil to quickly run through the field collecting the harvest behind her. Needless to say, the few farmers in the field were awe struck by this sight and a few of the newer ones thought she was a goddess sent to answer their prayers(And I liked the sound of it, so we now have a name for the sigil). +aw.entries.architect.demonProblem=A mage can never get a good rest without something happening... Magus has finally launched an operation to deal with the demon portal, and has asked Vlad, Demir, and myself to lead the siege team. He has cooked up some complicated plan that only he knows all the details, and in fact might be the only one who even has any idea if it might work (Quite a few of us felt lost when he gave the basic overview of the plan). One question asked at the meeting that felt quite memorable was "Wait, how are you able to replicate this portal?" Magus only smiled and asked him "At what point does science stop being science and starts being magic? It is the same principles and theories at work, just a different means of execution." For Magus, that seemed to answer everything. Gah, I need to focus on packing for the trip as we won't be back for a few weeks. I feel like I'm heading out for war, and I guess in a way we are... Alright, I did not expect to find a camp of demons when we warped to Venric's folly. I expected a hole in the fabric of space, I expected a few demons, but a little village... Not to mention the fact that I had to save a fairly inexperienced thaumaturge who hasn't dealt with demons before. He rushed in, thinking he would show off a bit. To his credit, he did manage to kill a few demons before the hoard took him down. I had to run in with a teleposer to save him, but we did discover something important: From the vanishing remains of the demons, I retreaved two crystals. One was a shiny red we have named a "Life shard". The other a brilliant blue we have dubbed a "Soul shard". What is odd is that my bound armor seemed to react when I touched them, and I saw a few stray strands of soul threads between the demons and these shards. But that isn't what was really odd. I was spotted by one of the demons when I went to save the fool, and noticed two things very quickly: The demon had a connection to the portal with a few soul stands. The second thing was that it seemed to be... Vibrating? Closest word that comes to mind when I think of it. Shortly after that, two things happened: The demons started running towards us from every part of the village, and for a few hours after we left the camp seemed to be under a lockdown. The demons had donned armor, and were patrolling the area instead of building. These guards seemed a little stronger then the others, but tomorrow I plan on mounting an operation to collect more of these shards for research... +aw.entries.architect.tier6Altar=From what we have learned so far, these crystals seem to be ordinary crystals (Well, ordinary as anything from Tartarous can be here) filled with demonic aura and... changed by the travel through the portal. These demons have been using them as a sort of personal anchor, an extension of the main portal's influence. I have discovered that mixing these crystals together in a five to four ratio of life to soul shards forms a purple block that is practically pulsating with demonic power. Since we may be here a while, I have started construction of a prototype blood altar that utilizes these new blocks for enough stability for a T6 to be possible. I have yet to try this, but if it works... Once again, a theory proved to work out. With the addition of four pillars capped in these crystal clusters, we are able to support another seventy six runes, nineteen on each side of the altar. I have also tried the clusters out for making a blood orb, and the "Transcendent orb" was the result with a cap of thirty million LP. Sadly, I haven't had a chance to experiment with this new altar or orb, so I haven't anything else to share yet. +aw.entries.architect.moreThanHuman=Magus and I have been looking into the oddity I noticed with the demon crystal and bound armour, and what we have reaped from it was far beyond what I had expected. I has assumed at first this would simply allow more sigils or other things slotted into our armour, but that was far from the truth. As it turns out, the demon soul in the armour was reacting to the crystals and was becoming more... Active? Present? Detached? All of these are accurate, but none of them are quite right. Regardless, strands of the demon's soul become... Loose? In my head this is makes sense, but on paper it just sounds odd. Let's start that again, no matter how odd it sounds. The strands of the demon soul became loose from the armour in some places, and I noticed them interacting with my own soul strands leading to the armour, twisting and tangling the strands. And as they touched my soul strands, I felt... Something. I can't put it into words, but I knew it is something to look into. Mentioning it to Magus, he made reference to tales of old arch mages making pacts with demons for a bit of the demon's power. With this train of thought in mind, we started the road that lead to what has recently born fruit: Project Omega. The concept was simple: Fuse the soul of the user and the demon in the armour, then see what results from it. The stories of what demonic power can do vary widely, so we honestly had no idea what to expect. What we got was the Omega state. Long story of testing short, we found that reagents made the perfect medium to hold our souls and that of a demon together, with as few repercussions as possible. What was interesting is that the reagent used seemed to... Colour(?) the demon soul, attuning it like those of the Demon invasion. Depending on the reagent used, the powers and abilities offered changed drastically. We gained power beyond anything expected, with the armour reshaping itself to suit it's new abilities. While there are too many to list by name, I'll cover a few general features. First, we haven't reached a point where the Omega state lasts forever. We use reagent to power the fusion, and to maintain this fusion it slowly burns through the reagent. While Magus has made a ritual to offset this, the range and the cost mean it is far from an ideal option. In order to ensure we aren't caught of guard by reagent running out mid battle without warning, I've managed to create a visual display in the helm(Located on the left side of the screen, next to the LP bar, or at least would be if you have a divination sigil slotted into your bound armour). We also found that the demonic power gave our armour it's own buffer of extra health, taking damage that normally would have pierced through armour and hurt us. I added another bar to represent this, underneath the other two bars. I should note that this "Reagent health" needs reagent to form, so the more damage it takes in for you the less Omega time you have. Depending on the reagent used for the process, we discovered that the area around us had an impact on us. We gained boons from each armour, with extra health and stronger strikes being common place among all of them. However, this weapon can cut both ways: While we gain boons in favourable areas, in hostile areas we would suffer debuffs and weaknesses. Water armour is great in an Ocean biome, not so hot in the Nether however. This is something to keep in mind before starting Omega: Don't pick one based on effects alone, but where you expect to be fighting. I should end this entry here for now, as we are still working on Project Omega. As of this time of writing, we have only managed to enter Omega using Terrea, Aquasallus, Incendium, and Aether. Any other reagent we've tried will need some fine tuning to have working, as we needed to customise the ritual for each of the four we have. We have also noted some odd behaviour from the armour when in use, trying to expend energy in odd ways. I plan on looking into this at a later date. + +aw.entries.rituals.intro=At the constant demands of my apprentices, I've started writing down my knowledge of blood magic. I've told them time and again that what we do is far too dangerous to write about, and in the wrong hands... I don't want to think of the consequences. But they have made one good point: if more people are going to learn blood magic, word of mouth is far too limited. But I'm getting sidetracked, back to what this is all about. Following their example, I will introduce myself. My name is Magus Arcana, and I am the founder of blood magic. I have lived a long life, studying more fields of magic then one could count. When I was younger I moved to the outskirts of a village to start my journeys into the arcane. After several decades of study, I realized there was one source of power few had ever touched: Blood. Many mages claimed that the use of blood in magic was taboo, yet gave no reason as to why. Eventually, my curiosity grew beyond my reluctance and I started experimenting with the art of blood magic. +aw.entries.rituals.weakRitual=My first breakthrough was with a simple device that used the power of whatever was above it as a template, along with a great deal of blood(25 hearts, or 5k LP if you go by the system one of my apprentices made years later) to perform small miracles. I must also note that at the start of each of the rituals lightning strikes the ritual stone setting it alight, as if the cost of activation wasn't deadly enough. After two weeks of meditation to strengthen my soul to the point where I could handle the strain of these rituals, I started experimenting with different templates to discover their effects. At that point, I only had the strength to test one template per day before I felt weak. I decided to start training my body and mind again like I did when I was younger, while using a few tricks I had learned over the years to help speed up the process.With some work I found that water creates a rainstorm with so much lightning that I couldn't sleep that night. A somewhat rare mineral block by the name of Lapis had the very interesting effect of turning day into night. Needless to say, everyone in the village was very confused when the sun suddenly vanished and they couldn't see anything. I was shocked when I found that a coal block summoned a zombie stronger than any other I've ever fought in the night. I also lost the coal block to fire from the lightning strike when I was dealing with said zombie. The final effect I found was with bedrock I found at the bottom of a local mine, hardening my skin temporarily. While I looked no different, I could shrug off a blow from an iron sword without a scratch. A bruise perhaps, but not a scratch. +aw.entries.rituals.rituals=I soon decided that those rituals were far too weak and costly, so I started working on a much larger version. By mixing my blood and a little bit of Mana with an item that was naturally attuned to an element(I found that magma cream worked for fire, a Lapis block for water, obsidian for earth, and a ghast tear for air) I created powerful scribing tools that used blood (100 LP's worth per use) as ink. I used stone fused with blood and obsidian to create stones strong enough to withstand more powerful rituals. It took me over two years to perfect the ritual stone. Trust me, you don't want to see what happened with some of the earlier tests. Let us just say they made the holes creepers leave look like potholes, and leave it at that. I also designed a "Master" stone to be what really controls the rituals, with the powerful dust called "Redstone" able to deactivate rituals and putting in a few safeguards so that if some fool tries to activate a ritual they don't have the strength or the blood to handle, it doesn't kill them outright. While I was able to weaken the pull that rituals carried on the user's life force to not cause any lasting harm, I could not quite get rid of the feeling of nausea and unease an unattended Ritual would cause. I eventually got tired of trying to stop it and marked it down as an occupational hazard. Once I had the stones, I realized that there needed to be a bridge between myself and the "Master" stone of the rituals. I found an old, red crystal in my attic that I bought months ago on the villages market. The trader claimed to have gotten it off the corpse of a demon after a brother of his killed it when it attacked their caravan. I don't know if his story was true, but I could tell it was magic. After shaping it a little, I found it made the perfect catalyst for linking my soul into the ritual stones. +aw.entries.rituals.waterRitual=Among the first rituals I made with these stones was the one I dubbed "The Ritual of Full Spring". I'll be the first to admit that, in terms of magic, it was nothing special. All it did was create an endless spring of water by using a few tricks from other magics and my soul as a fuel source. But when you are pioneering a new form of magic, you take what you can get. And it was cheap, 500 LP to start it and 25 LP for every bucket of water I got out of it. Luckily I made this ritual before the well outside my home dried up. +aw.entries.rituals.lavaRitual=The next ritual I created was "The Serenade of the Nether", where I tried to make something a bit more useful. I found that the ritual used a large activation cost of 20K LP, to link itself to the nether, then used a much smaller fee of 500 LP to pull a bucket worth of lava to the ritual. I am not sure what part of the nether it is getting the lava from, so it is probably best if we don't think about it too much. +aw.entries.rituals.groveRitual=The next ritual I made was the first I dared to show the villagers. After a horrible harvest due to bugs the villagers didn't have enough food to outlast the winter, and the last of the leaves were falling from the trees. We might have had a rocky relationship, but I wasn't just going to sit back and watch them die. Without enough herba essentia stockpiled to use lamps of growth, I quickly created what I now call the "Ritual of the Green Grove" to mimic its effects. After persuading two of the farmers to at least hear me out, I showed them the ritual and told them what it does. At first they thought I was trying to trick them, but instead of continuing my attempts at convincing them I planted a handful of seeds on the tilled soil I put atop the ritual. Within a minute the wheat was grown to maturity and both of the farmers were awestruck and speechless at what they had just seen. They ran back to the village, fistful of wheat in tow, returning within the hour with a dozen men, bringing their last batch of seeds and half a dozen carts. That evening pushed me to my limits, but we managed to get more than enough food to last the winter and live till the next harvest. And while only the two I first talked to thanked me in person, I knew that all of them were grateful for my help. +aw.entries.rituals.interdictionRitual=In my studies I heard of an item created by alchemists of yore called the "Interdiction torch". While replicating its effect was tricky, I eventually created the "Interdiction ritual" as a tribute to them. What it does is "Repel" any living thing that gets within its range. After realizing a small error, I changed it to where humans are the sole exception to its effect. I found being flung back by your own ritual has a tendency to make you want to tweak it. While I couldn't make it "free" like the alchemist's of yore, it only costs 1k LP to start and 10 LP per second while it is active. Rather cheap, all things considered. +aw.entries.rituals.containmentRitual=After experimenting with the effects of the interdiction ritual, I decided to try and reverse the polarity. It created a sort of "vacuum ritual", that I call "Ritual of containment". The cost is the same as the interdiction ritual, due to it using such a similar process. I found this ritual very useful for catching the odd wild rabbit when I wanted a nice dinner. Unfortunately, I caught as many creepers as I have rabbits with it. But a man can try, can't he? +aw.entries.rituals.bindingRitual=Over the years I've heard legends of a place called "Tartarus". Most other mages claim that the nether is what they are referring to, but I'm afraid the nether might just be the front yard while the real Tartarus is something we have never seen. To test my theory, I created a ritual to drag the soul of one of Tartarus's inhabitants to our world, then seal it inside an item. My research showed that few materials had the strength to withstand having a soul bound to them, much less a demon's soul, but I eventually found that diamond was the perfect material for the task. I activated the ritual (needing 5k LP), then dropped the diamond sword I had made years ago on the master ritual stone. Lightning flashed and struck each of the rituals pillars in turn as I quickly jumped to a better observing spot behind a large boulder. When I returned, the sword gleamed red like blood. Once I picked it up it turned into a shapeless goo, but by running a bit of my power through it the goo returned to its normal form. It was far sharper than any blade I had seen before, seemed nigh unbreakable, and as I was testing it on the common monsters that stalk the night I noticed something strange: As I killed them, I would find little red shards dropping form their bodies from time to time. It was rare, but a noticeable change. I made a note to investigate them later as I gathered them. Because of the ritual's function to bring a demon's soul for the sake of tying it to an item, I dubbed this the "Ritual of Binding." Shortly after this, I got my first apprentices in blood magic. Little farmer boys named Fenn and, his older brother, Way Chronos. I showed them whatever I could over five years, then they left to spread the word of blood magic to other mages. They still stop by from time to time, and I am always glad to show them what we have discovered while they were on their travels. +aw.entries.rituals.beastMode=When I was teaching Way and Fenn we experimented with binding the souls to various items. We found that along with the sword, diamond pickaxes, shovels, and axes could have souls bound to them. All of them needed LP to be used, and they had an interesting distinction to the sword. The seal on the tools could be opened temporarily, for less than the blink of an eye, to unleash a powerful effect. The terrain around the wielder will be destroyed, if the right tool is used (pick for stone, shovel for dirt, axe for wood. Do I really need to spell it out?). This uses a massive 10k LP per use, but the power seems worth the cost. Much later, when I had Tiberius as an apprentice, I did discover that an apprentice blood orb can be turned into the "Energy Blaster", a ranged weapon with the same ability to create blood shards as the bound sword. +aw.entries.rituals.unbindingRitual=The next ritual I created was an idea I had during the few years I taught Way and Fenn. The concept was a ritual that would remove souls from items, namely from the bound tools. Strangely, the souls seemed to become fond of their new homes and really don't want to leave those tools. While lesser souls bound to items as curses by necromancers and the like wither at this ritual's power, the souls of those who dwell in Tartarus seem far sturdier. It was over a decade later when Tiberius discovered that it was great at un-binding items from one and other. His first used it to recover a sigil from his sigil of holding (I still tell him to give it a better name, but I'm hardly one to talk about lazy naming), and again when he wanted to experiment with his sigils in bound armor. It seems it uses 30k LP, regardless of the number of items unbound from the original item dropped in. +aw.entries.rituals.jumpRitual=The next ritual I recall making is the "Ritual of the High Jump". It... well... it does exactly what is says on the tin. When activated, any entity on top of the master ritual stone will be flung strait up. After watching a cow use the ritual before me (I had to deal with a mess Fenn made, involving a bottle of ink, Way's hair, some dropped parchment, and a wobbly table. I returned to the ritual just in time to see the poor cow get airborne.), I added a secondary effect where anything that gets flung up can safely land back on the master ritual stone. On the bright side of that incident, we had fresh beef to cook for the next few days and a new batch of ink from some passing traders a week later. I almost forgot to add the cost, 1k LP for activation and around 15 lp per use. +aw.entries.rituals.duskInk=It was at this point that I realized that I was reaching the limits of what I could do with the four inks I had, and spent the remainder of my time teaching Way and Fenn to find a new type of ink. It took four years, but I found it. And it was worth every second. By mixing my blood and Mana with a coal block I created a scribing tool that turn blood into an ink so dark it seems to absorb light. I went on to call this new scribing tool "Dusk" as a result, and rituals far more powerful became possible. +aw.entries.rituals.magnetismRitual=The first ritual I made after creating that ink, strangely enough, didn't even need it. I had such a rush of new ideas that I didn't care if it used the dusk ink or not. Anyway, I based this ritual off of a small stone I saw the children of the village play with that had magnetic properties. By creating a ritual that mimics this attraction, I made the "Ritual of Magnetism" to pull ores out of the ground and place them in a three by three by three meter cube at the heart of the ritual. It seemed to pull from a seven by seven meter area centered on the master ritual stone, and I managed to tweak it to pull up almost any ore, metallic or not. I offered to help the miners in town with this, but they didn't want anything to do with my work. After realizing I forgot the cost again, I started leaving spaces at the end of these entries for them. This ritual has an activation cost of 5K, with 50 LP for every ore pulled up. +aw.entries.rituals.crusherRitual=To pair with the ritual of magnetism, I created the "Ritual of the Crusher." It will break any block in a three by three by three meter cube below the master ritual stone. Instead of having the crushed blocks fly off, I made the ritual push them up into an inventory above the master ritual stone. It doesn't really care where you want it, whether it be a simple chest or a barrel or something else. 2.5K activation cost, 7 LP per block broken. +aw.entries.rituals.speedRitual=As a variation of the "Ritual of the high Jump", I created the "Ritual of Speed". It was a simple task to modify an effect I already knew well to fling things at an angle instead of just up. What must be stated is that the direction, where the dusk ritual stone is, is the direction the ritual will send you, at a very rapid rate. You may want to have a way to slow down, as I discovered the hard way. 2k activation, 15LP per use. +aw.entries.rituals.shepherdRitual=Remembering the success of the ritual of the green grove, I wanted to test myself by creating a ritual that could transfer the effect from plants to animals. The "Ritual of the Shepherd" was just that. Any animal in the ritual's area of effect will grow at an alarming rate, what would take weeks just took an hour. After several tests, I concluded that if an animal took twenty minutes to grow from an infant to an adult, this ritual would cut that time down to three minutes flat. So far, I have found no side effects of using this process on animals, and I hope this remains the case as time goes on. 10K activation, 2LP every time it speeds up growth (about once every second). +aw.entries.rituals.darkMagic=The next ritual I created was one I'm not proud of. But after over three months of constant bandit attacks on the trade routes around the village I decided to take action, and anything I had at hand was far too merciful. They had earned a slow, painful end for all their crimes and I intended to deliver it. I created a ritual to use as a trap, laying it just off one of the largest trading routes, behind a thick group of trees. I then dressed as a merchant and bought a horse and cart to lure the bandits out. Like moths to a flame they came for me, riding on horses of their own. They expected me to either surrender or stop and put up a fight, so they only sent out two from their group behind the tree line. Once they saw I had no intention of stopping, they all gave chase, thinking I had something of great value, worth running from bandits for. I turned a tight corner into the tree line, the cart beginning to tip as I did, and went off the road to where I had set up the ritual overnight. By the time they saw it, it was too late for them. I stopped at the base of the ritual, knowing they couldn't get away in time. "What is this, where is your treasurer?" one of the first bandits there said. "I thought you had something, but now you stopped." I gave him a bitter laugh, he's more concerned about looting me than the reason why I brought them here. "I don't have any treasurer on me or in here, I came out here for you." By then all twenty of the bandits had arrived, some filled with blood lust, others full of greed. "Then why did you run? What is that thing anyway?" By now the head bandit was straining to keep ahold on his sword, so I kept him taking. "Oh, nothing much. Just a ritual built by a blood mage. I wanted to make sure and bring you here, just to test it out." Now all of them were pale, and their leader was having a hard time staying on his horse. "Blood magic? Are you the mage who built this? What are you trying to do to us?" He bellowed as he was trying to turn fear into anger. He was getting nervous now. Good to see the title "Mage" still sends a little fear into scum like him. "Nothing much. Well, to me anyway. To someone like you, who has cast aside his humanity for a quick bit of coin? A slow and painful death." At that point, most of the bandits were already lying on the ground while their horses started backing out of the clearing due to the panic and confusion. "Why... Why are you doing this?" The leader managed to spit out with his face in the dirt and far too weak to stand. "Because I have heard what you have done. How many you have killed for the few coins in their sacks. I know that you are slowly killing the village I call home, and while I am not someone who they like having around just outside their homes, I still feel obliged to help save them from any mortal danger they might face." At that point, none of them could move. After about five minutes, the last of their life essence had drained away. I tore the ritual apart, then went back to the village with all of the bandits' horses. I gave them and the cart to the "Mayor" of the village, if you'd call him that. He pulled me back into his office and asked where I got them from. I told him the truth, part of it anyways: "It seems like those bandits we've had for the last few months earned the ire of the wrong mage." He didn't ask any further questions, nor did he ever bring up the topic again. All I know is that I found a large pile of gifts from the village on my doorstep the next day, from fresh bread and milk to fine fabric. After a few rumors spread about what happened, we never has bandit troubles again. +aw.entries.rituals.knifeAndSufferingRitual.1=Years later when Tiberius created his blood altar I split that ritual into two versions, the "Well of Suffering" and the "Ritual of the Feathered Knife". Each needs a large activation cost of 50K LP, and I tweaked them so that they can fill a nearby blood altar with the essence they drain. Each has safeguards so that what happened with the bandits won't happen again. The well of suffering cannot affect humans, and will slowly kill everything inside its range. It will drain life one half a heart at a time at the cost of 2LP every time it steals essence, filling the linked altar with 10LP. I have tuned it to work with the altars sacrifice runes, so it is highly recommended to use them to boost the LP output of this ritual. +aw.entries.rituals.knifeAndSufferingRitual.2=The feathered knife on the other hand uses the life force of humans to fill the altar, but I have it set to stop when they start feeling weak, at about three hearts. Like the well, runes can boost its output of 100LP per half heart, but it needs self-sacrifice runes instead to boost its power. 20LP for every half heart drained. +aw.entries.rituals.regenerationRitual=Sometimes you find the idea for a ritual, and other times the ritual ideas find you. The ritual of regeneration was of the latter group. I was going about my daily business when I heard frantic knocking on my door, it is a rare thing for someone to come to my house willingly, let alone in such a panic. So I rushed to the door and found a few of the villagers standing there, one of them holding a boy of about ten in his arms. The boy was wounded badly, several deep cuts and dark bruises covered his body. There was enough blood on his clothes that I first thought them originally red. They told me that traders rushed him here from a nearby village that was under attack by demons, and that their healers couldn't do anything for him. After a quick glance, I told them to bring him inside, then sent them home. I did what I could to hold off infection and slow the bleeding, but nothing I had on such short notice could help more than just delaying the inevitable. But I couldn't let it rest at that; not having anything on hand was never an excuse for giving up. I hastily threw together a ritual, mixing concepts and taking risks to build it. Still untested, I brought the boy to the ritual. At first I thought nothing was happening, then after a minute I noticed his wounds starting to close and the bruises beginning to fade you can't imagine how glad I was that it worked. As I started gathering and preparing more medical supplies, I noticed the boy had opened his eyes. He was still quite dazed from the blood loss, and he was looking at the ritual with nothing less than awe. I caught his attention and gave him a light smile, holding a finger up to my lips as the universal sign for a secret. This was the first time someone, who wasn't one of my apprentices, got to see my lab, and there were quite a few thing here that I'd rather have the villagers not know about. At that point they had seen a few of my rituals, but they didn't know what fueled them. I then used a simple spell to send him back to sleep. I later found that my hastily assembled ritual had an unintended side effect: it didn't just work on humans: anything, from sheep to creepers, inside its area of effect will slowly be healed. I also discovered that it slots in easily with the well of suffering and the feathered knife. It needs 5K to activate, with 200LP every time it heals a human (It seems our lives are worth more than cows or creepers.), and 20LP when it heals anything else. I later learned that boy's name was Tiberius, and he grew curious about my work. For six years I held off his demands to train him. It was only after he mention seeing red threads coming from me and being attached to every ritual and item I had used blood magic to create, that I considered training him. It was only after he wrote down a theory and showed it to me that I finally said yes. I had him learn thaumaturgy as a cover up story for the villagers, and as a way to show him the difference between blood magic and other magics. First thing he started working on was an improved way to use blood alchemy, rather than learning the way I had been doing it for decades. I had to laugh to myself when he first told me that I had been so busy creating rituals that I never stopped long enough to think about ways to improve the other aspects of blood magic. So taking him under my wing was a good decision, even if he left me little choice. The blood altar we finally created was a much more efficient way to use blood alchemy, needing little in the way of magical prowess, unlike the way I had been doing it, while also being slightly cheaper in terms of blood use. We also created what he dubbed the "Blood orb", a vessel meant to mimic the soul while acting as an extension to it. After finishing the altar design it took him one week to build the altar and create the orb, granting him the same soul network capacity as two weeks of meditation. I might need to rethink the way I use blood magic, considering the leaps and bounds he is making with it. I might also be better off sticking with rituals and let him re-invent the wheel, since it seems like he is adding a few wheels of his own after I found him sleeping at his work desk drawing up a plan for a portable ritual. He soon created items he calls "Sigils" as a way to use similar power to rituals, but more portable and most are intended to be used on or around the caster. He quickly created a sigil meant to read the capacity of the bound user's soul, but when he tried to read mine I repelled his efforts. My way might have been harder, but it has given me a few tricks he might never learn. +aw.entries.rituals.harvestFestival=With Tiberius busy with his own work, I decided to challenge myself. I wanted to start creating rituals that pushed myself to the limits of what is possible with blood magic. Unfortunately, there was something baring my attempts to create these rituals: My activation crystal. It was barely able to conduct the Life essence required to activate rituals like regeneration, adding any more than that and I might lose more than just the crystal. I wanted to start researching a way to improve my crystal, but my duties to the village came first. We had a small drought to deal with, a small taint problem to the north, and the Hell's harvest festival was coming up, and so I had to meet with the other Conglomeration members to give updates on my work. I had grown to detest some of the work they do, but I still remain with them as their oldest member and as the last conglomeration founder still alive. Not that I had much choice when I joined, it was ether sit through a somewhat dull meeting every year and earn some gold for not causing trouble over the last year or let them destroy each other in an all-out war for the nether and its resources. There are still days when I wish that I went for the latter option. I asked Tiberius to help the villagers while I deal with the taint. On my way to the taint site it started to rain, so that might have made Tiberius's life a little easier. The festival came quickly, and I did my part in the opening ceremony and watched as Tiberius lit the portal. Never understood why we go through all the hassle of lighting the portal every year to then close it three days later. Regardless, we all entered the nether to see the others, already at work. I wandered off to greet people and answer a few questions, leaving Tiberius to fend for himself. I glanced back at one point to see him with a face that could only be described as pure disgust. Apparently he feels the same way I do about what the nether has become. I still remember the early days when I first opened the nether portals, back when the pigmen roamed wild and free, and death was around every corner. Those days seem like a dream now, after everything the Conglomeration has done to industrialize the nether to maximize their profit margins. Later that day I decided to visit the small building I own here and sleep at during these festivals. I found a note on my bed from Tiberius saying that he had some work he wanted to do, so he went home early. Can't blame him, I would have left myself if I had the choice. I went to this year's meeting spot late in the evening, when fewer people walked the paths cut into the netherrack. I attended the festival every year, so most people were used to seeing me here and I even got a few greetings from passersby. I walked towards the huge building carved into the netherrack with "Thermal expansion: Powering the world!" inscribed on the front of an otherwise purely white tower. I walked through the clear glass doors, then started my way towards the elevator. A tall skinny man stood inside the metallic box, and said "Greetings sir, where would you like to go?" as I walked inside the elevator. I had never seen him before, so I already knew what would happen next. "I need to go the thirty fifth floor. I have a meeting to attend to." I recall saying to him. "I'm sorry sir, but I can't do that. Only V.I.P's are allowed on that floor." I sighed as he was beginning to try my patience. "I know that, look up the name "Magus Arcana" in your little terminal over there." At first he seemed reluctant to even check, but once he saw I wasn't leaving till he at least looked at the terminal he turned and quickly hit a few keys. After about five seconds of reading the data that came up he quickly spun back to face me, his face a few shades paler. "I'm so sorry sir, I didn't know that..." I quickly cut off his stutter at that point. "No need to worry, I'm used to this by now. If we can start heading up now I might even give you a tip." After that he closed the doors to the elevator, pulled a key out of his pocket and stuck it into a small hole in the wall. A piece of the wall slid open and I saw the scanner that was hidden behind it, then he brought his eye up to it and asked me to do the same. Once it had scanned both our eyes it gave a small chime to let us know we did everything correctly, like it had the last time I had been there. I gave the man three gold coins, a generous tip to a king, let alone him. He could feed himself for a few months off that alone, and he might need to after today. They rarely keep their jobs if any of the board members didn't like them. I still heard him thanking me until after I entered the meeting hall, everyone else was already there. I knew almost everyone present, with only one new face at the seat of GregTech Intergalactical. They almost always had a new guy attend each year, so I assumed the Gregtech company was as cutthroat and brutal as rumors said. "Now that everyone is here, shall we get started?" Iza Lemming, daughter of thermal expansions founder asked once I took my seat. The new guy jumped up and started yelling once she said that "Wait, who's he? I don't recall ever seeing him before!" "Calm down, Frank. He is the guy we've been telling you about for the last half hour." Iza said. I couldn't help but crack a smile as she held up her reputation for not having any time for idiots. "Wait... He is the guy who lit the first nether portals? He is one of the founders?" I could tell he was confused, and I couldn't blame him. The fact that it was me who lit the portals a century ago is one of my best keep secrets, and the fact that I'm on this conglomeration's board is something only a handful of people outside this room know. While in truth I didn't discover the nether, I was the one who popularized it by creating portals in many major cities. "Yes, that is him," Iza said as I sat next to her "Now that you're up to speed will you take your seat so we can get started?" He took his seat again, but his gaze never left me. I looked around the table at everyone, noticing once again that for another year none of the other Conglomeration members bothered to show up in person, aside from Iza who owned the building we all sat in, opting instead to send representatives on their behalf. This year's meeting went on like every other years'. Trade requests and action requests were announced and Iza requested permission for two wither summons to start up a nether star generator. Frank demanded trade from me for iron and iridium, claiming that I owned a huge mine full of both. After ten minutes of trying to calmly tell him I owned no such mine, Iza told him to sit back down and drop the request or leave the room. He returned to his seat quickly, but I still saw the steam coming from his hairpiece that had come lose in his fury. No one bothered to tell him about it. On a quick note: I was telling him the truth, I own no such mine. I sold it a few years back, and only get a small cut of anything mined. But he didn't need to know that. The other requests went much faster, with Industrial Craft asking for some of Minefactory's rubber supply after a bad harvest, Mechanism requesting use of an ender quarry, and forestry asking for permission to search my lands for their precious bees. I gave them permission, as long as they sent a few traders through with a few of their products like honey and waxes. Then we moved on to general business of who earned how much, how far in the black they are, who now runs what. I sat quietly through all of it, making mental notes of all this information. As we were about to move on to the final topic, Frank decided to interrupt. "Wait, we haven't heard from Magus yet. Please, tell us what it is that you do? I honestly never heard a thing about you until today, and I see no reason why you own such a large area of land. I am even more curious about why you're the only magic user here. Please, enlighten me." He had a cocky grin on his face, like he had just asked questions I had never heard before. I gave him a very unamused response. "I'm sure you have heard of me, just not by name. My name is more in rumors and legends than in newspapers, and I honestly prefer it that way. As for what I do with my time, I spend it looking into legends and myths, old tomes and texts for information about new or lost forms of magic. You have huge R & D departments, I have a few friends who share their research and knowledge with me, and apprentices that always find new ways to use old things. As for why I'm the only magic user here and why I govern such a large area of land, the answer is simple: The mages never split up. While you technology users divided your land among over a dozen companies, the mages never did. We're happy governing ourselves, and we have never needed corporations or rulers to tell us what to do and what not to do. If you put the land together that all of you own, then compare it to what I have, you'll see that I have less than a third of that. Not my fault you split, and because I don't really "rule" my area they have no one to divide from. Does that answer all your questions?" He looked like I just popped his favorite balloon, so I guess he assumed to have me pinned. "But....but... That still doesn't answer why you haven't been at war with each other! I know there are many kinds of mages, so there is bound to be some in-fighting." I smiled, he used a question everyone like him has. "You're right. There are many kinds of magic, and there are small battles from time to time. But all the mages know that this is the only place where they can practice magic freely, in broad daylight. When the world is against us, we can set aside our differences to work together. Is that enough of an answer for you?" He apparently ran out of questions, as he grumbled to himself then waved to have the meeting move on. An hour later most of the representatives had left, first and foremost Frank. Only Iza, John.W. Tema from Extra Utilities, Prince Muse from the power suit empire, and myself remained to chat informally. Iza had decided to talk to me for a bit, as it was customary for the host to be the last to leave. "So, what did you think of Frank?" She asked, a light grin on her face. Nice to see running a company like this hasn't gotten rid of her humor. "Well, I don't think he likes me. I have no idea why." She gave a quick snort, trying hard to hide it. "It's how men like him are. He knew all kinds of information about all of us when he got here. That fact that he knew absolutely nothing about you was driving him nuts. He first thought it was a mistake when he noticed the number of chairs, and asked to have one taken outside. Let's just say I'll be happy when he is replaced, and I won't miss him at all." "Let's see...is he the fourth or the fifth to try and ask me questions they think I won't answer..." I said almost to myself, trying to remember. "Neither. He was the sixth, if my memory severs me," John said, Muse having left the room while we were talking. "I think you're right, the last one was about five years ago. Rodger, wasn't it?" I chuckled as I remembered him. "He demanded to see my papers, and thought we were trying to trick him. He never did believe that I own the largest chunk of the world. " "Well, you less "Own" it and more guard it. You tend to let the people own themselves, for better or worse." John said, taking a seat closer to Iza and me. "True. And it works for the better more often than not. Besides, I never could see myself in one of those big buildings you are both so fond of. Too flashy for my taste, I prefer to blend in, not stand out." I told them. "That's why you live like a hermit." Iza said, before leaning back in her chair. "I admit, I envy you at times, Magus. You can walk amongst your people and they will give you little more than a wave. If I try to do that, an army of news reporters track my every move in the hopes I slip up. It's exhausting at times." John gave a small sigh "I can agree with you there. Everyone I work with wants my job. I keep telling them that they really don't." We chatted like this for another hour, both of them letting their hair down as they talked about what's been going on with their lives. We left, Iza to the pent house on the top floor and John joined me on a short walk as I returned to my home in the nether. "I must say Magus, I always enjoy the end of these meetings when we can put business aside and actually talk for a change. Paper work is all well and good, but it is nothing compared to having a nice chat with you. I grow sick of all these "Yes Men" who only want to tell us what I want to hear till the ship starts sinking." "Having a real conversation with you and a few of the others is why I stay on the board. Everything else grows worse every year, but the afterward is still worth it all. How's your wife doing anyway?" He gave a quick chuckle before saying, "You know, I've been on that board for the last ten years. You're the only one who ever bothered to ask about my family. She's doing just fine, caring for our daughter while I'm out this weekend." "Well, we only have to work today. Since we already wrapped up business you might want to spend the next few days with them. If anyone asks I'll tell them you had something more important to do." He placed a hand on my shoulder. "Thanks, I might hold you to that. It has been a while since I gave her a nice surprise. I'll see you next year." He said as he started walking to a hotel. "Feel free to visit my home any time, I'm sure your daughter will enjoy a nice vacation." I told him as he left. He gave me a nod and a grin, before turning back to the path, almost running into a lamp post. The next two days went by much faster. I greeted people, helped a few fellow mages with questions. Apparently Way and Fenn had already started spreading the word, a few asked how my new research project was going. A few other Conglomeration members stopped by my small home, wanting to chat. I didn't see Frank again after he left the meeting, so I assumed he went back home. After the festival was over, I did my normal part in the ceremony by watching them close the portal again and not demanding that they leave it open. I returned to my home to find that Tiberius had been busy while I was out. He had created runes to augment his altar. When I asked him what purpose they had, he said the altar could make a few things that were not possible before, but that was about it. The "Blood Runes" he created looked a little plain, but I didn't voice my concern. As I fell asleep that night I realized how much they look like my ritual stones. Perhaps painting them might give them more power, like they do in my rituals? I was right, as Tiberius soon discovered accidentally. He managed to create runes on the stone using sugar, which made his altar work a little faster. We also noticed that the altar only had enough power to draw effects from the four runes closest to it. Perhaps we need to create something to "Boost" the altar's range... Three days later I heard a weak shout and raced to find Tiberius. He had collapsed at his altar, young fool, after getting far too close to his limit. I helped him stand, then looked to see what it was that pushed him so far: an emerald green blood orb. I gave Tiberius a hand in filling it, and his soul network to 25K LP. He was making quick progress, but I hoped he would be a bit more careful in the future. Life went on like this for the next year and a half. Tiberius had made several new sigils that gave him a simple form of flight, boosted the speed he worked, helped plants grow, and could remove liquids. We had started work on building a new blood altar behind my home, finding that glowstone worked well enough to boost the altar past the four upgrade slot limit we had reached and that the basement wasn't going to hold a bigger altar. We had gone the extra mile to create runes that boosted how much LP we received from our sacrifices, using the same effect glowstone dust has on the altar. Then one day when I was helping Tiberius create the last few runes, there was a knock on the door. +aw.entries.rituals.thenThereWereFive=Tiberius went to get the door, and I thought it was just one of the blacksmiths asking to use one of the lava crystals he had started renting out. About thirty seconds after he left, he called back. "Master, there are some people here to see you. They're asking for you by name." It was rare enough that we got visitors, let alone ones that want to speak with me and knew my name. I walked to greet whoever was at the door and found three children. One had dark brown hair, a ragged shirt and patchwork pants, an old and somewhat rusted short sword, and looked to be the eldest of the group at fifteen. The second looked enough like the first to be his brother, but not twins as his hair was lighter and he was a little taller. The third was a pale haired girl, so blood relation was probably ruled out. Her hair was long and a little matted, she looked to be the youngest at about thirteen, the dress she had on looked a little too small for her, was falling apart at the seams and it looked like she was trying to hide behind the other two. All three of them were painfully thin, dirty, and the eldest looked like he had a few fresh scars from at least three days ago. "You must be Magus." The dark haired boy said as I walked up. "We've come a long way to meet you. May we come in?" I couldn't turn down anyone who needs help like these three did, so I told them to leave their boots at the door and have a seat. Long tale short: I now had three more apprentices. Within a week all of them became blood mages after unintentionally finding three new branches of blood magic. Vlad started working with alchemy, both making potions and mixing items to create new items. Demir started working with spells, and has already created a powerful framework for conducting his power. Bella on the other hand has shown us that demons are much more than mindless creatures, and is working out how to form pacts with demons and bring them to our world, body and soul. +aw.entries.rituals.alchemyRitual=I created two more rituals since they have gotten here, one was "The Ballad of Alchemy". It was a way to help Vlad with the creation of large amounts alchemy products, as he mentioned how time consuming creating everything he needed was. After a little work, I had this ritual ready for use. After activation, it needs a little extra set up to work: On one side of the master ritual stone you need to place the alchemical chemistry set, and on the opposite side you need to place an inventory (a chest, or anything else really. Could be a furnace for all the ritual knows or cares.) Then the remaining two sides are "Input" sides, where the ritual will search any inventory for items. On top of the master stone you must place a blood altar with an item inside to act as a "Focus". The ritual will then pull items out of the input sides and place them inside the chemistry set, then any item it finds in the output slot, or any item not needed in the crafting (such as empty buckets) and places them inside the output inventory. Once I showed this to Vlad he nearly passed out, then hugged me. To say he was happy is an understatement. 20K activation, and 10 LP every time it moves an item. +aw.entries.rituals.domeRitual=The second ritual I created was the ritual of the dome. What it does is simple, it removes any fluid block in its radius of ten blocks. But it doesn't just remove the fluid, it stores it in a small pocket of space so that when it is deactivated any blocks it removed will return. Maintaining this effect does have a small LP cost every tick. While the range seems small at first, I am sure that I will be able to find a way to extend it. Placing stuff underneath the ritual appears to have no effect, so I should ask Vlad or Tiberius to look into it. Activation cost of 10K, with a small passive drain. Hmm, to think this ritual came about when I had to deal with a small flood... That brings us up to present day. I am still trying to strengthen the activation crystal, while all my students are busy with their own tasks. I will write again once I have something worth writing about happens. +aw.entries.rituals.awakenedCrystal=After a little over three years with having Vlad, Demir, and Bella as apprentices, they have helped me awaken the true potential of my activation crystal. After helping Bella create a way to summon demons, she showed me an item a special demon called an "Elemental" drops: The demon blood shard. I already knew that the activation crystal seemed to be attracted to blood shards, but what we have been harvesting off common monsters of the night turn to dust when I try using them on the crystal. But this... this blood shard has a slight demonic aura to it, and it seems like it wants to merge with my activation crystal. After some work with Vlad, we used a few of his more potent alchemical reagents to bind the demon blood shard to my activation crystal, "awakening" the true potential of it. I have yet to try and build any new rituals, but that will soon change. +aw.entries.rituals.featheredEarthRitual=The first ritual I created is "Ritual of the feathered earth". It has a huge LP cost of 100K, but any fall damage within a 30 block horizontal range or a 20 block vertical range is negated because the ritual turns the ground soft. The ritual needs no further cost after activation due to the semi-permanent nature of softening the ground. I was trying to make a ritual to let me fly, but this seems useful as well. +aw.entries.rituals.gaiaRitual=The next ritual was based off an old magic ritual that required three royal goat sacrifices. I have managed to replicate the effect using blood magic, and have named it the "Ritual of Gaia's Transformation." The basics are this: By sacrificing items and 1M LP to Gaia, you can change the climate (or biome, as some call it) of the area around the ritual. Unfortunately, Gaia will only take items off arcane plinths around the master ritual stone, but nothing else about this ritual is cheap so why should this be? The rituals area of effect must be defined by using blood stone bricks (either the larger or normal, and has a range of 21 blocks) and it only effects places with a definable path to the master ritual stone. Simply put: If you placed a water block on top of the master ritual stone, then placed more water blocks where the water flowed until the water stopped flowing, where there is water is where the ritual will effect. The ritual assumes first of all that you have a humidity of 0.5 and a temperature of 0.5. It will then consume the items that you have placed and modify the humidity and temperature accordingly. It also starts with assuming that a range of 0.1 is acceptable in both directions. If the ritual cannot find a biome that is registered in the list, it will simply set the biome to a "plains" biome, with a biome ID of 1. The items that can modify these parameters are as follows: Sand: humidity - 0.1 Sandstone: humidity - 0.2 Netherrack: humidity - 0.4 Lapis: humidity + 0.1 Water bucket: humidity + 0.2 Lapis block: humidity + 0.4 Coal: temperature + 0.1 Coal block: temperature + 0.2 Lava bucket: temperature + 0.4 Snow ball: temperature - 0.1 Snow block: temperature - 0.2 Ice block: temperature - 0.4. It is a tricky ritual to use, but the local bee keepers are thrilled by the possibilities. A tundra at the heart of a dessert, mushroom biomes anywhere, or even tweaking the Nets biomes so living there is possible. +aw.entries.rituals.condorRitual=After three month worth of work (Tiberius says I'm obsessive about rituals, and I have little ground to say otherwise. I worked on building this ritual for three days strait, without eating or sleeping.), The Reverence of the Condor (named after a legendary Thaumaturge's sword) allows anyone in a ten block horizontal range (from bedrock to skies limit, only horizontal distance matters.) will be able to fly freely. This ritual needs 1M LP to activate, but has no passive cost at all. Since adding this ritual to a new basement layer, I have found it to be useful. Caution mast be taken however, as this ritual does little for fall damage. It is recommended to use this with the ritual of feathered earth for best effect if you are planning to stray from its area of influence. +aw.entries.rituals.meteorRitual=After reading an interesting book on where ores come from, I built "The Mark of the Falling Tower." It uses a process similar to the ritual of magnetism, but instead of pulling them out of the earth in drags a meteor out of space and pulls it toward the master ritual stone. (Note: The meteors summoned by the ritual often come in with a powerful blast. This is unavoidable, as we are dragging in huge chunks of rock at very high speeds.) This process is not cheap, needing 1M LP to activate, then a "Template" item sacrificed by dropping it on the master ritual stone to help the ritual find a meteor. The item dropped will influence the meteor it finds, but there will always be some randomness to the process. Here is what I have discovered with some experimentation (Note, this might differ from person to person. I can only give you a reference point for what you might get and tell you what they need.): A stone block summons a huge meteor filled with lots of stone, while also having ores often found close to the surface of the world scattered about. Common things to find are: Coal, apatite, and iron. An iron block summons a meteor filled with metals like iron, gold, copper, tin, lead and silver. It also has very little stone, and some lapis and redstone mixed in with the metals. A diamond calls down a meteor that is often filled with gems (diamond, emeralds, amber) and other rare items like cinnabar. Finally a nether star calls down a meteor filled with very rare or tricky to get ores like nether quarts, diamonds and emeralds (more than what the diamond summons), sunstone, moonstone, certus quartz, and the always rare iridium. (Gregtech has become a lot friendlier since I discovered this ritual, for some reason). I should repeat that your location in the universe influences what the meteors come with. The ore amounts, meteor size, and even what ores do spawn have been known to change, from some having metals I've never heard of to other iron block summons having only iron, gold, lapis and redstone. It is almost as if someone can tweak these factors to their heart's content... No, nothing more than my paranoia. +aw.entries.rituals.expulsionRitual=The next ritual I have created with my wonderful new activation crystal was one I'm rather proud of. Every few years someone gets it in their head I'm the incarnation of evil and then raise up a mob to try and kill me. Since I knew it was time for it to happen again (always just after the first harvest, when the farmers are planting more seeds. This is around the time it happens, like clockwork.), I created the aura of expulsion. What it does is simple: It creates a field in a square 25 block radius that will check for anyone who isn't the activator. If it finds someone who isn't the activator, it will "Expel" them by randomly teleporting them away. This ritual has an activation cost of 1M LP, with a 1K fee every time it expels someone. I should note that if someone lands inside the field of another aura of expulsion they will be teleported again and again until they land outside the field or the ritual owner's network becomes dry. You have no idea how entertaining it was to sit on my porch and watch as the mob suddenly realized that they were heading in the wrong direction when they started marching toward my home. It took them an hour, but they finally figured out that they couldn't get close to my home. Afterward I got to hear all the silly reasons why they wanted to kill me this time. Also, I have added a check to the ritual for an inventory above the master ritual stone. If it finds a blood orb bound to someone inside, then they become "Whitelisted" from the effect of the ritual. +aw.entries.rituals.costOfProgress.1=Well, I write this with both good news and bad news: The good news is that we now have a lead on what my students need for their next tier of blood altar. The bad news is that what they need is very hard to get: Beacons. Four, to be exact. Nether stars are an extremely rare resource that very few have access to, so building this seemed impossible to them. I told them that I might be able to pull a few strings, but it will take time. For now they are working on building the upgrade runes they will need, then I will tell them to try and perfect what they can do with their master blood orbs. Thankfully, the next Hell harvest is in less than a month so I can start the plan I have been thinking up soon. But it will take at least a year to accomplish, so we have time to kill... I have just returned from the Conglomeration meeting, and my plan is now in action. You see, the host for the next meeting is the Mage guild, and as the host I have the authority to make a request: That all the Conglomeration members show up, in person. It has been what, thirty years since I have met most of them? Regardless, I gave each of the representatives a letter to deliver to the Conglomeration board members that said "As the host of next year's meeting, I have two requests. The first is that we hold the meeting near my home instead of in the nether, as I really don't have anywhere large enough to host there. The second is that all Conglomeration members show up in person. Don't bother bringing servants, but you may bring friends (give those poor souls you send in your place all the time a thank you. They deserve one.), and family members. Room and board should not be a problem, as I will gladly provide both. Don't send people in your place like most of you do, as I will not allow any substitutions. "If you attend this meeting, guests or no guests, I have prepared little gifts for each of you as a thank you. Inside this envelope you will find a card with what I am offering. You may find my offer beyond believe, but I can assure you that I have everything offered and more. Consider this a little incentive to come, as I know most of you spend the Hell's harvest working instead of enjoying a small vacation. If you wish to attend, simply send a reply letter to me in whatever manner you see fit. I look forward to seeing you all again." The gift I offered depended on who got the letter. To Gregorius Tech IV (he doesn't trust anyone else to run his company, so every time he feels like he can't run the business anymore he makes a clone of himself, then moves all his memories to the clone.), I offered a stack of raw iridium ore. To Iza Lemming I offered a few resonant ender cells (fully charged, of course. I have more than magic tools in my basements.). I could list them all, but then this book will drag on longer than it already has. I told my apprentices that I should be getting a few letters soon, and a week later I started getting the letters in a wide variety of ways. Gregorius opened a hole in space to have an intern hand deliver it, Queen Muse sent a power armored messenger with her letter soaring over the tree tops. Lucas Jaguar sent one of his personal trains in, one that built a track as it went and removed it automatically. I could go on, but I think you get the idea. When Tiberius asked what was going on, I told him I would be having a few guest over in a few months and these were their answers to my invitation. All of the letters said yes, so I must have gotten their attention. For the nine months after the Hell's harvest festival, I learned all I could from my apprentices. I wanted to use Tiberius's artifacts, so he showed me every sigil he has made and helped me upgrade the bound armor he gave me. Vlad showed me the secrets (in exchange for a few secrets of my own) of his potions, and the power he could bring out of what used to be so simple. Demir gave me spell components, and showed me how to build a spell structures. Bella helped me summon and tame a demon similar to Sinferrius (the "Fallen Angel" breed), who was named Thanatos. We found that the two of us shared a thirst for knowledge, and he started helping me with research in my library. When there was only three months until the next Hell's harvest festival, I opened the "Conglomeration Hall." +aw.entries.rituals.costOfProgress.2=The Hall is where I have stored most of the Technology I acquired over the years, from trades with the other board members or deals with more shady groups. Every innovation and project that any of the world's companies have ever made can be found here, from redstone furnaces to industrial grinders, power armor upgrades to quantum armor, and coal coke ovens to mass fabricators. Most of the time I never use this place, but it works as a fine testing ground for applications of my magic. After doing the ritualistic "Dance of the Mage" to call up from the ground then open the gates to The Hall, I noticed that all of my apprentices were standing behind me slack jawed. "What... What did you just do?" Demir finally asked. "I opened the door to this old place. We need to do some cleaning if we're going to have guests here. Dust gets everywhere and... Well, what are you waiting for, come in and help me!" It took all of us the first two months to clean the place (all ninety-five floors), and we spent the final month taking care of all the last minute touches such as making a large order for food from the great meat and produce alliance (Queen Pam, Harvey Growth, and Larry Iguana are the main representative for the Conglomeration, but there are many smaller colonies that make up their territories). Shortly after making sure everything was in working order, all the dust was cleaned out of the place, all the beds had clean sheets, and many other tasks were done was it time for the Hell's harvest festival, I asked my apprentice's to watch the place while I lead the other members here, and to greet them when they arrive. I think at that point Demir still thought this was some sort of prank, as there isn't any mention of the mage guild having a representative in any history books (and I've made sure it stayed that way. Any who have tried find their books missing, pages torn out, and critique for believing some legend is fact.). We went through the normal procedure, a merchant that had just moved in to town lighting the portal. After milling about the place for an hour, I met all my guests at Fire Grove Park (tourist spot, if you can believe it) and set about escorting them to my home as orderly as possible (which wasn't very). Thankfully, almost everyone was in commoner clothing as I had requested so no one realized all of the leaders of the world were walking past them. After just half an hour, we were all in the carriages I rented (I told the merchant it was a family reunion. He never asked if it was my family.), and on our way to my home. In total there was a little over a hundred and fifty people here, so I'm glad they took up my offer for guests. Once all of the carriages arrived, and I had asked the drivers to return a few days later, I set about greeting everyone and showing them around. It took most of the day, but everyone started relaxing and enjoying a nice vacation. We all came together again for dinner, and as we enjoyed meals cooked by a local family run restaurant that I always hired for large meeting like this I moved from table to table, greeting guests personally and answering questions. As the hour grew late all the Conglomeration members joined me in a small room for the meeting. "Well Magus, I had no idea you owned a place like this!" Raylind Diyo said as he came in. "I might have paid you a visit sooner if I did." Raylind said as he took his seat, smile on his face. I saw he brought both his wife and daughter here, so that might be why he is in such a good mood. "This place is better than any hotel or amusement park I've even been in!" Carrin Calclavia, the fifteen year old owner, head of research for Modular Force Fields, and daughter of the former owner Count Calclavia said while spinning in her chair. "Seems like a waste of my time," Gregorius said. "Oh, don't be such a spoil sport Greg. Most of us have forgotten what not working every minute of our lives is like, and I for one remember why I liked not working when I was younger!" Jason Algorithm of Applied Energetics said as he took his seat next to Greg. Greg gave him a cold glare for a few seconds, then his expression broke as he said, "Alright, I'll admit I have enjoyed not worrying about paper work for the last few hours." "Now that Greg has almost smiled, let's go to Magus for more miracles," Carrin said, mischievous grin on her face. "Well, everyone is here, so we may start. Any news to share?" The news this year was a little more lively than normal, a few had started "Re-inventing the wheel" to use their technologies in new ways, while a few others had started work on new projects. Then we moved on to the normal trade requests and protocol stage, where it was business as usual. Until it was my turn. "Before we move on, I have to request a few wither summons and kills." I told them. "Ah, you need nether stars? I still have a few spare, so you can use them." Jason said. "No, I only need a few stars. It is the killing of the Wither I'm more interested in. Call it a test for my students, who I'm sure most of you have met earlier today." Raylind started brushing his chin with one finger, before saying "Really, you want to have those kids kill a Wither? Seems like a bad idea to me..." I smiled at this "Don't worry about them, they can handle themselves. It's the withers you should be worried about." "Besides..." Carrin said "All of them are older than me. So I would not call them kids. And they're more mature than a few of you in here..." I had seen Carrin and Bella talking earlier, so it isn't a surprise she is defending them. And Carrin loves getting gabs in when she can, so this was the best of both for her. "We're getting off topic. How many wither summons are you requesting, and how many do you plan to have done by hand?" Iza Lemming said, trying to help poor Raylind. "Thirty summons, and thirty manual kills." This drew a gasp from everyone, including Greg. "Thirty... All at once?" Doland Tema, son of the founder R.W. Tema asked. "No. one for each my students, six for myself, and twenty as a finally. As I said, thirty," I told him. "Might I ask what you need that many nether stars for?" Greg asked, eyebrow raised slightly. "As I told you, this is a test for my students and myself. We really need only four stars, but I'd like to test the limits of the new form of magic we've been working on. And if you don't mind, Doland, I'd like to use Hell's Fridge for all of the Withers." He looked at me for a few seconds before saying "Well, it would be a shame to kill all these withers without making a show of it. Alright, you helped build the place anyway so I have no reason to deny you. Hell's Fridge is yours to use. And I approve the Wither summon request." One by one everyone approved the request, some more warily then others. Everyone here knew what nether stars can do, so someone with thirty of them Even in my KAMI days I didn't ask for that many at once. The meeting ended shortly after that, but I asked Greg to stay as I had to talk with him privately. After everyone else had left, I created a few protective wards to keep what was said secret to any eavesdroppers. "What do you need to talk about?" Greg asked, more curious than anything else. "I know we're both tired, so I'll get right to the point: I know all about your little "Project New Gate."" This seemed to shock him briefly, so I said "Oh, you and I both know your company can't keep secrets. It would have gotten out sooner if I didn't pull a few strings to keep it under wraps." Greg gave me a hard look for a few seconds, then sighed. "Alright, how much do you know?" "Everything." I told him. "I know you opened up a gateway to Tartarus, and then you started using robots to mine the place for new materials. But that didn't quite go to plan and demons overran the facility, then started getting out and roaming the land. That was about twenty years ago." Greg slumped his shoulders, knowing I had every detail about one of his darker secrets. "So what now? You're going to tell the others? Try to bankrupt me or black mail me?" He said, voice filled with regret. "No, as this wasn't your fault. You couldn't have ever known something like this would happen, from what I've heard and seen. It was an accident that has gotten way out of hand, to the point where you can't clean it up, and your pride has stopped you from asking for help. I know your company caused this problem, and for the last twenty years you've been trying to fix it. So now here is what's going to happen: You are going to talk to all of my students and tell them everything you know. Tomorrow we tell the other board members. Then, once my students tests are over with, you'll send me all the data from your research notes on New Gate. Tartarus is a place filled with both demons and magic, so I should have a better chance of opening a stable portal that I can enter Tartarus and close your portal from that side while you close your own portal in this dimension." He gave a cynical chuckle. "You make it sound so simple. What do you stand to gain from helping me? I take it there is something you want me to do for your help." I interlocked my fingers, then smiled. "I'll stop the demons coming into the mage guild, so that is enough. But you're right, there is one thing I need you to do. But I'll only tell you in front of the other board members tomorrow. It won't cost you a penny, but the price I will ask my be more then your willing to pay. Now then, I need you to go through my first request: Talking to my students about this mess you've made." I called in Tiberius and the others, each of them surprised that I wanted them to speak with Greg. Greg did what I asked and told them everything he knew, then I did the same. Both Tiberius and Bella took the news hard, discovering that I had known for the last few years where the demons had come from and who was responsible. "Why didn't you tell us sooner?" Tiberius yelled at one point. "I had cursed his name for the past few years, now you're telling me it isn't his fault?" I had enough of being the kind father at that point, so as the strict teacher I said, "Remember when you made your first dangerous level infusion?" That fazed him for a moment as he remembered the disaster that was. "You tried to make it without having enough essentia, then ran around the altar trying to fix it while losing items left and right. Remember how I simply sat in the next room and let it happen, then gave you a hand cleaning up?" Tiberius nodded without saying a word. "That is what has happened with Greg. The infusion has gotten out of control, so now it is time to help him clean it up. I gave you enough time to realize the infusion was out of your control, and you realized it in time and stopped the infusion. I gave Greg time to realize he needs a mage's help to fix this mess, and now he is willing to at lease consider my help. That is why I never told you, to give him a chance to fix it on his own." After I told Greg to leave and get some sleep, I told my students the truth: I had only discovered most of the details in the last few years, and had started looking deeper into it after Bella had met Sinferrius. The next morning the board members came together after breakfast. Greg fulfilled the request I had yesterday of telling the other members, then came the hard request. "I need you to ask me for help." I said to Greg. He looked puzzled, saying "But I thought you were going to help me already." "No, I can help you, but I will only do it if you swallow your pride and admit you need my help. As I told you, this request might be a price you aren't willing to pay while not costing you a penny." Greg stood up, and with the look of a man who has been utterly defeated said "Magus, will you help me close the portal to Tartarus?" I stood as well, placing a hand on his shoulder and told him "All you had to do was ask." After that we moved onto the topic of the withers I needed to kill. It would be hosted in the nether in one month's time, and all the other members had already decided to cancel whatever they had planned for that day. It is a rare occasion that Hell's Freezer is used, let alone by a few "Representatives of the Mage Guild". They would make the announcements to their lands, and it was to be considered a "Holiday" for everyone so they may watch. Hell's Freezer has a set of stands for an audience to watch it like some sport (which, in all honesty, that is what it has become), with a set reserved for each of the countries that make up the Conglomeration. Most of them have the seats sold to the highest bidders, but a few offer seats to anyone who comes for no charge (like the Mage Guild) or to close friends and family (Raylind Diyo does this, yet he still fills every seat with only friends and family). After the meeting was over, I went to the village and bought a few things from some traders (Tiberius needed more mana beans and wispy essence, while Bella wanted me to look for flowers to add to her garden), and while I was there I traded rumors with the group. I told them that all the Conglomeration members are supposed to be in the Mage Guild's land (They laughed at this, thinking it a joke.) and told them that I heard someone from the Mage Guild was going to use Hell's Freeze in a month's time. In exchange they told me of the local conspiracies on where the demons are coming from (Current believe is that a few miners unleashed them by digging too deep into the earth. I'll let them keep guessing, for Greg's sake.), and word of a war outside the Conglomeration's land (They mentioned a women with black hair and mismatched eyes was leading the conglomeration's defense. Good to hear she's having fun, but I hope she comes home soon.) As quickly as they came, the board members left. I thought my hand was going to fall off after all the handshakes, and I nearly fell over from some pats on the back. It has been a few hours since the portal was closed, and on the trip back I told the others about the deal I had made for the nether stars we needed. Each of them would fight one on one with a Wither to claim its star. Then, after my own brawl with six so I can clear away the rust of time, we would join to fight twenty together. When they asked if it was possible to kill twenty withers at once, I assured them we could do it. I didn't say that the most ever fought in Hell's Freezer was ten withers against three people and two of them died in the fight, as that would worry them a bit too much. That brings us up to now: I'm preparing myself and my students for the fight, teaching them what I know about killing withers (I have claimed my fair share of nether stars back in my KAMI days) and helping them craft all the items needed for their fights. Tiberius plans to use a combination of his sigils and thaumaturgy to kill them. Vlad is brewing a few potions to give him an edge (I've seen what his best potions do. He can handle it without any problems.), while he is using a few of the sigils he made with Tiberius and some spells from Demir. Demir is going all out with spells, from both blood magic and Ars Magica (I have helped him make a few of my favorites, and Vlad has made him mana potions to keep him going in the fight.) Bella is going to use her demon friends to help while she uses some of the witchcraft I've taught her (she has enough infusion of light power to protect her, and I know Sinferrius would never let Bella take so much as a scratch from some Wither). As for myself, I have been brushing the dust off my old bag of tricks. We will see if they are enough to get me through. If there is another page to this book, you'll know I lived through it. We killed all thirty withers. Vlad, Tiberius, and Demir are injured, but will make a full recovery in a few weeks' time (My regeneration ritual has helped them while their bodies do most of the work.). Bella and I came out with only cuts and bruises, so we have been helping the boys until they have healed. I've had to lock Vlad out of his lab so he will rest, and Tiberius is reading every book I can find for him. Demir meanwhile has ate enough to feed a cow, and yet the boy hasn't gained a pound. Aside from our light wounds, we managed to get all thirty nether stars (the old record was put to shame) and I am waiting for everyone to be fully healed before we put together the altar. The battle to gain said nether stars was hard, but amazingly brief. Each of my students used their respective field of blood magic to kill the withers, and my own Withers took less a minute to kill. Then we faced the twenty together. We used every branch of blood magic to take them down, with Vlad healing and buffing us, Tiberius defending us, Bella using her demons as support, and Demir and I dealing damage. It was a hard battle that lasted less than five minutes, but all of our soul networks were strained by the end of it. Currently, I have just begun researching and experimenting with ways to open a gate to Tartarus using the data Greg has sent me. From simply skimming these notes, I can tell that I will need the help of all my apprentices to build this. I will create rituals as I find time and inspiration, but this gate will most likely fill my days. Until then, I will start scattering copies of this book and the ones my apprentices have made. While I have seen that I have gone off on tangents about things other than rituals, I feel like I should keep it. Reading the books of my other apprentice's, I can see I'm not alone. +aw.entries.rituals.zephyrRitual=I must admit I have become lax in my updating of this book. Since the last time I have managed to sit down and start documenting, I have been experimenting with the "Reagent system" my colleagues have created as well as forming new rituals. I have not yet finished the portal, but I believe I have come up with a plan on how to build it.... But that is something for later. Starting with the rituals, I have had a few interesting ideas... There was the Call of the Zephyr, a ritual with the purpose of retrieving items off the ground and depositing them into any inventory above the master ritual stone. It does not just call the items through three dimensional space, but use a few new tricks to transport the items quickly and even through solid matter. +aw.entries.rituals.harvestRitual=Next up was the reap of the harvest moon. What it does it quite simple: It can harvest plants within a 9x9 area centered on the master ritual stone. However, I have needed to configure the ritual for any plants I need it to harvest. A few plants, such as wheat and carrots, I have already adapted the ritual to but I know of several crops that it can't function with this ritual. Later on they might work, but for now if it doesn't work then it might never work. +aw.entries.rituals.eternalSoulRitual=I have tried to improve the feathered knife ritual, but managed to achieve a strange but useful result christened Cry of the Eternal Soul : A way to convert LP from the soul network into liquid LP. It was designed to be constructed underneath a blood altar, and will link to the first one it finds. Afterword, it will drain the soul network of the activator and only if he is in range to fill the altar. This does have a few nuances, however: While inside it's range, the activator is extremely weak to the point of being near death. The conversion rate is rather poor at a two LP spent for each point of liquid added(One is added to the altar, and one used to create it). The altar also seems to consider this the same as a pipe adding LP, so any input is throttled by the buffer. As a result, any altar used will need to be built with usage of the ritual in mind. +aw.entries.rituals.ellipsoidRitual=As a means to aid in construction, I created the ritual "Focus of the ellipsoid". This ritual checks an inventory above the master ritual stone, and after my recent redesign the ritual will check an inventory directly below the master ritual stone to find blocks to construct the sphere(I couldn't get the ritual to function with the inventory any lower. This could be worked around with hoppers, teleposing the inventory, or just having something that doesn't care. I personally went with a simple setup of teleposers, redstone, a few rituals as a cobble stone production, and a hand full of demons. The demons wondered in over night, and I couldn't get them to leave.). It checks the first three slots of the inventory above it, the forms a dome with the dimensions based on the values. First slot is the X-radius, second is y, third is z. This ritual does have a cost per block, so large spheroids will cost far more then small ones. From initial tests, this seems to work well in conjunction with a ritual of the dome for underwater construction. +aw.entries.rituals.evaporationRitual=Speaking of the dome, another ritual was constructed to work with it: Song of evaporation. Basically, this one time use ritual will remove the remnants the dome ritual creates from fluid blocks that allow then to reform. In other words, when the dome ritual is removed the fluids will not return if you use this. Simple, but extremely effective. +aw.entries.rituals.sacrosanctityRitual=As a form of protection, we have created the Ward of Sacrosanctity as a way to deal with the hourds of monsters that form in our world. While I don't feel like going into Dust theory, this ritual blocks mobs from forming inside it's range(Thirty two blocks from the master ritual stone) regardless of light levels. Keep in mind it has a passive cost to run, so make sure you have a soul network strong enough to handle this. +aw.entries.rituals.evilRitual=And on the flip side of this coin, I created the Veil of Evil. It is effectively a way to increase mob spawning(Again, using the principles of Dust theory), and allows them to form regardless of light levels. Once again, it has a passive running cost to a shut off switch is in order. +aw.entries.rituals.stomachRitual=I have had many nights spent researching interrupted by the annoyance known as "Hunger". As ad hawk solution, I have built "Requiem of the satiated stomach". Much extracting food from an inventory above it, anyone inside it's range will fill satisfied. However, it does not actually fill your stomach with food(This turns out to be quite painful), but instead lowers the rate at which you consume food. Effectively, it adds the saturation of the food to anyone in range(So beef would be far more effective then bread). +aw.entries.rituals.reagentEffects.1=I mentioned a reagent system earlier, so I might as well give a brief explanation of it. Using the raw alchemical energy contained inside one of the reagents, they have discovered a way to augment my rituals. The results of this have been interesting, from improving old effects to adding completely new ones. However, these improvements are not free: The costs and if it is active or passive drains depends on the ritual and effect in question. I will try to document the effects, but the costs will be left for the readers to discover(I can't very well tell you everything, now can I? An old man needs to get his entertainment where he can.) +aw.entries.rituals.reagentEffects.2=The full spring has more effects then the average ritual, with Aquasalus letting it hydrate farmland in a four block radius from the master ritual stone. Offensa allows it to function as a weapon, thickening water vapor in the air to the point it is like drowning(By default it leaves the activator immune to this effect), but if it is paired with reductus it will ignore any humans. Crystallos allows it to freeze water, functioning as an ice generator. Finally, sactus allows it to have more control over where it places the water to the point of filling a tank placed over the master ritual stone. +aw.entries.rituals.reagentEffects.3=The serenade has only three effects, with offencia, reductus, and sanctus functioning in the same way as full spring. Main difference is that instead of causing them to drown, it gives them a more... Explosive result. +aw.entries.rituals.reagentEffects.4=The green grove is simpler in it's effects: Terrae and orbis terrae cause crops to grow even faster then normal(Orbis is slightly faster, but the effects do stack). Aquasalus allows it to till and hydrate any farmland above it, but only the three by three so it isn't as effective as a full spring. Virtus extends the range it speeds up growth to a nine by nine above the ritual, but this doesn't allow it to hydrate that far. +aw.entries.rituals.reagentEffects.5=Interdiction has two strange effects. With aether, items become influenced by the ritual as well. Magicalus removes the safety I put on the ritual so that humans are effected. +aw.entries.rituals.reagentEffects.6=Containment becomes more effective at keeping things in with reagent. Crepitous allows it to supress the natural destructive nature of the creeper, while magicales prevents teleportation for mobs inside. Aether has been just a simple extension on range. +aw.entries.rituals.reagentEffects.7=A ritual of unbinding powered with sanctus allows the breaking of a blood pact, so it can be reforged with another person. +aw.entries.rituals.reagentEffects.8=High jump has general effect improvement, with aether allowing it to fling you higher and terrae increasing the range of fall damage protection. +aw.entries.rituals.reagentEffects.9=Speed ritual has some interesting possibilities when upgraded with reagent, with sanctus and tenebrae allowing it to act as a form of animal sorting. Sanctus limits the effect to baby animals, tenebrae limits it to adults. Aether sends you farther, terrae limits the vertical distance it will launch you. Finally, reductus shields you against any fall damage temporarily for a safe landing. +aw.entries.rituals.reagentEffects.10=Magnetism has purely utilitarian upgrades, with terrae and orbis terrae increasing it's range while potentia improves running speed. +aw.entries.rituals.reagentEffects.11=Crusher has a few more interesting effects, with orbis terrae, potentia, and virtus adding fortune effect. Crystalus adds a silk tough effect(This can be mixed with a full spring for an ice farm), and incendium turns cobblestone into netherrack(Vlad mentioned an idea on autonomous incendium creation with this). +aw.entries.rituals.reagentEffects.12=Shepherd's effects seem to make it better for animal breeding, virtus allowing for animals to... How to put this tactfully... It triggers the urge to reproduce. Reductus on the other hand lowers the natural time between breeding cycles. +aw.entries.rituals.reagentEffects.13=Feathered knife has a few interesting effects to improve utility. Sanctus increases the amount of life force it leaves you with, so you aren't as weak inside it's range. Reductus lowers the range, to allow you to allow you to only be inside the range when only a few blocks from the master ritual stone(Testing shows that it is around the edges of a T5 altar). Magicales limits the draining only to the activator, so your guests don't make an unwilling donation. Potentia has the simple effect of increasing running speed. +aw.entries.rituals.reagentEffects.14=Reductus limits the regeneration ritual to humans, virtus allows it to heal even faster, with praesidum increasing the range. +aw.entries.rituals.reagentEffects.15=The effects on the feathered earth ritual are standard: Aether is vertical range, terrae and orbis terrae is horizontal range. +aw.entries.rituals.reagentEffects.16=Reverance of the condor has only two effects, with aether allowing it's effect to persist a bit longer after leaving it's area of influence and reductus limiting the flight only to the activator. +aw.entries.rituals.reagentEffects.17=Mark of the falling tower has quite a few unique effects, with terrae and orbis terrae buffing the average radius of the meteors(But these effects doing seems to stack with each other), crystalos summons a meteor with ice instead of stone, tennebrea has obsidian instead of stone, and incendium has a variety of nether materials. +aw.entries.rituals.reagentEffects.18=Ballad of alchemy only has a speed buff from potentia, no matter what I try recursive crafting seems impossible... +aw.entries.rituals.reagentEffects.19=Aura of expulsion seems to have two normal buffs, as virtus increases the distance something can be teleported and potentia the range of influence. Tennebrae has the interesting effect of allowing the ritual to teleport entities other then humans. +aw.entries.rituals.reagentEffects.20=Dome of suppression only has two range increases from aether and aquasalus. +aw.entries.rituals.reagentEffects.21=Call of the Zephyr with reductus adds a delay to when it picks up an item/ This has shown some interesting uses in automation... +aw.entries.rituals.reagentEffects.22=Cry of the eternal soul with sanctus leaves you with a bit more life, so you aren't knocking on deaths door. +aw.entries.rituals.reagentEffects.23=Well of Suffering, after a few tweaks on my end, is now able to accept three reagents. Potentia extends the range it has vertically, simple enough to understand. Tennebrea improves the efficiency of the process, allowing you to gain double the normal amount of LP from health then normal. Finnally, Offencia has the ritual damage mobs twice in quick succession, harvesting life essence faster and killing mobs faster. +aw.entries.rituals.reagentEffects.24=Rhythm of the Beating Anvil only has two reagent effect available as it stands. Potentia raises the rate of crafting from five times a second to twenty times a second. Virtus allows it to use the output chest as a fourth input. +aw.entries.rituals.reagentEffects.25=Blood of the New Moon only has one effect, we terra replacing moved blocks with dirt instead of leaving a hole. +aw.entries.rituals.conclaveOfMages=With my experimentation into reagents, I think I have the final piece of the puzzle I have needed to build the portal. I may need to call the conclave of the Mage guild for help executing my plan... The conclave has agreed to my plan, and we have set out on the road to Venric's folly, a somewhat natural prison to contain any demons that our portal spawns so they aren't as dangerous to people. Once we fortify the area, create a base of operations on the walls to view the demons progress from a safe distance, then set up a Nexus link here we will be ready to open the portal. Despite all the hardship it may cause, we will-No, we must open it. To many innocent lives have been lost to stop now. +aw.entries.rituals.forbiddenParadise=It is the eve of Forbidden Paradise, as the other mages have started calling it. The ritual is built and ready, I simply await the final hour before beginning. To pass the time, I will document the theories in place behind... the ritual I have yet to name. We've been so busy the last few weeks I haven't had a chance to give it a proper name! Well then, that will need to be addressed... I feel Bella should christen it. The work is done here, so I shale hold a small ceremony for the naming before sending off the others to a safe distance away. +aw.entries.rituals.convocationRitual=Convocation of the Damned... As fitting a name as any. Well I promised theories, so I'd best get started. The basic construction of the ritual is an improvement on the ritual of binding utilizing dusk runes and requires a far larger footprint to build(Around a hundred and twenty eight ritual stones are needed, I recall). The ritual then needs three investments; Fifteen million LP to start the process, eight full belljars of assorted reagents must be routed into the master ritual stone in any order(The ritual is designed to have them on the pillars, and in fact does not like working without them. The reagents needed are Incendium(Fire), Aquasalus(Water), Terrae(Earth), Aether(Wind), Sanctus(Holy), Tennebrae(Shadow), Magicales(Arcane), and Potentia(Energy)). Since Vlad's reagents have proven successful in summoning demons with Bella's little setup, this applies more power from the raw reagent on a much larger scale from the ritual in addition to the jumpstart LP offers. The final part requires the portal to be "Set" from a sacrifice. Using a blood altar placed above the master ritual stone and a demon, you set the portal by sacrificing said demon with a dagger of sacrifice after all the reagent has been consumed. If all the steps have been completed correctly, then the portal should complete and a link to Tartarius forged. After that... Well, I have theories but only time will tell if they are more then that. It is time to get some sleep, we have a long day head of us tomorrow... It has been a long day, but all of space hasn't collapsed in on itself after our efforts today. Always a good start, at least. The siege team has returned from a successful mission. An interesting side effect of how the portals work cause all demons who have entered via that portal to vanish, returning to their home since the portal acted as their "Anchor" here. But that isn't the big news. What happened after we opened the portal was something none of us expected: The demons started colonizing. They have been building homes, gathering resources, laying down roads... They have been building a proper encampment. The others have a few tales of their own about the demons, as I was out of commission for most of the day(Activating the ritual took far more out of me then I thought. I will need to start organizing our future plans now that this... Invasion has begun. +aw.entries.rituals.longHaul=It has been a little over a week, we've managed to make several improvements to our equipment using some of the shards retreated from the demons, and said demons have shown no sign of leaving any time soon. Since it was my plan to open the portal, I have volunteered to stay here and watch over the invasion and make sure the demons don't get out of check. Already a teleposer link to my homestead has been created for myself and my apprentices to use, and we have started work an a new home here and Venric's folly. But if I must build a new home here, even a temporary one, I should work on getting a few basic amenities to help ease our lives here while we see how this invasion pans out. +aw.entries.rituals.phantomHandsRitual=My first task was to create a ritual to help deal with all these chests we have laying around, as it is getting to be a nightmare finding things after the fledgling thaumaturge Soaryn paid a visit. Having a ritual take instruction, however, was a little harder then expected. After several experiments, I have discovered a relatively simple method to achieve this using chests(Same rules as most inventories with rituals. Doesn't care what it is, from a chest to a furnace. I will be using chests as an example, as that is easiest.) To begin, I need to cover the logistic foci that allow you to give instruction to the demonic force behind the ritual(Only thing smart enough to handle this task). Adjacent to the master ritual stone can be up to four chests, and these hold the "Input focuses" the ritual checks to know what to pull from and how to pull from it. In laymen terms, you right click on the side of whatever you want the ritual to pull out of and it will follow all the normal rules for extraction for whatever side you clicked on. The output foci need to be placed in chests located at the four nooks in the V's of ritual stones and roughly two blocks away from the master ritual stone. They follow the same rules for marking, right clicking on the side you want the ritual to send items to and following item input rules for the block. However, there is one addition: If you shift click on an inventory, it will not only mark it as a destination but save the item total of the inventory. If the focus has a saved total, it will keep the bound location stacked with that amount for each of it's set items. Note: You don't need the final destination to hold all the items for total binding, you can use a second inventory as a middle man to set the total and then bind the focus to the new inventory without changing the total(Make sure you don't shift right click on the new inventory with the focus as that would reset the amount). Should you wish to remove the item limit, shift right click on an inventory without anything inside. There are a few variations of the output focus, each with subtle differences that impact operation. The red "Default" focus is the standard focus, has no special properties to it. It will ignore the NBT of items, and will check the "Metadata". The blue "ModID" focus instead of checking exact items will instead check the origin and classification of the item and will send anything that matches this. For "Origins and Classifications", I mean anything made my the Industrial craft corporation will be sent to the same location but anything made by their splinter corporations like nuclear control or advanced solar panels will be sent to different locations. The rules behind what belongs to what are archaic at best, but the scribes and scholars at NEI and WAILA keep exact records of these things so seeking their help may be needed if you don't want to rely on trial and error. The dark green "Metadata" focus isn't as exact with metadata, allowing items such as dye and colored glass to have all the subtypes and variations sent to the same location without needed to specify every single one. This also applies to damaged armour, weapons, and tools. The Yellow "NBT" focus is very exact with what it sends, keeping track of the tiny hidden differences such as how much Vis a wand has, what setting a ritual diviner is on, where a spell crystal is bound, ext... It also checks meta data, so keep that in mind. Finally, the purple "Global" focus needs you to set any item to send(What it is doesn't matter), and afterword when the ritual reaches this task it will send anything it possibly can. This is useful as a last resort location for anything you don't want to have sit in a source location but you have not set anything for the ritual to do with it and don't want it to clog up the system. Now then, the ritual itself. As I stated, it will check the adjacent for where to pull items out, what are the source locations. The output foci set where to send any items from the sources, what is the limit on what to send, and all the rules on what it should be sending. To specify this, you need to place one or more output foci in one of the chests to tell it where to send it and how to look at the items, then one or more items after it to specify what it is to be looking for. If the ritual finds another routing focus after the last item in a "Command chain", it will create a now chain following all the same creation rules as the first and acting independently of it. I should note that the ritual will work sequentially, sending all possible items to the first focus location it can while still following all the set rules, then move on to the next focus and doing the same. Additional quirks of using more then one output foci in the same chain: If more then one of the foci have a item limit set, the limits will add together so having four foci with sixteen set as the limit as sixty four. Also, the ritual has some logic for sending items in a chain: For all foci types bar one it will act as "OR", meaning it can send items if any of them match and will go to the first match. The NBT focus, however, acts as an "AND" and the ritual will only send items if they match both the current focus and the NBT focus rules. +aw.entries.rituals.anvilRitual=With a way to move items around at hand, it is the next logical step to have a way to refine items automatically without needing to spend hours at a workbench crafting. Cue the creation of "Rhythm of the Beating Anvil", and I must say I'm rather proud of how it turned out. The ritual will look two blocks above the master ritual stone for up to nine inventories, and will use the items it finds in each inventory to try and form a recipe, then pull out of the three input inventories one block down and two out from the master ritual stone and next to the earth ritual stone to form the item and finally push the crafted item into the output chest(It's side is marked by a water ritual stone next to where the inventory goes). For shaped recipes, it will use the output location to determine where is the "Bottom" of the crafting grid is located, and will form recipes using that as a reference point. Now then, how you set a recipe is simple: In the first slot of each used inventory, place any item the recipe needs or leave it empty if the recipe doesn't need anything there(Like the middle for a furnace or chest). Place the used items in the inputs locations, and the ritual will craft up to a stack of the output before stopping. The ritual will then check the second inventory slot of each inventory for a recipe, try to craft it, then repeat for the third, then fourth, then fifth... You get the idea. The more inventory slots you have, the more recipes one ritual can handle. A tip for use: Normally chests don't like having more then one side by side, due to the parts used to merge to chests getting in the way. However, this does not apply if you alternate normal chests and trapped chests. While it will be added post script to the reagent effects, I should mention the effect of Virtus to this ritual as it is rather useful: It will allow the ritual to use the output chest as another input chest. While that doesn't sound useful, it actually allows for reciprocating crafting(An example of this is imputing logs, the ritual turning the logs into planks, planks into sticks, planks and sticks into signs, planks into chests, ect...). +aw.entries.rituals.dawnInk=This "Demon invasion" as we've come to call it has born some interesting fruit, one of which was a gift from Tiberius in the form of a new ink for my rituals. He has requested that I aid him in construction of a sort of "Chamber" and a ritual to power it, but is keeping some of the important details from me for what he says will be a "Big reveal" and would "Spoil the fun". +aw.entries.rituals.symmetryRitual=After a few weeks of design and testing, we have finished the ritual Tiberius wanted in order to achieve what he and the others have dubbed "The Omega state". I'll cover the ritual side of the process, and allow the others to go over the details of it's functions. For this ritual to function, it needs a sealed space in order to fill with reagent like a gas cloud. This reagent is then absorbed by the armour as the ritual merges the souls of the activator and the demon inside the activators bound armour. The problem is containing and controlling this gaseous reagent, as it likes to leak out of the chamber and the ritual can have difficulty "Pushing" the reagent into the armour. To address this, we created Glyphs. But I'm getting ahead of myself. First, I should cover how the ritual determines what is a "Sealed" chamber as it has safe guards to prevent reagent loss. The reagent gas is let lose above the master ritual stone, so the ritual starts checking there. It then starts expanding from there, searching for ways out in every direction, and if it can't get five blocks away from the master ritual stone(This isn't random, beyond five blocks away in any direction and the ritual has difficulty moving all the reagent. Think of it like compressing a gas, it always tries to move down the path of least resistance. To compress it, you need prevent it from being able to escape.) I have also noticed that the reagent, after being released into the chamber, collects on the walls of the chamber instead of staying in the air like tiny low hanging fog. The more surface area, the thinner the fog becomes and the more stable it is, and more stable fog means better value the ritual gets on the conversion process between reagent in the jars and the reagent in the armour, so the more time you have in the Omega state. No matter how you cut it, this chamber is meant to contain reagent for long stretches of time. The more stable the reagent fog is, the more time the ritual has to work and the less reagent wasted. Now then, I mentioned Glyphs earlier. After seeing the chamber in action, Tiberius created a few blocks called "Glyphs" to optimise and add to the champers use. First, the Glyph of Rigid stability was created to further stabilise the reagent fog, being worth roughly double the amount per square meter of space then a normal block. But that's not all he made with the Glyphs, as he discovered an interesting way to bolster the power of the demon using two new Glyphs for a system that resulted in something like enchanting. He mentioned two values, and had created Glyphs for each of them. First was "Enchantability", and it's is buffed by Glyph of the Adept Enchanter. The second value was "Arcane power" with Glyph of Arcane Potential, and functioned like the levels used in normal enchanting. To put how the two values work in layman's terms, Arcane power effects what enchantments are possible to receive, while Enchantability effects the odds of getting a good result. Since this process doesn't use normal enchanting(As the demons in our bound armour react negatively to such methods normally. This process circumvents this limitation by being more demonic in nature and this more... Tolerable to the demons.), it doesn't follow all the normal enchanting rules. For example, after much testing we were able to achieve the equivalent of protection six, fire protection four, and blast protection seven on a single piece of armour so some independent enchants can coexist. And normal power restriction also don't hold ground here, as seen by getting blast protection seven... More testing must be done, but you can see how this has potential. However, I should mention that a chamber can't be entirely enchantment blocks, as the Reagent reacts negatively to the magic used in them. While the reagent must touch the blocks to activate them, any fog that forms on them will destabilise severely causing less time in Omega. I have put in a safety to make sure it can not trigger the process if the stability is below zero, as that would be closer to a bomb then a fog at that point. I believe all the information you need to know before starting has been covered, so we will cover the actual ritual activation. The ritual is a flat platform with four holes, and in these holes you place the belljars of reagent to be used. This ritual doesn't use reagent in the normal fashion, so you don't need to route them into the master ritual stone like normal. With your awakened crystal, activate the ritual with your awakened crystal like normal. After the fifteen million LP fee is paid, it will look for belljars in the four holes for the thirty two thousand reagent cost. Once both are ready, it will check for the activator wearing bound armour and if present it will kick start the process. Within seconds, the transformation happens and you will enter the Omega state. +aw.entries.rituals.stallingRitual=After watching the others toy around with Omega, I realised how limiting the fact that Omega burns reagent to maintain the form can be. With this in mind, I have created a ritual to strengthen the bond between the two souls and remove the passive reagent cost of maintaining Omega. Named "Duet of the Fused Souls", it is able to replace the reagent cost with a high LP cost(Tiberius says it needs five thousand a second to run, far more then most setups can handle. At best, this ritual holds off the inevitable unless you have an extreme generation rate, and even then you will will have a crippled net gain.). You will still lose reagent to replenished your demonic resistance, so long term combat even in range of the ritual will eventually burn through your reagent supply. I should mention that this ritual doesn't have enough power on it's own it work, you need to build it around a tier four beacon. Once it is in place, the ritual can use it as a power source and will allow it to have an active range of roughly double that of the beacon. +aw.entries.rituals.newMoonRitual=Feeling unsatisfied with Focus of the Ellipsoid, I recently restructured the ritual to slightly change it's effect. In doing so, I found inspiration and created my new work "Blood of the new moon". In essence, it moves a small planetoid of blocks from an assigned distance below it to a mirrored distance above it. Magic behind it is slightly more complicated then that, but you aren't here for spell theory 101. To operate the ritual it is fairly simple: Above the master ritual stone needs to be an inventory to give the ritual instructions. The first slot sets the radius of the sphere, but is limited to a maximum thirty two. The second slot defines how far below it looks for blocks and above the sphere is created, with the distance defined being where the centre of the sphere is. As a bit of a safely precaution, the distance must be at least three blocks greater then the radius to prevent harm to the ritual. I should note that if there is an obstruction in the destination, instead of the two blocks being swapped the ritual will "Skip" that area. A final foot note: If this ritual is fed terra reagent, instead of leaving a hole where it pulls blocks it will instead create a block of dirt. A nice option to prevent clean up of a huge hole under a new sky base. + +aw.entries.demons.ashes=My name is Bella Highborn, and I am a blood mage. One month ago, the village I called home was attacked by demons in the night. I can't remember much of the attack, but I recall so many screams of pain echoing inside my head. It took me a few minutes after covering my ears to realize that the screams I kept hearing were not coming from the people. Shortly after the attack started, I ran from my burning home to try and hide in a small alley, behind a large waste basket the butcher dumped his scraps in. At one point I thought I was dead as a demon with long limbs, a gaping maw, and huge teeth lumbered into the ally. It looked strait at me, it's nose flaring as it did so, its blurry eyes looking down at me. It then piked up the basket I was hiding behind, ate everything inside, threw it over his shoulder onto a burning building, and then, left me without a scratch. Several other demons found me that night, and all of them had the same blurry eyes and all of them left me alone. At some point I managed to cry myself to sleep. The next day I awoke in the same little corner, the smell of death strong in the air. I wandered among the remains of the village, finding the burnt and frost covered bodies of my former friends everywhere, all while asking myself why I was spared when they weren't. After several hours, I finally heard a sound other than the crackling of embers from all the old buildings: Voices. Human voices. I looked around to see a small group of men wandering through the ashes. A few of them were bickering about something, occasionally pointing in my direction. At the distance I was at, I could barely make out the words "Girl", "Demons", and "Caravan". I had started to wander closer to them, a little afraid to get too close. Suddenly, one of them broke off from the group and took a few steps in my direction. After a few more quick words to the others, he turned to start walking towards me.As he got closer he started asking me simple questions. like if I was injured and if I could walk. I was still to upset to give him more of an answer than nodding or shaking my head. And then he said full of regret : "I can't do anything for the dead and I can't give you back your old home, but I can try to give you a new one. Care to take a risk and come with me?"his voice softened and he looked at me with his light green eyes. I thought of everything that had happened in the last few hours. Everything I ever knew was ripped away from me. I had no home. No family. No distant relatives. No chance to keep living here. I gave him a timid nod, then took the hand he offered me. I soon found myself walking down the only road that lead away from my village with the green eyed man, who told me his name was Vlad, and his brother Demir. We walked till my feet started hurting and then some, till dusk, when they set up camp. They asked for my name, and what happened the night before. I shook my head as memories of all the screaming came back. They then asked if I knew any magic, to which I shook my head again. I knew very little of magic, despite living so close to the mage guild's boarders. I then turned to look at my former home, now a few miles behind us. I silently said my last goodbye to the life I once knew, then fell asleep thinking of what may lie ahead of me. My dreams were filled with nightmares with scenes from the last night, and a hundred voices crying out for help. But all that still walked through the village were the demons. We walked for the next three weeks, with Vlad and Demir selling what little they had on them to fund our trip. Several times they mentioned a man I had never heard of : "Magus Arcana". Vlad spoke highly of him, while Demir didn't seem as impressed. We traveled almost all the time we where awake, and when my feet hurt so bad that I couldn't walk anymore either Vlad or Demir would take me piggyback. One evening I asked them why they are doing so much for me, both put on a weak smile and said "We know what it's like to lose both your home and your family. We lived in the streets for a few months before the Merry Lamb took us in. We didn't want you to go through what we did." For the first week I had that same nightmare every night. The second week it was every other night. By the time we reach a village named Lurric, they had almost stopped. I went with Demir to buy some supplies, and when we regrouped with Vlad he had a grin on his face. "We're almost there. You were right Demir, this is the town where he lives." After a few minutes of walking, we stood at a stone brick home. We had only one of those in my old home, and that belonged to barracks of the guardsmen. As we walked up to the door, I found myself hiding behind the brothers. I had heard some of the legends about the man who lived here on our trip, and anyone in there right mind would be nervous knocking on his door. After a brief chat Vlad had with two men, we were let inside. I thought I should be scared, but both of them seemed so nice that it was hard not to feel at home here. But as I stepped inside, I started hearing whispers. At first they were only a few, but as I sat down the whispers grew a little louder and more frequent. Soon after that I was distracted by my belly reminding me I haven't eaten since yesterday morning, and the fact that there were sandwiches on the table for us. As I ate, I tried to listen for the whispers, but they were still so faint that I couldn't make out what was said. Giving that up, I started paying attention to what the others where talking about . Unfortunately, I was a little late. Magus had already started getting up, while Tiberius was taking away the trays that once held sandwiches. After a few minutes, both Magus and Tiberius left to take care of something in the village leaving us to settle down a bit. "They're an odd bunch." Demir said soon after they left, starting to look around the room we were in. "They can say the same about us." Vlad said, and I couldn't help but smile at his deadpan humor. After an hour of milling about the place, gawking at all there was to see, Magus and Tiberius returned. We ate a large dinner Magus brought, then they showed us where we would spend the night. Magus lead me to his room, telling me that I could sleep here for the night while he would take the couch we had sat on earlier. Once we got inside, he closed the door as I took a seat on the surprisingly hard bed. "Now then, I have heard a few rumors about you Bella." He sat down next to me on the bed before continuing: "Mind if I ask what happened to you?" I hadn't told Vlad and Demir yet, but I finally had the strength to speak about what happened. After I finished the story of the attack, I told him of my nightmares and hearing countless voices crying out for help but there only being demons around me. Magus simply nodded, then said "I believe you. Your tale seems a little far fetched, but I can tell you speak the truth. I advise you to keep this story to yourself, but telling Tiberius or the other two should be fine. I'll need to think about this..." He said as he moved to get up. "Wait," I called out before he left. "Don't I get to ask you a question now?" He seemed a little puzzled, but said "Go ahead, ask away." "Do you know what is causing these whispers I'm hearing? I started hearing them as I came inside your home, and they seem to be coming from below us." He told me he heard no such whispers, but offered to help me find the source. After showing me the door that lead to a staircase, we went down two floors till I could more clearly hear the voices. It seemed like idle chatter, and the voices lead me to a box inside a store room that held several bright red blobs. As I opened the box Magus asked "Are these the source of the voices your hearing?" I nodded before asking "Should I try talking to them?" Magus pondered this for a moment, before saying "No, not yet. You still need to get settled in, and there are countless other preparations to be done. We can return to this later, when we have more time. For now, let's see what Tiberius is doing with the others." He lead me back out to the stairway, and I noticed him locking the door to that floor before he joined me up stairs. +aw.entries.demons.tamedDemon=A few days later, I was learning Botania magic from Magus. He showed me the garden he kept near his home, then we went through the names of all the flowers there. Just as we were getting to the more magical flowers and their uses, I started hearing a voice from my nightmares. There was only one voice saying the same two words, and it was slowly growing louder. "Bella, what's wrong? You're turning pale!" Magus said when he noticed me freezing. I stood up, and looked towards the origin of the voice. Then I saw it in the distance. A demon. Just one, wondering seemingly aimlessly. Magus saw it as well, he told me to stay still while he dealt with it. But I couldn't do that, I couldn't let him hurt something so lost and confused. Like it was. Like I was a few short weeks ago. I started running towards the demon, and saw it was one of the more human looking ones, with small wings on its back. It turned to me as I drew closer, and I saw it had the same blurry eyes all the other demons had. It didn't try to attack me, or really even move when it saw me. All I could hear was "Help me", over and over again. "Bella, back away from that!" Magus yelled as he followed, but I could barely hear him over the voice ringing inside my head. Then something compelled me to reach out and touch the demon, some inner instinct that had been dormant for all my life. Magus was close to us as I touched its hand, and I felt this surge of power race from me into the demon. Suddenly, it's eyes lost the blurriness and he seemed to be "Awake" now. And very confused. Suddenly, Magus was at my side and was trying to pull me away from the demon. Meanwhile, the demon was trying to work out what was going on. "Calm down, both of you!" I yelled, and Magus and the demon did just that as they started staring at me. "Magus, notice how the demon isn't trying to kill us right now. I don't think he was in control of his own body til just a few seconds ago." The demon nodded, before attempting to talk in a way Magus could under stand. "I... was trapped inside my head. I could see everything that happened, yet I had no power over my actions." Magus was still very wary of the demon, but asked how he got here. "I am not here by choice. I remember finding a strange metal thing in my home, being pulled violently towards the metal thing, then waking up in this strange place. I soon realized that I had no control of my actions, and have been wandering ever since. That is, until my brethren here freed me." "Brethren? I am afraid I am human, not demon." I said, confused by this claim. "Really? Your aura looks demon to me. I could tell that even before you freed me. As for him..." The demon turned to Magus. "Yours is like nothing I have ever seen before. It is a strange color, and is far larger than that of any humans I have seen." "Really, you can tell all of that just by our auras? Fascinating..." Magus said, the last of his wariness was trumped by his scholarly nature. "Well, I have always been better at reading them then many of my kin. But that can be saved for another time. Humans, I must ask you for your help. I can not stay here, your kind will hunt me every day I live for the crimes my kin and I had no say in. I must ask you to kill me." "Why? ", I asked:"Can't you try to hide or.." Magus put one hand on my shoulder. "No, he may be killed, but won't die. Supposedly, if a demon is killed in our world they return to their home in Tartarus. I assume that is why you wish us to kill you?" "Yes, that is true. But I can't ask you to do this for nothing... I sense something nearby that may be of assistance. Will you take me to your home?" He asked. Magus was more curious than cautious at that point, and lead the demon(Who we learned went by the name of Sinferrous) and me back. As we all walked inside Magus said "Vlad, Demir, Tiberius! We have a guest here." All three came out of the work room, and all three paled as they saw Sinferrous. "Greetings." he said as the others arrived. "Magus.... why is there a demon in our home?" Tiberius said, growing pale. Magus quickly told them what had happened and what we learned. "Now then Sinferrous, can you lead us to the thing you sensed?" After leading us down stairs, Sinferrous went strait for a strange red orb that was near my brothers work station. "This will do. Using this, I can make a pact between us. For your help freeing me, I will make the pact now. But my kin may not always be as willing, and you may need to defeat them before they will form a pact. Now then Bella, give me this orb." He handed me the orb, then I handed it back to him. As soon as it touched him, the orb vanished into a red mist. "The pact is done, and I am now at your command Mistress. Now, I request that you send me home." "Wait." I asked him. "If we send you to Tartarus how will we ever see you again?" "Simple. When my kind are killed in this world, we can leave behind a "Summoning Crystal". If you use this crystal, we will return to aid you. Because we made this pact, anytime I die in this world I will leave behind a crystal so you may summon me again." We all went outside to send Sinferrous home. Magus had volunteered to do the dirty work, and our new demon friend stood ready. "Before I do this, I have one final question." Magus asked. "You said there was some sort of metal contraption that forced you here. Did you see any symbols anywhere on it that might help us work out who created it?" Sinferrous nodded. "There was one symbol that seemed dominant... Here, let me see if I can copy it..." He began to draw in the dirt, and we saw something, that we never expected: The letters "GT" inside the picture of a gear. "Greg tech..." Magus mumbled, narrowing his eyes. Magus sent Sinferrous home, and it seems Tiberius needed some time to think. "His goal in life, getting revenge against the demons who destroyed his home, was just torn apart." Magus told me that evening. "Give him time to piece together a new goal. He'll recover, I can guaranty you that." The next day Magus and Tiberius told us about blood magic, where the orb I used just yesterday came from, how it was made, and all the risks of trying to make something like it required. They then asked us all a simple question: Would we like to be blood mages? If I said yes, Magus and Tiberius would help me with taming demons. If I said no, they would still teach me other forms of magic. There was no choice, I needed to discover more about this strange power I had. If that meant I had to become a blood mage, then I would become a blood mage. After Vlad, Demir, and myself passed a "First Test" of creating a weak blood orb, the same type of orb used to form a pack with Sinferrous, the three of us were blood mages. Tiberius gave all of us books like his own, and asked us to document our finding in it. So that brings us up to today, I will try to write down anything that happens with either my work as a blood mage or my life with the others. For now, I must get some sleep... +aw.entries.demons.future=My last entry was a week ago, and since then I have learned a much from Sinferrous. Apparently they have three main groupings of inhabitants inside Tartarius: Lesser demons that act as workers, guards, and servants for the second group called the greater demons. This was similar to peasants and nobles here, but the third group was something all together new: Elementals. Having so much demonic energy in one area causes strange things to pop up, entities of pure demonic power mixed with one of six elements. To the demons who live there they are little more then wildlife, but to us they are extremely hostile and dangerous beings. From what I could gather, each Elemental had several abilities that were common among them while also having a power unique to their element. All of them could fly, cast buffs on themselves to reflect damage, and they cast a strange effect that nullifies some powers of souls. He couldn't tell me much about the unique effects, but warned me getting in a fight with one unprepared would mean death. I noticed Tiberius growing less and less wary of Sinferrous as time went on, but I feel like he wont ever forget what happened to his home regardless of if they had a choice or not. My last entry was a month ago, and this is more of a progress update then an entry. Magus, Tiberius, Sinferrous, and myself have started building a way to form a temporary "Gate" to Tartarios to challenge demons, but we've ran into a few complications. Magus and Tiberius have already started work on upgrading the altar again, so we might be able to start summoning demons soon. In other news, the training Magus has everyone go through keeps getting harder and harder every week. But considering I would have ruled off what we do daily now as to much for me a month ago, we've made progress. It's been a little over two years since I last wrote in this. Finding what material the altar needs as an amplifier takes much longer then I had anticipated. Thankfully, we discovered a recently that the weak blood shards Magus had collected years ago mixed with stone to create a large amount of blood red blocks we have dubbed "Blood stone". The altar has responded well to the stone, so we have created pillars around the altar and are now searching for the item needed to create a blood orb of a higher quality. I've been binding my time helping the local area with demon problems, and Magus even lets me go out on my own to track them. I've formed pacts with almost a dozen now, and my brothers have always been glad to see what new friends I make on my trips... It seems so natural to call Vlad and Demir my brothers now, but I can't recall when I started referring to them as that. After everything we have been through, it feels like not calling them that is a little insulting. We have become so close in our time with Magus and Tiberius that "Family" is the only word I know for it. A little over two years ago they were nothing but strangers who saved a little girl from a village already burnt to the ground, and now look at where we are. Life is strange, that's for sure.... In other news, Magus has started teaching me witchery, as the botanie had grown to limited. +aw.entries.demons.knight=It has been another year and a few months, but we finally found the item needed for the blood orb: The very weak blood shards we had been using for everything else these days. At no point had it crossed our minds that it might be used for this as well, but we found a few new items in the search so not all is lost. One we made the first "Master" blood orb, Magus invited all of us to the finest meal house in Lurric as a treat. We all dressed in the common cloths we keep for when we wanted to blend in, and we went done to a small family ran business that had some of the best food for miles. We all ate our fill, which for Demir is easier said then done, and as we walked home we passed a man in unadorned armor who was sitting in the street like he had been thrown out of somewhere. He looked at us when we walked by, but he quickly tried to stand up when he saw me. "YOU!!.." he bellowed in a slightly slurred voice that made we think my guess about him being thrown out wasn't far off the mark. "You're that girl I've heard so much about... That one from the demon thing... ATTACK, you're from that attack! I've come here to claim the life of the demon girl as retribution for what happened to that poor village!" He started preaching, before realizing we had already started walking away. "Don't you run from me... You can never outrun the justice that will deliver my blade!" He cried as he charged at us, drawing his sword as he did so. Unfortunately for him, his assault was easily dodged by the simple act of stepping to the left. He ran past us, then tripped on a rock and fell to the ground. As he struggled to stand, he said to the others "Don't you dare try to help her! I will slay you as well if you attempt to do that!" Magus smiled and said to him "We wouldn't dream of it, sir. After all, she doesn't need our help to deal with a senseless fool like you." Magus dropped the smile and turned to me. "Alright, now is as good a time as any to put your training to work. I give you permission to deal with him as you see fit." By now the man had stood, and was starting another charge at me. Instead of stepping to the side like last time, I ducked under his sword, then grabbed him by one of the exposed straps on his armor. Once I had a good grip, I turned to the small crowd of people watching. "Any one here mind if I toss him in the slosh pit?" The slosh pit was the name of the depression behind a few of the building where water gathers when it rains, and for a few days after word it is nothing but a muddy pit. Nobody objected, and a few even offered to give me a hand chucking him. I told them I could handle it myself, then proceeded to drag the fool around a few of the buildings, all while he demanded to know what was going on. The crowd cheered when I finally got him to the edge of the pit, grabbed one of his arms, then flung him face first into the slosh pit. We all returned to our home without any mud on our clothing, but the same can't be said for his armor. I'll note if I ever see that man again. It's been two weeks, so I'd say he left town after waking up in a mud pit. +aw.entries.demons.demonShard=With the help of Sinferrous and my other demon friends I have finished building the summoning area. The smaller pillars need to be in just the right points for complete balance, so it is tricky to build the ritual area. But after a few failed attempts and some help from Vlad, we have the ritual area we needed. Today, by accident, we discovered how to summon elementals. I'll write more about them once I know more, but they are as hard to kill as Sinferrous warned. We also found after killing it they can drop a strange blue blood shard we have dubbed a "Demon" blood shard. It's been a week, and each of us has earned a demon blood shard. Magus has used his to empower his activation crystal, and the rest of us are saving them to create blood orbs(I still wonder how Magus gets by without any blood orb). +aw.entries.demons.demonSummoning=Something odd happened today: Magus asked me to show him how to tame a demon using my summoning area. He asked me to go over everything, from the basics of how it works to the taming itself. I write here what I can remember telling him. Alright, in the center we have a arcane plinth to help form then anchor a "Gateway" to Tartarius. The plinth needs a blood orb on it to act as a "Beacon" for the demons, but only a master blood orb has the strength to pierce the barriers between worlds. But the plinth alone isn't strong enough to keep the gateway stable, and we can't make a "Universal" portal. We have pedestals around the plinth to help keep the portal stable by sacrificing items, but this has the side effect of "Locking" the portal to one type of demon. So if you use the same "Recipe" five times, you get the same type of demon five times. Some of the demons need more then the six at the bottom to keep it stable long enough to bring one in, so there can be a second or third ring if need be. Once the portal has formed after the last item is placed on the pillars, items will be consumed one by one to keep the portal stable while the demon is pulled in. Once the last item has been consumed, the demon will be summoned on top of the plinth. The demon will be confused, and will see you bringing it to the overworld as some form of a challenge. Then it will try and kill you. If you beat the demon, it will drop a crystal to summon it back to the overworld(And it won't try to kill you this time). By giving it a weak blood orb you form a "Pack", to make the demon follow any commands you give it. Unfortunately the most powerful things we can summon, the elementals, aren't willing to serve anything due to their inherent chaotic nature of how they are formed. +aw.entries.demons.keysGate.1=Here I will add any recipes we discover that can summon a demon, but at the request of Sinferrous, I will not describe the demons in any way. It will be a mystery till it is too late to go back. Note: Some of these recipes might need more then the first ring of pedestals, so if that is the case the first set of items will go in the first ring, the second in the second.... You get the idea. Remember that the arcane plinth needs at least a master blood orb to work as a beacon. +aw.entries.demons.keysGate.2=Fallen Angel: Santus | Sanctus | Sanctus | Aether | Terrae | Tennebrae +aw.entries.demons.keysGate.3=Lower Guardian: Cobblestone | Cobblestone | Terrae | Tennebrae | Iron ingot | Gold nugget +aw.entries.demons.keysGate.4=Small earth golem: Clay | Terrae | Terrae +aw.entries.demons.keysGate.5=Ice demon: Crystallos | Crystallos | Crystallos | Aquasalus | Sanctus | Terrae +aw.entries.demons.keysGate.6=Boulder fist: Terrae | Sanctus | Tennebrae | Bone | Steak | Steak +aw.entries.demons.keysGate.7=Shade: Tennebrae | Tennebrae | Tennebrae | Aether | Glass bottle | Glass block +aw.entries.demons.keysGate.8=Bile demon: (Poisonous Potato | Tennebrae | Terrae | Raw porkchop | Raw beef | Egg) - (Crepitous | Crepitous | Terrae | Iron block | Iron block | diamond) +aw.entries.demons.keysGate.9=Winged fire demon: (Aether | Incendium | Incendium | Incendium | Tennebrae | Netherrack) - (Diamond | Gold block | Magicales | Magicales | Firecharge | Coal block) +aw.entries.demons.keysGate.10=We later found that placing a full ring(6) of certain alchemical elements(Earth, Air, Fire, Water, Light, Shadow) will summon an elemental of the respective type. And they are the only way to get demon blood shards. +aw.entries.demons.futurePlans=That is what we have so far. We are working on trying out a stronger blood orb, but Magus keeps telling us that what we need to upgrade the altar is extremely hard to get. To bind my time I have started talking with Sinferrous about "Greater Demons". We have decided that our next goal is to start summoning them, but there auras are so strong that the gate way our master blood orb can form is far to weak. We will need something better, and so we have reach square one again of needed the stronger orb. Well, the Hell's harvest festival is soon so I will write if anything comes up. Strangely, Magus mentioned having replies from people he is inviting coming soon. Well I had no idea what was coming with the Hell's harvest. Magus calls up the doorway from the ground to a giant building full of technology, something extremely rare in the mage guild. Most people come here to get away from all the technology of the other lands, to get back to basics and make there own way in life. Yet what I saw down there was beyond even my wildest dreams. Tech that was only spoken of in hush tones, machines that aren't even available to privet businesses, let alone the public! Magus had mentioned once before that he worked on the conglomeration's members board, but this... I thought he meant that he was a grunt worker, or some administer or mangers. But he is on THE board, where all the worlds leaders meet... And Magus told us they will be meeting here this year since he is the host. I always thought Magus had secrets, but reality seems to go beyond my wildest dreams. Magus asked us to help prepare "The Hall" as he referred to it as. After a few months of hard work, the Hell's harvest is only a few days away. Magus started calling in favors for help, and the boys started talking about just who would be coming. Only now have I realized that I'm going to meet with some of the most powerful people in the world! Magus gave us a few books on every member, so we would know something about each of them. Sadly, the books he gave us didn't include pictures so we had no idea what they would look like. I'll write again after the festival is over.I have meet so many people the last few days, from so many places and from countless walks of life. I became friends with a woman by the name of Iza Lemming, and another girl about my age by the name of Carrin Calclavia. For such amazing people, they seem so... normal. Another man I met Magus keep referring to as "Greg". As it turns out, Greg owns Gregtech, and he is the reason the demons are running ramped like they are. Strangely, I don't hate him. By all rights I should hate him for everything he has done, all the people who have died to the demons... But I don't. From what both Magus and Greg have told me, he did the same thing I did: Opened up a portal to Tartarius without knowing what would come out. The real difference was that I had a demon to help me build the portal, and he had to do it from scratch. Without the help of a demon, the portal he opened was unstable and drove any demon to walk through it mad, and they lost control of themselves. He had no idea that would happen, that that could happen. I can't bring myself to blame him for something he could have never predicted. In other news, Magus has gotten us the nether stars we need for our next altar upgrade. The bad news is we must kill the withers to claim them. Thirty withers, to be exact. I have mastered witchcraft, botanie, and have learned what I can of blood magic from my brothers and Magus. But will it be enough to kill one of those... things? I asked Sinferrous this one night, and he told me that he no idea what a "Wither" was, but if I needed to fight one that he was willing to stand by my side, as would any of the other demons I had a pact with. With all of them by my side, I might stand a chance. We beat the withers. All of them. I... was terrified of it from the moment I saw it. I had three skulls for heads, and it made unnatural sounds as it started warming up. Then the attacks it used, launching flying blue and black skulls, were devastating in the blast and the "Withering" effect they leave behind if you get hit. Thankfully, the "Freezer" we fought them in was completely blast proof(Warded octuple compressed cobblestone) so falling into holes was not a problem. After an eternity compressed into an hour, we had beat all thirty withers. My brothers are all injured, so I need to go change a few bandages. I'll write again when I get a chance. Now that my brothers have fully healed, life almost seems to have gone back to normal. Well, as normal as it will ever be in a house full of mages. I've started experimenting with nether stars in my efforts to summon greater demons, but I still haven't managed one. In other news, the number of demon attacks has been getting smaller as of late. Magus said this might be the calm before the storm, and asked me to start leaving the mage guild to help with demon attacks in the other lands. Most people are happy to have my help, but others... Lets say I rarely sleep in the inns and leave it at that. +aw.entries.demons.demonInvasion=Magus has sent out a call for all free mages, with little in the way of context for why. Even I don't know what this is about... He did say there would be a in a little over a week a picnic, however. But knowing him, he has something up his sleeve. The conclave of mages was held today, with some... Interesting results. Fifty people in total showed up, from all ways of magic and life. We met on a hill under the shade of a grove of trees about a mile from here, many of the mages brought there own meals for the picnic. After ten minutes faffing about with people getting settled, Magus called the conclave to order. "I'm sure you all have ideas on why I called you here, and I know Jarico was running lots... So I might as well sate your curiosity. I finally have a plan on how we can deal with the incursion of demons. For the last few years they have been a hazard, an endless army we have fought off. The two things that have complicated our efforts: The fact we didn't know where they have been coming from, and the side effects of closing the portal. Thankfully, I have managed to address both issues." At this point Magus unrolled a map with a few hand drawn markings, which everyone crowded around. "This circled area here is the location of the portal they are getting in, A secret gregtech research lab in the middle of a forest. I have gained permission to mount an excursion to close this portal, but it sadly isn't that simple. The portal is unstable, and has been slowly damaging the fabric of space here."At this point one of the others interrupted with "But if it is slow, how bad could it be?" Magus responded with "Very. This portal has been left open for the better part of the last three decades, and the damage keeps getting worse and worse. As it stands, closing the portal might cause more harm then good as strange as that may seem." A different mage, one a bit older , a little wiser, and a lot more cranky then the first interrupted this time. "If that is the case, why have you called us here? I assume you intend to do more then waste our time." Magus smiled at this, replying "Yes, I think you will be interested in my discovery. To prevent a spacial fracture from occurring, we will need to jump through a few hoops, as it were. You see, closing the portal won't cause any issues. It is the removal of the connection between our and their world that ends with all the nasty side effects. Now, I few of you might think the portal and the connection are one in the same. That isn't the case, instead the portal is the entrance and exit while the actual connection is the road they lead too. So we should be able to close the portal here, then open a new portal here..." Magus pointed to a second circled location on the map, far into the mage guild in mostly unpopulated land. "...before the connection collapses in on itself. If we can pull that off, then the new stable portal will not only allow the connection to remain but will ease the burden that the old one is causing. Over time, the strain on space should dissipate and we can close the portal for good. Any questions?" A female mage was the quickest, asking "Wait, if we are opening another of those portals then wont demons be able to come out of it as well?" "Yes, but they won't be in pain as they are now. While they can flow in, we will be able to choose where we open the portal." An older mage, who looked to be going for the classic white beard but could only manage a gray patchy fuzz said "So that is why you circled Venric's folly. Place is a canyon with steep walls a hundred and fifty meters high. There are less then half a dozen valleys in or out of there." Magus smiled, saying "Right, the area should function as a prison. We send one group to terraform and secure the area, while a second siege the research lab to close the old portal. The tricky part comes in the fact that we have roughly a five minute time limit between closing the portal and opening the new one. We must open the new one after the old has closed so a new connection isn't formed, but wait too long and the connection collapses in itself." Magus started assigning people to each group, with a fairly even split by then end. Magus and I would be with the terraforming group(Magus to open the portal, and myself because of my strange affinity with demons.) while the other three aid is the siege. Apparently closing that portal should be as simple as shutting off the generators for the lab and thus cutting all power to the portal. Because it sounds simple, it will be nothing of the sort. The demonic aura of the area seems to mess with some forms of magic, as an experiment we ran a few weeks ago showed. We shired this discovery when someone asked why Magus didn't just drop a meteor on it. "We tried that. Three times, in fact. All of them ended in different, strange ways." Answered Magus. Tiberius tacked on "First one was pushed away, and landed a mile from the target.", followed by Demir with "Second turned into blue cheese."(This got a few worried looks from some of the more experienced mages. Things turning into cheese was bad, but normally it was cheddar or jack. Blue was almost unheard of.) I added that the third was teleported away, and we still haven't found it. Vlad couldn't help but add "On an unrelated note, we haven't heard from the Redpower institute in a while." The general plan was for the group to brute force their way into the lab, locate the generators, then set up a foothold inside at the generators to rest at while waiting for the predetermined time. The terraforming group was to travel to Venric's folly and close off any entrances and exits, level some ground and change the biomes inside the depression in preparation for the ritual to open the portal. Most forms of communication would either not work, be too slow, or be unavailable to one or both parties so Magus opted for a simple time based system. This entire operation would take around two weeks; group one would need three days to prepair for the siege, a little over a week to get to the lab, then the remainder would be to entering to building, finding the generators, then holding off the demons by building a foothold to wait in. Group two on the other hand would have only a day to gather everything they could carry on their backs then regroup at Ank to ride the wagons for a ten day trip to the canyon to start working. After that, we need to build the ritual and hope to time it right... Then move on from there. Once the new stable portal is open, all bets are off as to what might happen next. The other mages have left to ready their things, and we leave for Ank in the morning. It has been a rough and bumpy week and a bit, but we have arrived at Venric's folly(I asked about the name on the way here. Apparently there is a legend about how the area was formed involving a mage named Venric and a large magical explosion. No one knows if it is true, but knowing mages I'd say it was possible.) The next few days are going to be filled with us working our magic on this area, smoothing out the walls to a near vertical surface and sealing off any and all possible exits to keep them in and fool-hearty travelers out. After that, we clear out an area near the heart of the canyon to build the ritual. Magus has requested I find a feral demon, something not to difficult all things considered, then bring it back to the ritual location. I'll try to write again when the ritual has been finished. It is the day before we open the portal, and Magus has brought us all together around the wicked looking structure he has built. "Tomorrow the peace ends and begins!" He cried when the mages had started gathering. "For the common man outside these walls, we will have brought peace and security to their lives, with the threat of demons ransacking their homes gone. For us however, we will have created a lot of bloody work. We will need people to keep an eye on these demons, examine the walls, and make sure nothing gets in or out. We will create a schedule, but that will come later as I know we are all weary. But this is not why I have called you here, as it is far more dire that a heinous error is corrected! I forgot to name this ritual behind me, with everything that has happened lately. Bella, can you come up here?" I walked up quickly, eyes of the fellow mages following me. "Bella, I give the honor of naming this ritual to you." In the space of seconds, it felt like I ran through thousands of possibilities. I finally settled on a name that seemed most appropriate. "Let us call it the Convocation of the Damned." +aw.entries.demons.observations=It has been a few days since we opened the portal, and I have noticed a few interesting things about the demons that have come out. First, they are already bound in service of other demons so they won't be willing to serve us. Second, these demons are just the grunts, the weaklings, the dime a dozen henchmen. Considering that they have proved to be strong enough to dispatch a skilled mage with ease... I worry about facing the higher ranking demons. And According to Sinferious, these grunts can come in one of five types: Fire(The ones we got, a portal seems to lock on to a set type), ice, earth, wind, and normal/untyped. Each one has some advantages and disadvantages over the others, so we will need to prepare based on what comes out of the portal. + +aw.entries.spells.demonGirl=My life use to be simple. Get up at dawn, move with the caravan, keep an eye out for bandits, fight any that show up, do any odd jobs that needed doing, go to bed. For about ten years my daily routine was just this, with a few days a year where this cycle was broken. Living with traders was a hard life, but it wasn't bad. I gave up this life when my brother, Vlad, decided to take care of Bella, and I was given the choice of staying with the Merry Lamp or leaving with my brother. Wasn't much of a choice, really. He knows more details than I do, but soon after he found her the three of us were walking to the home of someone called "Magus Arcana". After we set up camp I asked my brother if he knew where we're going. I quickly learned that we didn't have much to go on. My brother had heard a few rumors, but nothing really concrete. With only the general direction of "To the lands of the mage guild!" we set off. So our adventure began, if a little out of the blue. My name is Demir Highborn, and I am a blood mage. I have since earned the title of "The Battle Mage" to go with my brots "The Alchemist", my teacs "The Ritual Master", my friend Tiberius' "The Architect" and my adoptive sister Bellas "The Demon Kin". But I am getting ahead of myself, back to the beginning of our little "Journey". About two days after leaving the caravan, we stopped at a small town to get my brother a sword (We only had enough spare money for one) while I went to sell a few gems. While at the market I noticed two men in mage's robes, so if anyone was going to know where to find Magus here it would be them. I walked up to a vendor near them, neither of the two noticing me walk past them while they chatted. I traded the gems for a fair bit of coin, then asked the merchant in a voice a little louder then normal, "While I'm here, have you heard any rumors of a man called "Magus Arcana"? I have some business with him." The merchant chuckled and told me that he was nothing but legends told to kids to calm them down. Thankfully, he wasn't the one I was asking. Out of the corner of my eye I saw both of the robed men glance at me, then quickly turn back. They never would have made it as traders. I thanked him for his time, then started walking out of the market, down a narrow path under a few oak trees that had very few people. As I walked away, I noticed both of the robed men following me, just as I planed. I slowly walked down the narrow path, giving the pair more than enough time to catch up with me. "Hey," one of them said as they drew close to me. I turned around, acting surprised that they had stopped me. "Why hello there. ' Didn't see you walk up." I told them, a simple trick to fool even mages that could tell when you're lying. While it was true that I didn't "see" them, I still knew fully well that they were coming. The one on the right nodded, reading that I told them the truth. "We heard you asking about Magus, what business do you have with him?" The one one the left asked me. "Well, that is a little complicated. I need to find him so that he might teach my brother and I. I already know a little about magic, but people willing to teach for little to no coin are few and far between these days." The one on the right nodded again, then said "That is far too true. My brother Way and I were once apprentices to Magus, and he refused every coin we tried to give him. If you want to find Magus, head north east to a village called Lurric at the heart of these lands. We can't give exact directions, but I'm sure this is better then what you had. But fair warning, he tends to be reluctant to teach just anyone who comes knocking." I thanked them both, and they told me to say hello to their old teacher. Returning to the well, where my brother said to meet up, I found both Bella and Vlad waiting for me. "What took so long? You normally don't take this long to make a sell.", my brother asked. I told him what I found out. "I got more then coin this time. I got a name: Lurric. That is where Magus is suppose to be living, and we should find it if we head north east." About three weeks of walking later, we arrived at Lurric. It was as lackluster as the rumors said, with very few signs that a mage lived around here. Vlad found one such sign while Bella and I went to find some antiseptic for the wounds he had gotten when a skeleton caught us off guard. He meet us with a grin on his face, then pointed us to a cobble stone path out of the village. After walking for about a quarter of a mile, we finally saw the fabled stone house of the great mage Magus Arcana. To say it didn't look like the house a mage would live in was an understatement. The outside was simple, with nothing really standing out that screamed "Magic!", so I became very skeptical of just how great he is if he lives in a place like this. It was smaller than the homes of some of the local lords, let alone most of the nobles. We walked up to the simple wooden door, the only possessions we had left were the clothes on our backs, Vlad's brewing stand, a few odd items that Vlad had collected over the years that we couldn't sell, and the sword we had bought a few weeks ago that had saved our lives more than once. I wouldn't have let us in, let alone take us under his wing and teach magic. We looked more like street urchins then potential mages, in all honesty. When we walked up to the door, Vlad asked us both if we were ready. I told him I was, and Bella (Who had hidden behind me and Vlad) gave him a quick nod. With our blessing, Vlad knocked on the door sharply. After almost a minute the door opened, and a tall man answered us. Vlad talked to him, asking if Magus was here. Another minute later and a slightly taller man greeted us. I let Vlad do all the talking, watching as the man first seemed puzzled, then curious, and as he let us in he had a face of amusement. I forget most of what happened after that, mostly due to the fact that Magus had the other man make sandwiches. By the time I had finished my second sandwich, they were done talking. Magus and the other man left us, and I began talking with my brother. An hour later, Magus and his apprentice Tiberius (Vlad had filled me in on what happened while I was eating. I was almost hurt when he said that he wasn't surprised that I was more interested in the food than the man who gave us said food.) returned, gifts in hand. While Tiberius barely managed to bring in a large roll of fabric, Magus came in arms loaded with more food. Once again, what happened next is a blur. The next thing I remember clearly was Magus and Tiberius creating new rooms for the house using their magic. No wonder it looked so normal from the outside, most of the building was under ground. With three new rooms and a hallway built, each of us had a room to call our own. This was odd for Vlad and I, as we had always shared one room (Normally with other people as well). Once we bathed and changed into the clothing Magus had made out of "Enchanted fabric", each robe dyed to a different color. Vlads green, mine red, and Bella asked for purple. Once we were all changed, we met for breakfast. It was a simple meal of waffles, syrup, milk, and eggs. While we ate, Magus asked a question: "Out of curiosity, do any of you have last names?" Vlad and I told him no. "We didn't need them as traders. The leaders always told us names got in the way of a sell." I said, before finishing the last of the eggs. He then turned to Bella, "What about you?" She also said no. "We... We got last names when we turned eighteen or took up a profession. Even so, everyone went by first names." Magus began to scratch his chin before saying "Well, most people around here have last names. Would you mind if I gave you one? You can't take Arcana, that name only brings trouble. So how about "Highborn"?" All three of us thought it over, then one by one we nodded with approval. Magus began to grin, saying "Very well, henceforth you shall be know as Vlad, Demir, and Bella Highborn." We spent the rest of the day and the next filling out our rooms. Magus provided furniture, supplies, and countless other thing to help us feel at home. Unfortunately, I had no idea what a home was suppose to look like, so my room ended up looking a little barren. I asked Magus if I could move a strange table I found in one of the storage rooms into mine. He told me I could, and offered me a hand moving it. It was a plain wooden table with a red cloth on top, a few strange symbols were faded in the cloth and in the wood. As I touched the table I felt something strange in the heart of the table: a strange power that wanted to escape the table. I told Magus about it, and he was curious as well. "That is... Odd. I bought this a few years ago, intending to work out what it does. Feel free to take a crack at it yourself. Let's move it to the main workroom instead of your room then, alright?" We soon had it at one of the half dozen work spaces that doted the large room. This particular space was close to a white structure with an empty basin on top of it. +aw.entries.spells.spellTable.1=It took me three days, but after looking into a few books I discovered gaining access to the power inside the table was going to be both easy and tricky. to get it out of the table I needed some sort of "Bridge", but I discovered there were two problems: Finding something that works as a bridge, and what happens next. I had no idea what would happen when the power was released. As far as I knew, it might be nothing or it might unleash hell on earth. I hoped it was somewhere in between. I quite literally stumbled over the answer to the first problem. At one point when I was walking out the back door to the strange structure so I could get a little air I tripped over the leg of a table, knocking off a small box that popped open to reveal a small red crystal sphere. The box had the label "Failed attempt" written on the lid, and it also had a very sharp edge that I quickly cut my thumb on. As I picked up the sphere with my cut hand, I felt a strange sensation as I touched the crystal with my bloody thumb. Then the crystal started vibrating. It was soft at first, and as I carried it down to the work room it grew stronger and stronger. It suddenly stopped when the crystal touched the table, and it seemed to flash briefly when this happened. So one half of the task was done, finding the bridge between the world and the table. My next goal was to see what happens when that power is released. With the permission and assistance of Magus, I went out a few hundred meters to conduct the test. With a simple nod from Magus, I began trying to tap into the crystals power. At first, nothing happened. Then I felt a burst of arcane energy, that then did nothing. "How odd..." Magus said as we walked home, defeated. "I felt the magic of the crystal as well, but it was almost without any form. There might be a way to shape it, so don't give up." While Magus left to help the others, I returned to the work room. Then I noticed something odd: The table was a few inches closer to the white structure(Which I later learned was a blood altar). On nothing but a hunch I used the crystal again. Once more the arcane energy went out, doing nothing. But I watched the table while this happened, and as I thought it seemed to move a little closer to the altar. With a quick push from me the table sat next to the altar, and the runes seemed to brighten a bit. I rested my hand on the table, and felt the power moving from the table into the altar as if it was seeking something. Going with my gut once more, I started searching for an item to use as a "Focus". After a few minutes I dropped a set of flint and steel in the altar, then went back outside to try again with Magus watching from just outside the door. After taping into the crystals, I felt a wave of warm air around me. It seems a focus is not enough, so I returned to search for something to refine the tables power even more. After an hour I found a few old skulls and heads of several monsters. After placing a skeleton skull on the table, I felt the table hum with power briefly. It was nearing dark, so with the last few lights of the day I tried the crystals power one last time. Magus watched near me as I tapped into the crystals power, and felt myself get a little weaker as a ball of fire shot out of the crystal. +aw.entries.spells.spellTable.2=After showing Magus and the others my setup, both Magus and Tiberius seemed surprised to see that it needed the altar. After I showed them the crystal I had found, Magus and Tiberius asked me to hold off on experimenting with this further for a few days. Two days later I found out why. I don't feel like putting down all the details, so a quick summary: Each of us had unknowingly discovered new branches of "Blood Magic". Blood magic was a new form of magic that he and Tiberius had been trying to create and prefect for quite some time. Everything we had done so far had connected into blood magic in ways both of them had never expected. If we wanted to continue with the work we had been doing, my spells, my brots alchemy, and Bella's demon taming we would need to become blood mages like them. They went over the risks involved, told us that death was a real possibility, and that if we didn't want to go into blood magic we didn't have to. We quickly gave them our answer: We've already started on the path, so we can't really turn back now. We then went through the first test of any blood mage: The creation of a weak blood orb. All of our palms were tender at the end of the day, but we were now blood mages. +aw.entries.spells.simpleEffects.1=I discovered that the spells the table created used LP, and for the next month I searched for items to act as foci. Here is the list that I have discovered so far, but I don't want to write all the details, so anyone reading this will need to experiment on their own. As Magus says "Life is nothing without a few mysteries." +aw.entries.spells.simpleEffects.2=Flint and Steel acts as, surprise surprise, foci for fire . As a result, most of the spells it creates will leave you or something else with a few nasty burns. +aw.entries.spells.simpleEffects.3=Ice blocks seem to make the effects far chillier, slowing what the projectiles hit and forming ice. +aw.entries.spells.simpleEffects.4=TNT as a foci is quite... Explosive. All of the effects, in one way or another, end with a bang. +aw.entries.spells.simpleEffects.5=Ghast Tears let it control wind, pushing entities around. +aw.entries.spells.simpleEffects.6=Glowstone Dust governs the weather, allowing lightning and such to happen. +aw.entries.spells.simpleEffects.7=Bucket of Water has to do with the control of water, strangely. Expect drowning and water, not necessarily in that order. +aw.entries.spells.simpleEffects.8=Obsidian has the energy attune to stone, for some... Interesting effects. +aw.entries.spells.simpleEffects.9=Ender Pearls allow teleportation, for both you and others. +aw.entries.spells.simpleEffects.10=Apprentice Blood Orb create some strange combat effects that have little rhyme or reason from my experience. +aw.entries.spells.simpleEffects.11=Something else that is interesting about the table is that it does not need to be re-bound to the crystal. If you change the foci or the paradigm the spell will change as well the next time you use the crystal. I also found four "Paradigms" to use with the spells. Skeleton heads imprinted a ranged attack to the energy of the spell, the wither skeleton skull made the spell more suited for close combat, the zombie turned the spell defensive, and the creeper head gave the spell more environmental impact. I should also note that Magus shared with me crafting recipes for turning wither skeleton skulls into heads of the other mobs. Seems a bit pricy, but when you have no other choice... +aw.entries.spells.tableAndSkulls.1=I asked Tiberius how he made the spell crystal, and he told me that while trying to create a new blood orb he stumbled across it. All it needed was a piece of glass in a blood altar, using 1k LP to transform the glass into the crystal. +aw.entries.spells.tableAndSkulls.2=We managed to recreate the powers and effects of the "Spell Table" using blood magic. Amazing what you can do with items laying around Magus's home... +aw.entries.spells.timePasses=This brings us up to today, when Tiberius brought us books so we could write all our work down, if we wished. It has taken a few hours, but here we are. Currently I am working with my brother to create a much more advanced form of the spell system, and will add any information I learn to this book when I have time. Has it really been three years since we came to this place? My life before coming to Magus seems like a distant memory now, and my days have become filled with training and work that I have fallen in love with. Since I last wrote here so much has happened... My sister Bella has come out of her shell, freely walking amongst the villagers in the market without cowering behind us. She has become more outgoing, helping Magus deal with demon attacks and cutting the number of deaths every year substantially. She has formed pacts with over a dozen demons, while working with Magus and my brother to create a way to "Pull" demons into our world, body and soul. My brother Vlad has been busy with his alchemy, creating new potions that have powerful effects but more often then not taste like tree bark mixed with dirt. Alongside that he has been helping me create the components I need for my spell constructs. I needed materials that conduct large amounts of magical and elemental energy, and he has been the only reason I've gotten so far. And no, I'm not writing that just because he is sitting next to me, though it would be a lie to say that hasn't been a factor. +aw.entries.spells.complexSpellBasics.1=Anyway, back to what we're here to write about. We have discovered a way to use the items known as "Blood Shards" and my brots alchemical reagents to create a new way to form spells using blood magic. It uses four components: Paradigms, Effects, Modifiers, and Enhancements. The main improvement of this system over the old one is the ability to "Chain" spell effects together. Before I cover how to create the spells, I should go over the parts. +aw.entries.spells.complexSpellBasics.2=The paradigms act as the starting point for the spells, and define what the spell will target. There is only one "Output" side to these blocks, and it is on the side with five points(It will be hard to miss it), and the output side can be rotated with a simple right click. We have currently created four different paradigm versions: Projectile, melee, self, and tool. While the names feel self explanatory, I'd best talk about them anyway. +aw.entries.spells.complexSpellBasics.3=Projectile: Makes the spell ranged, and will trigger on impact with anything. +aw.entries.spells.complexSpellBasics.4=Melee: Short range spell, normally the target must be within one to two blocks for the effect to work. +aw.entries.spells.complexSpellBasics.5=Self: Targets the caster, or the area immediately surrounding the caster. +aw.entries.spells.complexSpellBasics.6=Tool: Creates an alchemical manifestation of the spell from the crystal in the shape of a mace. Depending on what is in the spell, it can change what this mace does, from being a weapon or a digging tool or "Crushing" any block it breaks. +aw.entries.spells.complexSpellBasics.7=Next we have the effect blocks, and these are what give the paradigms some kick. Unlike the paradigms, theses have both an input and an output. An effect blocks input is always the five pointed non-colored side, while the output is the side with the colored ends(The color depends on the effect block). We currently have the effect blocks for fire, earth, wind, and ice. The effects of these blocks are heavily influenced by the modifiers that come after it, but spells can function with only a paradigm and one effect. +aw.entries.spells.complexSpellBasics.8=Modifiers change what the last effect in the chain before them does. So, if you had a fire, ice, wind chain then placed an offensive modifier, the wind would take an offensive effect while the others remain default. The current modifiers are: Default, Offensive, Defensive, and Environmental. +aw.entries.spells.complexSpellBasics.9=Default makes the effect act as if you left it without a modifier. Useful for spells where you want to guaranty its effect. +aw.entries.spells.complexSpellBasics.10=Offensive makes the spell more combat oriented. Doesn't mean the spell will deal damage, but it might help in combat. +aw.entries.spells.complexSpellBasics.11=Defensive has shown to change effect to protect the user. This comes in several forms, from creating shields and cloaking the user to slowing an opponent. +aw.entries.spells.complexSpellBasics.12=Environmental does what the name says: It makes spell effects have bigger impact on the world, from setting fires at the targets feet to carving out large chunks of land. +aw.entries.spells.complexSpellBasics.13=Finally we have enhancements. Enhancements improve the spell without major changes to the effect. The enhancements are: Power, Cost, and Potency. Like most other spell blocks, plain is in and colored is out. What should also be covered are the frames that hold enhancements. There are three types of frames, each stronger then the last. Your cheap and basic unstable frame can only withstand one per type(You may have one power, one cost, and one potency. If you try to add two unstable power enhancements one will not be able to improve the spell, and actually might blow up damaging the blocks around it). While you may only have one unstable per type, you may have two standard and three reinforced for a grand total of three enhancements of any type(If you want to save on the resources needed for these enhancements, try having one of each in the chain, placed in the order of weakest to strongest. While an unstable can only handle its own power, a standard can handle its own and that of a unstable, with a reinforced able to channel all three without failing). As I write this down I realize it is a little confusing, but with a little practice it becomes simple. +aw.entries.spells.complexSpellBasics.14=Power boosts the, well, power of the spell. If you had a spell that did damage and gave the target a potion effect, the spell would do more damage or make the potion effect stronger. +aw.entries.spells.complexSpellBasics.15=Cost lowers the cost of the spell effect. Doesn't get much simpler then this, yet will always be useful as the cost of these spells can get quite hefty after you chain a few effects. +aw.entries.spells.complexSpellBasics.16=Potency increases the potency of the spell. What this means differs from spell to spell, but with our damage/potion effect example it might make the effect last longer or be stronger. +aw.entries.spells.complexSpellBasics.17=This covers all the parts of a spell, but there is still one block remaining: The conduit. It doesn't add anything to the spell, but it allows you to have the parts of the spell farther apart. The input and output is dictated by the dots on the respective side. Four small dots is the input, one large dot is the output. Now then, how do you create a spell? First, pick your paradigm. Then, create a complex spell crystal to bind to the paradigm(Crafting recipes will be on the following pages for convenience) and make sure the crystal is also bound to an owner. Then, place and connect an effect block to the paradigm(Change outputs with right click, inputs with sneak right click. Do note that one side can't be both the input and the output.) Now the spell will work, but it might not do what you want. You can alter the spells effect by placing down and connecting a modifier. Still doesn't mean the spell will work as expected, but you can at least nudge it in the right direction. Finally you can add enhancements to boost the spell, but they might make the effect cost more(Unless you add cost enhancements), There are three tiers of enhancements, and a spell effect can one tier one... You know what, I went over this in the modifiers section. Look there for more information. But you don't need to stop on one effect, you can chain to another effect and another effect and another.... The possibilities are as endless as your soul network will allow. A few final notes: Every spell will do something. Some need other effects to really flourish while others work best on there own. The cost of the spell will always be the sum of all the effects and their enhancements multiplied by the complexity factor. So you can create massive spells with several effects at once, but watch your soul network as you use it. Just a warning. +aw.entries.spells.crafting= +aw.entries.spells.complexSpellEffects.1=And now Vlad is requesting I mention the effects of the spell... This might take a few pages, but I guess it is worth doing. +aw.entries.spells.complexSpellEffects.2=Self paradigm effects are always interesting... A default fire effect causes the user to burst into flames, while an offensive effect cloaks you in fire to ignite attackers and nearby entities. Defensive forms a puddle of magma at your feet(Useful if you can't be hurt by fire, but the thing trying to kill you can). Finally for fire, environmental causes you to superheat an area causing fires and things to change(Sand to glass, cobble to stone). +aw.entries.spells.complexSpellEffects.3=Earth is a bit less...Wild in it's effects for self. Default raises the ground bellow you up to your feet, forming a platform to stand on and I have found it helpful for when you suddenly don't know where the ground has gone(Happened once when testing a wind spell). Offensive creates an impact at your feet that crushes blocks, cobblestone to gravel, gravel to sand... Defensive effect is a powerful combat option with a catch: You become much heartier, able to take far more damage then normal at the cost of movement. Environmental creates a quick shock wave that weakens near by entities. +aw.entries.spells.complexSpellEffects.4=Ice has been a fun one to use. Default creates a small pillar under you that pushes you up, allowing for quick vertical movement. Offensive causes entities around you to become lethargic, moving slower. Defensive is a bit more interesting, allowing you to slow entities and freeze water using a cloak of ice(You can easily use this to walk on water). When water isn't available, you can create a bridge of ice using environmental ice. +aw.entries.spells.complexSpellEffects.5=Wind has turned out to be quite practical in it's uses, from my tests. Default hs the useful effect of creating a brief burst of wind that puts out fires on the user and protects the user from sudden downward momentum that can cause quick yet extreamly messy death. Offensive mimics the effects of an air sigil, launching you forward. Defensive causes near by entities to have a strong downward wind limit movement. Finally, environmental causes a large high pressure area to form around the user, that then moves to the low pressure area(Everywhere else). This has the side effect of taking entities with it in the sudden gust of air that is formed. +aw.entries.spells.complexSpellEffects.6=On to melee effects, for those who like close range combat. Starting off with fire again, this effect as default causes spontaneous combustion for near by entities. The always entertaining offensive effect causes the target to gain an effect called "Fire fuse". This effect does nothing until it expires, at which point the entity explodes. The explosion not only damages the entity, but causes it to to launch in the air while the explosion damages near by entities. Defensive allows you to wall off areas with fire, stopping things from passing unless the brave the flames. Environmental causes it to form a short range projectile that evaporates any water nearby. +aw.entries.spells.complexSpellEffects.7=Earth melee has a few of the old effects in a new form. Default destabilizes blocks, causing them to fall akin to sand. Offensive has the same smashing effect from earlier in projectile form. Defensive forms a wall by raising a chunk of the ground up. Environmental on the other hand is able to remove the stone from an ore, leaving a fair amount of dust to process into ingots. +aw.entries.spells.complexSpellEffects.8=Ice allows some useful combat options, starting with a default effect that allows the target to lose the tolerance to pain that happens after a blow effectively allowing you to apply more damage in less time. Offensive rockets the target into the air akin the the self ice effect from earlier. Defensive forms a wall of ice to protect you from damage. While Environmental... Well, it is odd. It unleashes an omnidirectional volley of snow balls at the target. +aw.entries.spells.complexSpellEffects.9=Wind is very combat flow oriented, with default pulling entities towards the user, offensive away from the user, and defensive in the air. Environmental is more utility, as it pulls items on the ground toward the users. +aw.entries.spells.complexSpellEffects.10=Projectile spells share many of the effects of other types with a few all their own. A default fire allows the attack to unleash a torrent of fire when it hits something. Offensive creates flowing lava in the air under the target, but is tricky to use without the aid of other spell effects. Defensive smelts blocks, while environmental evaporates water. +aw.entries.spells.complexSpellEffects.11=Earth projectiles are mainly focused on mining, with default disintegrating all matter it comes in contact with. Offensive forms a hole under an entity it hits(It will normally only dig the hole in mundane blocks like dirt and cobblestone). Defensive smashes blocks in the same manor stated before, while environmental mines blocks in an area around the projectile. +aw.entries.spells.complexSpellEffects.12=Ice has a lot of classic effects, with default being an ice plume on impact, Offensive slowing targets, defensive freezing water and making snow, and environmental just freezing water in an area around the projectile. +aw.entries.spells.complexSpellEffects.13=Wind has a few interesting effects, with default sending mobs flying, offencive giving "Heavy heart" to ground entities, defensive letting blocks mined by the spell drop as if mined by a silk touch pickaxe, and environmental pulling items to the user. +aw.entries.spells.complexSpellEffects.14=Tool spells seem to be a mix of utility and combat, with many of the effects allowing it to function as a set tool type. Starting with earth, default acts as a pickaxe, offensive as a way to remove mundane blocks, defensive a shovel, and environmental gives it the power to mine multiple blocks. I know I sound like I'm rushing through these, but they sort of say what they do on the tin. +aw.entries.spells.complexSpellEffects.15=Fire has a few powerful effects, with default smelting anything mined(Cobble to smooth stone, sand to glass...), offensive acting like the enchantment fire aspect, defensive increases the time the spell stays in tool form, and environmental lets it turn stone into lava. +aw.entries.spells.complexSpellEffects.16=Ice is more combat centered, with default letting blows it deals slow entities, offensive giving it a few sharp points for more damage, defensive unleashes a torrent of cold air when the tool is summoned that creates snow and slows mobs. The environmental effect is a black sheep, allowing the tool to function as if it has silk touch. +aw.entries.spells.complexSpellEffects.17=Wind has effects that are just... Useful. Default allows it to function as an axe, offensive gives it some extra punch to throw mobs back after being hit, defensive weighed them down, and finally environmental pulls items closer to the user. +aw.entries.spells.offTopic=Tiberius has informed me that this book will update as I add to it, so if we ever create more blocks for the advanced spells, you'll know when I do. For now, this is the end. And yet it might be your beginning. I'll go off topic for a bit, because today something happened that I never thought possible: I killed a wither(You know, big black flying skeletal death monster that wants to kill everything? One of those.) Not only did I kill one, but I also helped kill twenty more. Magus said that the most killed at once before this was ten by three people, so we crushed the record. We needed a few nether stars to upgrade our altar, but nether stars are near impossible to get. Unless you work on the conglomeration board like Magus that is.(He runs the largest country in the world, apparently. I know, I can hardly believe it either.) After inviting every single world leader for a holiday weekend(Of which they actually treated like a holiday trip), Magus managed to get us a reservation in a battle arena to kill thirty withers. To say I was shocked is an understatement. But, by some miracle, we managed to not only kill all of the withers(And all of us lived to tell about it). Sadly, I'm stuck in bed with a busted leg(Wither skull nailed me when I was casting a spell.), so I've taken this as an opportunity to try new kinds of food(Magus knows how to cook like any five star chief). I'd keep writing, but I smell the roasted chicken coming down the stairs now... Vlad has finally found a more stable recipe for the more advanced spell parts for the augments. While he has been able to create them before, the new orbs we have allow them not to fall apart four out of five times. A slight improvement, I'm sure you may agree. With this, the reinforced spell augments are much more reliable. Well, the last few days have been interesting. We have managed to open a hole in the fabric of space to let in an invading army of demons, but it was to stop another portal letting in other demons so it is all fine. Sorry, but I had to comment on how ridicules that sounded when I first heard Magus's plan. But it isn't as bad as it sounds, since we opened the second portal we had control over where the demons come out and can prevent them from running wild. Absurd sounding, I know, but when you deal with holes in space leading to demonic realms things are rarely ever simple. Or when a mage has any involvement, for that matter. +aw.entries.spells.demonicPower=Gah, look at me! I opened this musty old book to mention the new augments Vlad and Tiberius had created using the spoils of this "War", and ended up ranting about how strange and wonderful life as a mage can be. Right, Vlad managed to make a few parts better using these life and soul shards we've been collecting. Not much else to it, really. Sure, Vlad might say how he had to create new laws of alchemy to explain this process, but he does that on a daily basis anyway. + +aw.entries.alchemy.fatedMeeting=My name is Vlad Highborn, and I am a Blood Mage. I have studied the intricate workings of alchemy and the process of "Equivalent Exchange," which governs all aspects of magic. Basically, you cannot create something from nothing, although many have tried when searching for a particular stone. That obviously didn't end well, because people are clamoring for a fake variant even today. Of course simply saying that I am an alchemist isn't enough, because one of the main things I do is study Blood Magic with The Ritual Master and The Architect, both of whom have achieved those titles by their own merits. Magus and Tiberius have been busy recording their own works over the years, although I don't think Magus has everything written down in a book - I have yet to find any actual proof. Demir and myself were working with a trading company named the "Merry Lamb," which operated throughout the entire lands travelling from place to place, selling our wares from horseback and buying whatever was of value. We didn't have last names, we didn't need them - the only thing that was of worth to the caravan company was how much of a profit you were able to obtain, and last names only got in the way of a sell. When we weren't busy with the various villages, trying to part with our gleaming swords and precious gems, all that was left for us was to read the many books that we obtained in the light through the canvas of the caravan. That was how I fell in love with Alchemy in the early days. One of the members of the trading caravan I worked with was an alchemist, who created simple potions and poisons for both medical use and profit. He taught me many things while he worked with us, but I quickly learned that he only knew the basics of what could be done. This void of knowledge led me to collect several alchemical tomes from the merchants of the passing villages, where I heard of a powerful mage that lived on the outskirts of a small village. At times I fantasized of meeting him, perhaps even learning from him alchemy like nothing I could ever dream of. But every rumor made me think he was more myth then man, filled with outrageous stories of his skill and power that no one else has ever came close too. Paired with the fact that no one had ever seen him almost killed the last of my dreams. I was reading the latest book in my collection, one that I bought from a hermit alchemist in the last village who kept muttering about turnips, when I noticed a flickering that didn't match the light of the candle that I had in the caravan. I looked out of the back of the caravan as it slowed to a crawl, all of the traders were looking at the same thing: a trail of dark smoke rising from behind the trees and blowing in the harsh wind. The head of the caravan quickly dispatched a group containing one person of each profession, which included myself as the now only alchemist, and we headed towards where the village used to stand. A massacre. I saw the smoke and ashes of the buildings, charred and even frozen flesh littering the ground. I swallowed heavily, looking around me for hope that I wouldn't lose my supper, and overheard someone speaking the obvious, "It must have been demons! No mage would use both ice and fire to attack a village." "Hell, no self-respecting mage would attack a village in the dead of night. They still honour that code from the medieval era." We readied our weapons, myself relegated to medic duty, but there was hardly any use because demons rarely stayed for more than an hour after they're done. "Hey," Nick shouted, a new member to our group, "there's someone here!" We all looked around and saw a little girl, possibly about age twelve, wondering through the ashes and looking both lost and dazed. "The demons leave no survivors, boy," the leader of our group said. "It is a bad omen to find her here, alive and alone. Hell," he laughed bitterly, starting to walk away, "that may not even be a ' - could be another demon for all we know." The thought stirred me, not of what she could be but that someone could leave a lost child by herself. "Fine," I said, after arguing the point for several minutes, "if you won't take her, I will leave the Merry Lamb." I can't fully remember the argument because of how much time passed before I could finally write it down. What I do remember is that the head of the caravan was quite startled at my proclamation, but finally agreed to send a carrier to fetch both my brother as well as my belongings, and to give me a good deal on some supplies. "I won't try to talk you out of it, since I know how you get when your mind is set. But if I may ask, why are you so intent on trying to help her?" I turned around to start walking towards the girl, who was watching us blankly. Not surprising, considering we are probably the first people she had seen today. Living, at least. After walking the few paces that put me between the girl and the caravan, I turned to the leader and said what I was holding onto for the past few years. "I know what it is like, to not have any home to call my own. I'm hoping that this is not a bad omen, but is rather a sign of fate." Unfortunately it might have been a little preemptive of me to throw away my whole livelihood and wayward home to help a single lost girl. Demir wasn't exactly happy having to pick up everything that he had to head out on an adventure and neither of us were expecting, but I couldn't really blame him. Demir was attuned to several forms of magic, being the resident wizard-in-training of our group. Thankful for the little spark of mana that he managed to cultivate over the years, he kindled a fire for the three of us once we managed to walk off the rest of the night. Her name was Bella, with light blonde hair and blue eyes. When we asked her what happened that night, she simply shook her head and tucked her knees under her chin. Demir and I looked at each other, and we knew that no form of magic that we knew would heal her of the wounds that she had in her mind. When we tried to ask her if she knew of any magic herself, considering that we neared the boarder to the Mage's Guild's land, she shook her head again and looked sullenly back towards the village that she came from, now miles behind us. Demir finally asked the question that I was thinking myself - it seemed that he always had the uncanny ability to read my thoughts, or at least my mood at any given moment. "So, which way is it to this 'Magus Arcana?'" It was a long and difficult trek towards the village that the Mage was rumoured to live in. Three long, blistering weeks. It is actually quite amazing how a distance can be so hard to traverse on foot without a caravan, pulling our dwindling belongings with us as we continued onwards towards our goal. When we reached a village we would do the same thing: we would go to the local market at daybreak and sell whatever books and gems that we could, grab our allotment of food for the next leg of the journey, and ask in the tavern if anyone has heard of rumours of the great mage Magus. It seemed that with each village our supplies were getting less prosperous, dwindling until all that was left was a few worthless rocks that no one was keen on buying. Thankfully it seemed that we were getting close, since the rumours were becoming more and more substantial, until it became a reality. Passing by a blacksmith's shop, I noticed that the furnace was burning a lot more brightly than if it was filled with lava, and I peered into the slot for the fuel. What appeared to be there was a crystal made of lava, pulsating slowly as if it received a beat from a heart nearby. I asked the blacksmith about it, and he told me about an apprentice who made it, who didn't appear to have a name in the blacksmith's memory - if I were to hazard a guess, I'd say that he was more afraid of the apprentice than he let on. Grabbing Demir, who bought some antiseptic for a few wounds we received from a stray skeleton the previous night, and Bella, we finally headed towards the outskirts of the village we were looking for. The home wasn't hard to find, there was a simple cobble stone path leading away from the village to a lone stone house. Considering the fact that there can't be that many homes out here like this, this was the place or whoever does live here can give us directions to the right one. We walked up to the surprisingly simple wooden door, and I turned to the other two. "Are you ready?" I asked them, more for my sake then theirs. Bella simply nodded, barely speaking more then a few sentences a day since we left three weeks ago. Demir put his hand on my shoulder saying "This is the place, right? Let's not just stand here like a bunch of geese." Gathering myself, I knocked three times on the door. At first, I feared we had the wrong house. Then I feared we had the right house, but no one was home.... Before my mind could think of another scenario, I heard the sounds of a door being opened and someone walking on stone. The door swung inwards with a light squeak from the hinges, reveling someone of about eighteen wearing long robes. "Hello, how may I help you?" He asked after quickly looking us over, and I assumed this is the apprentice the blacksmith mentioned. "We're looking for the great mage Magus Arcana, is he here?" The man looked at all of us, then turned his head yelling "Master, there is someone here to see you. They're asking for you by name." We soon heard a door open again, and a man who looked to be in his late thirty's appeared behind the apprentice. I saw him briefly look the three of us over, raising his eyebrow as he did so. "You must be Magus. We've come a long way to meet you. May we come in?" He seemed to think this over for a few seconds, then sighed saying "Alright, you may come in. Leave your boots at the door, then follow me to the main room. Tiberius, can you make a quick lunch for the five of us?" The apprentice nodded, then left around a corner to the right while Magus lead us left to a large room with a few chairs, a simple couch, a plain wooden table, and an unlit fireplace with a strange red rock on the bottom. He gestured for the three of us to take a seat on the couch, which we gladly accepted. We had been on our feet for the last three weeks, so a chance to sit in a cool room was a nice change of pace. As Tiberius brought out a tray with several sandwiches on it to set on the table, I looked around the room to see what was on the walls. Stone tablets with strange symbols, brightly colored wands and stave's adorned the walls like kings use old swords, and a small book shelf was set above the fire place holding a variety of books in a few languages. I recognized "The theory of equivalent exchange" by Pahimar, the book that sparked the search for that certain stone. I noticed that while I had been gawking at the walls, everyone else had started eating. I grabbed the remaining sandwich, a simple pork and cheese with a strange sauce that I didn't recognized but immediately loved. "So..." Magus said as we finished the last few crumbs of the meal. "..what brings you to me?" Demir gave me a sideways glance, my que to start talking. "Well, I heard stories of what how much you know. I wanted to learn alchemy, so I came here. I know of only one other alchemist, the one who taught me the basics." He frowned, pinning his glare on me. "I looks like you three traveled a long way to get here, and you were unprepared for a long journey. So I'll ask again, what made you come to me?" He knew we didn't have as much of a choice as I was trying to let on, so there was no point in lying. "My brother and I lived with traders. About three weeks ago we came across a village that was attacked by demons, with there being only one survivor." Magus glanced over at Bella, who was eating a second sandwich Tiberius had brought for us. "Yes, Bella was that survivor. That other traders wanted to leave her for dead, but I couldn't bring myself to do that. So I was forced to go threw with a plan I had been preparing for the last few years, trying to find you, early. I had originally planned to come here alone, and had just enough money to get one person here. We barely scraped by with three, getting here with the last few gems I had to trade." Magus nodded, a intense look on his face. "And what were you planing to do if I was not here, or you never found me, or if I was a myth like many people think I am? Or did you even have a plan?" I sighed at his questions, he really pinned me down and read me like a book. "I had a back up plan, if a bad one. If worse came to worse I planed on trying to find a village that needs an alchemist to brew potions. I still have all the equipment in my bag, one of the few thing I couldn't bring myself to sell. I know how much the traders made off my work, I could feed the three of us with it, if only just barely." Magus nodded as if I gave the right answer. "Now then, what of your brother and your friend Bella? What had you planned to do with them if you found me?" "Well, my brother has a little mana, enough to create sparks strong enough to light fires. As for Bella, she doesn't know if she as any talent for magic." Magus's gaze shifted over to Demir, then Bella, then returned to me. "And if your brother or Bella didn't have enough talent for me to teach them?" I sighed once again. He was asking all the right questions. "I would shift to plan B. I'm not leaving my brother or Bella, not after all we have been threw, and not for the teachings of a heartless mage." He gave me a hard stair for a few seconds, then a wide grin grew on his face as he said "Right answer. Alright, I'll see what I can do. I should be able to teach something to you three, and I doubt anyone else around here is going to take her in. Rumors of the blond haired demon girl have beat you here." Magus made a few arrangements for us, having Demir and I stay in Tiberius's room while Bella took Magus's. When I asked where he would be sleeping, Magus said he kept the old couch around for more then one reason. When I started to protest he said that this was only temporary and that the three of us would have our own rooms tomorrow. When I asked how, all he did was smile and say "You'll see." While the three of us got accustomed to our new home, Magus and Tiberius went out for a few things. "Well, there an odd bunch." Demir said shortly after they left. "Don't laugh, they can say the same about us." I told him. This comment earned a rare smile from Bella, who had slowly started coming out of her shell. Magus and Teberius returned a little over an hour later, Magus caring a huge amount of food while Tiberius had a large roll of uncut fabric. Magus brought the food to the main room we sat at before, its intoxicating smell had caused both my brother and Bella to start drooling. I would criticize them if I wasn't doing the same thing. "Even after lunch you three looked half starved." Magus said as he set down loafs of fresh bread, cheese, and dried meat slices. "So we got you something, though we didn't have many options on short notice. Consider it a welcoming gift, along with some new clothes we'll make. But those can come later, for now you can dig in!" We ate like wilder beasts, tearing apart the bread, clawing for the meat, and making sure to get every last crumb of the cheese. I had no idea just how hungry I was till I saw all that food, and by the end of it I was amazed at how long it had been since I ate like this. Three weeks ago? No, a few month ago. When the traders were celebrating a huge trade with a large and wealthy village. The leader has so happy that he almost spent half the money he earn off the deal on the party. Almost. After a nice long night of sleep, we all awoke to the sounds of Magus and Tiberius carving out a large chunk of the dirt on the other side of a wall. I was fascinated by how they were doing it: Magus cast a spell to remove the dirt, then Tiberius replaced the dirt with stone bricks using a strange looking wand. At first I wondered where all the dirt was going and stone was coming from, then I noticed a few strange bags at the side of Magus and Tiberius. Once the main size was laid out, Magus asked Tiberius for the bag he had. With it in hand, Magus raised one arm to have walls raise out of the ground with it. Then Tiberius grabbed a few strange flying flames to light up the hallways, and candles for the rooms. "Alright, we're done. You three now have rooms to call your own. I'll have to do some work, but we might be able to get a few beds here as well. I only have one spare, so you three can decide who get's it for now. "Bella." my brother and I said in unison. "Alright. Tiberius, can you give me a hand moving it to her room? Also, your rooms have a small work area. If you need more space, you can use the main basement area or let us know. We'll see what we can do. For now, you three can pick which room you want, then move unpack your things there." The next two days went by fast, Magus helped make our rooms homes and assisted us in finding fields of magic to study(He had over a dozen tomes on alchemy inside is huge library, so I quickly felt at home with my nose in a book). While he attended to Demir and Bella, I started diging into the tomes. After cross referencing several of the books, I noticed that very few ever tried to improve upon the first brewing stand. Of the few who did, none succeeded in making potions larger then one dose. After briefly talking with Magus and Tiberius, they encouraged me to try and improve the design and gave me a space in the main workroom to do my testing. +aw.entries.alchemy.firstSteps=I knew I needed to try and reinforce the stand, as it was far to fragile to mix more then one item at a time. I tried iron, gold, stone, and several other material. They ether were far to weak, incompatible with the stand, or unruly with my attempts to shape them. It was when I tried to use obsidian, something that was compatible with the stand, strong enough to withstand the strain of the alchemy process. My only problem was fusing the obsidian with the stand. While I pondered my options, I felt my hand brush against a strange red orb that had been sitting next to my work space. Once I did so, the obsidian seemed to spring to life, wrapping around and shaping the stand into something far greater. I called down Magus and Tiberius to see what just happened. When Magus asked how I did what many others failed at, I told him the truth. "I'm not sure. I was thinking of how to do just this, when I accidentally touched something on that table and then the obsidian sprang to life." "You touched something and the obsidian seemed to come to life? What did you..." Magus said, then stopped dead as he looked at the other table. "Was it that orb?" He asked hastily. "I think so. After I touched it, this happened. It looks like what I created had a slot shaped like that orb."I told him, and Magus looked shaken. "Tiberius, we're going to need to talk about this. For now Vlad, can you hold off on testing what that device does?" "Alright." I told him, a little confused. "But I think I should name it. How does "The Alchemical chemistry set" sound?" Magus put on a weak smile "That seems fitting. It seems to be much more then a simple brewing stand. I recall Demir saying you had a few alchemical items that an adventure sold to the traders in your possession. Perhaps you can try to work out what they do, or what they're made of." Trying what Magus suggested, I started experimenting with the strange alchemy items I collected in my time with the traders. In total, I had two small red orbs, one larger red item that seems like a better version of the red orb, three small blue orbs, and two blue items that seem like they're between the small orbs and the large ones. Using a small alchemy lab Magus brought me to, I started breaking down anything I had spares of. Taking one of the blue orbs and grinding it in a mortar and pedestal, I found it was made of three redstone, and two items I had never seen before. One was acting as a "Binding" agent, while the other was some sort of liquid catalyst. After a few hours of work, I had a few formulas for the items, but I still needed to recreate them. Normal mixing wasn't working, as it seems like there was some other factor that merged them in the first place that I am missing. I'll write the formulas here when I find out what I'm missing, so until then I start grinding up the other items. Alright, after about three days worth of work I now have discovered that my original assumption that the larger red and blue reagents were stronger, more "Condensed" versions of the small orbs was correct. After a bit of work I am starting to think there is some sort of link between the alchemical chemistry set and these reagents. The chemistry set has five "Input" slots and one "Output" slot, and many of the items here need just five items... I will need to ask Magus about trying this with the orb that formed the set inside. Well, I am apparently now a blood mage. Magus and Tiberius told us details about some of the items we had been finding around our new home, from the weak blood orb that help create the alchemical chemistry set(Which Bella later used to tame her new demon friend. After everything I have heard about them, he is remarkably civil.) to the altar behind the house and in the basement. I was given the choice of continuing to study blood magic and use my new chemistry set(And taking all the risks that come with it), or studying other forms of alchemy. I went with the risky option, simply because I would be blazing a new form of magic. I now have a weak blood orb to call my own, and I will start trying to experiment with creating some of the reagents I have discovered in the last few days. +aw.entries.alchemy.chemistrySet.1=Hmm. It seems that the "Simple Catalyst" is the only alchemy reagent I could make with a weak blood orb. Once I had the recipe(Two parts redstone, one part glowstone, one part sugar, and one part gunpowder. Mixing these together should make one simple catalyst), I place one of each item in the outer five slots of the chemistry set. This alone is not enough to create a simple catalyst, you need to have a blood orb bound to you in the "Orb" slot to supply LP for the process(The simple catalyst only needs 200LP, so it is fairly cheap). Tiberius mentioned he had already made a stronger blood orb, so I might ask him for help making my own. I'll log any recipes I find. With a bit of work, I have managed to create the other component of the tiny dark blue orb(The small light blue orb still eludes me. I might need to look into a stronger blood orb, but that will need to come later.) The "Binding Agent" seems to have a few uses in both crafting and the other experiment I have been running with potions(More on that later). The weak binding agent needs only two simple catalysts and a piece of clay to form(Along with 1K LP). I say weak because I feel I can improve it with some of the reagents I have been creating. For now, I should go over what I've made in the past month. With the help of Magus, I have managed to make "Alchemical elemental reagents". These reagents represent various elements found in the world that always play a major role in both magic and alchemy. I will make a quick list of each element and its recipes, and will try to create these entry's as close to what I find in all the alchemy books I have read. Also I should note that they all need 500LP as a catalyst to make. +aw.entries.alchemy.chemistrySet.2=Incendium: Holding the power of fire and the nether, incendium need items often attributed to fire and are a part of the nether. Due to this, it is very hot and it has left me with a few small burns from my time handling it. +aw.entries.alchemy.chemistrySet.3=Aether: A reagent holding the power of wind, I have had to make sure it doesn't float away with every breeze. Made with items that seem to always be used as in reference with the wind(Ghast tears and feathers) that I bound to glowstone dust and a simple catalyst to give it some physical form. +aw.entries.alchemy.chemistrySet.4=Sanctus: Closest thing to powered light I could make, it seems to hold strange properties that I still can't understand. It needed a little gold, glowstone dust, and glass I had ground up in the chemistry set to make, but it seems worth the cost. +aw.entries.alchemy.chemistrySet.5=Crepitous: Chaos and destruction in physical form, I named it after the creepers that gave me the idea(And the gunpowder) for it. Made with one simple catalyst, two cobble stone, and two gunpowder. +aw.entries.alchemy.chemistrySet.6=Crystallos: A fine, cold powder that sends chills down my spine every time I touch it. Made with two parts ice(I need to find a better way to get this, The village doesn't have much in stock, and I burn through most of it trying to get the formula right), two parts snow(Full blocks, not balls or sheets), and the standard simple catalyst. +aw.entries.alchemy.chemistrySet.7=Terrae: A hard, grainy powder that has the power of the earth. Composed of two parts obsidian, one part dirt, one part sand, and mixed together in a simple catalyst. +aw.entries.alchemy.chemistrySet.8=Aquasalus: A reagent that seems to shift between powder and liquid on a whim, it represents the force of water in alchemy. Made by mixing three parts water(the amount in water bottles seems perfect), a ink sack(I didn't ask Magus why he has a huge stock pile of these in his storeroom, and he doesn't seem the type to mention it on a whim), and a simple catalyst. +aw.entries.alchemy.chemistrySet.9=Tennebrae: If sanctus is solid light, tennebrae is hardened shadow. Black as night and seems to dim everything around it, this reagent has potential to be powerful is used correctly. Made with obsidian, two pieces of coal, a ball of clay, and a simple catalyst. +aw.entries.alchemy.chemistrySet.10=Magicales: Raw alchemical power seems to pulse in this dust, and I feel like I have only glimpsed the true potential of this reagent, and I both fear and adore it. Made by mixing one part redstone, one part gunpowder, and two parts glowstone in a simple catalyst. +aw.entries.alchemy.incense.1=>A note, this is an entry written several years after the others before and after this. After talking to the others, I am adding this here as a post script to aid others who read this for the simple reason of "We would have loved to have this when we were starting out". This will, however, mention people and items that might be foreign to you for now. Roll with it, it will all make sense later.< +aw.entries.alchemy.incense.2=I have found something... Well, unexpected to say the least. The self proclaimed hedge mage Athis stopped by our still in construction homestead in Venric's folly to visit Tiberious. Apparently in one of the letters he wrote her he mentioned being unable to relax after working on watching the demons running around and building various things he and Magus decide we need here(Isn't this meant to be a temporary base of operations?). Well, she came by with a small pouch of wood ash incense and a little brazier to help him with this, but what this provided was far more valuable than simple scented air. I joined Tiberious and Athis for the first use of the incense, and to her credit I started feeling relaxed breathing in the sweet scents it let off. Part way through I got up to visit the blood altar, being my turn in the roster to top out out communal soul network. After performing a sacrifice like normal, something odd happened: There was more LP in the altar then there should be, by a fair margin. Several sacrifices later, I couldn't get it to happen again, so I went in to mention it to Tiberious(While it might have been a simple miscalculation, we must always look deeper into it. This philosophy was passed down to us by Magus, and has saved us time, lead us to great discoveries like this, and at times has resulted in a lot of cheese.). He performed his own sacrifice in the altar, and again there was more LP then there should be. Long story, involving investigations into the local flora, positions of stars, and phase of the moon, short we discovered it was the incense of all things causing the discrepancy. As it turns out, being under the effects of this simple wood ash was resulting in a greater exchange of raw life essence for a given amount of blood, akin to how self sacrifice runes work. After some experimentation, we have a basic calculation for the process and method for the most profit. You must sit in range of the improved brazier I have designed after giving it wood ash until white particles are emitted(You can do the sacrifice before this, but you won't get the full effect). You then must sacrifice almost all of your blood in one quick burst(This is achieved by holding right click for several seconds, then releasing), after this Lp will be added to the altar based on the number of hearts sacrificed, plus the bonus of the self sacrifice runes in the altar, then this total is multiplied by the effect of highest quality incense you are under. An example: If you sacrifice nine hearts into an altar without any self sacrifice runes while under the full effect of wood ash, you would add 2160 LP to the altar instead of the normal 1800. This process isn't without issues, however, as this rapid expenditure of blood weakens you for a time, with an effect not unlike soul fray. +aw.entries.alchemy.incense.3=Now then, I mentioned "Highest quality incense" before. Well, after the revelation that mundane wood ash would offer a sizeable boon to LP creation, I descended into my lab to perfect the process by creating better incense. After three days, ten pots of coffee, and one nap I emerged with four new incenses: Byrrus, Livens, Viridis, and Purpura for bonuses to LP creation of 60%, 120%, 200%, 300% respectively, compared to the 20% of wood ash. There is a minor issue, however: You can't just make and use the strongest one and be done with it. You see, these are designed to be used with each other and wood ash in a sort of chain. Once you reach the peak of wood ash, Byrrus can start taking effect, once you are at it's peak Livens can start, and so on. I should also note that while the LP gains they offer are improved, the relative scents they can let off vary from par with the wood ash to as foul as a compost pile. Sacrifices must be made, and a few foul fumes is worth the gains. I should note that you can speed up the process by which you are effected by increasing the volume of vapours inhaled. In laymans terms, the more braziers active with the same incense around you the faster the effect can take hold. +aw.entries.alchemy.potions=That is it for the reagents, for now. The other use for the alchemical chemistry set I have found is the creation of potions unlike anything anything I have ever seen. While not big on taste(But really, has there ever been a potion that isn't hard to swallow?), the potions it makes are more... refined. Using a single flask(Made in a T2 blood altar with2K and a glass bottle, the first being made by accident when I dropped the bottle in the lab after tripping on a table leg that had been moved), a potion ingredient, and a binding agent I can turn the solution in the flask(A mixture of nether wart, redstone, and glowstone dust) into a potion that has eight uses or "Swigs" instead of the normal one per bottle. Another interesting power of these new potions is that the red and blue alchemy items I had acquired from the adventures(Who in turn got from some chest in a dungeon) can be used to "Augment" the potions by mixing them in with more of potions ingredient. The red ones I have dubbed "Power catalysts", making the potions effect much more potent at the cost of shortening the effect. The blue ones I have started calling "Lengthening catalysts", as they make the potions last much longer then normal. On another note, I have started trying to make a better binding catalyst after an idea came to me from a mishap in the lab. I had tried to make a slowness potion(We had a few villagers that had been pestering us, so I wanted to get rid of them without hurting them), but after adding in the sugar powered I tried mixing in a fermented spider eye. Trying to add it in with a weak binding catalyst, I noticed that instead of mixing with the speed potion it was forming it's own section the same color of a weakness potion. Then the flask exploded. If my theory holds true, these potions can hold more then one effect, but the solution destabilizes when an effect is added. Should the potion fully destabilize, it will cause a small explosion that shatters the flask and damages anyone close to it with the glass shards. If I can help keep the potion stable, I might have found a secret of alchemy countless mages have sought but never found.... +aw.entries.alchemy.reagentRevolution.1=I have been experimenting with what I can make with this new blood orb, a gift from Tiberius for my help with his sigils. Using this orb I have finally been able to recreate the power and lengthening catalyst. Sadly, I can only make the mundane versions of each, but one step at a time. I haven't actually made many new items for my potions and alchemy(Well, compared to the shift from weak to apprentice orbs) but everything I have found is extremely useful with my potions. Then there is what I've been making for my brother, but I wrote most of the uses of them in his book. I'll add the recipes here anyway, for completeness sake. +aw.entries.alchemy.reagentRevolution.2=The first step towards these new reagents was to make a better form of catalyst. Surprisingly, this was the easy part. By mixing in a netherwart and bonemeal into two simple catalysts, I could create two "Strengthened catalyst" with which to create new reagents and enhance old ones. +aw.entries.alchemy.reagentRevolution.3=Shortly after this discovery, I managed to make a reagent I have dubbed "Offensa" by mixing in two arrows, a flint, and a strengthened catalyst into an incendium. While the original reagents represented elements, these new reagents seem to represent ideas and concepts(With "War and battle" being given to offensa). +aw.entries.alchemy.reagentRevolution.4=More tinkering gave birth to Praesidium, which seems to represent "Defense and protection" and is created by mixing tennibrae into strengthened catalyst, iron ingot(Ground into a powder at the set), redstone dust, and a cobweb(This may or may not have fallen into the set when Bella was doing some cleaning, ending with this happy accident). +aw.entries.alchemy.reagentRevolution.5=By strengthening terrae with the better catalyst, sand, gun powder, and a netherrack chunks(Luckily, we still have some from the last hell harvest festival but I must remember to buy more in a few months), I have created orbis terrae. Where terrae seems to be the element of earth, orbis terrae is the environment itself, encompassing above and below ground from the dessert to the nether. +aw.entries.alchemy.reagentRevolution.6=After a few days of nothing, I managed to form a powder now called "Virtus" from two parts redstone, one part coal, and one part gun powder mixed into a strengthened catalyst. From what I can tell, this is the raw manifestation of power(Fitting, this reagent is hard to control and a few of our uses of it have backfired horribly). It holds in it a great deal of potential energy, but releasing it(And then controlling it) has proven to be very difficult. +aw.entries.alchemy.reagentRevolution.7=This next one is a little odd. Late one night in the lab I had been mixing things together to see the results, and something caused me to mix a gold ingot powdered in the stand, soul sand from our nether wart farm, redstone dust, and a carrot of all things in the strengthened catalyst. When I awoke the next day, I found three things: A reagent called reductus(The aspect of reduce and diminish), a large mess in the lab, and that this wasn't the strangest things I had mixed together. Since then I have started brewing pots of coffee before I begin working late in an attempt to stay lucid. +aw.entries.alchemy.reagentRevolution.8=The final reagent that I have created is called "Potentia", due to the energy that causes it to crackle and pop on its own(Note: As my brother accidentally discovered, this powder does have some electrical properties to it that caused his hair to stand on end when he was working with it). Created with two chunks of lapis lazuli, glowstone dust, a piece of nether quartz, and a strengthened catalyst, this powder is similar to virtus. The difference is that while virtus is raw power, potentia is energy. Ironically, virtus is the more stable of the two, only giving off energy in large bursts while potentia seems to give off a little at all times. +aw.entries.alchemy.newPotions=After a few weeks worth of work, I finally managed to upgrade the binding agent and have made one that lets me make more advanced potions with more then one effect. Unfortunately, it doesn't work every time. For the first effect it works every time, like the weak binding agent. For the second effect, it only works four times out of ten(On average). Then the third effects works only sixteen times out a hundred(Again, on average.) It also needs 1.5K LP to make the binding agent when mixing a weak binding agent, a sanctus and a crystallos. With how rare some of the ingredients of my potions are, I decided to create a "Filling agent" that replaces the solution in the potion flask so that I can get more uses out of them. I have noticed that potions with more then one effect require stronger filling agents, as every effect in the potion cuts down how effective the agent is. The weak filling agent is made with a simple catalyst, a pile of redstone and glowstone dust, and a piece of nether wart. The weak filling agent can then be upgraded with a terrae and 1K LP into a "Standard" filling agent. +aw.entries.alchemy.soulSand=I managed to find a new use for the weak blood shards that the others have been gathering. Since the shards are technically part of a "Soul", I tried mixing it in with a bucket of water and sand using my chemistry set to get a fairly close replication of an uncommon nether resource, soul sand. While not identical, it can serve the same purpose as the normal one found in the nether. +aw.entries.alchemy.timeGoesBy=It just occurred to me, it has been over three years since I came to Magus's doorstep with my brother and sister. I've gotten so use to living here, and the daily routine seems like something I've done all my life. Strange, I never thought I'd settle down. Five years ago, I'd have never considered leaving the caravan. I have barely left my lab in the last month, aside from when Magus, my brother or sister drag me out by the back of my robe. Normally I would go out willingly, but we recently finished our altar upgrade and have created the "Master Blood orbs". As is customary, this new orb has given me the boost in power needed to create more alchemy items for both general use and my potions. As a result, progress has been coming in leaps and bounds with something new almost every other day. After many late nights and early mornings, theses are the fruits of my labor. +aw.entries.alchemy.catalysts=I managed to improve the catalyst even further by mixing in a gold nugget and the fragments of a bone into the strengthened catalyst, making it into a much more concentrated form, hence the name "Concentrated catalyst". With it, I have been able to infuse the imbued slates created in the blood altar with alchemical power, making it stronger then normal and able to construct devices to hold alchemical and magical energy. On the potion items, I can finally make all the forms of the power and lengthening catalysts, filling agents. By merging two of a catalyst with a standard binding agent you can make the standard form of said catalyst, and then you can create the greater form of the catalyst by fusing two of the standard with a reagent(Incendium for power and Aquasalus for lengthening). Adding these to a potion is the same process as the mundane, place the potion and the ingredient in the stand with the catalyst of choice. Note: You don't need to teir up from normal to the greatest, you can jump strait to the greatest effect by mixing in a greater catalyst. Adding a better catalyst to an old potion does nothing for the effect, and is the same as if you added it to a potion that never had a catalyst added. The greater filling agent is able to resort six charges to a one effect potion, and is made by adding aquasalus and magicalus to a standard filling agent. The remainder of my time has been spent brewing potions. Bella has almost finished the demon summoning area, and I have been creating a few reagents for that and brewing potions to buff myself during the fights. Bella has mentioned a beast called an "Elemental", and it has me slightly worried. A few new bruises later, and I now have a demon blood shard to call my own. I also have one procured by Magus to improve his ritual activation crystal with, and I will need to use a few reagents to merge the blood shard with the crystal, and some experimentation will be needed to find out what... +aw.entries.alchemy.activationCrystal=A few tries later, and the binding of the demonic power to the crystal works with Aquasalus, Incendium, and Aether. In theory a nether star can be used in place of a demon blood shard, but considering how hard those are to get a hold of... Magus has been thrilled with his new crystal, and I have started work on a new project with Tiberius as a surprise for Magus. His rituals as they stand are good, but I have had an idea to make them even better... I'm having a hard time sleeping tonight, so I might as well go over our idea and hope Magus doesn't read this. As it stands, the rituals only use life essence to run and are often "One trick ponies". What I proposed to Tiberius is this: What would happen if one of the rituals was charged with alchemical power, costing reagent to give it new or stronger effects? We might get nothing, or something amazing. Time will tell which it is. +aw.entries.alchemy.reagentSystem.1=It has taken the last two months, but we have the ground work for testing our idea done. The results so far have been even better then expected. We only have tested the full spring ritual and have discovered quite a few effects, but I'll let Magus cover those. +aw.entries.alchemy.reagentSystem.2=Instead, I'll write how the reagent system works. You first need an alchamic calcinator, then place a blood orb into it to act as a power source. After that, reagents can be placed by hand or fed into the calcinator to turn into pure alchemical energy, the type based on the reagent fed in. Once it has a solid reagent, it will use LP to turn one reagent into 1000AR(Alchemy Reagent) which is then moved into the 2000AR "Buffer" of the calcinator. Once in the buffer, the reagent slowly starts being moved into the main tank which can then be siphoned out. +aw.entries.alchemy.reagentSystem.3=Now then, to move it out of the main tank you need to have somewhere for it to go. To this extent, you have three options: A crystal belljar, a alchemic relay, or a master ritual stone. How you need to link it is simple: Create a alchemic router, then Shift right click with it on the calcinator to select the reagent type for it to transport(A note for blocks with more then one tank and more then one reagent type: Shift right clicking again on the block will swap between the available reagents inside the block.), then normal right click on the block with the router to bind it to the block. After that, right click on the destination(Needs to be within a few blocks, the range isn't that large). If it has worked, you should see reagent "Flowing" to the destination from the source(In this case the calcinator). We have tweaked it to where you can't see reagent moving with the naked eye, you need to have a tool(Like the Alchemic router) in hand to see this effect. You can also use a divination sigil on the belljars, relays, calcinator, and master ritual stone to read how much reagent the device holds. This process of binding can be applied to all the other blocks so I shouldn't need to cover it further, but I should note that these blocks can only accept and send reagent to so many locations at once. For example, the belljar can only accept reagent from one location, and send it to one location. I must also reiterate that if you have a relay set to send aether to destination A and Tennibrae to destination B, aether can never traval to B and vicversa for Tennibrea. New connections must be made for each reagent type, and we could not get a "Colorless" version of a connection to function. +aw.entries.alchemy.reagentSystem.4=Getting more into detail about the blocks and items of our new system, I'll cover the bell jar first. Created out of mundane glass and wood slaps, then filled with a concentrated catalyst solution to contain the alchemical energy in a stable enough environment to allow you to move the jar without losing any energy inside. While it can hold only one type of reagent and is restricted to one source and one destination, it functions as a portable form of "Bulk storage"(Able to hold 16000AR). An option for more storage is to link a few belljars together, but I feel this is a far from perfect answer to the problem of mass storage of reagent.... I will need to talk with Tiberius and Magus about this later. Regardless, Tiberius managed to incorporate a bit of redstone interaction into the design of the jar. Based on the amount of reagent inside the jar, it outputs a redstone signal(15 when full, 0 when empty, and so on). With a bit of work, you can use this for automated systems. +aw.entries.alchemy.reagentSystem.5=The "Alchemy Relay" acts as a small buffer(Two tanks that can hold two reagent each), and can be used to merge and divide a transport line of reagent energy. Each relay can have limitless sources, and four destinations. With the creative use of relays, you can create a large power network for transporting reagent. Tiberius has worked his magic on this device as well, and tweaked it to not send reagent when a redstone signal is applied(It also spins slightly slower to represent this). +aw.entries.alchemy.reagentSystem.6=To assist with the use of this system, we have three items to manage these devices. The Alchemic Router is used to bind the destinations of set reagents for all devices. The Alchemic Segmenter is used to partition tanks to a set reagent. All you need to do is set the reagent type the same way you would the router, then right click the device you want to partition a tank for that reagent type. One tank will be set for that type per right click, and if you exceed the maximum number of available tanks it will reset all tanks partitioned tanks to the default "First come first served". I should also note that if you set a relay to accept sanctus, offensa and vistus, the two available tanks will distributed to whichever reagents that get there first. The final item is the alchemic cleanser, and its use is simple but very useful: It resets all destinations. All locations the device is set to send reagent are cleared, so you can easily bind the device to new locations. +aw.entries.alchemy.reagentSystem.7=Now, we have made a few minor alterations to the "Master ritual stone" to enable our system to function. Its recipe and normal uses have remained the same, but it now has three internal tanks that each hold 1000AR. If the ritual has any reagent, it will display an "Alchemy Ring" above the master ritual stone as a sign that it has been augmented. Then depending on the ritual and the effect in question, it will use an amount of reagent to perform a new effect or augment an old one. An example of this is the full spring fulled with aquasalus will convert earth into farmland then hydrate it in a nine by nine around the master ritual stone, but if the full spring is given crystallus it will freeze all water source blocks around it. This all is paired with the base effect of the rituals, so the full spring can still function as an endless water source. This is all I can think of to write down about our new system. Tiberius and I plan to show it to the others tomorrow, so I need to get some rest. We showed our new system to Magus and my siblings today, and to say they loved it was an understatement. We had decided to be a little flashy with the show, building a full spring next to a small pond that had formed from the recent rainfall. After a bit of work hiding the relays and the belljar, Tiberius hid out of sight while I showed the others to the demonstration. I asked Magus to activate the ritual, keeping a close eye to see if he focused on anything in particular, but he quickly and effortlessly activated the ritual without pausing for a moment. After he returned to my side, I yelled for Tiberius to throw the switch. In an instant the reagent flowed to the ritual, and as the alchemy circle formed in the air the water created by the ritual and that of the pond quickly froze over. I heard gasps from both of my siblings, and I noticed Magus's eyes widen for just a moment(His equivalent of a jaw hanging slack) before he composed himself. Afterword we went over the details for them of how it works for the other, explaining the minor modifications we had made to the basic master ritual stone design and such. +aw.entries.alchemy.magusSecret=It has been a week since we ironed out most of the kinks with the reagent system, and Magus brought all of us together around the dinner table to go over the next few months. He said that he could get us something he felt would be needed to upgrade the altar to teir five, but it would take a little over a year to get them. He also mentioned that we should be getting a few messages after this years Hell harvest festival, which I thought was a little odd. "A little odd" doesn't begin to describe what has been happening the last few days. It seems most of us have put research on the side while we watch some of the "Replies" come in. They have come in via air drop, mechanized mail carriers, train and countless other ways that always seem stranger then the last. Tiberius managed to ask Magus what this was all about and he simply replied that he invited a few guests over, and these were the replies they had sent. When pressed for more details, he just said they wouldn't be coming for a few months, so we should start mastering what we can do with our blood orbs. We then started showing each other the little details of the branches of blood magic we had created and had been perfecting. In the last few months I have befriended a few demons with the help of my sister, created a few spell crystals and help construct a large complex spell with my brother, and then forged armor and sigils with Tiberius. Then it came time to teach the other alchemy and potion brewing.... I was reluctant to give out my secrets to brewing potions, even to them. I had told no one of the recipes for these brews, brewing potions for the others myself when they needed them. I almost wanted to tell the others no, but then Magus made me an offer. "I understand how you want to keep the secrets of your brews hidden, so how about we make a trade of knowledge instead?" he asked me when I was contemplating this matter. He offered me details about himself, somethings that wasn't common knowledge and even gave me permission to write everything down. Considering how little I knew of him, even after all these years, I quickly took him up on this offer. The very next day I had everyone in my personal lab, showing then the details and reciting the recipes for some of the most potent effect I had found then demonstrating there uses. I was done showing them everything shortly before dinner, so while we ate in the common room Magus told us his story. I'll jot as much of it as I can recall here, for you to enjoy as well. "So it is time to tell my story... I always hate doing this. So many questions that I really don't have answers for, and frankly it is a long bloody story. But a deal is a deal, and you all deserve to hear it. I have only told a handful of people this, all of them were either mages or Conglomeration members. You will so count among this number... I was born in the middle of the Talus kingdom, before all these corporations were founded and started forming their own governments. Back then gods and kings dictated law, and wars were fought on the battle field and not in markets shares and advertisement campaigns. My family was small, all I had was a mother who did all she could at home and a father who worked at the royal library. I ended up spending many hours in that library, both helping my father with his work and studying the countless tomes that adorned those shelves. At an early age I discovered a hidden treasure trove in those shelves: Books on magic. At the time magic wasn't well known, and most regarded it as nothing but myths created by fools. Because of this, theses books stayed lost and forgotten on these shelves until I came along. While other boys were learning the right way to hold a sword or a pickaxe, I spent my time studying the arcane. At the end of my first year there, I had already created a basic fireball spell and a thaumanonicon. I managed to keep my activates in magic hidden from everyone, my parents include, until I had come of age and needed to find a profession. It was then that I told them of what I had been working on all those years, showing them some of the smaller tricks I had perfected. To say they were shocked is an understatement, so I felt it best to leave their little world in the kingdom and set out to find a new home to practice magic without needing to be as secretive. That is how I came to Lurric, and it has been my home ever since then. The early days were hard, as I really didn't have the funds to live off of let alone support my research. I managed to get by helping the locals, merchants with book keeping and identifying some of the more obscure relics and "Treasures" they had for sale, farmers with stock and management, and even as a cook when times were really dark for me. But this only lasted a year or two, then I had the infrastructure in place to support myself with a little extra to live on. Amazing how much traders are willing to spend floating balls of flame and purple metal.... Skipping ahead a few years through the dull portion, I had begun to master a few forms of magic like thaumurgy and botany. My name had started to spread to the other nearby villages, and people asking for favors and knowledge started popping up at my door like they do now. At the time I never asked for gifts or compensation, but I didn't turn down food or books if they were offered. Traders started traveling to Lurric more and more, hoping to acquire a few goods that only I could provide at the time in exchange for gold, jewels, and rare books. Those who brought the third I gave the best deals. Still, life went on like this for a few more years with books starting to pile up in my library, more then enough gold to pay for my more "Exotic" materials, and never having a day of rest for the full decade I had first lived here. That peace was shattered the day a man by the name of Gareth broke down my door. He came in, adorned in full iron armor and long sword in hand, to challenge me to a dual to the death. It took more then a few sleep spells to knock him out of his rage, at which point I restrained him to a reclined chair I had in the back that I used when treating wounded. When he finally awoke, I started interrogating him. Well, interrogate isn't quite the right word for it.... Honestly, I just asked him a few questions. Once I saw that he had calmed down, I untied him and offered food. Did I mention the sounds his stomach made while he was unconscious? They were strong enough to rattled the chair. After eating a whole bread loaf and a large part of the stew I had been preparing before he arrived, we sat in this very room to talk like civil beings over why he decided to break down my door. His story is about as ludicrous as mine is. He was one of fifty seven immortal beings who walked the earth. He told me what details about he could, but he seemed unsure about it as well. What he did tell me was that the gift of immortality comes with a few boons aside from the obvious, and what they are differ from person to person. He said his gift was that of prophecy, and he recently had a vision of the future where I and people I influence would play a major role. As a result, he came here to challenge me to a dual to the death. I then asked him if that wasn't a bit unfair, him being immortal and all. He, in the most serious tone possible, said that it was completely fair: While an immortal can not be killed normally, there are set way that it can happen. One way is by a one on one dual to the death, with immortality wagered as the prize. They really don't have much choice in this, as it is like natural magic: The mere act of it the dual happening is enough for the "Wager" to take place. If both parties exert their full strength, then the killing blow is enough to complete the wager and transfer the gift. We talked for the next few hours, and I learned quite a few interesting facts. He had no idea who the other fifty six immortals were, and he frankly had no way to tell them apart from normal humans. He also mentioned that he could still be injured outside of the dual, but he would not fall to mortal wounds and heal at an accelerated rate. Not much of one however, as he mentioned breaking a leg once and it taking over a month to fully heal. Another note was how short a time he had been immortal, he had gained it about two decades ago. While to you that seems like a long time, he said the one he killed was alive for over a century. We finally ended that night with an agreement: In one weeks time he would return to my home, where we would share a fine meal, then have our dual the next morning. He wanted to get strait to the dual, but I had the meal as a non-negotiable point that he finally caved on. I spent the next week preparing for the battle, arming myself with the most potent spells and artifacts at my disposal from several schools of magic. In a flash that week went by, then Gareth once again sat with me to eat at my table. I gave him a bed to sleep in that night, then at dawn we both walked to the hill just behind this house where Bella's garden currently lays. Of all things about Gareth, our battle was one things I barely remember. Once we reached the top of the hill, we both brew our blades and turned to each other. After that, I only remember flashes and out of order scenes. It felt like it was over in only a few minutes, but it might have been hours and was one of the most brutal fights I have ever been a part of . His agility was far greater then I expected, dodging my swings and spells with ease. Unfortunately for him I was still a force to be reckoned with back then. I never let up on my spells, casting fire, ice and lightning one after another using my foci then teleporting around with a few spells. In the end, he died when he dropped his sword in reflex to the heat my flame spell had left on it and I capitalized on this. By this point we both felt taxed by the fight, and he could barely avoid my slowest attacks. The final blow I dealt was out of mercy, a quick end for his suffering that I had caused. I watched as Gareth grinned at me like he knew this would be how he died, then he closed his eyes as his body turned into sand carried away in the wind. I feel to my side after that, strength sapped and mana depleted, to awake a few hours later. I felt a new strength in my body when I got up, slight but still there. All in all, suddenly having immortality was rather lack-luster, but that was how it happened." At this point I was shocked into silence at his words. Not what he said, but how he said them: Little feeling or emphasis. It was like he just said that he gained a new scar or it started to rain. He has been more emotional over the acquisition of a rare book then immortality. Glancing at the others, I could tell they were mulling over this information as well. After a few minutes, my brother spoke up to start the questions. "So... Did your life change much after that?" Demir asked Magus, before taking a bite out of a sandwich he seem to have created from thin air. "Not really. Life as an immortal was just the same as life as a mortal. More researching, more learning, more magic.". "Have you met any more immortals since then?" Bella asked. "Two, and I happen to be related to both of them." "Related?" asked Tiberius with curiosity, "I never knew you had any relatives." "Well, they never came up. One of them is my brother, who started studying the Myst a few decades ago and hasn't been heard from since. I expect he will pop by any time he feels homesick for a few days, then drop out of touch again." "And the other immortal?" Bella asked with interest. "The other is my wife." Once again we all went into stunned silence, Tiberius and Demir slack-jawed. "You're married! Since when?" Bella asked after a moment. "Few centuries ago. We met when a small war was being fought with a necromancer, and she was the one leading the forces. Of course, most people at the time didn't know her real gender. She tried hard to keep it hidden, so the troops wouldn't think of her any differently. I was brought in to help deal with the "Undead army" details of the whole thing, and that had me working with her. One thing lead to another, and we were married a few months after the war was over. Currently she works as a commander of the Conglomeration's defense force, so she is rarely has time to come home." The questions continued for the next half hour, ranging from "Did you really open the first nether portals" to "Why are you on the Conglomeration board?". Magus took all are questions with the air of a man who has done this all before. When the questions were over, all the others started retiring to their rooms while I stopped by the library to look up something. The Talus kingdom fell almost a millennium ago. Wow... It has been a few months since I last wrote in this book. I've met more people in the last few weeks then I have in the last few years, many of them from lands I have never set foot in! Kings and queens, rulers and underlords, CEO's and owners from every nation. Then there was the fight with the withers... I'm not sure what to say about all that. I sort of walked in there, chugged a few potions then let the years of training with Magus take over. By the time the adrenalin rush was over for me, we had killed all of the withers and I was barely aware of a dull pain in my leg. Magus has used a spell to restrict my movement so I won't leave this bed while my broken leg heals since I "May" have tried to sneak into my lab once or twice to get to work. For now I must be content with my notebook and what Magus brings me from his library to past the days... +aw.entries.alchemy.simpleCreations=I've only had a little time at my chemistry set, so I haven't had much time to experiment with my new orb. All my tests trying to make new reagents failed, and I so far have only managed to make two new runic slates for my brother(But we have been trying to find new uses for them). The normal runic slate is a simple upgrade to the old cracked slates by infusing terrae into them. The final slate, dubbed imbued, is two runic slates bound together with magicales, incendium, and aquasalus. These days I've been working with the other on a few secret projects, so I have needed to keep up with and research all kinds of strange subjects. I also always seem to need to make more reagents, as our experiments burn through them rather quickly... I will write more when I have the time. + +guide.BloodMagic.entryName.architect.intro=A Classic Tragic Back-story +guide.BloodMagic.entryName.architect.bloodAltar=The Blood Altar +guide.BloodMagic.entryName.architect.soulNetwork=The Soul Network +guide.BloodMagic.entryName.architect.blankSlate=Basics of Sigils +guide.BloodMagic.entryName.architect.divination=The Divination Sigil +guide.BloodMagic.entryName.architect.waterSigil=Training, and a Water Sigil +guide.BloodMagic.entryName.architect.lavaCrystal=The Lava Crystal +guide.BloodMagic.entryName.architect.hellHarvest=Hell's Harvest Festival +guide.BloodMagic.entryName.architect.lavaSigil=The Lava Sigil +guide.BloodMagic.entryName.architect.blankRunes=Blank Runes - the Step to Tier 2 +guide.BloodMagic.entryName.architect.speedRunes=Speed Runes +guide.BloodMagic.entryName.architect.apprenticeOrb=The Apprentice Blood Orb +guide.BloodMagic.entryName.architect.voidSigil=The Void Sigil +guide.BloodMagic.entryName.architect.airSigil=Air Sigil +guide.BloodMagic.entryName.architect.sightSigil=Sigil of Sight +guide.BloodMagic.entryName.architect.advancedAltar=Advanced Altar Mechanics +guide.BloodMagic.entryName.architect.fastMiner=Sigil of the Fast Miner +guide.BloodMagic.entryName.architect.soulFray=Soul Fray +guide.BloodMagic.entryName.architect.greenGrove=Sigil of the Green Grove +guide.BloodMagic.entryName.architect.dagger=Dagger of Sacrifice +guide.BloodMagic.entryName.architect.sacrifice=Runes of Sacrifice +guide.BloodMagic.entryName.architect.bloodPack=The Blood Letter's Pack +guide.BloodMagic.entryName.architect.fivePeople=And Then there was Five +guide.BloodMagic.entryName.architect.tier3=The Next Step: Tier 3 +guide.BloodMagic.entryName.architect.magicianOrb=The Magician's Blood Orb +guide.BloodMagic.entryName.architect.newRune=New Runes +guide.BloodMagic.entryName.architect.magnetism=Sigil of Magnetism +guide.BloodMagic.entryName.architect.phantomBridge=The Phantom Bridge +guide.BloodMagic.entryName.architect.holding=Sigil of Holding +guide.BloodMagic.entryName.architect.elementalAffinity=Sigil of Elemental Affinity +guide.BloodMagic.entryName.architect.ritualStones=Recreating Ritual Stones +guide.BloodMagic.entryName.architect.bloodLamp=Shining a Blood Lamp +guide.BloodMagic.entryName.architect.boundArmour=Bound Armour +guide.BloodMagic.entryName.architect.sanguineArmour=Sanguine Robes +guide.BloodMagic.entryName.architect.soulSuppress=Suppressing the Soul +guide.BloodMagic.entryName.architect.ritualDiviner=The Ritual Diviner +guide.BloodMagic.entryName.architect.bloodShard=Blood Shards +guide.BloodMagic.entryName.architect.tier4Altar=The Life of a Mage - Tier 4 +guide.BloodMagic.entryName.architect.masterOrb=The Masters of the Tier 4 Altar +guide.BloodMagic.entryName.architect.whirlwind=Sigil of the Whirlwind +guide.BloodMagic.entryName.architect.compression=Sigil of Compression +guide.BloodMagic.entryName.architect.severance=Sigil of Ender Severance +guide.BloodMagic.entryName.architect.teleposer=The Teleposer +guide.BloodMagic.entryName.architect.suppression=Sigil of Suppression +guide.BloodMagic.entryName.architect.superiorCapacity=Rune of Superior Capacity +guide.BloodMagic.entryName.architect.orbRune=Rune of the Orb +guide.BloodMagic.entryName.architect.fieldTrip=A Field Trip +guide.BloodMagic.entryName.architect.bindingKey=The Key of Binding +guide.BloodMagic.entryName.architect.tier5Altar=The Trials of a Tier 5 Altar +guide.BloodMagic.entryName.architect.priceOfPower=The Price of Power +guide.BloodMagic.entryName.architect.demonicOrb=The Archmage's Orb +guide.BloodMagic.entryName.architect.energyBazooka=Power of the Energy Bazooka +guide.BloodMagic.entryName.architect.accelerationRune=Acceleration Runes +guide.BloodMagic.entryName.architect.harvest=The Harvest Godess +guide.BloodMagic.entryName.architect.demonProblem=Solving a Demon Problem +guide.BloodMagic.entryName.architect.tier6Altar=Tier 6 Already +guide.BloodMagic.entryName.architect.moreThanHuman=More Than Human: Project Omega + +guide.BloodMagic.entryName.rituals.intro=Introduction +guide.BloodMagic.entryName.rituals.weakRitual=Weak Rituals +guide.BloodMagic.entryName.rituals.rituals=Rituals +guide.BloodMagic.entryName.rituals.waterRitual=Ritual of the Full Spring +guide.BloodMagic.entryName.rituals.lavaRitual=Serenade of the Nether +guide.BloodMagic.entryName.rituals.groveRitual=Ritual of the Green Grove +guide.BloodMagic.entryName.rituals.interdictionRitual=Ritual of Interdiction +guide.BloodMagic.entryName.rituals.containmentRitual=Ritual of Containment +guide.BloodMagic.entryName.rituals.bindingRitual=Ritual of Binding +guide.BloodMagic.entryName.rituals.beastMode=Beast Mode +guide.BloodMagic.entryName.rituals.unbindingRitual=Ritual of Unbinding +guide.BloodMagic.entryName.rituals.jumpRitual=Ritual of the High Jump +guide.BloodMagic.entryName.rituals.duskInk=Dusk Ink +guide.BloodMagic.entryName.rituals.magnetismRitual=Ritual of Magnetism +guide.BloodMagic.entryName.rituals.crusherRitual=Ritual of the Crusher +guide.BloodMagic.entryName.rituals.speedRitual=Ritual of Speed +guide.BloodMagic.entryName.rituals.shepherdRitual=Ritual of the Shepherd +guide.BloodMagic.entryName.rituals.darkMagic=Dark Side of Magic +guide.BloodMagic.entryName.rituals.knifeAndSufferingRitual=Feathered Knife and Well of Suffering +guide.BloodMagic.entryName.rituals.regenerationRitual=Ritual of Regeneration +guide.BloodMagic.entryName.rituals.harvestFestival=The Hell's Harvest Festival +guide.BloodMagic.entryName.rituals.thenThereWereFive=And Then there were Five +guide.BloodMagic.entryName.rituals.alchemyRitual=The Ballad of Alchemy +guide.BloodMagic.entryName.rituals.domeRitual=Dome of Suppression +guide.BloodMagic.entryName.rituals.awakenedCrystal=Awakened Activation Crystal +guide.BloodMagic.entryName.rituals.featheredEarthRitual=Ritual of the Feathered Earth +guide.BloodMagic.entryName.rituals.gaiaRitual=Gaia's Transformation +guide.BloodMagic.entryName.rituals.condorRitual=Reverence of the Condor +guide.BloodMagic.entryName.rituals.meteorRitual=Mark of the Fallen Tower +guide.BloodMagic.entryName.rituals.expulsionRitual=Aura of Expulsion +guide.BloodMagic.entryName.rituals.costOfProgress=The Cost of Progress +guide.BloodMagic.entryName.rituals.zephyrRitual=Call of the Zephyr +guide.BloodMagic.entryName.rituals.harvestRitual=Reap of the Harvest Moon +guide.BloodMagic.entryName.rituals.eternalSoulRitual=Cry of the Eternal Soul +guide.BloodMagic.entryName.rituals.ellipsoidRitual=Focus of the Ellipsoid +guide.BloodMagic.entryName.rituals.evaporationRitual=Song of Evaporation +guide.BloodMagic.entryName.rituals.sacrosanctityRitual=Ward of Sacrosanctity +guide.BloodMagic.entryName.rituals.evilRitual=Veil of Evil +guide.BloodMagic.entryName.rituals.stomachRitual=Requiem of the Satiated Stomach +guide.BloodMagic.entryName.rituals.reagentEffects=The Effects of Reagents +guide.BloodMagic.entryName.rituals.conclaveOfMages=The Conclave of Mages +guide.BloodMagic.entryName.rituals.forbiddenParadise=Forbidden Paradise +guide.BloodMagic.entryName.rituals.convocationRitual=Convocation of the Damned +guide.BloodMagic.entryName.rituals.longHaul=The Long Haul +guide.BloodMagic.entryName.rituals.phantomHandsRitual=Orchestra of the Phantom Hands +guide.BloodMagic.entryName.rituals.anvilRitual=Rhythm of the Beating Anvil +guide.BloodMagic.entryName.rituals.dawnInk=Dawn Ink +guide.BloodMagic.entryName.rituals.symmetryRitual=Symmetry of the Omega +guide.BloodMagic.entryName.rituals.stallingRitual=Duet of the Fused Souls +guide.BloodMagic.entryName.rituals.newMoonRitual=Blood of the New Moon + +guide.BloodMagic.entryName.demons.ashes=The Girl From the Ashes +guide.BloodMagic.entryName.demons.tamedDemon=The First Tamed Demon +guide.BloodMagic.entryName.demons.future=A Glimps into the Future +guide.BloodMagic.entryName.demons.knight=A Wandering Knight +guide.BloodMagic.entryName.demons.demonShard=Pale Blue Demonic Shard +guide.BloodMagic.entryName.demons.demonSummoning=Demon Summoning and Taming +guide.BloodMagic.entryName.demons.keysGate=The Keys to the Gate +guide.BloodMagic.entryName.demons.futurePlans=Future Plans +guide.BloodMagic.entryName.demons.demonInvasion=The Demon Invasion +guide.BloodMagic.entryName.demons.observations=Observations of the Demons + +guide.BloodMagic.entryName.spells.demonGirl=Wandering and Demon Girls +guide.BloodMagic.entryName.spells.spellTable=Spell Table Top Games +guide.BloodMagic.entryName.spells.simpleEffects=Spell Effects for Beginners +guide.BloodMagic.entryName.spells.tableAndSkulls=To Make a Table and Skulls +guide.BloodMagic.entryName.spells.timePasses=And so Time Passes +guide.BloodMagic.entryName.spells.complexSpellBasics=Complex Spells, the Basics +guide.BloodMagic.entryName.spells.crafting=Vlad's Guide to Crafting +guide.BloodMagic.entryName.spells.complexSpellEffects=Effects of Complex Spells +guide.BloodMagic.entryName.spells.offTopic=Off topic, This is my Life +guide.BloodMagic.entryName.spells.demonicPower=Demonic Power Unleashed + +guide.BloodMagic.entryName.alchemy.fatedMeeting=A Fated Meeting +guide.BloodMagic.entryName.alchemy.firstSteps=First Steps of Alchemy +guide.BloodMagic.entryName.alchemy.chemistrySet=Uses of the Chemistry Set +guide.BloodMagic.entryName.alchemy.incense=Incense Inside +guide.BloodMagic.entryName.alchemy.potions=The Power of Potions +guide.BloodMagic.entryName.alchemy.reagentRevolution=Reagent Revolution +guide.BloodMagic.entryName.alchemy.newPotions=New Potion Improvements +guide.BloodMagic.entryName.alchemy.soulSand=Soul Sand +guide.BloodMagic.entryName.alchemy.timeGoesBy=As Time goes By +guide.BloodMagic.entryName.alchemy.catalysts=Upgrading the Catalysts +guide.BloodMagic.entryName.alchemy.activationCrystal=Activation Crystal Upgrade +guide.BloodMagic.entryName.alchemy.reagentSystem=The Reagent System +guide.BloodMagic.entryName.alchemy.magusSecret=Magus's Secret +guide.BloodMagic.entryName.alchemy.simpleCreations=Simple-ish Creations + +guide.BloodMagic.category.architect=The Architect +guide.BloodMagic.category.rituals=The Ritual Master +guide.BloodMagic.category.demons=The Demon Kin +guide.BloodMagic.category.spells=The Battle Mage +guide.BloodMagic.category.alchemy=The Alchemist + +guide.BloodMagic.welcomeMessage= +guide.BloodMagic.book.title=Sanguine Scientiem +guide.BloodMagic.book.name=Sanguine Scientiem +guide.BloodMagic.authorName= + diff --git a/src/main/resources/assets/forge/lang/en_US.lang b/src/main/resources/assets/forge/lang/en_US.lang new file mode 100644 index 00000000..2f9368d4 --- /dev/null +++ b/src/main/resources/assets/forge/lang/en_US.lang @@ -0,0 +1,5 @@ +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s : Mean tick time: %d ms. Mean TPS: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. \ No newline at end of file diff --git a/src/main/resources/assets/forge/lang/es_ES.lang b/src/main/resources/assets/forge/lang/es_ES.lang new file mode 100644 index 00000000..de2e5178 --- /dev/null +++ b/src/main/resources/assets/forge/lang/es_ES.lang @@ -0,0 +1,212 @@ +#Block Localization +tile.bloodAltar.name=Altar de Sangre +tile.bloodRune.blank.name=Runa de Sangre +tile.bloodRune.fill.name=Runa de Capacidad Aumentada +tile.bloodRune.empty.name=Runa de Dislocación +tile.bloodRune.orb.name=Runa del Orbe +tile.bloodRune.betterCapacity.name=Runa de Capacidad Superior +tile.speedRune.name=Runa de Velocidad +tile.efficiencyRune.name=Runa de Eficiencia +tile.runeOfSacrifice.name=Runa de Sacrificio +tile.runeOfSelfSacrifice.name=Runa de Auto-Sacrificio +tile.ritualStone.name=Piedra Ritual +tile.blockMasterStone.name=Piedra Ritual Maestra +tile.bloodSocket.name=Cuenca Llena +tile.imperfectRitualStone.name=Piedra Ritual Imperfecta +tile.armourForge.name=Forja de la Armadura del Alma +tile.emptySocket.name=Cuenca Vacía +tile.bloodStoneBrick.name=Ladrillo de Piedra de Sangre +tile.largeBloodStoneBrick.name=Ladrillo de Piedra de Sangre Grande +tile.blockWritingTable.name=Set de Química Alquímica +tile.blockHomHeart.name=Mesa de Hechizos +tile.bloodPedestal.name=Pedestal Arcano +tile.bloodPlinth.name=Plinto Arcano +tile.bloodTeleposer.name=Teleposador +tile.blockConduit.name=Conductor de Hechizos +tile.blockSpellParadigm.projectile.name=Generador de Partículas +tile.blockSpellParadigm.self.name=Auto-Aumentador +tile.blockSpellParadigm.melee.name=Agregador de Tumultos +tile.blockSpellParadigm.tool.name=Forjador de Herramientas +tile.blockSpellEnhancement.power1.name=Fortalecedor de Hechizos Inestables +tile.blockSpellEnhancement.power2.name=Fortalecedor de Hechizos Estándar +tile.blockSpellEnhancement.power3.name=Fortalecedor de Hechizos Reforzado +tile.blockSpellEnhancement.power4.name=Fortalecedor de Hechizos Imbuido +tile.blockSpellEnhancement.power5.name=Fortalecedor de Hechizos Demoníaco +tile.blockSpellEnhancement.cost1.name=Debilitador de Hechizos Inestable +tile.blockSpellEnhancement.cost2.name=Debilitador de Hechizos Estándar +tile.blockSpellEnhancement.cost3.name=Debilitador de Hechizos Reforzado +tile.blockSpellEnhancement.cost4.name=Debilitador de Hechizos Imbuido +tile.blockSpellEnhancement.cost5.name=Debilitador de Hechizos Demoníaco +tile.blockSpellEnhancement.potency1.name=Aumentador de Hechizos Inestable +tile.blockSpellEnhancement.potency2.name=Aumentador de Hechizos Estándar +tile.blockSpellEnhancement.potency3.name=Aumentador de Hechizos Reforzado +tile.blockSpellEnhancement.potency4.name=Aumentador de Hechizos Imbuido +tile.blockSpellEnhancement.potency5.name=Aumentador de Hechizos Demoníaco +tile.blockSpellModifier.default.name=Modificador de Hechizos por Defecto +tile.blockSpellModifier.offensive.name=Modificador de Hechizos Ofensivos +tile.blockSpellModifier.defensive.name=Modificador de Hechizos Defensivos +tile.blockSpellModifier.environmental.name=Modificador de Hechizos Ambientales +tile.blockSpellEffect.fire.name=Crisol de Fuego +tile.blockSpellEffect.ice.name=Creador de Hielo +tile.blockSpellEffect.wind.name=Generador de Viento +tile.blockSpellEffect.earth.name=Formador de Tierra +tile.alchemicCalcinator.name=Calcinador Alquímico +tile.crystalBelljar.name=Campana de Cristal +tile.blockReagentConduit.name=Relé Alquímico +tile.lifeEssenceFluidBlock.name=Esencia Vital + +#Item Localization +item.weakBloodOrb.name=Orbe de Sangre de Débil +item.apprenticeBloodOrb.name=Orbe de Sangre de Aprendiz +item.magicianBloodOrb.name=Orbe de Sangre de Mago +item.masterBloodOrb.name=Orbe de Sangre de Maestro +item.archmageBloodOrb.name=Orbe de Sangre de Archimago +item.energyBlast.name=Dinamitador de Energía +item.energySword.name=Hoja Vinculada +item.lavaCrystal.name=Cristal de Lava +item.waterSigil.name=Sello de Agua +item.lavaSigil.name=Sello de Lava +item.voidSigil.name=Sello del Vacío +item.blankSlate.name=Pizarra en Blanco +item.reinforcedSlate.name=Pizarra Reforzada +item.sacrificialDagger.name=Cuchillo de Sacrificios +item.daggerOfSacrifice.name=Daga de Sacrificio +item.airSigil.name=Sello de Aire +item.sigilOfTheFastMiner.name=Sello del Minero Rápido +item.sigilOfElementalAffinity.name=Sello de Afinidad Elemental +item.sigilOfHaste.name=Sello de Rapidez +item.sigilOfHolding.name=Sello de Propiedad +item.divinationSigil.name=Sello de Adivinación +item.waterScribeTool.name=Herramienta de Inscripción Elemental: Agua +item.fireScribeTool.name=Herramienta de Inscripción Elemental: Fuego +item.earthScribeTool.name=Herramienta de Inscripción Elemental: Tierra +item.airScribeTool.name=Herramienta de Inscripción Elemental: Aire +item.duskScribeTool.name=Herramienta de Inscripción Elemental: Crepúsculo +item.activationCrystalWeak.name=Cristal de Activación Débil +item.activationCrystalAwakened.name=Cristal de Activación Despertado +item.boundPickaxe.name=Pico Vinculado +item.boundAxe.name=Hacha Vinculada +item.boundShovel.name=Pala Vinculada +item.boundHelmet.name=Casco Vinculado +item.boundPlate.name=Pechera Vinculada +item.boundLeggings.name=Pantalones Vinculados +item.boundBoots.name=Botas Vinculadas +item.weakBloodShard.name=Esquirla de Sangre Débil +item.growthSigil.name=Sello de la Pequeña Arboleda +item.blankSpell.name=Cristal Desvinculado +item.alchemyFlask.name=Frasco de Poción +item.standardBindingAgent.name=Agente Vinculante Estándar +item.mundanePowerCatalyst.name=Catalizador de Poder Mundano +item.averagePowerCatalyst.name=Catalizador de Poder Medio +item.greaterPowerCatalyst.name=Catalizador de Poder Grandioso +item.mundaneLengtheningCatalyst.name=Catalizador de Alargamiento Mundano +item.averageLengtheningCatalyst.name=Catalizador de Alargamiento Medio +item.greaterLengtheningCatalyst.name=Catalizador de Alargamiento Grandioso +item.incendium.name=Incendium +item.magicales.name=Magicales +item.sanctus.name=Sanctus +item.aether.name=Aether +item.simpleCatalyst.name=Catalizador Simple +item.crepitous.name=Crepitous +item.crystallos.name=Crystallos +item.terrae.name=Terrae +item.aquasalus.name=Aquasalus +item.tennebrae.name=Tenebrae +item.demonBloodShard.name=Esquirla de Sangre de Demonio +item.sigilOfWind.name=Sello del Torbellino +item.telepositionFocus.name=Centro de Teleposición +item.enhancedTelepositionFocus.name=Centro de Teleposición Mejorado +item.reinforcedTelepositionFocus.name=Centro de Teleposición Reforzado +item.demonicTelepositionFocus.name=Centro de Teleposición Demoníaco +item.imbuedSlate.name=Pizarra Imbuida +item.demonicSlate.name=Pizarra Demoníaca +item.sigilOfTheBridge.name=Sello de Conexión Fantasma +item.armourInhibitor.name=Inhibidor de Armadura +item.cheatyItem.name=Orbe de Ensayo +item.weakFillingAgent.name=Agente Sustancioso Débil +item.standardFillingAgent.name=Centro de Teleposición Estándar +item.enhancedFillingAgent.name=Centro de Teleposición Mejorado +item.weakBindingAgent.name=Agente Vinculante Débil +item.ritualDiviner.name=Adivinador Ritual +item.sigilOfMagnetism.name=Sello de Magnetismo +item.itemDiabloKey.name=Llave de Vinculación +item.energyBazooka.name=Bazooka de Energía +item.bloodLightSigil.name=Sello de la Lámpara de Sangre +item.itemComplexSpellCrystal.name=Cristal de Hechizos Complejo +item.itemSigilOfSupression.name=Sello de Supresión +item.itemSigilOfEnderSeverance.name=Sello de Ruptura de Ender +item.bucketLife.name=Cubo de Vida +item.bloodMagicBaseItem.QuartzRod.name=Vara de Cuarzo +item.bloodMagicBaseItem.EmptyCore.name=Núcleo Vacío +item.bloodMagicBaseItem.MagicalesCable.name=Cable Magicales +item.bloodMagicBaseItem.WoodBrace.name=Puntal de Madera +item.bloodMagicBaseItem.StoneBrace.name=Puntal de Piedra +item.bloodMagicBaseItem.ProjectileCore.name=Núcleo de Proyectil +item.bloodMagicBaseItem.SelfCore.name=Auto-núcleo +item.bloodMagicBaseItem.MeleeCore.name=Núcleo de Tumulto +item.bloodMagicBaseItem.ToolCore.name=Núcleo de Herramienta +item.bloodMagicBaseItem.ParadigmBackPlate.name=Lámina Paradigma +item.bloodMagicBaseItem.OutputCable.name=Cable de Hechizos de Salida +item.bloodMagicBaseItem.InputCable.name=Cable de Hechizos de Entrada +item.bloodMagicBaseItem.FlameCore.name=Núcleo Ígneo +item.bloodMagicBaseItem.IcyCore.name=Núcleo Helado +item.bloodMagicBaseItem.GustCore.name=Núcleo Borrascoso +item.bloodMagicBaseItem.EarthenCore.name=Núcleo Terroso +item.bloodMagicBaseItem.CrackedRunicPlate.name=Placa Rúnica Resquebrajada +item.bloodMagicBaseItem.RunicPlate.name=Placa Rúnica +item.bloodMagicBaseItem.ScribedRunicPlate.name=Placa Rúnica Imbuida +item.bloodMagicBaseItem.DefaultCore.name=Núcleo Descalibrado +item.bloodMagicBaseItem.OffensiveCore.name=Núcleo Ofensivo +item.bloodMagicBaseItem.DefensiveCore.name=Núcleo Defensivo +item.bloodMagicBaseItem.EnvironmentalCore.name=Núcleo Ambiental +item.bloodMagicBaseItem.PowerCore.name=Núcleo de Poder +item.bloodMagicBaseItem.CostCore.name=Núcleo de Reducción +item.bloodMagicBaseItem.PotencyCore.name=Núcleo de Potencial +item.bloodMagicBaseItem.ObsidianBrace.name=Puntal de Obsidiana +item.bloodMagicAlchemyItem.Offensa.name=Offensa +item.bloodMagicAlchemyItem.Praesidium.name=Praesidium +item.bloodMagicAlchemyItem.OrbisTerrae.name=Orbis Terrae +item.bloodMagicAlchemyItem.StrengthenedCatalyst.name=Catalizador Fortalecido +item.bloodMagicAlchemyItem.ConcentratedCatalyst.name=Catalizador Concentrado +item.bloodMagicAlchemyItem.FracturedBone.name=Hueso Fracturado +item.bloodMagicAlchemyItem.Virtus.name=Virtus +item.bloodMagicAlchemyItem.Reductus.name=Reductus +item.bloodMagicAlchemyItem.Potentia.name=Potentia +item.sanguineHelmet.name=Yelmo Sanguíneo +item.itemSeerSigil.name=Sello de la Vista +item.itemFluidSigil.name=Sello del Fluido +item.multiTool.name=Maza Dinámica +item.itemCombinationalCatalyst.name=Catalizador Combinativo +item.sanguineRobe.name=Ropajes Sanguíneos +item.sanguinePants.name=Pantalones Sanguíneos +item.sanguineBoots.name=Botas Sanguíneas +item.itemAttunedCrystal.name=Direccionador Alquímico +item.itemTankSegmenter.name=Segmentador Alquímico +item.destinationClearer.name=Limpiador Alquímico +item.demonPlacer.name=Cristal de Demonio + +#Creative Tab +itemGroup.tabBloodMagic=Blood Magic + +#Extra Strings +bm.string.consume=Uso +bm.string.drain=Drenaje +bm.string.tier=Tier +bm.string.crafting.orb.shaped=Fabricación con forma de Orbe +bm.string.crafting.orb.shapeless=Fabricación sin forma de Orbe + +#Entities +entity.AWWayofTime.EarthElemental.name=Elemental de Tierra +entity.AWWayofTime.FireElemental.name=Elemental de Fuego +entity.AWWayofTime.HolyElemental.name=Elemental Sagrado +entity.AWWayofTime.ShadeElemental.name=Elemental Sombrío +entity.AWWayofTime.WaterElemental.name=Elemental de Agua +entity.AWWayofTime.AirElemental.name=Elemental de Aire +entity.AWWayofTime.Shade.name=Sombra +entity.AWWayofTime.BoulderFist.name=Puño Rocoso +entity.AWWayofTime.IceDemon.name=Demonio de Hielo +entity.AWWayofTime.SmallEarthGolem.name=Gólem de Tierra Pequeño +entity.AWWayofTime.WingedFireDemon.name=Demonio de Fuego Alado +entity.AWWayofTime.BileDemon.name=Demonio Malhumorado +entity.AWWayofTime.LowerGuardian.name=Guardián Inferior +entity.AWWayofTime.FallenAngel.name=Ángel Caído diff --git a/src/main/resources/assets/forge/lang/fr_FR.lang b/src/main/resources/assets/forge/lang/fr_FR.lang new file mode 100644 index 00000000..bd01daa9 --- /dev/null +++ b/src/main/resources/assets/forge/lang/fr_FR.lang @@ -0,0 +1,5 @@ +commands.forge.usage=Utilisez /forge . Les sous-commandes sont tps, track +commands.forge.usage.tracking=Utilisez /forge track . Les types valides sont te (Tile Entities). La durée doit être inférieur à 60. +commands.forge.tps.summary=%s : Duré de tick : %d ms. TPS moyen : %d + +commands.forge.tracking.te.enabled=Trackage des Tile Entity activé pour %d secondes. \ No newline at end of file